Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

RaaS: Reasoning-Aware Attention Sparsity for Efficient LLM Reasoning

About

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 an LLM to generate long sequences, incurring $O(N)$ time and memory complexities per token, where $N$ is the current sequence length. To reduce complexities, existing sparsity-based algorithms propose to retain Key-Value (KV) vectors, the intermediate representations of only the most critical tokens. However, these algorithms struggle with the "impossible trinity" of accuracy, time, and memory. For example, the state-of-the-art algorithm, Quest, achieves high accuracy with $O(L)$ time but $O(N)$ memory ($L$ is the cache budget, $L \ll N$). To address the "impossible trinity", 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 RaaS that identifies milestone tokens and retains their KV vectors until they are no longer needed, achieving high accuracy with $O(L)$ time and $O(L)$ memory complexities.

Junhao Hu, Wenrui Huang, Weidong Wang, Zhenwen Li, Tiancheng Hu, Zhixia Liu, Xusheng Chen, Tao Xie, Yizhou Shan• 2025

Related benchmarks

TaskDatasetResultRank
Mathematical ReasoningMATH500 (test)
Accuracy74
922
Mathematical ReasoningMATH 500
Accuracy70
589
Mathematical ReasoningAIME 2024 (test)
Accuracy36.7
294
Long-context UnderstandingLongBench v2
Overall Score28.23
185
Math ReasoningAIME 2024
Mean Wall-Clock Time (s)885.2
61
Mathematical ReasoningMATH 500
Mean Wall-Clock Time246.6
49
Math problem solvingAIME 2024
Mean Peak GPU Memory (MB)1.56e+4
41
Multi-choice Question AnsweringLongBench v2
Overall Accuracy32.6
41
Mathematical ReasoningMATH 500
Mean Peak GPU Memory (MB)1.56e+4
37
Long-form generationLongGenBench
CR77.65
24
Showing 10 of 13 rows

Other info

Follow for update