打破阶段壁垒:一种面向大语言模型长上下文扩展的新型单阶段方法
Breaking the Stage Barrier: A Novel Single-Stage Approach to Long Context Extension for Large Language Models
AI总结:
针对多阶段长上下文扩展依赖人工调优的问题,本文提出单阶段 HARPE,通过为不同注意力头设置不同 RoPE 基频并直接训练目标长度,在 RULER 等 4 个基准上媲美甚至超越多阶段方法。
摘要:
近年来,大语言模型(LLM)彻底改变了自然语言处理(NLP)。由于训练上下文长度有限,经过预训练的 LLM 在处理长 token 序列时存在困难,从而限制了它们在各类下游任务上的表现。当前面向长上下文建模的解决方案通常采用多阶段持续预训练,通过若干个持续预训练阶段逐步增加有效上下文长度。然而,这些方法需要大量人工调优和人类专业知识。本文提出一种新型单阶段持续预训练方法——Head-Adaptive Rotary Position Encoding(HARPE,头自适应旋转位置编码),在简化训练流程的同时赋予 LLM 长上下文建模能力。我们的 HARPE 在不同注意力头上使用不同的 Rotary Position Encoding(RoPE,旋转位置编码)基频值,并直接在目标上下文长度上训练 LLM。在包括最新 RULER 基准在内的 4 个语言建模基准上进行的大量实验表明,HARPE 通过单阶段训练在理解和整合长上下文任务方面表现出色,达到甚至超过现有多阶段方法。我们的结果凸显出,HARPE 成功打破了训练具备长上下文建模能力的 LLM 所面临的阶段壁垒。
英文摘要:
Recently, Large language models (LLMs) have revolutionized Natural Language Processing (NLP). Pretrained LLMs, due to limited training context size, struggle with handling long token sequences, limiting their performance on various downstream tasks. Current solutions toward long context modeling often employ multi-stage continual pertaining, which progressively increases the effective context length through several continual pretraining stages. However, those approaches require extensive manual tuning and human expertise. In this paper, we introduce a novel single-stage continual pretraining method, Head-Adaptive Rotary Position Encoding (HARPE), to equip LLMs with long context modeling capabilities while simplifying the training process. Our HARPE leverages different Rotary Position Encoding (RoPE) base frequency values across different attention heads and directly trains LLMs on the target context length. Extensive experiments on 4 language modeling benchmarks, including the latest RULER benchmark, demonstrate that HARPE excels in understanding and integrating long-context tasks with single-stage training, matching and even outperforming existing multi-stage methods. Our results highlight that HARPE successfully breaks the stage barrier for training LLMs with long context modeling capabilities.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。