CLAA: Cross-Layer Attention Aggregation for Accelerating LLM Prefill
Organizations: Franklin and Marshall College · Meta Reality Labs
Abstract
The prefill stage in long-context LLM inference remains a computational bottleneck. Recent token-ranking heuristics accelerate inference by selectively processing a subset of semantically relevant tokens. However, existing methods suffer from unstable token importance estimation, often varying between layers. Evaluating token-ranking quality independently from heuristic-specific architectures is challenging. To address this, we introduce an Answer-Informed Oracle, which defines ground-truth token importance by measuring attention from generated answers back to the prompt. This oracle reveals that existing heuristics exhibit high variance across layers: rankings can degrade sharply at specific layers, a failure mode invisible to end-to-end benchmarks. The diagnosis suggests a simple fix: aggregate scores across layers rather than relying on any single one. We implement this as Cross-Layer Attention Aggregation (CLAA), which closes the gap to the oracle upper bound and reduces Time-to-First-Token (TTFT) by up to 39% compared to the Full KV Cache baseline.
Figures & tables
| Single-Document QA | Multi-Document QA | Summarization | Few-shot Learning | Synthetic | Code | ||||||||||||
| Method | NrtvQA | Qasper | MF-en | HotpotQA | 2WikiMQA | MuSiQue | GovReport | QMSum | MultiNews | TREC | TriviaQA | SAMSum | PCount | PRe | LCC | RB-P | Avg. |
| Keep Token Rate = 100% | |||||||||||||||||
| FullKV | 30.16 | 45.53 | 54.94 | 56.02 | 46.66 | 31.28 | 35.12 | 25.28 | 27.25 | 73.00 | 91.65 | 43.80 | 8.88 | 99.50 | 63.38 | 56.73 | 49.32 |
| Keep Token Rate = 10% | |||||||||||||||||
| Oracle | 29.85 | 43.94 | 55.85 | 54.99 | 47.11 | 28.92 | 32.26 | 25.29 | 21.95 | 68.50 | 91.43 | 41.80 | 7.47 | 99.50 | 59.63 | 56.85 | 47.83 |
| GemFilter | 24.36 | 21.07 | 39.73 | 51.29 | 33.92 | 25.78 | 28.94 | 18.98 | 17.42 | 60.50 | 91.53 | 40.39 | 4.76 | 87.50 | 22.73 | 32.47 | 37.59 |
| Method | LLaMA-3.2-3B | LLaMA-3.1-8B | Mistral-Nemo-12B |
|---|---|---|---|
| Keep Token Rate = 100% | |||
| FullKV | 44.23 | 49.32 | 48.32 |
| Keep Token Rate = 10% | |||
| Oracle | 44.13 | 47.83 | 47.75 |
| GemFilter | 35.20 | 37.59 | 36.60 |
| FastKV | 42.45 | 46.81 | 45.62 |
| Method | Retr. | M-Hop | Agg. | QA | Avg. |
|---|---|---|---|---|---|
| FullKV | 98.27 | 86.88 | 86.67 | 63.30 | 83.78 |
| GemFilter | 82.23 | 58.20 | 88.33 | 63.70 | 73.12 |
| FastKV | 87.69 | 87.16 | 86.67 | 63.60 | 81.28 |
| CLAA | 89.85 | 87.72 | 86.67 | 63.80 | 82.01 |
| Task | Method | Rewrite | Total TTFT | Speedup | Score |
|---|---|---|---|---|---|
| Qasper | Full KV | — | 1084 ms | 1.00x | 0.487 |
| Selective Context | 3134 ms | 3421 ms | 0.32x | 0.186 | |
| LLMLingua | 901 ms | 1141 ms | 0.95x | 0.129 | |
| CLAA (20%) | — | 755 ms | 1.44x | 0.470 | |
| GovReport | Full KV | — | 13505 ms | 1.00x | 0.377 |
| Selective Context | 5642 ms | 15391 ms | 0.88x | 0.327 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Parameter | Symbol | Value(s) Explored | Final Value in Main Results |
| Oracle | Token Keep Rate | - | {0.1, 0.2, 0.4} | Main Variable |
| (Ours) | Pruning Layer Index | {3, 7, 11, 15, 19} | 15 | |
| FastKV | Token Keep Rate | - | {0.1, 0.2, 0.4} | Main Variable |
| TSP Layer Index | {3, 7, 11, 15, 19} | 15 | ||
| Observation Window | {8} | 8 | ||
| Pooling Kernel Size | - | {7} | 7 |