arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.06214cs.CLcs.AIcs.LG
收藏

从128K到4M:超长上下文大语言模型的高效训练

From 128K to 4M: Efficient Training of Ultra-Long Context Large Language Models

NVIDIA(英伟达)

Chejian Xu, Wei Ping, Peng Xu, Zihan Liu, Boxin Wang, Mohammad Shoeybi, Bo Li, Bryan Catanzaro

AI总结:

本文提出从128K扩展到4M token的超长上下文LLM高效训练方案,基于Llama3.1-Instruct构建UltraLong-8B,在长上下文基准上取得最优性能并保持短上下文能力。

摘要:

长上下文能力对于广泛的应用至关重要,包括文档与视频理解、上下文学习以及推理时扩展,这些应用都要求模型能够处理并推理长序列的文本和多模态数据。在本工作中,我们提出了一种高效训练方案,用于从对齐的指令模型构建超长上下文大语言模型,将上下文长度边界从128K扩展到1M、2M和4M个token。我们的方法利用高效的持续预训练策略来扩展上下文窗口,并采用有效的指令微调来保持指令遵循和推理能力。我们基于Llama3.1-Instruct并使用该方案构建的UltraLong-8B,在多种长上下文基准上取得了最先进的性能。重要的是,使用我们的方法训练的模型在标准基准上保持了有竞争力的表现,展示了长上下文和短上下文任务的均衡改进。我们进一步对关键设计选择进行了深入分析,重点揭示了扩展策略和数据构成的影响。我们的发现为在保持通用模型能力的同时高效扩展上下文长度建立了一个稳健的框架。我们在https://ultralong.github.io/发布了所有模型权重。

英文摘要:

Long-context capabilities are essential for a wide range of applications, including document and video understanding, in-context learning, and inference-time scaling, all of which require models to process and reason over long sequences of text and multimodal data. In this work, we introduce a efficient training recipe for building ultra-long context LLMs from aligned instruct model, pushing the boundaries of context lengths from 128K to 1M, 2M, and 4M tokens. Our approach leverages efficient continued pretraining strategies to extend the context window and employs effective instruction tuning to maintain the instruction-following and reasoning abilities. Our UltraLong-8B, built on Llama3.1-Instruct with our recipe, achieves state-of-the-art performance across a diverse set of long-context benchmarks. Importantly, models trained with our approach maintain competitive performance on standard benchmarks, demonstrating balanced improvements for both long and short context tasks. We further provide an in-depth analysis of key design choices, highlighting the impacts of scaling strategies and data composition. Our findings establish a robust framework for efficiently scaling context lengths while preserving general model capabilities. We release all model weights at: https://ultralong.github.io/.

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

↑