TinyR1-32B-Preview: Boosting Accuracy with Branch-Merge Distillation
本文提出了一种名为Branch-Merge的蒸馏方法,通过分支和合并两个阶段,有效提升了小型语言模型的推理准确率。
更新于 2025-03-26。作者:Lin Sun、Guangxiang Zhao、Xiaoqi Jian、Yuhan Wu、Weihong Lin、Yongfu Zhu、Change Jia、Linglin Zhang、Jinzhu Wu、Junfeng Ran、Sai-er Hu、Zihan Jiang、Junting Zhou、Wenrui Liu、Bin Cui、Tong Yang、Xiangzheng Zhang。
中文摘要
在保持大型语言模型(LLMs)性能的同时缩小其体积的挑战受到了广泛关注。然而,现有的方法,如模型蒸馏和迁移学习,往往难以实现高精度。为了解决这一局限性,我们提出了分支-合并蒸馏方法,该方法通过两个阶段来提升模型压缩效果:(1) 分支阶段,通过领域特定的监督微调(SFT)将有知识的大教师模型选择性地蒸馏到专业的学生模型中;以及(2) 合并阶段,将这些学生模型合并,以实现跨领域知识迁移并提高泛化能力。我们使用DeepSeek-R1作为教师模型,DeepSeek-R1-Distill-Qwen-32B作为学生模型来验证我们的蒸馏方法。结果产生的合并模型TinyR1-32B-Preview在多个基准测试中优于其对应的DeepSeek-R1-Distill-Qwen-32B模型,包括数学(+5.5分)、编码(+4.4分)和科学(+2.9分),同时在AIME 2024测试中与DeepSeek-R1的性能几乎相同。分支-合并蒸馏方法为创建更小、性能更高且计算成本和时间减少的LLMs提供了一种可扩展的解决方案。
英文摘要
The challenge of reducing the size of Large Language Models (LLMs) while maintaining their performance has gained significant attention. However, existing methods, such as model distillation and transfer learning, often fail to achieve high accuracy. To address this limitation, we introduce the Branch-Merge distillation approach, which enhances model compression through two phases: (1) the Branch Phase, where knowledge from a large teacher model is selectively distilled into specialized student models via domain-specific supervised fine-tuning (SFT); And (2) the Merge Phase, where these student models are merged to enable cross-domain knowledge transfer and improve generalization. We validate our distillation approach using DeepSeek-R1 as the teacher and DeepSeek-R1-Distill-Qwen-32B as the student. The resulting merged model, TinyR1-32B-Preview, outperforms its counterpart DeepSeek-R1-Distill-Qwen-32B across multiple benchmarks, including Mathematics (+5.5 points), Coding (+4.4 points) and Science (+2.9 points), while achieving near-equal performance to DeepSeek-R1 on AIME 2024. The Branch-Merge distillation approach provides a scalable solution for creating smaller, high-performing LLMs with reduced computational cost and time.
解读
一句话总结
本文提出了一种名为Branch-Merge的蒸馏方法,通过分支和合并两个阶段,有效提升了小型语言模型的推理准确率。
问题1:这篇论文想要解决什么具体问题?
- 问题背景:现有模型蒸馏和迁移学习方法在缩小大型语言模型(LLMs)尺寸的同时保持其性能方面存在困难。
- 现有方案不足:现有的模型蒸馏和迁移学习方法通常无法达到高精度,且需要仔细选择相关数据/领域并调整比例进行联合训练,过程耗时且容易出错。
- 研究目标:提出Branch-Merge蒸馏方法,通过两个阶段提升模型压缩效果,实现更小的、性能更高的LLMs。
问题2:论文的核心创新点是什么?
- 技术创新:Branch-Merge蒸馏方法包含两个阶段:分支阶段通过领域特定监督微调(SFT)将知识从大模型蒸馏到学生模型;合并阶段通过Arcee融合规则将学生模型合并,实现跨领域知识迁移。
- 方法改进:通过解耦训练领域并随后进行调和,解决了数据选择和梯度冲突的问题。
- 优势:显著提高模型精度,减少合并阶段的时间和计算成本,同时实现跨领域知识迁移。
问题3:实验结果如何验证了方法的有效性?
- 关键实验:使用DeepSeek-R1作为教师模型,DeepSeek-R1-Distill-Qwen-32B作为学生模型,TinyR1-32B-Preview在多个基准测试中优于其同类模型。
- 性能提升:TinyR1-32B-Preview在数学、编码和科学基准测试中分别提高了5.5、4.4和2.9个点,同时在AIME 2024上的性能与DeepSeek-R1相近。
- 对比结果:与DeepSeek-R1-Distill-Qwen-32B相比,TinyR1-32B-Preview的数学精度提高了约5%,科学和编码精度也有所提升。
问题4:这个研究的实际应用价值是什么?
- 应用场景:适用于需要高性能小型LLMs的领域,如教育、咨询和自动化。
- 实施建议:使用Arcee融合技术合并领域特定的模型,实现跨领域知识迁移。
- 局限与展望:未来可以探索使用不同骨干模型和不同大小的模型,以及进一步分析实验设置对性能的影响。