arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2306.01709cs.CL
收藏

蒸馏用于跨语言迁移的高效特定语言模型

Distilling Efficient Language-Specific Models for Cross-Lingual Transfer

University of Cambridge(剑桥大学);University of Edinburgh(爱丁堡大学)

Alan Ansell, Edoardo Maria Ponti, Anna Korhonen, Ivan Vulić

AI总结:

本文提出 BiStil 两阶段双语蒸馏法,从大规模多语言 Transformer 中提取轻量双语模型,在零样本跨语言迁移中保持接近原模型性能并优于多语言蒸馏基线。

摘要:

大规模多语言 Transformers(MMT),例如 mBERT 和 XLM-R,被广泛用于跨语言迁移学习。尽管这些模型经过预训练以表示数百种语言,但 NLP 系统的最终用户通常只关注个别语言。出于此类目的,MMT 的语言覆盖范围使其在模型大小、推理时间、能源和硬件成本方面的部署代价高得不必要。因此,我们提出从 MMT 中提取压缩的、特定语言的模型,同时保留原始 MMT 用于跨语言迁移的能力。这是通过双语蒸馏 MMT 实现的,即仅使用来自所关注源语言和目标语言的数据。具体而言,我们采用一种名为 BiStil 的两阶段蒸馏方法:(i) 第一阶段从 MMT 中蒸馏一个通用双语模型,而 (ii) 第二阶段即任务特定阶段,使用原始 MMT 的任务调优变体作为“教师”,对双语“学生”模型进行稀疏微调。我们在多个标准跨语言基准的零样本跨语言迁移中评估了这种蒸馏技术。关键结果表明,尽管蒸馏后的模型显著更小、更快,但相对于基础 MMT,其目标语言性能下降极小。此外,我们发现它们优于 DistilmBERT 和 MiniLMv2 等多语言蒸馏模型,而相比之下训练预算非常有限,即使按每种语言计算也是如此。我们还表明,从 MMT 蒸馏得到的双语模型大幅优于从头训练的双语模型。我们的代码和模型可在 https://github.com/AlanAnsell/bistil 获取。

英文摘要:

Massively multilingual Transformers (MMTs), such as mBERT and XLM-R, are widely used for cross-lingual transfer learning. While these are pretrained to represent hundreds of languages, end users of NLP systems are often interested only in individual languages. For such purposes, the MMTs' language coverage makes them unnecessarily expensive to deploy in terms of model size, inference time, energy, and hardware cost. We thus propose to extract compressed, language-specific models from MMTs which retain the capacity of the original MMTs for cross-lingual transfer. This is achieved by distilling the MMT bilingually, i.e., using data from only the source and target language of interest. Specifically, we use a two-phase distillation approach, termed BiStil: (i) the first phase distils a general bilingual model from the MMT, while (ii) the second, task-specific phase sparsely fine-tunes the bilingual "student" model using a task-tuned variant of the original MMT as its "teacher". We evaluate this distillation technique in zero-shot cross-lingual transfer across a number of standard cross-lingual benchmarks. The key results indicate that the distilled models exhibit minimal degradation in target language performance relative to the base MMT despite being significantly smaller and faster. Furthermore, we find that they outperform multilingually distilled models such as DistilmBERT and MiniLMv2 while having a very modest training budget in comparison, even on a per-language basis. We also show that bilingual models distilled from MMTs greatly outperform bilingual models trained from scratch. Our code and models are available at https://github.com/AlanAnsell/bistil.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑