arXiv:2410.01335cs.CLcs.AI2024-10ICLR被引 21

通过层替换实现大模型零样本跨语言数学推理

Layer Swapping for Zero-Shot Cross-Lingual Transfer in Large Language Models

  • 用英语数学专家和目标语言通用专家的层交换构建新模型
  • 在4种语言上数学基准测试提升10%,超越单个专家
  • 无需微调,操作简单,适合缺乏目标语言数据的场景

模型融合(如model souping)是在不进一步训练的情况下将同架构模型合并的技术。本文提出一种新方法,解决大语言模型在非英语任务中因缺乏特定数据而难以微调的问题,聚焦于数学推理任务。从同一预训练模型出发,分别在英语数学指令数据上微调数学专家,在目标语言通用指令数据上微调语言专家。随后,直接将数学专家的顶层和底层Transformer层替换为语言专家的对应层,从而提升目标语言下的数学表现。该融合模型在四类主要语言的数学基准MGSM上较单个专家及其他融合方法平均提升10%。该层替换策略简单、低成本且直观,基于对各专家微调过程中关键参数变化的可解释性分析。此方法实现了后验重组模型以跨语言迁移推理能力,为模块化解决方案与能力组合开辟了新路径。

原文摘要 · Abstract (English)

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.

大模型跨语言数学推理模型融合

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。