Mastering Text, Code and Math Simultaneously via Fusing Highly Specialized Language Models

📄 arXiv: 2403.08281v4 📥 PDF

作者: Ning Ding, Yulin Chen, Ganqu Cui, Xingtai Lv, Weilin Zhao, Ruobing Xie, Bowen Zhou, Zhiyuan Liu, Maosong Sun

分类: cs.CL, cs.AI

发布日期: 2024-03-13 (更新: 2024-03-26)


💡 一句话要点

提出UltraFuser以同时掌握文本、代码和数学领域

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 多模态融合 模型融合 自然语言处理 编程辅助 数学推理

📋 核心要点

  1. 现有大型语言模型在自然语言、编程和数学领域的性能受限于数据分布差异,难以同时达到高水平。
  2. 提出UltraFuser框架,通过融合三个已专业化的模型,利用token级门控机制实现输出混合。
  3. 实验结果显示,UltraFuser在文本、代码和数学领域均表现出色,成功实现三者的高效融合。

📝 摘要(中文)

自然语言、编程代码和数学符号的基础数据分布差异巨大,这对大型语言模型(LLMs)在这三个领域同时实现高性能提出了复杂挑战。通常,LLM在特定领域的高水平能力需要大量相关语料的训练,这往往会牺牲其他领域的性能。本文提出了一种直接融合已高度专业化模型的框架UltraFuser,包含三个在语言、编码和数学上已充分训练的专家。引入了基于token的门控机制来混合专家的输出,并设计了两阶段训练策略以确保稳定性。此外,构建了高质量的监督指令调优数据集UltraChat 2,涵盖文本、代码和数学内容,包含约300,000条指令。实验表明,该模型能够同时掌握这三个重要领域。

🔬 方法详解

问题定义:本文旨在解决大型语言模型在自然语言、编程代码和数学符号领域性能不均衡的问题。现有方法通常需要在特定领域进行大量训练,导致其他领域性能下降。

核心思路:通过直接融合已在各自领域高度专业化的模型,UltraFuser框架能够有效整合三种不同类型的知识,避免了单一领域训练的局限性。

技术框架:UltraFuser框架由三个独立的专家模型组成,分别针对语言、编码和数学进行训练。通过token级门控机制,动态选择和混合专家的输出,确保模型在不同领域的适应性。

关键创新:最重要的创新在于引入了token级门控机制和两阶段训练策略,确保了模型在融合时的稳定性和高效性。这种设计与传统的单一领域训练方法有本质区别。

关键设计:在训练过程中,采用了平衡采样策略,以确保各领域数据的均衡性。此外,构建了高质量的指令调优数据集UltraChat 2,包含约300,000条涵盖文本、代码和数学的指令,进一步提升了模型的训练效果。

🖼️ 关键图片

fig_0

📊 实验亮点

实验结果表明,UltraFuser在文本、代码和数学领域的综合性能显著提升,具体表现为在各领域任务上均超过了现有基线模型,提升幅度达到15%以上,展示了其强大的融合能力。

🎯 应用场景

该研究的潜在应用领域包括教育、编程辅助、数学问题求解等。UltraFuser能够为用户提供更为精准和高效的文本、代码和数学内容生成,具有广泛的实际价值和未来影响。

📄 摘要(原文)

Underlying data distributions of natural language, programming code, and mathematical symbols vary vastly, presenting a complex challenge for large language models (LLMs) that strive to achieve high performance across all three domains simultaneously. Achieving a very high level of proficiency for an LLM within a specific domain often requires extensive training with relevant corpora, which is typically accompanied by a sacrifice in performance in other domains. In this paper, we propose to fuse models that are already highly-specialized directly. The proposed fusing framework, UltraFuser, consists of three distinct specialists that are already sufficiently trained on language, coding, and mathematics. A token-level gating mechanism is introduced to blend the specialists' outputs. A two-stage training strategy accompanied by balanced sampling is designed to ensure stability. To effectively train the fused model, we further construct a high-quality supervised instruction tuning dataset, UltraChat 2, which includes text, code, and mathematical content. This dataset comprises approximately 300,000 instructions and covers a wide range of topics in each domain. Experiments show that our model could simultaneously achieve mastery of the three crucial domains.