Once the scores are ranked, where should we stop?
To see why the cutoff matters in LLaMA, start with just four weights.
Suppose the four weights have importance scores of 4, 3, 2 and 1. Now raise the first score from 4 to 94. Every weight keeps its place in the ranking, yet the first weight’s share of the total score rises from 40% to 94%.
A fixed 50% cutoff would keep the first two weights in both cases. If one weight now carries nearly all the score, should we still keep two? The bars below show where EMP places the cutoff for each vector.
More concentrated
(94, 3, 2, 1)Kept Pruned Bars show each entry’s share of the total score, on the same scale.
EMP uses the score magnitudes to compute an effective number of contributors. Here it keeps three of the four weights in the first example and only the first weight in the second. The same calculation works for anything you can score. A photograph lets us see what that choice does to the result.
How much detail does a photograph retain after pruning?
In a photograph, we can give each entry a score and see what changes when we discard the entries below the cutoff.
We score each pixel value by how far it lies from the mean of its group within the same color channel. The signed difference from that mean is its residual. EMP keeps the residuals with the largest absolute values and sets the rest to zero. Adding the mean back gives the reconstructed photograph.
Per patch computes a separate mean and count inside each patch. Whole image computes one mean and count per color channel across the entire image. Switch between them to see how changing the group changes the score distribution and the resulting selection.
Each patch gets its own mean and retention count, separately for each RGB channel.
Each RGB channel is processed separately. Scores are absolute deviations from the group mean. EMP retains the largest score magnitudes and replaces the other values with that mean, rounded to an integer. The reported sparsity counts selected entries, including entries whose displayed value does not change. The error view shows the absolute reconstruction error multiplied by ten and capped at 255; PSNR (peak signal to noise ratio) and SSIM (structural similarity) use the actual reconstruction. In the mask, a bright red, green or blue channel marks an entry replaced by its group mean. Larger patches do not necessarily remove more entries; for a fixed grouping, use to change the pruning strength. Hover over the picture for a magnified view.
Interactive adaptation of Section 5.5. The embedded image is a 960 × 640 copy; the paper evaluates the 6000 × 4000 original. For 4 × 4 patches, Figure 4 reports 32.3% sparsity, 38.3 dB PSNR and 0.991 SSIM. Live metrics above are calculated on the image currently loaded.
Why an effective number?
Each patch in the photograph gets its own count. To see where that number comes from, first consider a group in which all the positive scores are equal.
Start with candidates and a nonzero importance score vector , where . Use nonnegative scores, or score magnitudes when magnitude encodes importance. Normalize them to shares that sum to one.
If exactly entries contribute equally and the others have zero score, each positive share is . Their sum of squared shares is therefore
Inverting this concentration gives exactly . For unequal scores, the same expression defines an effective number of equal contributors. EMP takes its integer part and keeps that many of the largest scores.
From concentration to quantity
EMP retains every entry when all shares are equal. When only one share is positive, it retains that entry.
Keep the largest scores
Use your existing criterion to rank the candidates. EMP supplies the number retained.
Before rounding down, this number is known as the effective sample size, or the inverse Simpson index. It tells us how many equally weighted entries would give the same sum of squared shares.
What do those entries account for? Add their shares to find the fraction of the total score they retain. You can track both quantities in the explorer below.
Why use the sum of squared shares?
Draw two candidate indices and independently, each with probability of selecting entry . The probability of drawing the same entry twice is . For equal contributors, it is exactly . This connects quadratic concentration to an effective count.
The same sum of squares also determines the Euclidean distance to equal shares. That exact geometric relation makes it possible to analyze the smallest retained score mass for each EMP count.
Score scaling, signs and grouping
Multiplying every score by the same positive constant leaves the normalized shares and the EMP count unchanged. Reordering candidates also leaves the count unchanged.
Use scores for which a larger magnitude means greater importance. If positive and negative values carry different meanings, first construct appropriate nonnegative importance scores.
Choose a group whose scores can be meaningfully compared. This may be an entire vector, a feature group, a model layer, an output row, or an image patch. EMP computes a count within that group. The all zero case is handled separately in the code.
Bring your own importance scores
Try the calculation on a set of scores you know. Before you run it, how many entries would you keep?
Paste your weight magnitudes, feature scores or image residual magnitudes, or choose one of the example distributions. The two plots show where EMP cuts the ranking and what share of the total score lies above that cutoff.
The dashed line marks the EMP reference count, where the multiplier is 1. The green selection uses the current multiplier and is limited to the available entries. The mass bound applies at the EMP reference count. Generated scores use a fixed seed until you choose a new draw. Pasted scores are processed in your browser.
How the retention multiplier works
Let be a positive multiplier and let be the number actually retained. The implementation uses
Standard EMP uses . Smaller values retain fewer entries; larger values retain more, up to the total available. This optional multiplier changes the selected operating point, and the experimental sweeps vary it.
Why Gaussian scores give a familiar retained fraction
For independent scores with distribution , where , the empirical mean magnitude converges almost surely to , and the empirical mean squared score converges almost surely to . The retained fraction before taking the floor is the square of the first empirical mean divided by the second. Its limit is therefore . Taking the floor changes the retained fraction by less than , so the same limit applies to EMP. Finite samples need not equal this limit.
The count has a geometric structure
Different vectors in the explorer can give the same count. To see what they have in common, plot the normalized scores as a point and measure its distance from the center.
The normalized scores form a point on a simplex: a triangle for and a tetrahedron for . Let be its equal share center. Expanding the squared Euclidean distance gives
So the count depends on one thing only: how far lies from the center. Around the center sit nested balls , where has radius , and is the number of balls that contain . Their boundaries are familiar: the first passes through the corners, the second touches the midpoints of the edges, the third touches the centers of the faces, and the last is the center alone.
The point is the normalized score vector, and the red dashed circle is the sphere through it. The EMP count is the number of balls that contain the point; the shell between the last ball that contains it and the first that does not is tinted. Colored marks show the contact points: the corners on the boundary of , the midpoints of the edges on that of , the centers of the faces on that of . For four components, the simplex is shown as a tetrahedron in orthographic projection. Use the presets or drag a score bar to change the vector.
Why nested balls correspond to integer counts
The identity follows by expanding and using .
For each integer from 1 to , define as the closed ball in the affine hyperplane of the simplex, centered at , with radius . A point of the simplex lies in this ball exactly when its sum of squared shares is at most . Equivalently, its effective number before taking the floor is at least . Counting the balls that contain the point therefore gives .
Moving the point within one region keeps the EMP count fixed, even as the individual shares change. That lets us study all the score vectors with a given count together.
A guarantee for what survives
Within one of these regions, how little of the total score could the retained entries carry?
The geometry gives us a lower bound that holds throughout the region. Define as the sum of the normalized scores retained by standard EMP. For , Theorem 4.2 gives
The bound is sharp: for each eligible count, score vectors exist whose retained mass approaches it arbitrarily closely. They approach a boundary along the segment joining a simplex corner to its center. The guarantee depends only on the scores. It applies to image residuals, model components and any other candidates represented by an importance score vector.
Each point is a generated score vector. Its horizontal coordinate is the effective number before taking the floor; its vertical coordinate is the sum of retained normalized scores. The staircase is the sharp bound. The red examples approach the bound from within the corresponding count region. Sampling illustrates the theorem; the proof is in the paper.
A bound for any score vector
EMP controls the normalized score mass retained at its selected count. For , the sharp lower bound is at a count of 1; at a count of , all score mass is retained.
From scores to the task
The criterion gives those scores their meaning. For weight magnitude scores, Section 4.2 connects the retained mass to an asymptotic loss bound under its stated conditions. For other scoring criteria, we can measure what happens to task performance when we apply the cutoff.
Putting the rule to work in models
In the photograph, we could inspect reconstruction quality directly. For a pruned model, we can measure the change in loss, accuracy or perplexity.
We first let EMP choose how many weights, neurons, filters or attention heads to retain from their importance scores. We then evaluate each pruned model against its dense counterpart.
One rule, different budgets
At the default count, the same rule selects very different sparsities, because the score distributions differ. Each bar is the share of scored components removed, next to the measured outcome. No sparsity level was tuned in any row.
Tables 1 and 4, Section 5.2 and Figure 4 of the paper. The KAN hidden layer retains 47 of its original 64 nodes. LLaMA sparsity is measured over the pruned MLP linear layers. Neuron and filter pruning are reported in Table 2 of the paper, attention heads in Table 3.
LLaMA: the criterion ranks the weights, EMP sets the threshold
Two rows above refer to the same seven LLaMA models. One uses weight magnitudes and the other uses Wanda scores. In both cases we apply EMP to each output row of an MLP weight matrix. We can then compare the resulting thresholds with pruning a fixed 50% of each row using the same scores.
- 1Score
Magnitude or Wanda assigns a score to every weight, exactly as usual.
- 2Compute the threshold
In each output row of an MLP weight matrix, EMP computes from the scores of that row.
- 3Prune
Keep the largest scores of the row and remove the others. No sparsity level is specified.
Each strip stands for all MLP weights, ranked within every output row from the largest score to the smallest. Green is the share that EMP keeps once every row has been cut at its own , and the hatched region is the additional share that a fixed 50% budget removes. The bars give the WikiText perplexity added over the dense model on one common scale; the small marks are the seven individual models.
| Scores and threshold | MLP sparsity | Perplexity change | Accuracy change, points |
|---|
Changes are relative to each dense model.
The selected sparsity varies little across these seven models, but differs between the two scoring criteria. It lies between 36.6% and 36.7% for magnitude scores and between 40.0% and 41.1% for Wanda scores. With magnitude scores, mean perplexity rose by 0.75 at the EMP thresholds and by 2.98 at fixed 50% sparsity. The increase at the EMP thresholds was close to the 0.68 observed with Wanda scores at their own EMP thresholds. The paper interprets this as evidence that the fixed sparsity budget accounts for much of the performance drop seen with magnitude pruning at 50% sparsity. EMP removes fewer weights than 50% here. These results show the operating point that EMP selects directly from the scores, without a sparsity search.
Tables 7 to 9. WikiText perplexity; mean accuracy over BoolQ, RTE, HellaSwag, WinoGrande, ARC easy, ARC challenge and OpenBookQA. Sparsity is measured over the pruned MLP linear layers. Means across the seven models are computed from the values listed for each model. No fine tuning.
What changes around the EMP reference?
The multiplier varies the retained count relative to standard EMP. The LLaMA comparison uses two pruning choices. In the sweeps below, we vary the multiplier to see how model performance changes on either side of the EMP count. The vertical line marks , the count computed from the scores. Move across a chart, or tap it, to read every run.
In these runs, retaining more than the EMP reference yields limited additional benefit. Retaining fewer entries produces larger changes in some models, especially the deeper networks and the attention heads. Taylor scores are spread almost evenly over the 144 heads of GPT-2, so standard EMP removes three of them and perplexity moves from 34.86 to 35.20; at three quarters of that count it rises to 94.72. The tested points do not identify the exact minimum count needed for a specified performance target.
Fully connected sweeps from the released experiment notebook; these runs are distinct from some configurations tabulated in the paper. At they remove 28.1% to 37.0% of weights, with an absolute accuracy change of at most 0.16 percentage points. GPT-2 sweep: Table 3, Figure 3 and the released head pruning notebook, on WikiText-2. No fine tuning follows pruning.
Use EMP with your own importance scores.
The same calculation determined which image residuals survived and which model weights we kept. To use it with your own criterion, choose the entries you want to score together and pass their scores to the function below.
Supply any importance score
Keep the criterion that fits your task. Feed its score vector into EMP to compute a retention count and a selection mask.
Let local scores set local counts
Apply the rule within patches, feature groups, layers or other groups. Each group gets a count from its own score distribution.
Use a bound in your analysis
Use the sharp lower bound when you need to control the normalized score mass retained by selection.
EMP in PyTorch
import math
import torch
def emp_mask(scores: torch.Tensor, beta: float = 1.0) -> torch.Tensor:
"""Return the entries retained by EMP. Keep all if every score is zero."""
if not math.isfinite(beta) or beta <= 0:
raise ValueError("beta must be finite and positive")
if scores.numel() == 0:
return torch.zeros_like(scores, dtype=torch.bool)
s = scores.detach().abs().reshape(-1).to(torch.float64)
if not bool(torch.isfinite(s).all()):
raise ValueError("scores must be finite")
scale = s.max()
if float(scale) == 0:
return torch.ones_like(scores, dtype=torch.bool)
s = s / scale
effective_number = float(s.sum().square() / s.square().sum())
if beta >= s.numel() / effective_number:
keep = s.numel()
else:
# The small tolerance keeps exact cases exact: (3, 1, 1, 1) has effective number 3.
keep = max(1, math.floor(beta * effective_number + 1e-9))
mask = torch.zeros_like(s, dtype=torch.bool)
mask[s.topk(keep).indices] = True
return mask.reshape(scores.shape)
# Example: the candidates can be any objects with importance scores.
scores = torch.tensor([4.0, 3.0, 2.0, 1.0])
keep = emp_mask(scores)
# keep is tensor([True, True, True, False]).
# Use it to select the corresponding candidates in your workflow.Apply one threshold to a vector, or call the function separately for each chosen group. The all zero case keeps every entry by convention. What happens to unselected candidates depends on the application: for the photograph, their residuals become zero before reconstruction. The repository contains the experiment implementations.
ICML 2026 Spotlight
Effective Model Pruning: Measuring the Redundancy of Model Components
If you use EMP to choose how many scored entries to retain, or use its retained mass bound, please cite the paper.
@inproceedings{wang2026emp,
title = {Effective Model Pruning: Measuring the Redundancy of Model Components},
author = {Wang, Yixuan and Guralnik, Dan P. and Akbari, Saiedeh and Dixon, Warren E.},
booktitle = {Proceedings of the 43rd International Conference on Machine Learning},
series = {Proceedings of Machine Learning Research},
volume = {306},
year = {2026},
url = {https://arxiv.org/abs/2509.25606}
}
Share the idea
Copy a short introduction, or share the published page.