Long chain-of-thought (CoT) reasoning models such as DeepSeek-R1 keep lengthening their inference chains under test-time scaling, yet standard self-attention incurs quadratic cost in context length, making long-CoT deployment costly in production. We therefore introduce LISA (Linear-Indexed Sparse Attention), a plug-and-play replacement for self-attention that requires no full pretraining. LISA combines a linear-attention branch for long-range memory with a Lightning Indexer that dynamically selects the most relevant tokens for a sparse self-attention branch. The two branches are fused through a learned gate, so the model retains broad context while focusing computation on informative tokens. We train LISA in two stages. In Stage 1, a linear-attention branch is integrated with sliding-window attention and distilled from a frozen teacher's full-attention distribution. In Stage 2, the Lightning Indexer replaces the static window and is trained with a per-head KL-divergence objective to mimic teacher attention patterns. The resulting model reduces eager-mode self-attention computation from quadratic in sequence length to linear in the number of generated tokens and the selected context budget. Experiments on DeepSeek-distilled Qwen models show that LISA cuts measured eager-mode mean sample latency by 23.9% at 16K context without degrading long-context reasoning quality. Across nine mathematical and code reasoning benchmarks, the gated LISA-1.5B model improves the equal-weight benchmark average by 4.2 percentage points relative to the full-attention baseline.
Figures & tables
Figure 1: Overview of the LISA architecture.
Method
GSM8K
MATH-500
AMC23
AIME24
AIME25
AVG.
Acc↑
Tok↓
ReL↓
Acc↑
Tok↓
ReL↓
Acc↑
Tok↓
ReL↓
Acc↑
Tok↓
ReL↓
Acc↑
Tok↓
ReL↓
Acc↑
ReL↓
Qwen2.5-1.5B Series
Full-attention baseline
80.1
2086
76.2
78.8
3958
139.4
62.5
6392
242.9
20.0
13765
536.8
16.7
12684
504.7
51.6
300.0
+ H2O
76.1
2116
71.7
75.4
3835
128.5
55.0
6230
209.7
13.3
13921
462.2
10.0
12802
428.6
46.0
260.1
+ SepLLM
77.3
2230
75.8
76.0
3890
130.3
57.5
6573
220.2
13.3
13690
452.6
13.3
12690
423.9
47.5
260.6
LightThinker
78.8
2109
69.6
77.6
4060
134.8
60.5
6312
214.6
16.7
13827
461.6
13.3
12934
434.6
49.4
263.0
Table 1: Results of our model and baselines on mathematical reasoning benchmarks. The Full-attention baseline row is the unmodified original model. All cells report a single representative run; run-to-run variance on the small-sample benchmarks is reported separately in Table 2 .
AMC23
AIME24
AIME25
Acc↑
± std
Acc↑
± std
Acc↑
± std
Full-attention baseline
62.5
2.24
19.6
1.65
16.1
1.83
LISA
70.0
2.74
25.8
1.96
25.9
2.29
Table 2: Mean accuracy ( % ) over 16 independent evaluation runs on the small-sample benchmarks, Qwen2.5-1.5B. These benchmarks contain only about 30 problems each, so we report the standard deviation alongside the mean; the corresponding single-run values in Table 1 fall within one standard deviation of these means.
Method
GPQA-D↑
HumanEval↑
LiveCodeBench↑
BigCodeBench↑
Full-attention baseline
23.23
76.22
35.0
22.7
LISA
26.26
79.27
37.4
24.7
Table 3: Generalization results of Qwen2.5-1.5B on non-mathematical tasks (accuracy, %).
Variant
Description
GSM8K
MATH-500
AMC23
AIME24
AIME25
Avg
Acc↑
Acc↑
Acc↑
Acc↑
Acc↑
Full LISA (ours)
Complete method (Stage 1 + Stage 2)
80.2
82.0
70.0
26.7
26.7
57.1
Stage 1 only
Sliding-window sparse without indexer-guided training
79.2
80.6
65.0
23.3
23.3
54.3
Linear only
Remove sparse branch
68.3
67.8
55.0
13.4
10.0
42.9
Sparse only
Remove linear branch
66.6
60.8
42.5
6.7
6.7
36.7
No gating
Remove learned gating
78.3
80.2
65.0
23.3
20.0
53.4
Table 4: Component-level ablation on Qwen2.5-1.5B (accuracy, %). All variants use the same training configuration.
Figure 2: Cosine similarity between the linear and sparse attention outputs across all layers.
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
Context
Qwen2.5-1.5B
Qwen2.5-7B
Full-Attn
LISA
Reduction
Full-Attn
LISA
Reduction
4K
3.33 G
3.20 G
3.8%
14.69 G
14.74 G
− 0.3%
8K
4.03 G
3.47 G
13.9%
16.34 G
15.37 G
5.9%
12K
4.73 G
3.74 G
21.0%
17.98 G
16.00 G
11.0%
16K
5.44 G
4.01 G
26.3%
19.63 G
16.63 G
15.3%
Appendix
Table 5: Secondary decoding-FLOPs estimate per generated token (GFLOPs; SA + Indexer with cached keys + LA + SwiGLU MLP). LISA uses 5 full-attention + 23 LISA blocks. Primary efficiency claim: measured ReL.
Figure 3: Visualization of the top-256 tokens selected by the Indexer across layers.