Manuscript Offprint
arXiv:2610.01763TopK-Guided: Adaptive, Budget-Aware Activation Sparsity for Efficient LLM Inference
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 sparsity-dependent projection compute as WINA, with the largest gains at high sparsity. Ablations show that both components provide complementary improvements.
1 Introduction
Every token generated by a large language model (LLM) requires a full forward pass through the network, and within each transformer block most of this cost comes from a few large linear projections ( in attention and in the MLP), each multiplying a weight matrix by an activation vector [14]. A well-documented property of trained LLMs is that many of the activation entries feeding these projections are already close to zero at inference time [12] and contribute negligibly to the output [14, 15].
Activation sparsity exploits this. Before a projection Wh, it sets the smallest-magnitude entries of the activation vector h to zero; whenever an entry is zeroed, the corresponding column can be skipped, since it only ever multiplies . Zeroing a fraction s of the entries thus skips a fraction s of the projection's work. Unlike weight pruning [19, 7], which permanently removes the same parameters for every input, activation sparsity leaves the model untouched and chooses its sparsity pattern afresh for each token [14].
Given a target sparsity s, a method must decide, for each token, which entries of h to zero. Two recent methods define the state of the art and adopt opposite strategies. TEAL [13] calibrates, per projection, a single threshold offline so that on average a fraction s of activation magnitudes fall below it, and at inference retains every entry above the threshold:
40th Conference on Neural Information Processing Systems (NeurIPS 2026). Workshop: AXIOM 2026: Foundations of Efficient Deep Learning — Towards predictive principles for efficient AI connecting deep learning theory, scaling laws, and efficiency.

Figure 1: Per-block sensitivity (Eq. 4) on Llama-2-7B and Llama-3-8B, shown at four probe levels .
At inference time, the same threshold affects each token differently: a token whose activations are mostly small loses many entries, giving it higher sparsity, while a token with larger activations keeps more, giving it a lower sparsity. The mask therefore adjusts itself to each token, a property we call token adaptivity. This adaptivity comes at a cost: since is fixed after calibration but activation distributions vary across tokens, the realised sparsity drifts from the target (Appendix B), and the resulting speedup becomes unpredictable. WINA [3] takes the opposite strategy: rather than fixing a threshold and letting the number of kept entries vary, it fixes that number directly through TopK selection. For each token it keeps the entries with the largest weight-informed score , which ranks entries by how much each one moves the output, and zeroes the rest ( is the number of entries in ). Since is the same for every token, exactly a fraction is zeroed each time, so the realised sparsity always matches the target. But fixing removes the token adaptivity that TEAL had for free. The two methods therefore sit at opposite ends of a single trade-off. TEAL adapts to each token but cannot control the realised sparsity, while WINA controls the sparsity exactly but cannot adapt to the token. Ideally we would want both: a mask that adjusts to each token while keeping the realised sparsity close to the target.
Both TEAL and WINA share a further limitation: they assign the same budget s to every transformer block. Blocks, however, are not equally tolerant of sparsification: sparsifying each block on its own and measuring how much its output changes shows that early blocks are far more sensitive than later ones (Figure 1). A uniform budget therefore over-sparsifies the fragile early blocks and under-uses the robust later ones.
We propose TopK-Guided, two complementary training-free modifications to WINA, one for each issue: 1) TopK-Guided masking (Section 2.1) recovers the per-token adaptivity that WINA gives up while keeping the realised sparsity within a bounded of the target. We reuse TEAL's calibrated threshold to estimate how sparse each token naturally is, then clip that estimate to a narrow band around s, before applying TopK. 2) Sensitivity-aware block sparsity (Section 2.2) replaces the uniform budget with one matched to each block's sensitivity: a single calibration pass measures it, and sensitive blocks then get less, robust ones more. Like OWL[22], we allocate sparsity non-uniformly across blocks, but base it on a direct sensitivity measurement rather than a weight-outlier signal.
Across Llama-2-7B [20] and Llama-3-8B [9], TopK-Guided beats both TEAL and WINA on perplexity and downstream tasks at matched compute, with the largest gains at high sparsity.
2.1 TopK-Guided Masking
Threshold masking adapts to each token but its realised sparsity can deviate from the target in an unbounded, input-dependent way, making inference-time speedup unpredictable. TopK masking eliminates this deviation by enforcing exactly k active elements per token, but at the cost of complete rigidity: the same fixed fraction s is applied to every token regardless of its activation distribution, with no adaptation whatsoever. We propose TopK-Guided masking, which keeps threshold masking's per-token adaptivity while bounding the sparsity deviation to a small band around the target.
The key observation is that the calibration threshold already encodes the typical activation distribution of each projection. At inference we therefore use to cheaply estimate, in , the token's natural sparsity , the fraction of its entries that fall below :
where is the -th activation entry for the current decode token . This estimate tells us how many entries want to be zero for this specific token. We do not apply directly but clip it to a band around the target, giving the per-token target sparsity that we actually enforce:
That is, equals when the natural estimate lies within , and is otherwise pulled to the nearer boundary. Finally, TopK is applied with the resulting count active elements retained per token. The mask thus adapts to each token's activation pattern like threshold masking, while the realised sparsity is guaranteed to stay within of the target; WINA's exact TopK is the special case . The whole step is per token: an comparison to form , a scalar clip , and the selection itself. Since only the top- mask is needed and not a full ordering, we skip sorting and find the cutoff with quickselect [11] in , rather than the partial sort WINA's implementation uses. We fix throughout, so the realised per-token sparsity deviates by at most one percentage point from the target: small enough to leave the compute savings essentially unchanged, yet enough room for meaningful per-token adaptation. We therefore treat as fixed rather than a tunable hyperparameter.
2.2 Sensitivity-Aware Block Sparsity
We give block i its own budget , the target sparsity applied to that block, in two steps: measure how sensitive it is to sparsification, then redistribute the global budget s from sensitive blocks to robust ones.
Measuring sensitivity: For block i, we run one calibration pass on a small corpus D with block i sparsified at a fixed probe level , and record how much its output moves:
where is the block's dense output, its output at probe sparsity , and avoids division by zero. A large marks a sensitive block, a small one a robust block (Figure 1 plots these ). The probe is only a measuring stick, not the sparsity any block is finally run at.
Redistributing the budget: Let be the mean sensitivity over the L blocks. Each block's budget is
so a block above average sensitivity gets less than the target and a robust block takes up the slack, leaving the average at . Here sets how hard to redistribute, and the clamp to keeps any block from going nearly dense or nearly empty.
Each then feeds WINA's existing greedy per-projection allocation (Appendix D), precomputed at calibration; we add no new machinery, only change the per-block budget it receives. TopK-Guided introduces three hyperparameters absent from WINA: the clip margin (Section 2.1), the probe sparsity , and the redistribution strength . We fix throughout, leaving only and free.
3 Experiments
Setup: We evaluate on Llama-2-7B and Llama-3-8B at target sparsity on single NVIDIA A100 SXM4 — 40 GB GPU. We report C4 [17] perplexity on 500 validation samples and average zero-shot accuracy over eight tasks (ARC-Easy [5], WinoGrande [18], HellaSwag [23], BoolQ
Table 1: C4 perplexity and average accuracy over eight tasks (Acc %) on Llama-2-7B and Llama-3-8B. Best per column in bold.
| Model | Method | s = 0.3 | s = 0.5 | s = 0.7 | |||
|---|---|---|---|---|---|---|---|
| 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 | |
| TopK-Guided | 9.04 | 73.88 | 10.46 | 70.02 | 21.55 | 57.85 | |
[4], SciQ [21], MMLU [10], GSM8K [6], LAMBADA [16]) with the lm-evaluation-harness [8]. Baselines follow their published setups: WINA uses tensor rotation with TopK masking, whereas TEAL uses threshold masking with no rotation. The two free hyperparameters and are selected on a held-out dataset, never on the reported one: for each target sparsity we sweep the grid on one dataset, keep the lowest-perplexity setting, and evaluate it on the other, so the reported C4 numbers use chosen on WikiText-2 (Appendix E).
Main results: Table 1 reports C4 perplexity and average accuracy on both models. TopK-Guided attains the lowest perplexity and the highest accuracy in every one of the twelve comparisons. The margin over the baselines is small at and grows with sparsity, becoming largest at : when most activations are kept, the masking rule and budget split have little room to act, but as sparsity rises each decision about which entries to drop and where to spend the budget matters more, and the two contributions have their greatest effect. One case stands out: on Llama-3-8B at , TEAL records a lower perplexity than WINA yet a lower average accuracy, a reminder that perplexity and downstream accuracy need not move together. We do not investigate the cause of this reversal, but we note that it is exactly the kind of case where WINA is not uniformly the stronger baseline, and that TopK-Guided still surpasses both TEAL and WINA on both metrics there. An ablation (Appendix F) shows that both contributions help on their own and combine well, with the largest joint gain at .
Computational savings and quantization: TopK-Guided delivers its gains at no added cost over WINA. Because it holds the realised per-token sparsity within of the target, it skips the same fraction s of each projection's computation as exact TopK, up to the small margin, for the same FLOP reduction; the only overhead is an mask per token, negligible beside the projection. So at matched compute it improves on WINA on every setting, while also improving on threshold masking, whose realised sparsity can fall short of the target and deliver less than the promised saving, where our bounded deviation guarantees the target reduction is met. And it comes for free architecturally too: TopK-Guided operates on the same SVD-rotated weights WINA inherits from SliceGPT [1], the basis in which rotation-based quantization such as QuaRot [2] also acts, so the two compose on the same computationally-invariant model with no extra machinery.
4 Conclusion and Limitations
We presented TopK-Guided, two training-free changes to WINA that add no cost over it yet consistently improve on both WINA and TEAL. TopK-Guided masking recovers per-token adaptivity while keeping the realised sparsity within a bounded of the target, and sensitivity-aware block sparsity splits a fixed global budget across blocks by a single-pass sensitivity estimate. The gains hold across both models and all sparsities and are largest where sparsification is most aggressive, and an ablation confirms that each contribution helps on its own. Our study has two main limits. We evaluate decoder-only models up to 8B parameters, so the method's behaviour at larger scale and on other architectures remains to be checked, though it makes no architecture-specific assumptions. We also report FLOP-level savings rather than wall-clock speedup, leaving a kernel-level implementation to future work. Finally, because TopK-Guided operates on the same rotated, computationally-invariant model as recent rotation-based quantization, combining the two is a natural next step toward faster low-precision inference.
References
[1] Saleh Ashkboos, Maximilian L. Croci, Marcelo Gennari do Nascimento, Torsten Hoefler, and James Hensman. Slicegpt: Compress large language models by deleting rows and columns, 2024. URL https://arxiv.org/abs/2401.15024.
[2] Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, and James Hensman. Quarot: Outlier-free 4-bit inference in rotated llms, 2024. URL https://arxiv.org/abs/2404.00456.
[3] Sihan Chen, Dan Zhao, Jongwoo Ko, Colby Banbury, Huiping Zhuang, Luming Liang, Pashmina Cameron, and Tianyi Chen. Wina: Weight informed neuron activation for accelerating large language model inference, 2026. URL https://arxiv.org/abs/2505.19427.
[4] Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. Boolq: Exploring the surprising difficulty of natural yes/no questions, 2019. URL https://arxiv.org/abs/1905.10044.
[5] Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge, 2018. URL https://arxiv.org/abs/1803.05457.
[6] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems, 2021. URL https://arxiv.org/abs/2110.14168.
[7] Elias Frantar and Dan Alistarh. Sparsegpt: Massive language models can be accurately pruned in one-shot, 2023. URL https://arxiv.org/abs/2301.00774.
[8] Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Alain Le Noac'h, Haonan Li, Kyle McDonell, Niklas Muennighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lintang Sutawika, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. A framework for few-shot language model evaluation, September 2021. URL https://doi.org/10.5281/zenodo.5371628.
[9] Aaron Grattafori, Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, et al. The llama 3 herd of models, 2024. URL https://arxiv.org/abs/2407.21783.
[10] Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding, 2021. URL https://arxiv.org/abs/2009.03300.
[11] C. A. R. Hoare. Algorithm 65: find. Commun. ACM, 4(7):321–322, July 1961. ISSN 0001-0782. doi: 10.1145/366622.366647. URL https://doi.org/10.1145/366622.366647.
[12] Zonglin Li, Chong You, Srinadh Bhojanapalli, Daliang Li, Ankit Singh Rawat, Sashank J. Reddi, Ke Ye, Felix Chern, Felix Yu, Ruiqi Guo, and Sanjiv Kumar. The lazy neuron phenomenon: On emergence of activation sparsity in transformers, 2023. URL https://arxiv.org/abs/2210.06313.
[13] James Liu, Pragaash Ponnusamy, Tianle Cai, Han Guo, Yoon Kim, and Ben Athiwaratkun. Training-free activation sparsity in large language models, 2025. URL https://arxiv.org/abs/2408.14690.
[14] Zichang Liu, Jue Wang, Tri Dao, Tianyi Zhou, Binhang Yuan, Zhao Song, Anshumali Shrivastava, Ce Zhang, Yuandong Tian, Christopher Re, and Beidi Chen. Deja vu: Contextual sparsity for efficient llms at inference time, 2023. URL https://arxiv.org/abs/2310.17157.
[15] Iman Mirzadeh, Keivan Alizadeh, Sachin Mehta, Carlo C Del Mundo, Oncel Tuzel, Golnoosh Samei, Mohammad Rastegari, and Mehrdad Farajtabar. Relu strikes back: Exploiting activation sparsity in large language models, 2023. URL https://arxiv.org/abs/2310.04564.
[16] Denis Paperno, Germán Kruszewski, Angeliki Lazaridou, Quan Ngoc Pham, Raffaella Bernardi, Sandro Pezzelle, Marco Baroni, Gemma Boleda, and Raquel Fernández. The lambda dataset: Word prediction requiring a broad discourse context, 2016. URL https://arxiv.org/abs/1606.06031.
[17] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer, 2023. URL https://arxiv.org/abs/1910.10683.
[18] Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale, 2019. URL https://arxiv.org/abs/1907.10641.
[19] Mingjie Sun, Zhuang Liu, Anna Bair, and J. Zico Kolter. A simple and effective pruning approach for large language models, 2024. URL https://arxiv.org/abs/2306.11695.
[20] Hugo Touvron, Louis Martin, Kevin Stone, and Peter Albert. Llama 2: Open foundation and fine-tuned chat models, 2023. URL https://arxiv.org/abs/2307.09288.
[21] Johannes Welbl, Nelson F. Liu, and Matt Gardner. Crowdsourcing multiple choice science questions, 2017. URL https://arxiv.org/abs/1707.06209.
[22] Lu Yin, You Wu, Zhenyu Zhang, Cheng-Yu Hsieh, Yaqing Wang, Yiling Jia, Gen Li, Ajay Jaiswal, Mykola Pechenizkiy, Yi Liang, Michael Bendersky, Zhangyang Wang, and Shiwei Liu. Outlier weighed layerwise sparsity (owl): A missing secret sauce for pruning llms to high sparsity, 2025. URL https://arxiv.org/abs/2310.05175.
[23] Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence?, 2019. URL https://arxiv.org/abs/1905.07830.
Table 2: The sparsity-related symbols used throughout the paper.
| 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). | |
| global | Clip margin bounding ; fixed at 0.01 (Eq. 3). | |
| global | Redistribution strength: how far moves from (Eq. 5). |
A Notation
Our method introduces several sparsity quantities that operate at different levels: a single global target, a per-block budget, and a per-token target, plus the calibration and control parameters that relate them. Because they share the symbol , Table 2 collects them in one place, giving each symbol’s scope, meaning, and the equation or section where it is defined.
B Target Sparsity Vs Realised Sparsity
Threshold masking calibrates a fixed threshold offline to hit a target sparsity , but because is frozen after calibration while each token’s activation distribution differs, the fraction of activations actually falling below at inference varies from token to token and need not average to . TopK masking, by retaining exactly elements per token, hits the target by construction.
Table 3 quantifies this on Llama-2-7B at a target of across three datasets. TEAL’s threshold masking consistently under-shoots the target, and by an amount that drifts from one dataset to the next, so its realised sparsity, and hence its actual speedup, is neither on target nor predictable. WINA’s TopK hits the target exactly on every dataset, by construction. TopK-Guided stays within its band of the target () on all three datasets: it recovers threshold masking’s per-token adaptivity while keeping the realised sparsity controlled, close to the target and stable across datasets, which is exactly what neither baseline achieves at once.
Table 3: Target vs. realised sparsity of TEAL, WINA, and TopK-Guided on Llama-2-7B at target , over 500 samples from each dataset. Perplexity (PPL) is shown for reference.
| 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 |
| TopK-Guided | WikiText-2 | 50% | 49.39% | 7.20 |
| TopK-Guided | C4 | 50% | 49.52% | 7.32 |
| TopK-Guided | cc100 | 50% | 49.46% | 10.24 |
C Tensor Rotation: What, Why, and How
Both WINA and our TopK-Guided method operate on a rotated version of the model’s weights and activations. This appendix explains what the rotation is, why it makes WINA’s weight-informed score well-founded, and how it is applied at zero inference cost.
C.1 The Problem: The Per-Element Bound Ignores Cross-Terms
WINA’s selection rule comes from a single-element error analysis: dropping index perturbs the projection output by , with norm . This per-element quantity is the score WINA uses to rank activations.
At target sparsity , however, many elements are dropped at once. Let be the set of dropped indices, so for and otherwise. The resulting error is
the sum of each dropped element's individual contribution. Its squared norm expands into a double sum over pairs of dropped indices, which splits into diagonal and off-diagonal terms:
The first term is exactly the sum of WINA's squared per-element scores, which is what its ranking implicitly optimises. The second term, the cross-terms, depends on the inner products between the columns of dropped indices: if two dropped columns are aligned and their activations share a sign, their errors reinforce and the true error exceeds the per-element estimate. By summing only the diagonal term, WINA implicitly assumes the columns of W are orthogonal. Learned weight matrices are not, so the cross-terms are non-negligible and the per-element score does not reliably identify the elements whose joint removal minimises output error.
C.2 The Idea: Column-Orthogonalise the Weight Matrix
If the columns of were orthogonal, then for , the cross-terms in Equation 7 would vanish, and the per-element score would sum to the true error.
WINA achieves this, following SliceGPT [1], by right-multiplying each weight matrix with an orthogonal matrix Q obtained from its own Singular Value Decomposition. Writing with U, V orthogonal and diagonal, and choosing Q = V, the transformed weight is
whose columns are exactly orthogonal, since is diagonal. Every off-diagonal inner product is zero by construction, so WINA's per-element score applied to recovers the true error exactly.
This rotation is data-dependent, derived from an actual weight matrix rather than fixed in advance. The SVD construction yields exact orthogonality for the matrix whose SVD is taken, at the cost of requiring the propagation machinery below to preserve the model's output.
C.3 The Implementation: Computational Invariance
Orthogonalising a standalone layer via would change its output unless the input is also transformed to . In a transformer, that input transformation must be produced by the preceding layer, which then requires its own compensation, and so on. SliceGPT's key observation is that this chain closes: the required rotations can be absorbed into adjacent weight matrices throughout the network, so no rotation is ever computed at runtime. RMSNorm is rotation-equivariant and residual connections are linear, so both commute cleanly with .
After this one-time offline preprocessing, the rotated model produces exactly the same outputs as the original (the computational invariance property of SliceGPT) while performing the same number of FLOPs at inference. All experiments in this paper, including sensitivity estimation and TopK-Guided masking, operate on these rotated weights.
D Block-wise Greedy Sparsity Allocation
Both TEAL and WINA, and our method, allocate a block's sparsity budget non-uniformly across its weight matrices using a greedy search. This appendix describes that procedure, which our sensitivity-aware budgets feed into unchanged.
Intuition: Within a transformer block there are weight matrices in attention and in the MLP). They are not equally forgiving under sparsification: zeroing activations feeding into some matrices barely changes the block's output, while the same fraction into others causes large error. The greedy algorithm exploits this asymmetry. It repeatedly asks which matrix can absorb a little more sparsity for the smallest increase in output error, and assigns that matrix the next increment. Repeating this traces out a good allocation for every overall budget, computed once at calibration and looked up at inference.
Setup: Let be the parameter count of matrix and the block total. Each matrix has its own sparsity , and the block's compute-weighted sparsity is . Because larger matrices move more per unit of , each matrix takes a step size inversely proportional to its size,
where is a small base step ( in our experiments). A small matrix thus takes large steps and a large matrix small steps, so a single step from either moves the overall by roughly the same amount.
The loop: Starting from for all , the algorithm repeats until reaches 1: (i) for every matrix , tentatively raise by and measure the output reconstruction error against the dense block output , then undo the change; (ii) permanently commit the increment for the matrix with the least error; (iii) recompute and record the row in the lookup table. The full procedure is given in Algorithm 1.
Worked example: Consider a toy block with two matrices: a small matrix with and a large matrix with (so ), using . The step sizes are and , so moves in large jumps and in small ones. Suppose the errors evolve as in Table 4. At steps 1 and 2, sparsifying by its small step costs far less than sparsifying by its large one, so is chosen. By step 3, has absorbed two increments and its next one costs more than giving its first, so the algorithm switches to . After three steps the block reaches with the non-uniform allocation , , an allocation a uniform “sparsify everything by 30%” baseline would not find. Over the real matrices, the large MLP matrices tend to absorb sparsity earliest, while smaller, more sensitive attention projections are protected until later.
Table 4: Toy trajectory of Algorithm 1 on a 2-matrix block (, , ).
| Step | Candidate errors () | Winner | |||
|---|---|---|---|---|---|
| 0 | |||||
| 1 | |||||
| 2 | |||||
| 3 |
Algorithm 1 Block-wise Greedy Sparsity Allocation
Require: Block , base step , calibration input , weight matrices
1: for parameter count of each matrix 2: total parameter count of block 3: , initialise all sparsities to zero 4: dense forward pass — ground truth output 5: while do 6: for to do 7: 8: tentatively increase sparsity of 9: 10: 11: undo tentative increment 12: end for 13: projection with least reconstruction error 14: permanently commit the increment 15: 16: record append row to lookup table 17: end while
E Hyperparameter Sweep
With the clip margin fixed at , TopK-Guided has two free hyperparameters: the probe sparsity used for sensitivity estimation and the redistribution strength . This appendix reports WikiText-2 perplexity for every combination in the grid at each target sparsity on Llama-2-7B. In each table, entries that meet or beat the WINA baseline for that target sparsity are shown in bold. The purpose is to establish whether a consistent parameter region outperforms the baselines, so that the method can be applied without a careful per-setting search.
Table 5: WikiText-2 perplexity on Llama-2-7B across the grid for each target sparsity. Bold entries meet or beat the WINA baseline for that sparsity. Columns are ; rows are .
| 0.2 | 0.4 | 0.6 | 0.8 | |
|---|---|---|---|---|
| (TEAL = 6.83, WINA = 6.78) | ||||
| 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 = 7.45, WINA = 7.24) | ||||
| 0.2 | 7.22 | 7.20 | 7.22 | 7.21 |
| 0.4 | 7.21 | 7.22 | 7.23 | 7.23 |
| 0.6 | 7.22 | 7.23 | 7.25 | 7.27 |
| 0.8 | 7.21 | 7.26 | 7.28 | 7.32 |
| (TEAL = 17.90, WINA = 10.79) | ||||
| 0.2 | 10.49 | 10.29 | 10.16 | 10.14 |
| 0.4 | 10.24 | 10.13 | 10.09 | 10.09 |
| 0.6 | 10.23 | 10.07 | 10.11 | 10.34 |
| 0.8 | 10.16 | 10.14 | 10.37 | 10.87 |
Observations: At , all 16 combinations beat TEAL and 15 of 16 meet or beat WINA; perplexity varies over just 0.03 points (6.77 to 6.80), so at low sparsity the method is essentially insensitive to the parameter choice. At , all 16 beat TEAL, and 11 of 16 beat WINA. At , all 16 combinations beat TEAL, 15 of 16 beat WINA. Across all three sparsity levels the region , is consistently strong, indicating that TopK-Guided does not require an extensive hyperparameter search in practice.
F Ablation of our Contributions
To verify that each contribution helps on its own, we evaluate four configurations on Llama-2-7B, starting from the WINA baseline and adding each component in turn (Table 6). The first row is WINA. The second adds only sensitivity-aware block sparsity, keeping WINA's TopK masking. The third adds only TopK-Guided masking, keeping WINA's uniform block budget. The fourth is the full method, with both contributions active.
As in the main results, the two hyperparameters are tuned on one dataset and the resulting fixed setting is then evaluated on the other. Concretely, for each target sparsity we sweep the grid on the selection dataset and keep the single combination that gives the lowest perplexity there. That one chosen setting is then held fixed and used to produce the reported numbers on the other dataset, which took no part in the selection. We show both directions: the C4 columns use the selected on WikiText-2, and the WikiText-2 columns use the selected on C4. The selection is repeated independently for each target sparsity.
Table 6: Ablation on Llama-2-7B. Each row adds one contribution on top of WINA; perplexity is lower-is-better. Hyperparameters are selected on the opposite dataset to the one reported (Appendix E). Best per column in bold.
| Configuration | C4 (selected on WikiText-2) | WikiText-2 (selected on C4) | ||||
|---|---|---|---|---|---|---|
| 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 |
Observations: Each contribution independently matches or improves on WINA in most settings. Sensitivity-aware block sparsity tracks WINA closely at low sparsity and gives its clearest gain at , where budget redistribution matters most. TopK-Guided masking alone meets or beats WINA across the board, with modest gains that grow with sparsity. Combined, the two reinforce each other: the full method is best at every sparsity level, with the largest joint gain at . The two effects are largely complementary, so the full method tracks the better of the two at each level.
G Per-Task Downstream Accuracy
Tables 7 and 8 give the full per-task breakdown of the downstream accuracy summarised in the main text, for Llama-2-7B and Llama-3-8B respectively. All tasks are evaluated zero-shot with the lm-evaluation-harness. The average column matches the one reported in the main results.
Table 7: Per-task accuracy (%) on Llama-2-7B across eight tasks. Best average per sparsity level in bold.
| Method | ARC-E | WG | HS | BoolQ | SciQ | MMLU | GSM8K | LAMBADA | Avg |
|---|---|---|---|---|---|---|---|---|---|
| Sparsity s = 0.3 | |||||||||
| 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 s = 0.5 | |||||||||
| TEAL | 72.64 | 66.30 | 73.87 | 75.60 | 90.40 | 36.48 | 10.24 | 69.49 | 61.88 |
| WINA | 73.44 | 68.51 | 74.42 | 75.84 | 91.00 | 38.98 | 11.22 | 73.22 | 63.33 |
| TopK-Guided | 73.11 | 68.51 | 74.43 | 75.44 | 91.50 | 39.29 | 11.98 | 73.14 | 63.42 |
| Sparsity s = 0.7 | |||||||||
| TEAL | 62.33 | 59.75 | 60.61 | 65.99 | 81.60 | 26.34 | 1.67 | 43.22 | 50.19 |
| WINA | 66.04 | 64.09 | 64.90 | 70.49 | 89.20 | 28.86 | 2.65 | 66.10 | 56.54 |
| TopK-Guided | 65.32 | 64.09 | 66.33 | 70.24 | 88.10 | 29.45 | 3.18 | 67.65 | 56.80 |
Table 8: Per-task accuracy (%) on Llama-3-8B across eight tasks. Best average per sparsity level in bold.
| Method | ARC-E | WG | HS | BoolQ | SciQ | MMLU | GSM8K | LAMBADA | Avg |
|---|---|---|---|---|---|---|---|---|---|
| Sparsity s = 0.3 | |||||||||
| 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 s = 0.5 | |||||||||
| TEAL | 76.14 | 70.40 | 75.88 | 79.45 | 93.30 | 57.16 | 32.75 | 73.61 | 69.84 |
| WINA | 75.42 | 71.74 | 76.18 | 81.96 | 92.80 | 56.78 | 29.04 | 74.40 | 69.79 |
| TopK-Guided | 75.76 | 70.24 | 76.24 | 81.50 | 93.60 | 57.42 | 30.63 | 74.77 | 70.02 |
| Sparsity s = 0.7 | |||||||||
| TEAL | 62.21 | 61.72 | 59.77 | 67.13 | 86.60 | 31.75 | 3.56 | 48.38 | 52.64 |
| WINA | 62.08 | 60.77 | 60.62 | 72.57 | 88.80 | 35.29 | 3.03 | 59.58 | 55.34 |
| TopK-Guided | 64.69 | 62.27 | 63.72 | 73.18 | 89.80 | 42.91 | 4.09 | 62.14 | 57.85 |
H Impact Statement
This work aims to reduce the computational cost of LLM inference, which may lower energy use and make LLM deployment more accessible in resource-constrained settings. We do not identify any direct negative societal impacts specific to the proposed method, as it does not introduce new model capabilities, training data, or user-facing behavior.