arXiv:2505.18092cs.CL2025-05被引 2

让大模型处理超长文本更高效准确,突破记忆瓶颈。

QwenLong-CPRS: Towards $\infty$-LLMs with Dynamic Context Optimization

  • 用自然语言指令动态压缩上下文,多粒度优化
  • 实现21.59倍上下文压缩,性能平均提升19.15点
  • 适配主流大模型,适合长文档处理场景

本技术报告提出QwenLong-CPRS,一种面向显式长上下文优化的上下文压缩框架,解决大语言模型在长序列处理中预填充阶段计算开销过大及‘中间信息丢失’的问题。通过创新的动态上下文优化机制,实现由自然语言指令引导的多粒度上下文压缩,在效率与性能上均取得提升。基于Qwen架构系列演化而来,引入四项关键创新:(1) 自然语言引导的动态优化;(2) 双向推理层增强边界感知;(3) 带语言建模头的令牌判别机制;(4) 窗口并行推理。在五个基准测试(4K–2M词上下文)中全面评估显示,QwenLong-CPRS具有三重优势:(1) 在准确率与效率上持续优于RAG、稀疏注意力等方法;(2) 与所有旗舰LLM(包括GPT-4o、Gemini2.0-pro、Claude3.7-sonnet、DeepSeek-v3、Qwen2.5-max)无架构依赖集成,实现21.59×上下文压缩并带来19.15点平均性能增益;(3) 部署于Qwen2.5-32B-Instruct时,在Ruler-128K和InfiniteBench上分别超越领先商用模型4.85和10.88点,刷新当前最佳表现。

原文摘要 · Abstract (English)

This technical report presents QwenLong-CPRS, a context compression framework designed for explicit long-context optimization, addressing prohibitive computation overhead during the prefill stage and the "lost in the middle" performance degradation of large language models (LLMs) during long sequence processing. Implemented through a novel dynamic context optimization mechanism, QwenLong-CPRS enables multi-granularity context compression guided by natural language instructions, achieving both efficiency gains and improved performance. Evolved from the Qwen architecture series, QwenLong-CPRS introduces four key innovations: (1) Natural language-guided dynamic optimization, (2) Bidirectional reasoning layers for enhanced boundary awareness, (3) Token critic mechanisms with language modeling heads, and (4) Window-parallel inference. Comprehensive evaluations across five benchmarks (4K-2M word contexts) demonstrate QwenLong-CPRS's threefold effectiveness: (1) Consistent superiority over other context management methods like RAG and sparse attention in both accuracy and efficiency. (2) Architecture-agnostic integration with all flagship LLMs, including GPT-4o, Gemini2.0-pro, Claude3.7-sonnet, DeepSeek-v3, and Qwen2.5-max, achieves 21.59$\times$ context compression alongside 19.15-point average performance gains; (3) Deployed with Qwen2.5-32B-Instruct, QwenLong-CPRS surpasses leading proprietary LLMs by 4.85 and 10.88 points on Ruler-128K and InfiniteBench, establishing new SOTA performance.

长文本生成上下文压缩大模型优化

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