arXiv:2605.24168cs.AIcs.LG2026-05被引 1

让大模型推理时跳过大量无关上下文,提速10倍且不丢性能。

Inference Time Context Sparsity: Illusion or Opportunity?

论文配图:Inference Time Context Sparsity: Illusion or Opportunity?
图 1 · 摘自论文原文
  • 推理时动态忽略冗余上下文,实现极端但有原则的稀疏计算。
  • 在50倍稀疏下,处理长文本速度比FlashInfer快10倍,效果稳定。
  • 适合追求高效推理的部署场景,尤其对长文本任务意义重大。

稀疏性长期是大模型效率的核心议题,但在上下文处理中的作用仍不明确。随着大模型工作负载向更长上下文和代理交互演进,注意力机制带来的算力与内存瓶颈日益严峻,引发一个关键问题:这些限制是否本质存在?我们认为,这些限制是人为设定而非必然,未来大模型推理应走向极端但有依据的上下文维度稀疏化。这一观点得到多方面的实证与理论支持:首先,长上下文中查询将O(N)的注意力信息压缩至维度d << N的隐空间,过程天然存在损失,因此强制稠密注意力不合理;其次,我们在20个模型、五个模型家族、多种上下文长度与稀疏水平下进行广泛研究,发现当前大模型虽未专门训练以适应稀疏性,但在检索、多跳问答、数学推理和代理编程等复杂任务中,对推理时解码稀疏性表现出惊人鲁棒性;更重要的是,现有硬件已足以实现显著收益,例如在H100上,50倍稀疏下,我们的稀疏解码内核相较FlashInfer提升达10倍。总体而言,极端上下文稀疏性并非临时权宜之计,而是可作为大模型推理、训练与架构设计的根基,既可行又有效,是未来系统的重要方向。

原文摘要 · Abstract (English)

Sparsity has long been a central theme in LLM efficiency, but its role in context processing remains unresolved. As LLM workloads shift toward longer contexts and agentic interactions, the compute and memory bottlenecks of attention become increasingly critical, raising the question of whether these constraints are fundamental. Our position is that these constraints are artificial and unnecessary, and that the future of LLM inference lies in extreme but principled sparsity along the context dimension. This position is supported by several strands of empirical and theoretical evidence. First, we find the insistence on dense attention unreasonable, since in a long context a query effectively projects O(N) attention information into a hidden space of dimension d << N, making the process inherently lossy. Second, we perform an extensive study of sparsity in LLMs spanning 20 models across five model families, varying context lengths, and different sparsity levels. We empirically demonstrate a strong trend: current LLMs, despite not being trained for context sparsity, are remarkably robust to inference-time decode sparsity across tasks of varying complexity, including retrieval, multi-hop QA, mathematical reasoning, and agentic coding. Importantly, we also show that current hardware is already sufficient to realize substantial gains from this sparsity. For example, our sparse decode kernels accelerate large-context processing by up to 10x over FlashInfer at 50x sparsity levels on hardware such as the H100. Overall, these results position extreme context sparsity not as a heuristic, but as a principled foundation for LLM inference, training, and architecture design: one that is both feasible and beneficial, and a compelling direction for future systems.

大模型推理上下文稀疏加速

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