动态稀疏注意力让中端显卡高效处理超长文本。
SparseAccelerate: Efficient Long-Context Inference for Mid-Range GPUs
- 根据输入特征自适应调整稀疏模式,降低计算复杂度
- 32K token时TTFT降低1.04倍,支持128K长文本推理
- 适合内存受限的实时长文本应用,如客服、文档分析
随着大语言模型上下文窗口持续扩展,传统注意力机制随输入长度呈二次增长的计算开销成为实时与内存受限部署的关键挑战。现有稀疏注意力方法常伴随显著开销或精度损失,难以在中端硬件上实用。本文提出SparseAccelerate,一种动态稀疏注意力方法,能依据输入特征自适应调整稀疏模式,有效平滑注意力复杂度曲线。该方法从16K tokens起有效,可在双NVIDIA A5000 GPU(每卡24GB)上扩展至128K tokens。实验显示,在32K tokens时,其Time-To-First-Token(TTFT)延迟最多降低1.04倍,同时大幅节省内存。这些改进使原本不可行的内存密集型长文本任务变为可能。此外,SparseAccelerate展现出相较其他方法最小的TTFT增长梯度,从根本上改变缩放趋势。多基准测试验证了其可扩展性,标志着在可及硬件上实现高效、实时、大上下文语言模型推理的重要进展。
原文摘要 · Abstract (English)
As Large Language Models (LLMs) scale to longer context windows, the computational cost of attention mechanisms, which traditionally grows quadratically with input length, presents a critical challenge for real-time and memory-constrained deployments. Existing sparse attention techniques have sought to reduce this complexity, but they often incur significant overhead or compromise accuracy, making them less practical for large contexts on mid-range hardware. In this paper, we introduce SparseAccelerate, a dynamic sparse attention method that adapts its sparsity patterns based on input characteristics, effectively flattening the attention complexity curve. Our approach is effective for input lengths starting at 16K tokens and scales efficiently up to 128K tokens on dual NVIDIA A5000 GPUs (24GB each). Experimental results show that SparseAccelerate achieves up to a 1.04x reduction in Time-To-First-Token (TTFT) latency at 32K tokens, while also providing substantial memory savings. These improvements yield practical gains for memory-intensive applications and long-context tasks that were previously infeasible with standard attention. Beyond latency reductions, SparseAccelerate fundamentally shifts the scaling trend, demonstrating the smallest TTFT growth gradient relative to context length among competing methods. Ongoing evaluations on diverse benchmarks confirm its scalability, positioning SparseAccelerate as a critical advancement toward efficient, real-time, and large-context LLM inference on accessible hardware.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。