GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
ICML 2023

SparseGPT: Massive Language Models Can Be Accurately Pruned in One-Shot

The GPTQ team's pruning method removes half the weights of OPT-175B in about 4 GPU-hours with no retraining, and perplexity stays flat. Magnitude pruning collapses on the same models.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2023
AUTHORS
Frantar, Alistarh
FROM
IST Austria, Neural Magic
PUBLISHED
Jan 2023 · ICML 2023
CITED BY
1,671Semantic Scholar · Nov 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 23% of this breakdown.

01

The paper in one minute

Pruning sets some of a model's weights to zero so they need not be stored or multiplied. For vision models and small language models, it works well, but only with retraining: prune, then train again so the survivors compensate. Retraining a 175-billion-parameter model is not something most teams can do. The only pruning method cheap enough to apply directly at that scale, dropping the weights with the smallest magnitude, kept OPT-175B intact only up to about 10% sparsity and destroyed it beyond.

SparseGPT, from the authors of GPTQ, does accurate pruning in one shot. Like GPTQ, it works one linear layer at a time with a small calibration set (128 sequences of 2,048 tokens of web text) and asks: which weights can be removed, and how should the remaining ones change, so that the layer's output on those inputs barely moves? That question is a sparse regression problem; solving it exactly for billions of weights is hopeless, so SparseGPT approximates it with the same trick GPTQ uses for rounding. It processes columns left to right; when a weight is removed, its contribution is redistributed onto the columns not yet processed, using a row of the inverse Hessian. Which weights to remove is decided in small blocks of columns, by the classic Optimal Brain Surgeon score w²/[H⁻¹]_jj, so the mask adapts as the weights change.

On OPT-175B and BLOOM-176B, SparseGPT removed half the weights, about 100 billion, with perplexity unchanged or slightly better, and reached 60% with small losses. It also handles 2:4 and 4:8 semi-structured sparsity, the patterns NVIDIA GPUs from Ampere onward can accelerate, and can prune and quantize to 4 bits in the same pass. A 175B model takes about four hours on one A100.

THE IDEA, VISUALLY
THREE PATTERNS, SAME 50% OF WEIGHTS (SECTION 3) unstructured 2:4 dense filled = kept weight Per layer, pick the mask and new weights so the layer's output on 128 calibration sequences barely changes: min || WX - (M * W')X ||^2 1 every 128 columns, drop weights with the smallest w^2 / [H^-1]_jj 2 push each dropped weight's error onto the columns not yet processed (as in GPTQ) 3 optionally quantize kept weights to 4 bits about 4 hours for a 175B model on one A100 no retraining, no fine-tuning OPT-175B, WIKITEXT2 PERPLEXITY (TABLE 1) lower is better; magnitude bar cut off dense 8.35 magnitude 50% ~43,000 SparseGPT 50% 8.21 SparseGPT 4:8 8.45 SparseGPT 2:4 8.74 50% + 4-bit 8.29 GPTQ 3-bit, same size 8.68 MEASURED SPEEDUPS (APPENDIX E) GPU, 2:4, OPT-175B layer shapes Q/K/V/Out 1.79x FC1 1.67x FC2 1.54x CPU, unstructured, OPT-2.7B 40% 1.57x 50% 1.82x 60% 2.16x speed needs sparse kernels; dense storage of zeros saves nothing arXiv 2301.00774, IST Austria and Neural Magic, ICML 2023
SparseGPT walks each weight matrix column by column, picks which weights to drop by how little their removal disturbs the layer's output, and adjusts the surviving weights to compensate. Half of OPT-175B's weights can go with perplexity unchanged, where removing the smallest weights alone destroys the model.
Research notes: the problem, approach and results
~100B

weights removed from OPT-175B or BLOOM-176B with low impact on accuracy (Section 4)

8.35 → 8.21

OPT-175B WikiText2 perplexity, dense to 50% sparse; magnitude pruning gave 43,000 (Table 1)

~4 h

to prune a 175B model on one A100 80GB GPU (Section 4)

THE PROBLEM

Pruning removes weights to save memory and compute, but accurate pruning has always needed retraining, which is out of reach at 100B+ parameters. The one-shot method that scales, removing the smallest weights, ruins large language models beyond about 10% sparsity.

THE IDEA

Treat pruning each layer as a sparse regression: keep the layer's output on 128 calibration sequences as close as possible while forcing a fraction of weights to zero. Approximate the optimal update with the same column-by-column inverse-Hessian machinery as GPTQ, choosing the mask adaptively in small blocks. It extends to 2:4 and 4:8 patterns and to joint 4-bit quantization.

THE RESULT

OPT-175B and BLOOM-176B reached 50% to 60% unstructured sparsity in one shot with negligible perplexity change; at 50%, OPT-175B scored 8.21 on WikiText2 against 8.35 dense, while magnitude pruning scored 43,000. 2:4 sparsity, which Ampere GPUs accelerate, cost 0.39 points and sped up OPT-175B's layers 1.54x to 1.79x.

02

Why it matters to an FDE

Pruning is the other half of model compression alongside quantization, and this paper is the reason it is practical for large language models without retraining.

Sparsity saves nothing until something uses it. A matrix with half its entries zero stored as an ordinary dense matrix takes the same memory and the same time. Savings need a sparse storage format or kernel: 2:4 sparse tensor cores on NVIDIA GPUs, or a sparse inference engine on CPUs. The paper's own measurements show 1.54x to 1.79x faster layers with 2:4 on GPUs and 1.57x to 2.16x end to end on a CPU engine.

Quantization is usually the first move. For memory, 4-bit quantization saves four times; 50% sparsity with fp16 values saves less once you count the index or mask. SparseGPT's own comparison pits 50% sparsity plus 4-bit against plain 3-bit at the same size. Sparsity is worth it where kernels turn it into compute savings.

Large models tolerate pruning better. The paper finds the bigger the model, the less pruning hurts: at 50%, OPT-2.7B lost about a point of perplexity while OPT-175B gained a little. That points to pruning as a tool for the largest models in a fleet.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 290 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦2 results tables
  • ?5 interview questions with answers
  1. 03Key takeaways

    The sparse-regression view, mask selection, n:m support, joint quantization and two misreadings

    Free account
  2. 04How it works

    The layer-wise problem, why exact solves are slow, the approximation, masks, joint quantization

    Premium
  3. 05The numbers that matter

    Perplexity by size and pattern, zero-shot results, runtime and the measured speedups

    Premium
  4. 06Try it yourself

    Prune a toy layer both ways, count storage bits, and check the speed tables

    Premium
  5. 07Where it breaks

    Smaller models, kernel dependence, structured patterns, evaluation scope and gaps

    Premium
  6. 08Using it on a deployment

    When to prune, which pattern to pick, and how to confirm the savings are real

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →