arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.04541cs.CLcs.AI
收藏

LycheeDecode: 通过混合头稀疏解码加速长上下文LLM推理

LycheeDecode: Accelerating Long-Context LLM Inference via Hybrid-Head Sparse Decoding

Harbin Institute of Technology, Shenzhen(哈尔滨工业大学深圳研究院)

Gang Lin, Dongfang Li, Zhuoen Chen, Yukun Shi, Xuhui Chen, Baotian Hu, Min Zhang

AI总结:

LycheeDecode通过混合头稀疏解码方法,实现长上下文LLM推理的高效与高质量

摘要:

长上下文大语言模型(LLM)的普及暴露了一个关键瓶颈:解码过程中快速膨胀的键值缓存,这带来了沉重的内存和延迟成本。尽管近期方法试图通过在层之间共享一组关键令牌来缓解这一问题,但这种粗粒度的共享会通过忽视注意力头的功能多样性而损害模型性能。为了解决这一问题,我们提出了LycheeDecode,一种以细粒度混合头注意力机制为核心的高效解码方法,该方法采用硬件高效的top-k选择策略。具体而言,新的HardKuma机制将注意力头划分为一小部分检索头,这些头动态识别关键令牌,以及大部分稀疏头,这些头重复使用它们进行高效计算。通过在Llama3和Qwen3等领先模型上进行广泛的实验,涵盖了长上下文理解(如LongBench、RULER)和复杂推理(如AIME24、OlympiadBench)等多种基准测试,我们证明LycheeDecode在生成质量上与全注意力基线相当,有时甚至超过了它。关键的是,这一成果在128K上下文长度下实现了高达2.7倍的速度提升。通过保持注意力头的功能多样性,我们的细粒度策略克服了现有方法的性能瓶颈,提供了一条强大且经过验证的路径,以实现高效且高质量的长上下文LLM推理。

英文摘要:

The proliferation of long-context large language models (LLMs) exposes a key bottleneck: the rapidly expanding key-value cache during decoding, which imposes heavy memory and latency costs. While recent approaches attempt to alleviate this by sharing a single set of crucial tokens across layers, such coarse-grained sharing undermines model performance by neglecting the functional diversity of attention heads. To address this, we propose LycheeDecode, an efficient decoding method centered on a fine-grained hybrid-head attention mechanism that employs a hardware-efficient top-k selection strategy. Specifically, the novel HardKuma-based mechanism partitions attention heads into a small subset of retrieval heads that dynamically identify crucial tokens and a majority of sparse heads that reuse them for efficient computation. Through extensive experiments on leading models like Llama3 and Qwen3 across diverse benchmarks for long-context understanding (e.g., LongBench, RULER) and complex reasoning (e.g., AIME24, OlympiadBench), we demonstrate that LycheeDecode achieves generative quality comparable to, and at times surpassing even the full-attention baseline. Crucially, this is accomplished with up to a 2.7x speedup at a 128K context length. By preserving the functional diversity of attention heads, our fine-grained strategy overcomes the performance bottlenecks of existing methods, providing a powerful and validated pathway to both efficient and high-quality long-context LLM inference.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑