If you have ever tried to run a state-of-the-art Large Language Model (LLM) like Llama-2 or a vision model like Segment Anything (SAM) on a single consumer-grade GPU, you know the struggle. These models are massive. A 7-billion parameter model is often the upper limit of what a decent desktop GPU can handle for inference, let alone fine-tuning.
To deploy these models efficiently, we often turn to pruning—the process of removing unnecessary weights to make the model smaller and faster. However, there is a catch. Current “one-shot” pruning methods (which are fast and don’t require expensive retraining) work great when you remove 20% or 30% of the weights. But if you try to push the sparsity to 50% or 70% to significantly reduce the model size, performance collapses.
Why does this happen, and how can we fix it without needing a cluster of A100s?
In this post, we will dive into a CVPR paper titled “ICP: Immediate Compensation Pruning for Mid-to-high Sparsity.” The researchers propose a clever technique that balances the speed of one-shot pruning with the accuracy of full fine-tuning, allowing for high sparsity levels on standard hardware.
The Problem: The Error Snowball Effect
To understand the solution, we first need to understand why current methods fail at high sparsity.
Most efficient pruning methods, like SparseGPT or Wanda, operate on a “layer-wise” basis. They look at one layer, figure out which weights are least important, remove them, and maybe make a small local adjustment to the remaining weights to minimize the damage. Then they move to the next layer.
The problem is that these methods treat layers somewhat independently. They don’t fully account for how a small error introduced in Layer 1 might get magnified by Layer 2, then twisted by Layer 3, and so on. By the time the data reaches the end of the network, the accumulated error is massive.
The researchers of ICP illustrated this phenomenon clearly.

In Figure 1, you can see the Mean Squared Error (MSE) accumulating as we go deeper into the network (from layer 15 to 23). Notice the difference between the blue line (50% sparsity) and the green line (70% sparsity). At higher sparsity levels, the error doesn’t just grow linearly; it explodes. This suggests that to make high sparsity viable, we need to stop this error propagation in its tracks.
The Solution: Immediate Compensation Pruning (ICP)
The core insight of ICP is simple but profound: If you break something in one layer, fix it immediately in the next layer.
Traditional iterative pruning (like the Lottery Ticket Hypothesis) prunes the whole model and then fine-tunes the whole model. This fixes errors but requires massive GPU memory. On the other hand, methods like Wanda prune without any retraining, which saves memory but ignores the error drift.
ICP sits in the middle. It creates a “sliding window” of two blocks. When it prunes Block \(N\), it immediately uses Block \(N+1\) to compensate for the damage.

As shown in Figure 2, a standard approach (a) prunes blocks sequentially or simultaneously without interaction. In ICP (b), after block \(t\) is pruned (represented by scissors), the algorithm tweaks the weights of block \(t+1\) (represented by the fire icon) to adapt to the changed output of block \(t\). This prevents the “error snowball” from rolling down to the deeper layers.
The Mechanism: Block-wise Compensate Pruning
Let’s break down exactly how this works algorithmically. The method focuses on the Transformer architecture, which is composed of stacked blocks (containing Attention and Feed-Forward networks).
The authors use a technique they call Block-wise Compensate Pruning. Here is the step-by-step logic:
- The Sliding Window: Imagine a window that covers two blocks: Block \(i\) and Block \(i+1\).
- The Split Stream: We take our calibration data (a small set of samples) and duplicate it.
- Standard Stream: This is the “ideal” path. The data passes through the unpruned Block \(i\) and then the original Block \(i+1\). This gives us the target output—what the model should be producing.
- Error Stream: This is the “reality” path. The data passes through the pruned Block \(i\). Because weights were removed, the output here is biased/noisy.
- The Compensation: We take the biased output from the pruned Block \(i\) and feed it into Block \(i+1\). We then train (fine-tune) the weights of Block \(i+1\) so that its output matches the “Standard Stream” target.
By doing this, Block \(i+1\) learns to “clean up” the mess made by pruning Block \(i\). The network effectively “forgets” that Block \(i\) was damaged because Block \(i+1\) has adjusted its internal processing to correct the signal.

Figure 3(a) visualizes this sliding window. You can see the “Standard Stream” (the top path with clean, unpruned weights) generating labels for the “Error Stream” (the bottom path where pruning happens). Crucially, this only requires loading one or two blocks into GPU memory at a time, keeping the memory footprint very low compared to full model fine-tuning.
Sparsity Rearrangement
Pruning 50% of a model doesn’t necessarily mean you should prune exactly 50% of every single layer. Some parts of the model are more redundant than others. The authors introduce two rearrangement strategies to optimize where the cuts happen.
1. Inter-Block Rearrangement (Between Blocks)
There is a flaw in the “fix it in the next layer” strategy: What happens to the very last block?
If you prune the final block of the model (Block \(n\)), there is no Block \(n+1\) to compensate for the errors. Therefore, the errors in the final block are permanent. To mitigate this, the authors propose shifting some of the pruning burden away from the last block and distributing it among the earlier blocks (which can be compensated).
The sparsity of the last block (\(P_{B^n}\)) is calculated as:

Here, \(\alpha\) is a parameter (usually between 0.6 and 0.9). If \(\alpha < 1\), the last block is pruned less than the target sparsity \(s\).
The “saved” weights from the last block are then added to the pruning targets of all previous blocks (\(P_{B^j}\)):

This ensures the total number of parameters removed remains the same, but the critical final layer is preserved.
2. Intra-Block Rearrangement (Inside a Block)
Within a single Transformer block, not all layers are created equal. A block typically contains:
- Q, K, V Matrices: These drive the self-attention mechanism. They are mathematically “deep” inside the block.
- Output Projection & Feed-Forward (FC) Layers: These are closer to the block’s output.
The authors realized that errors in the Q, K, and V matrices are harder to compensate for because they go through complex non-linear attention operations before leaving the block. The second fully connected layer (fc2), however, is right at the exit. Adjusting fc2 is much easier.
Therefore, they protect the Q, K, V matrices by pruning them less:

And they compensate by pruning the fc2 layer more aggressively:

Here, \(\beta\) controls the shift. This “Intra-Block” strategy ensures that the most sensitive internal mechanics (Attention) are preserved, while the robust output layers take the hit.
Figure 3(b) highlights these layers. The Q, K, and V weights (inner layers) are treated differently from the outer layers to maximize the effectiveness of the compensation.
Experimental Results
Does this theory hold up in practice? The researchers tested ICP on both Large Language Models (OPT, Llama-2) and Vision Models (SAM) using a single NVIDIA RTX 3090.
Language Model Performance
Let’s look at the OPT-125M model performance on the Wikitext-v2 dataset. Lower perplexity (PPL) is better.

In Table 1, look at the column for 70% sparsity.
- Magnitude Pruning (a basic baseline) completely breaks the model (PPL: 3806).
- SparseGPT hits 220.9.
- Wanda hits 328.2.
- ICP (Ours) maintains a perplexity of 65.20.
This is a massive improvement. While the baselines degrade into gibberish at 70% sparsity, ICP keeps the model functional. The trend holds for larger models like OPT-1.3B and OPT-6.7B, where ICP consistently outperforms the competition.
The results are similarly impressive for the popular Llama 2-7B model on Zero-Shot tasks (reasoning tasks the model wasn’t explicitly trained for).

In Table 3, at 70% sparsity, ICP achieves an average accuracy of 46.94%, compared to 41.79% for SparseGPT and 34.34% for Wanda. This gap represents the difference between a usable compressed model and a broken one.
Vision Model Performance
The authors also applied ICP to the Segment Anything Model (SAM). Here, the metric is Intersection over Union (IoU)—higher is better.

Looking at Table 4 (SAM-H model) at 90% sparsity (extreme compression):
- SparseGPT: 18.15% IoU
- Wanda: 1.20% IoU (Total failure)
- ICP: 57.60% IoU
This result is staggering. Wanda relies on priors specific to language models, so it often fails in vision tasks. ICP, however, relies on the structure of the network (blocks) rather than data-specific statistics, making it highly effective for vision transformers as well.
Memory and Time Efficiency
Students and hobbyists often care most about one metric: Will this run on my hardware?
The authors compared the GPU memory usage (Peak Memory Usage or PMU) and the time required to prune an OPT-6.7B model.

Table 9 brings the good news:
- Memory: ICP uses 7.8 GB of peak memory. This is actually lower than SparseGPT (8.3 GB) and significantly lower than Wanda (21 GB). This means you can prune a 7B model on a standard 10GB or 12GB consumer GPU.
- Time: ICP is slower than the ultra-fast Wanda (1551s vs 143s), but comparable to SparseGPT. Considering the massive performance gains at high sparsity, waiting ~25 minutes (1551s) instead of 2 minutes is a trade-off most users would gladly make.
Tuning the Parameters (Ablation)
Finally, how much do those \(\alpha\) (inter-block) and \(\beta\) (intra-block) parameters matter?
(Note: Referencing the composite Figure 4 provided in the image deck)
The charts in Figure 4 (specifically graphs a, c, e, g inside the deck) show that:
- Sensitivity: Performance is sensitive to \(\alpha\) and \(\beta\). For example, finding the “sweet spot” for \(\beta\) (Intra-block rearrangement) can drop perplexity significantly.
- Compensation Epochs: How long do we need to train Block \(i+1\) to fix Block \(i\)? Graph (g) shows that just 1 epoch is enough to get most of the benefit. Training for 12 epochs helps slightly more, but diminishing returns hit fast. This explains why the method is efficient—it doesn’t need long training loops.
Conclusion
The “ICP: Immediate Compensation Pruning” paper presents a compelling solution for the democratization of Large Models. By recognizing that pruning errors propagate and snowball, the authors devised a method that cleans up errors locally before they can spread.
For students and researchers, the key takeaways are:
- Block-wise Compensation: You can fine-tune a model “piece-by-piece” to save memory while still getting the benefits of error correction.
- Sparsity isn’t Uniform: You should prune the end of the model less (Inter-block) and the attention matrices less (Intra-block) to preserve performance.
- High Sparsity is Possible: We can remove 50-70% of a model’s weights and still keep it functional, provided we compensate for the loss intelligently.
ICP bridges the gap between computationally expensive full fine-tuning and computationally cheap (but inaccurate) one-shot pruning. It paves the way for running powerful 7B+ parameter models on the hardware sitting in your dorm room or home office.
](https://deep-paper.org/en/paper/file-2078/images/cover.png)