arXiv:2506.14429cs.CL2025-06AAAI被引 39

发现扩散语言模型能更好处理长文本,提出无需训练的扩展方法。

LongLLaDA: Unlocking Long Context Capabilities in Diffusion LLMs

  • 利用旋转位置编码理论,发现扩散模型在长上下文下更稳定。
  • 在超长文本中,扩散模型仍可从最近段落准确检索信息。
  • 适合研究长文本生成、推理的学者与开发者参考。

大型语言扩散模型(diffusion LLMs)已成为自然语言处理的重要方向,但其长上下文能力尚未系统研究。本文首次系统对比了扩散LLM与传统自回归LLM在长上下文任务中的表现。发现扩散模型在直接上下文外推时,困惑度保持稳定;而自回归模型在超过预训练长度的Needle-In-A-Haystack任务中完全失效,扩散模型则展现出独特的局部感知现象,可成功从近期上下文段落中检索信息。这一现象可通过旋转位置编码(RoPE)缩放理论解释。基于此,我们提出LongLLaDA——一种无需训练的方法,将LLaDA与基于NTK的RoPE外推结合。实验验证了已有外推缩放定律对扩散模型依然有效。同时,我们识别出扩散模型表现更优的长上下文任务,以及其仍需改进的领域。本研究建立了首个针对扩散模型的长度外推方法,提供了关键理论洞察与实证基准,为未来长上下文扩散模型研究奠定基础。代码已开源:https://github.com/OpenMOSS/LongLLaDA。

原文摘要 · Abstract (English)

Large Language Diffusion Models, or diffusion LLMs, have emerged as a significant focus in NLP research, with substantial effort directed toward understanding their scalability and downstream task performance. However, their long-context capabilities remain unexplored, lacking systematic analysis or methods for context extension. In this work, we present the first systematic investigation comparing the long-context performance of diffusion LLMs and traditional auto-regressive LLMs. We first identify a unique characteristic of diffusion LLMs, unlike auto-regressive LLMs, they maintain remarkably stable perplexity during direct context extrapolation. Moreover, where auto-regressive models fail outright during the Needle-In-A-Haystack task with context exceeding their pretrained length, we discover diffusion LLMs exhibit a distinct local perception phenomenon, enabling successful retrieval from recent context segments. We explain both phenomena through the lens of Rotary Position Embedding (RoPE) scaling theory. Building on these observations, we propose LongLLaDA, a training-free method that integrates LLaDA with the NTK-based RoPE extrapolation. Our results validate that established extrapolation scaling laws remain effective for extending the context windows of diffusion LLMs. Furthermore, we identify long-context tasks where diffusion LLMs outperform auto-regressive LLMs and others where they fall short. Consequently, this study establishes the first length extrapolation method for diffusion LLMs while providing essential theoretical insights and empirical benchmarks critical for advancing future research on long-context diffusion LLMs. The code is available at https://github.com/OpenMOSS/LongLLaDA.

扩散模型长文本位置编码外推

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