TopK-Guided: Adaptive, Budget-Aware Activation Sparsity for Efficient LLM Inference
Organizations: MBZUAI · National Taiwan University
Abstract
Activation sparsity speeds up large language model (LLM) inference by setting unimportant activations to zero so that the corresponding computations can be skipped. Existing training-free methods, however, make different trade-offs: threshold-based methods such as TEAL adapt the sparsity level to each token but do not tightly control the realised sparsity, while TopK-based methods such as WINA enforce a fixed sparsity level but use the same sparsity budget for every token. Both also apply the same budget across transformer blocks, despite large differences in block sensitivity. We introduce TopK-Guided, a training-free method that addresses both limitations by combining bounded token-level sparsity adaptation with sensitivity-aware block-level budget allocation. Across Llama-2 and Llama-3 models, TopK-Guided consistently improves perplexity and downstream accuracy over TEAL and WINA while preserving essentially the same sparsitydependent projection compute as WINA, with the largest gains at high sparsity. Ablations show that both components provide complementary improvements.
Figures & tables
| Model | Method | PPL | Acc | PPL | Acc | PPL | Acc |
| Llama-2-7B | TEAL | 6.92 | 64.46 | 7.57 | 61.88 | 15.85 | 50.19 |
| WINA | 6.90 | 64.63 | 7.34 | 63.33 | 10.72 | 56.54 | |
| TopK-Guided | 6.89 | 64.71 | 7.32 | 63.42 | 10.15 | 56.80 | |
| Llama-3-8B | TEAL | 9.05 | 73.56 | 10.49 | 69.84 | 24.09 | 52.64 |
| WINA | 9.05 | 73.59 | 10.52 | 69.79 | 27.78 | 55.34 | |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Scope | Meaning |
| global | Target sparsity: the fraction we aim to zero, fixed for a run. | |
| per-block | Probe sparsity used only to measure a block’s sensitivity in Eq. 4 ; never the level a block is finally run at (Sec. 2.2 ). | |
| per-block | Sensitivity of block : its relative output error when sparsified at (Eq. 4 ). | |
| per-block | Budget actually applied to block , from redistributing across blocks by sensitivity (Eq. 5 ). | |
| per-token | Token ’s natural sparsity: the fraction of its entries falling below (Eq. 2 ). | |
| per-token | Target actually enforced for token : clipped to a band around (Eq. 3 ). |
| Method | Dataset | Target | Realised | PPL |
| TEAL | WikiText-2 | 50% | 48.14% | 7.45 |
| TEAL | C4 | 50% | 48.36% | 7.57 |
| TEAL | cc100 | 50% | 47.64% | 10.40 |
| WINA | WikiText-2 | 50% | 50.00% | 7.24 |
| WINA | C4 | 50% | 50.00% | 7.34 |
| WINA | cc100 | 50% | 50.00% | 10.28 |
| Step | Candidate errors | Winner | |||
| 0 | – | – | 0.000 | 0.000 | 0.000 |
| 1 | 0.000 | 0.125 | 0.100 | ||
| 2 | 0.000 | 0.250 | 0.200 | ||
| 3 | 0.500 | 0.250 | 0.300 |
| 0.2 | 0.4 | 0.6 | 0.8 | |
| (TEAL , WINA ) | ||||
| 0.2 | 6.77 | 6.77 | 6.77 | 6.77 |
| 0.4 | 6.77 | 6.78 | 6.77 | 6.78 |
| 0.6 | 6.78 | 6.78 | 6.78 | 6.78 |
| 0.8 | 6.78 | 6.78 | 6.78 | 6.80 |
| (TEAL , WINA ) | ||||
| C4 (selected on WikiText-2) | WikiText-2 (selected on C4) | |||||
| Configuration | ||||||
| WINA (baseline) | 6.90 | 7.34 | 10.72 | 6.78 | 7.24 | 10.79 |
| + Sensitivity-aware sparsity | 6.90 | 7.35 | 10.25 | 6.78 | 7.24 | 10.23 |
| + TopK-Guided masking | 6.89 | 7.33 | 10.66 | 6.77 | 7.21 | 10.67 |
| + Both (TopK-Guided) | 6.89 | 7.32 | 10.15 | 6.77 | 7.20 | 10.09 |
| Method | ARC-E | WG | HS | BoolQ | SciQ | MMLU | GSM8K | LAMBADA | Avg |
| Sparsity | |||||||||
| TEAL | 74.24 | 68.98 | 76.02 | 77.19 | 91.20 | 41.12 | 13.42 | 73.51 | 64.46 |
| WINA | 74.49 | 68.51 | 76.01 | 77.06 | 91.00 | 42.11 | 14.33 | 73.55 | 64.63 |
| TopK-Guided | 74.71 | 68.90 | 75.89 | 77.22 | 91.10 | 41.97 | 14.33 | 73.57 | 64.71 |
| Sparsity | |||||||||
| TEAL | 72.64 | 66.30 | 73.87 | 75.60 | 90.40 | 36.48 | 10.24 | 69.49 | 61.88 |
| Method | ARC-E | WG | HS | BoolQ | SciQ | MMLU | GSM8K | LAMBADA | Avg |
| Sparsity | |||||||||
| TEAL | 77.06 | 72.38 | 78.72 | 81.07 | 93.90 | 61.32 | 47.92 | 76.11 | 73.56 |
| WINA | 77.31 | 73.16 | 78.80 | 81.41 | 93.70 | 61.47 | 47.01 | 75.86 | 73.59 |
| TopK-Guided | 77.23 | 73.48 | 78.89 | 81.59 | 93.80 | 61.61 | 48.29 | 76.13 | 73.88 |
| Sparsity | |||||||||
| TEAL | 76.14 | 70.40 | 75.88 | 79.45 | 93.30 | 57.16 | 32.75 | 73.61 | 69.84 |