Large language models (LLMs) face significant challenges in processing long contexts due to the linear growth of the key-value (KV) cache and quadratic complexity of self-attention. Existing approaches address these bottlenecks separately: Multi-head Latent Attention (MLA) reduces the KV cache by projecting tokens into a low-dimensional latent space, while sparse attention reduces computation. However, sparse methods cannot operate natively on MLA's compressed latent structure, missing opportunities for joint optimization. In this paper, we propose Latent-Condensed Attention (LCA), which directly condenses context within MLA's latent space, where the representation is disentangled into semantic latent vectors and positional keys. LCA separately aggregates semantic vectors via query-aware pooling and preserves positional keys via anchor selection. This approach jointly reduces both computational cost and KV cache without adding parameters. Beyond MLA, LCA's design is architecture-agnostic and readily extends to other attention mechanisms such as GQA. Theoretically, we prove a length-independent error bound. Experiments show LCA achieves up to 2.5× prefilling speedup and 90% KV cache reduction at 128K context while maintaining competitive performance.
Figures & tables
Figure 1: An overview of Latent-Condensed Attention (LCA). The history context is condensed into a compact set of representatives via group-wise condensation in the latent space: semantic information is aggregated through weighted pooling of CKV , while positional information is preserved via anchor selection from KR . The recent context is retained in full fidelity without condensation.
Methods
Computation
Memory
No Extra Params
Minference
<O(L2)
O(L)
✓
FlexPrefill
<O(L2)
O(L)
✓
KDA
<O(L2)
O(L)
Ours
O(Lm)
O(m)
✓
Table 1: Comparison of efficient attention methods.
Methods
S. QA
M. QA
Sum.
F. S.
Syn.
Code
Avg.↑
FTL (s) ↓
DeepSeek V2-Lite (MLA)
23.92
11.15
17.52
63.19
3.09
58.17
29.51
3.20
∙ MInference Jiang et al. (2024)
14.54
5.61
13.80
41.15
2.17
41.01
19.71
2.99 (1.1 × )
∙ FlexPrefill Lai et al. (2025)
14.35
5.94
14.10
48.00
2.22
41.72
21.05
2.51 (1.3 × )
∙ KDA Kimi et al. (2025b)
18.81
11.68
14.22
56.97
3.25
57.97
27.15
2.47 (1.3 × )
∙ LCA (Ours)
22.61
8.90
23.74
58.27
2.33
58.67
29.09
1.80 (1.8 × )
Table 2: Comparisons on LongBench-E Bai et al. (2023) . We report the latency of DeepSeek V2-Lite within contexts of 64K on H200 GPUs.
Methods
4K
8K
16K
32K
64K
128K
Avg.↑
FTL (s) ↓
DeepSeek V2-Lite ( MLA )
79.51
78.82
62.28
58.33
47.57
23.96
58.91
10.78
∙ MInference Jiang et al. (2024)
76.88
69.69
44.06
20.31
10.31
4.34
37.60
5.66 (1.9 × )
∙ FlexPrefill Lai et al. (2025)
72.81
70.00
56.25
19.06
9.38
7.19
39.11
5.38 (2.0 × )
∙ KDA Kimi et al. (2025b)
72.22
73.61
64.24
51.39
44.10
22.22
54.63
4.96 (2.2 × )
∙ LCA (Ours)
77.19
77.19
63.75
59.69
50.63
24.38
58.80
4.40 (2.5 × )
Table 3: Comparisons on RULER Hsieh et al. (2024) across 4-128K context. We report the latency of DeepSeek V2-Lite within contexts of 128K on H200 GPUs.
Figure 2: Efficiency comparison of different context lengths. (a) presents the first-token generation latency. (b) shows the per-token (interval) latency during decoding. (c) illustrates the GPU memory footprint of KV cache.
Table 6Table 7Figure 8
#Queries
S. QA
M. QA
Sum.
F. S.
Syn.
Code
Avg.
32
23.01
8.82
23.87
58.33
2.41
59.09
29.26
16 (default)
22.61
8.90
23.74
58.27
2.33
58.67
29.09
8
22.34
8.37
23.17
56.22
2.09
58.41
28.43
Table 8: Ablation on the number of queries used to compute importance scores. Default setting is 16.
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Context Length
4K
32K
128K
∥ki∥2
20.00
22.13
21.39
δk
0.43
0.64
0.77
δk/∥ki∥2
2.15%
2.89%
3.60%
∥vi∥2
20.87
21.38
21.23
δv
0.68
0.73
0.77
δv/∥vi∥2
3.26%
3.41%
3.63%
Appendix
Table 9: Statistics across different context lengths.
Metric
Multi-Doc. QA
Summarization
Code
∥ki∥2
22.76
21.42
20.07
δk
0.67
0.98
0.89
δk/∥ki∥2
2.94%
4.58%
4.43%
∥vi∥2
19.09
24.78
29.78
δv
0.56
0.51
0.98
δv/∥vi∥2
2.93%
2.06%
3.29%
Appendix
Table 10: Statistics across different task types.
g
LongBench Avg.
RULER Avg. (4K–128K)
RULER@128K
32
28.32
58.18
23.96
16
29.09
58.80
24.38
8
29.38
59.42
24.63
Appendix
Table 11: Effect of group size g with fixed window size w=1024 .
w
LongBench Avg.
RULER Avg. (4K–128K)
RULER@128K
512
28.84
57.14
23.68
1024
29.09
58.80
24.38
2048
29.14
59.52
25.53
Appendix
Table 12: Effect of window size w with fixed group size g=16 .