We introduce XFT, a simple yet powerful training scheme, by simply merging upcycled Mixture-of-Experts (MoE) to unleash the performance limit of instruction-tuned code Large Language Models (LLMs). While vanilla sparse upcycling fails to improve instruction tuning, XFT introduces a shared expert mechanism with a novel routing weight normalization strategy into sparse upcycling, which significantly boosts instruction tuning. After fine-tuning the upcycled MoE model, XFT introduces a learnable model merging mechanism to compile the upcycled MoE model back to a dense model, achieving upcycled MoE-level performance with only dense-model compute. By applying XFT to a 1.3B model, we create a new state-of-the-art tiny code LLM (<3B) with 67.1 and 64.6 pass@1 on HumanEval and HumanEval+ respectively. With the same data and model architecture, XFT improves supervised fine-tuning (SFT) by 13% on HumanEval+, along with consistent improvements from 2% to 13% on MBPP+, MultiPL-E, and DS-1000, demonstrating its generalizability. XFT is fully orthogonal to existing techniques such as Evol-Instruct and OSS-Instruct, opening a new dimension for improving code instruction tuning. Codes are available at https://github.com/ise-uiuc/xft .
翻译:我们提出XFT,一种简单而强大的训练方案,通过直接合并升级的混合专家模型(MoE)来释放指令微调代码大语言模型(LLMs)的性能极限。标准稀疏升级方法无法改善指令微调,而XFT在稀疏升级中引入共享专家机制及新颖的路由权重归一化策略,显著提升了指令微调效果。在对升级后的MoE模型进行微调后,XFT引入可学习的模型合并机制,将升级的MoE模型恢复为稠密模型,以仅需稠密模型的计算成本达到升级MoE级别的性能。通过将XFT应用于1.3B参数模型,我们创建了新的最先进的小型代码LLM(<3B),在HumanEval和HumanEval+上分别取得67.1和64.6的pass@1指标。在相同数据和模型架构下,XFT在HumanEval+上将监督式微调(SFT)性能提升13%,并在MBPP+、MultiPL-E和DS-1000上获得2%至13%的持续改进,证明了其泛化能力。XFT与Evol-Instruct和OSS-Instruct等现有技术完全正交,为改进代码指令微调开辟了新维度。代码开源地址:https://github.com/ise-uiuc/xft 。