arXiv:2604.17535cs.CLcs.AI2026-04被引 23

用模型自身短上下文能力指导长上下文生成,提升准确性。

OPSDL: On-Policy Self-Distillation for Long-Context Language Models

论文配图:OPSDL: On-Policy Self-Distillation for Long-Context Language Models
图 1 · 摘自论文原文
  • 自教师机制:用模型自身短上下文能力监督长上下文生成
  • 在7B到32B模型上均实现显著性能提升,样本效率更高
  • 适合需要稳定长文本生成的场景,如文档问答、代码生成

扩展大语言模型的有效上下文长度仍是实际应用中的核心挑战。尽管近期后训练方法在长上下文扩展上取得进展,但通常依赖高质量监督数据或稀疏序列级奖励,导致优化不稳定且低效。我们提出OPSDL,一种面向长上下文语言模型的在线自蒸馏方法。不同于以往依赖特权信息或依赖模型上下文学习能力作为教师的方法,OPSDL利用模型固有的强短上下文能力作为自教师,在长上下文生成时提供逐标记的监督信号。具体而言,模型先基于完整长上下文生成响应,再通过提取相关短上下文,使用点对点反向KL散度计算自教师信号。该密集的逐标记信号促进对相关证据的忠实利用,缓解无关上下文引发的幻觉。我们在多个7B至32B参数的模型上评估了OPSDL,结果表明在不同上下文长度下均有持续且显著的提升,优于SFT和DPO等标准后训练方法,且样本效率更高。值得注意的是,这些提升未损害模型在一般短上下文任务上的表现。结果表明,OPSDL是一种可扩展且稳定的长上下文学习方法。

原文摘要 · Abstract (English)

Extending the effective context length of large language models (LLMs) remains a central challenge for real-world applications. While recent post-training methods have made progress in long-context scaling, they either rely on high-quality supervision data or sparse sequence-level rewards, leading to unstable and inefficient optimization. We propose OPSDL, an On-Policy Self-Distillation method for enhancing the Long-context capabilities of LLMs. Unlike other recent self-distillation methods that inject privileged information and rely on the model's in-context learning ability to act as a teacher, OPSDL leverages the model's own inherently strong short-context capability as a self-teacher to supervise its own generation in long-context scenarios. The model first generates responses conditioned on the full long-context, then the self-teacher provides per-token supervision signals via point-wise reverse KL divergence under the relevant extracted short-context. This dense token-level signal encourages faithful use of relevant evidence and mitigates hallucinations induced by irrelevant context. We evaluate OPSDL on long-context benchmarks across a range of models from 7B to 32B parameters. Results show consistent and substantial improvements across varying context lengths, outperforming standard post-training approaches such as SFT and DPO with higher sample efficiency. Notably, these gains are achieved without degrading general short-context performance. These findings highlight the effectiveness of OPSDL as a scalable and stable approach for long-context learning.

长上下文自蒸馏大模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。