arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.07680cs.LGcs.AI
收藏

层次化平衡打包:面向长上下文LLM的高效监督微调

Hierarchical Balance Packing: Towards Efficient Supervised Fine-tuning for Long-Context LLM

Shanghai Jiao Tong University(上海交通大学);SenseTime Research(商汤科技研究院);Central South University(中南大学);The Chinese University of Hong Kong(香港中文大学);Beihang University(北京航空航天大学)

Yongqiang Yao, Jingru Tan, Kaihuan Liang, Feizhao Zhang, Jiahao Hu, Shuo Wu, Yazhe Niu, Ruihao Gong, Dahua Lin, Ningyi Xu

AI总结:

本文提出层次化平衡打包(HBP)方法,通过多级数据打包组与动态训练流水线解决长上下文LLM训练中的工作负载不平衡与通信开销问题,在多个模型上显著加速训练,对DeepSeek-V2 (236B)实现2.4倍提速。

摘要:

训练长上下文大语言模型(LLM)具有挑战性,因为混合使用长上下文和短上下文数据进行训练通常会导致工作负载不平衡。现有工作主要使用数据打包来缓解此问题,但未能考虑注意力计算的不平衡和浪费的通信开销。本文提出层次化平衡打包(HBP),设计了一种新颖的批次构建方法和训练方案来解决这些低效问题。具体而言,HBP构建多级数据打包组,每个组使用不同的打包长度进行优化。它将训练样本分配到其最优组,并为每个组配置最有效的设置,包括序列并行度和梯度检查点配置。为了有效利用多级数据组,我们设计了专门为HBP量身定制的动态训练流水线,包括课程学习、自适应序列并行和稳定损失。我们的大量实验表明,在多个数据集和开源模型上,我们的方法在保持强大性能的同时显著减少了训练时间。对于最大的DeepSeek-V2(236B)MoE模型,我们的方法在具有竞争力的性能下将训练速度提高了2.4倍。代码将发布于https://github.com/ModelTC/HBP。

英文摘要:

Training Long-Context Large Language Models (LLMs) is challenging, as hybrid training with long-context and short-context data often leads to workload imbalances. Existing works mainly use data packing to alleviate this issue, but fail to consider imbalanced attention computation and wasted communication overhead. This paper proposes Hierarchical Balance Packing (HBP), which designs a novel batch-construction method and training recipe to address those inefficiencies. In particular, the HBP constructs multi-level data packing groups, each optimized with a distinct packing length. It assigns training samples to their optimal groups and configures each group with the most effective settings, including sequential parallelism degree and gradient checkpointing configuration. To effectively utilize multi-level groups of data, we design a dynamic training pipeline specifically tailored to HBP, including curriculum learning, adaptive sequential parallelism, and stable loss. Our extensive experiments demonstrate that our method significantly reduces training time over multiple datasets and open-source models while maintaining strong performance. For the largest DeepSeek-V2 (236B) MoE model, our method speeds up the training by 2.4$\times$ with competitive performance. Codes will be released at https://github.com/ModelTC/HBP.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑