Efficient Long-Decoding Inference with Reasoning-Aware Attention Sparsity

Large Language Models (LLMs) have demonstrated strong capabilities across various domains, with recent advancements in challenging reasoning tasks such as mathematics and programming. However, solving reasoning tasks often requires long decoding chains (of thoughts), which incur time and memory consumption, where is the chain length. To mitigate time and memory consumption, existing sparsity-based algorithms propose retaining only the most critical token's intermediate data (i.e., key-value cache) and discarding the rest. However, these existing algorithms struggle with the ``impossible trinity'' of accuracy, time, and memory. For example, the state-of-the-art algorithm, Quest, achieves high accuracy with time but memory ( is the cache budget, ). To address this issue, in this paper, we identify a new attention pattern during the decode stage of reasoning tasks, where milestone tokens (analogous to lemmas in mathematical proofs) emerge, are utilized, and then become unimportant afterward. Based on this pattern, we propose a new algorithm named RaaS that identifies and retains milestone tokens only until they are no longer needed, achieving high accuracy with time and memory complexity.
View on arXiv@article{hu2025_2502.11147, title={ Efficient Long-Decoding Inference with Reasoning-Aware Attention Sparsity }, author={ Junhao Hu and Wenrui Huang and Weidong Wang and Zhenwen Li and Tiancheng Hu and Zhixia Liu and Xusheng Chen and Tao Xie and Yizhou Shan }, journal={arXiv preprint arXiv:2502.11147}, year={ 2025 } }