One pass beats iterative regrowth
DSnoT also rebuilds masks without training, but prunes and regrows weights over many cycles with a fixed iteration limit, layer by layer. LLM-Barber rebuilds each block once and recovers far more from a poor start.
ICCAD2025IEEE/ACM International Conference on Computer-Aided Design, Munich
Block-Aware Rebuilder for Sparsity Mask in One-Shot for Large Language Models
One pass rebuilds the mask of a pruned LLM. No retraining, no weight updates, same sparsity.
1Southern University of Science and Technology 2The University of Hong Kong *Equal contribution โ Corresponding author
LLM-Barber starts from any pruned model and rebuilds the mask of every Self-Attention and MLP block in one pass. The weights keep their values and the sparsity stays the same.
Too many swaps hurt again
A few pairs carry most of the gain
Layer-wise pruners fit each projection to its own output, , and the small biases add up from layer to layer. LLM-Barber takes one error at the output of the whole block, so the masks of all its projections are judged together:
At the dense model is zero and its gradient vanishes, which is why methods such as SparseGPT turn to the Hessian. After pruning is no longer zero, so the first-order term is enough. Pruning or regrowing a weight changes it by , which gives the score:
Weight
Gradient
Score
is one of the smallest weights, but its gradient is the largest, so it scores highest. , one of the two largest weights, scores 1.1. Point at a cell to read it.
Pruned weights are sorted by from high to low and kept weights from low to high, then paired in order. Each swap regrows one weight and prunes another, so the sparsity never changes. Only a fraction of the pairs with a positive gain is swapped:
Pairs are formed within a group: an output row, an input column, a matrix or the whole block. The best sits where the outlier pairs end, about 10% after Magnitude and 1% after Wanda on LLaMA-7B.
Starting mask
Grow pruned weights, highest score first
Prune kept weights, lowest score first
Rebuilt mask
LLaMA and OPT models from 6.7B to 13B parameters, pruned to 50% by Magnitude, SparseGPT or Wanda and then rebuilt, with 128 segments of 2048 tokens from C4 for calibration.
DSnoT also rebuilds masks without training, but prunes and regrows weights over many cycles with a fixed iteration limit, layer by layer. LLM-Barber rebuilds each block once and recovers far more from a poor start.
Mean accuracy over BoolQ, RTE, HellaSwag, ARC-e, ARC-c and OpenBookQA. From a magnitude mask, LLaMA3-8B goes from 36.57 to 52.58; the dense model has 62.79.
Top: the gain of each candidate pair, largest first. Bottom: WikiText-2 perplexity of LLaMA-7B against , for four ways of grouping the pairs. The dashed line marks the best , which follows where the outlier pairs end: 10% after Magnitude, 1% after Wanda.

Bold marks the best pruned result per task.
The repository rebuilds masks from Magnitude, SparseGPT or Wanda on LLaMA and OPT models, and has the scripts for every experiment in the paper.
conda create -n barber python=3.10
conda activate barber
pip3 install torch torchvision torchaudio
pip3 install -r requirements.txt
python main.py --model huggyllama/llama-7b \
--prune_method wanda \
--sparsity_ratio 0.5 --sparsity_type unstructured \
--prune_barber --prune_granularity output1 --threshold 0.01 \
--save_ppl out/ppl
--threshold is the swap ratio (the paper's mask rebuilding ratio). Commands for every experiment are in script/.
@inproceedings{su2025llmbarber,
title = {{LLM-Barber}: Block-Aware Rebuilder for Sparsity Mask
in One-Shot for Large Language Models},
author = {Su, Yupeng and Guan, Ziyi and Liu, Xiaoqun and Jin, Tianlai and
Wu, Dongkuan and Chen, Zhengfei and Chesi, Graziano and
Wong, Ngai and Yu, Hao},
booktitle = {2025 IEEE/ACM International Conference On Computer Aided Design (ICCAD)},
pages = {1--9},
year = {2025},
doi = {10.1109/ICCAD66269.2025.11240704}
}