推理时上下文稀疏性:幻觉还是机遇?
Inference Time Context Sparsity: Illusion or Opportunity?
AI总结:
本文通过实证和理论证据论证,在长上下文LLM推理中采用极端但原则性的上下文维度稀疏性不仅是可行的,而且能显著加速处理(如H100上实现10倍加速),从而挑战了密集注意力机制的必要性。
摘要:
稀疏性长期以来一直是LLM效率的核心主题,但其在上下文处理中的作用仍未解决。随着LLM工作负载转向更长的上下文和智能体交互,注意力的计算和内存瓶颈变得日益关键,这引发了这些约束是否根本性的问题。我们的立场是,这些约束是人为且不必要的,LLM推理的未来在于沿上下文维度的极端但原则性的稀疏性。这一立场得到了多方面的经验和理论证据支持。首先,我们发现坚持密集注意力是不合理的,因为在长上下文中,查询实际上将O(N)个注意力信息投影到维度d << N的隐藏空间中,使得该过程固有地有损。其次,我们对跨越五个模型家族的20个LLM进行了广泛的稀疏性研究,变化上下文长度和不同稀疏水平。我们经验性地展示了一个强烈趋势:当前的LLM,尽管未针对上下文稀疏性进行训练,但在不同复杂度的任务(包括检索、多跳QA、数学推理和智能体编码)中对推理时解码稀疏性表现出显著的鲁棒性。重要的是,我们还表明当前的硬件已经足以从这种稀疏性中实现实质性收益。例如,我们的稀疏解码内核在H100等硬件上以50倍稀疏性水平将大上下文处理加速高达10倍,相比FlashInfer。总体而言,这些结果将极端上下文稀疏性定位为不仅是启发式的,而是LLM推理、训练和架构设计的原则性基础:既可行又有益,是未来系统的一个有吸引力的方向。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。