arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2604.14339cs.CL
收藏

重组上下文:RoPE扰动的自我蒸馏用于长上下文适应

Shuffle the Context: RoPE-Perturbed Self-Distillation for Long-Context Adaptation

Georgia Institute of Technology(佐治亚理工学院);Microsoft(微软)

Zichong Li, Chen Liang, Liliang Ren, Tuo Zhao, Yelong Shen, Weizhu Chen

AI总结:

本文提出RoPE扰动的自我蒸馏方法,通过扰动RoPE索引生成不同视角的训练序列,提升模型对位置变化的鲁棒性,实验显示在长上下文任务中表现更优。

摘要:

大型语言模型(LLMs)越来越多地在需要可靠长上下文理解的设置中运行,如检索增强生成和多文档推理。一种常见策略是在目标序列长度上微调预训练的短上下文模型。然而,我们发现标准的长上下文适应仍然脆弱:模型准确性强烈依赖相关证据的绝对位置,即使在控制任务格式和难度的情况下,位置变化也表现出高方差。我们提出了RoPE扰动的自我蒸馏,一种改进位置鲁棒性的训练正则化方法。核心思想是通过扰动其RoPE索引形成相同训练序列的替代“视角”——即有效地将上下文的一部分移动到不同位置,并训练模型在不同视角下产生一致的预测,通过自我蒸馏。这鼓励模型依赖语义信号而不是脆弱的位置依赖。在Llama-3-8B和Qwen-3-4B的长上下文适应实验中,显示在长上下文基准测试中表现一致,包括在SFT后,Llama-3-8B在RULER-64K上改进了12.04%,Qwen-3-4B在RULER-256K上改进了2.71%,同时在训练上下文窗口之外的长度扩展上也有所提升。

英文摘要:

Large language models (LLMs) increasingly operate in settings that require reliable long-context understanding, such as retrieval-augmented generation and multi-document reasoning. A common strategy is to fine-tune pretrained short-context models at the target sequence length. However, we find that standard long-context adaptation can remain brittle: model accuracy depends strongly on the absolute placement of relevant evidence, exhibiting high positional variance even when controlling for task format and difficulty. We propose RoPE-Perturbed Self-Distillation, a training regularizer that improves positional robustness. The core idea is to form alternative "views" of the same training sequence by perturbing its RoPE indices -- effectively moving parts of the context to different positions -- and to train the model to produce consistent predictions across views via self-distillation. This encourages reliance on semantic signals instead of brittle position dependencies. Experiments on long-context adaptation of Llama-3-8B and Qwen-3-4B demonstrate consistent gains on long-context benchmarks, including up to 12.04% improvement on RULER-64K for Llama-3-8B and 2.71% on RULER-256K for Qwen-3-4B after SFT, alongside improved length extrapolation beyond the training context window.

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

↑