SinkRouter: 为大语言和多模态模型高效长上下文解码的感知路由
SinkRouter: Sink-Aware Routing for Efficient Long-Context Decoding in Large Language and Multimodal Models
AI总结:
本文提出SinkRouter,通过感知路由机制提升长上下文解码效率,减少计算冗余,实现在512K上下文下的2.03倍加速,保持高精度。
摘要:
在大语言模型和多模态模型的长上下文解码中,注意力机制因需要加载大量KV缓存数据而变得内存密集。现有加速策略常以牺牲精度换取效率,依赖启发式剪枝可能丢弃有用信息。本文发现注意力sink现象对应训练期间形成的稳定、可达且误差可控的固定点。基于此,提出SinkRouter,一种无需训练的选择性路由框架,检测sink信号并跳过产生近零输出的计算。为将此机制转化为实际加速,开发了具有块级分支和Split-K并行的硬件感知Triton内核。在LongBench、InfiniteBench、CVBench、MileBench和MMVP等多样化的长上下文基准测试中,使用文本和多模态骨干网络进行评估,SinkRouter在保持竞争力精度的同时,显著提升了解码效率,达到512K上下文的2.03倍加速。
英文摘要:
In long-context decoding for LLMs and LMMs, attention becomes increasingly memory-bound because each decoding step must load a large amount of KV-cache data from GPU memory. Existing acceleration strategies often trade efficiency for accuracy by relying on heuristic pruning that may discard useful information. At a deeper level, they also tend to indiscriminately preserve all high-scoring tokens, treat early tokens as indispensable anchors, or rely on heuristic head routing, reflecting an insufficient mechanistic understanding of the attention sink phenomenon. In this paper, we show that the attention sink phenomenon corresponds to a stable, reachable, and error-controllable fixed point constructed during training. Based on this insight, we propose SinkRouter, a training-free selective routing framework that detects the sink signal and skips computations that would otherwise produce near-zero output. To translate this mechanism into real-world acceleration, we develop a hardware-aware Triton kernel with block-level branching and Split-K parallelism. We conduct extensive evaluations on a diverse suite of long-context benchmarks, including LongBench, InfiniteBench, CVBench, MileBench, and MMVP, using both text-only and multimodal backbones such as Llama-3.1-8B, Llama-3.1-70B, Yi-9B-200K, LLaVA-1.5-7B, and LLaVA-1.5-13B. Across these settings, SinkRouter consistently improves decoding efficiency while maintaining competitive accuracy, and reaches 2.03x speedup with a 512K context.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。