Stem: Rethinking Causal Information Flow in Sparse Attention
Authors: Lin Niu, Xin Luo, Linchuan Xie, Yifu Sun, Guanghua Yu, Jianchen Zhu, S Kevin Zhou
Organizations: Tencent · School of Biomedical Engineering, Division of Life Sciences and Medicine, University of Science and Technology of China, Hefei, Anhui, 230026, China · Suzhou Institute for Advanced Research, University of Science and Technology of China, Suzhou, Jiangsu, 215123, China · School of Biomedical Engineering, Division of Life Sciences and Medicine, University of Science and Technology of China (USTC), China · Medical Imaging, Robotics, Analytic Computing & Learning (MIRACLE) Lab, YRD-RIGHT, USTC Suzhou Institute for Advanced Research, Suzhou, China · Jiangsu Provincial Key Laboratory of Multimodal Digital Twin Technology, USTC, China · Biomedical Basic Research Center (BBRC) of Jiangsu Province, Suzhou, China · State Key Laboratory of Precision and Intelligent Chemistry, USTC
The quadratic computational complexity of self-attention remains a fundamental bottleneck for scaling Large Language Models (LLMs) to long contexts, particularly during the pre-filling phase. In this paper, we rethink the causal attention mechanism from the perspective of information flow. Due to causal constraints, tokens at initial positions participate in the aggregation of every subsequent token. However, existing sparse methods typically apply a uniform top-k selection across all token positions within a layer, ignoring the cumulative dependency of token information inherent in causal architectures. To address this, we propose Stem, a novel, plug-and-play sparsity module aligned with information flow. First, Stem employs the Token Position-Decay strategy, applying position-dependent top-k within each layer to retain initial tokens for recursive dependencies. Second, to preserve information-rich tokens, Stem utilizes the Output-Aware Metric. It prioritizes high-impact tokens based on approximate output magnitude. Extensive evaluations demonstrate that Stem achieves superior accuracy with reduced computation and pre-filling latency.
Figures & tables
Figure 1: Latency comparison (ms) on H20 GPU. Results are reported as Attention Kernel Time/Total Time.
Figure 2: Visualization of recursive error propagation. The diagram depicts the impact of sparsification across layers l→l+2 based on Eq. (1). Red circles indicate sparse tokens, while blue circles indicate dense tokens. Pruning the initial token V1(l+1) triggers a global distortion that affects all tokens in the next layer (dashed red connections), whereas pruning the last token VN(l) results in only a local error confined to the tail.
Figure 3: Sensitivity analysis of token position segments. The X-axis represents the specific token interval subject to sparsification. Y-axis shows head logit MSE loss. Curves compare dynamic ratios vs. fixed budgets.
Figure 4: Pipeline of Stem. The figure illustrates the framework workflow and compares the sparsity budget schedules between the standard Uniform Top- k and our Token Position-Decay strategy.
Method
L5
L15
L25
L35
Head Logits
SAM
1.5e-5
2.0e-4
8.5e-4
6.0e-3
0.3368
OAM
1.4e-5
2.0e-4
8.1e-4
5.2e-3
0.3126
Table 1: Comparison of sparse loss between SAM and OAM.
Method
CC
FSL
MD1
MD2
SUM
SYN
AVG
BUD.
Qwen3-8B
Dense
19.09
63.10
11.23
15.06
20.63
62.92
32.01
100%
MINF
18.91
61.87
10.78
14.46
20.26
55.32
30.27
69%
FLEX
19.75
55.31
10.76
13.49
21.18
50.83
28.55
31%
XATTN
21.03
62.30
11.42
14.64
20.47
52.92
30.46
28%
Stem
19.43
61.84
11.22
14.97
20.21
62.19
31.64
25%
Table 2: LongBench results (%). We compare accuracy on Llama-3.1-8B-Instruct and Qwen3-8B across task families: Code Completion (CC), Few-Shot Learning (FSL), Multi-Document QA (MD1/MD2), Summarization (SUM), and Synthetic (SYN). AVG and BUD denotes the average accuracy and the sparsity budget.
Method
CC
FSL
MD1
MD2
SUM
SYN
AVG
DeepSeek-V3.2
DSA
32.42
41.85
51.83
48.30
22.28
60.35
42.84
+ Stem
32.02
44.03
51.67
48.44
21.97
60.85
43.16
MiniCPM-4.1
InfLLMv2
55.61
53.74
42.83
20.26
17.10
67.00
42.75
+ Stem
55.62
53.65
43.03
20.13
17.13
67.00
42.76
Table 3: Performance on training-based sparse models.
Method
4K
8K
16K
32K
64K
128K
AVG
Bud.
Llama-3.1-8B-Instruct
Dense
95.52
94.06
93.43
88.19
84.86
77.11
88.86
100%
MINF
95.51
93.56
92.70
91.68
80.06
76.67
88.36
55%
FLEX
94.98
93.91
92.68
89.51
82.66
75.40
88.19
27%
XATTN
95.46
93.83
93.65
89.82
81.60
74.35
88.12
26%
Stem
95.17
93.96
93.73
89.92
82.67
75.37
88.47
25%
Table 4: Accuracy (%) and Budget on the RULER benchmark.
Config
CC
FSL
MD1
MD2
SUM
SYN
AVG
Qwen3-8B
Uniform
19.01
58.92
10.91
14.32
20.12
53.23
29.41
+ TPD
19.28
60.81
11.42
15.04
20.46
61.58
31.43
+ TPD + OAM
19.43
61.03
11.34
14.94
20.44
60.92
31.64
Llama-3.1-8B-Instruct
Uniform
34.02
57.26
21.96
28.21
23.61
59.86
37.48
Table 5: Ablation study on LongBench.
Figure 5: Hyperparameter ablation studies on LongBench.