层交换实现大语言模型零样本跨语言迁移
Layer Swapping for Zero-Shot Cross-Lingual Transfer in Large Language Models
AI总结:
本文提出通过交换微调后的语言专家与数学专家的顶层和底层Transformer层,实现无需目标语言数学数据的零样本跨语言数学推理迁移,在MGSM基准上提升10%。
摘要:
模型合并(如模型汤)是一种将具有相同架构的不同模型组合在一起而无需进一步训练的做法。在本工作中,我们提出了一种模型合并方法,以解决在非英语语言中针对目标任务微调大型语言模型(LLMs)的困难,这些语言中特定任务的数据往往不可用。我们聚焦于数学推理,并在没有目标语言数学数据的情况下,通过组合语言能力和数学能力来促进跨语言迁移。从相同的预训练模型出发,我们在英语数学指令数据和目标语言的通用指令数据上分别微调独立的“专家”模型。然后,我们直接将数学专家的顶部和底部Transformer层替换为语言专家的层,从而提升目标语言中的数学性能。由此产生的合并模型在数学基准MGSM上,在四种数学指令数据稀缺的主要语言中,比单独的专家模型和其他合并方法高出10%。此外,这种层交换方法简单、廉价且直观,因为它基于对每个专家微调过程中最重要参数变化的解释性分析。以这种方式成功重组LLMs实现跨语言迁移,为未来结合模型专长、创建模块化解决方案以及跨语言迁移推理能力开辟了可能性,且所有这些均可在事后进行。
英文摘要:
Model merging, such as model souping, is the practice of combining different models with the same architecture together without further training. In this work, we present a model merging methodology that addresses the difficulty of fine-tuning Large Language Models (LLMs) for target tasks in non-English languages, where task-specific data is often unavailable. We focus on mathematical reasoning and without in-language math data, facilitate cross-lingual transfer by composing language and math capabilities. Starting from the same pretrained model, we fine-tune separate "experts" on math instruction data in English and on generic instruction data in the target language. We then replace the top and bottom transformer layers of the math expert directly with layers from the language expert, which consequently enhances math performance in the target language. The resulting merged models outperform the individual experts and other merging methods on the math benchmark, MGSM, by 10% across four major languages where math instruction data is scarce. In addition, this layer swapping is simple, inexpensive, and intuitive, as it is based on an interpretative analysis of the most important parameter changes during the fine-tuning of each expert. The ability to successfully re-compose LLMs for cross-lingual transfer in this manner opens up future possibilities to combine model expertise, create modular solutions, and transfer reasoning capabilities across languages all post hoc.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。