Foundation Lab

Pruning: Removing Unnecessary Weights

Lottery ticket hypothesis changed how we think about overparameterization

Concept 64 of 100EfficiencyPhase 6
#64PruningEfficiency
key equation
Wpruned=W⊙M,Mij=1[∣Wij∣>θ]W_{pruned} = W \odot M, \quad M_{ij} = \mathbf{1}[|W_{ij}| > \theta]
Reading map and next steps

Selected Foundation Object

Keep the equation fixed; move through the evidence.

Concept 64 of 100PruningEfficiency / Phase 6: Modern efficiency & inference
Current question

Small weights ≠ unimportant; magnitude pruning is a heuristic, not optimal

Wpruned=W⊙M,Mij=1[∣Wij∣>θ]W_{pruned} = W \odot M, \quad M_{ij} = \mathbf{1}[|W_{ij}| > \theta]
PredictionCommit before the demo.

Ask what should change when the equation is manipulated, then use the linked notebook demo to test that expectation.

EvidenceCompare the linked witness and source.

Use the linked notebook demo, this key equation, and canonical papers as separate witnesses for the same object.

InvariantName what survives notation changes.

The useful learning product is the reusable mechanism you can carry into another model, paper, or engineering tradeoff.

Next moveContinue in the newer notebook.

This atlas page has no local demo; the domain notebook carries the interactive witness and the fuller Intuition -> Math -> Code -> Demo sequence.

Why It Matters for Modern Models

  • Lottery ticket hypothesis changed how we think about overparameterization
  • SparseGPT can prune 50% of GPT-175B weights with minimal quality loss
  • Structured pruning enables actual speedups; unstructured sparsity needs special hardware

What Tutorials Skip

What is still poorly explained in textbooks and papers:

  • Small weights ≠ unimportant; magnitude pruning is a heuristic, not optimal
  • Unstructured 90% sparsity sounds great but doesn't speed up standard GPUs
  • Iterative pruning (prune, retrain, repeat) works much better than one-shot

Visualization Status

Core Math (Optional Deep Dive)

If you want intuition first, start with the key equation here and the linked notebook demo. Come back here for the full walkthrough.

Key Equation
Wpruned=W⊙M,Mij=1[∣Wij∣>θ]W_{pruned} = W \odot M, \quad M_{ij} = \mathbf{1}[|W_{ij}| > \theta]

Magnitude pruning: Remove weights with smallest ∣w∣|w|:

Wpruned=W⊙M,Mij=1[∣Wij∣>θ]W_{pruned} = W \odot M, \quad M_{ij} = \mathbf{1}[|W_{ij}| > \theta]

Structured pruning: Remove entire neurons/attention heads:

Wpruned=W[:,keep_indices]W_{pruned} = W[:, \text{keep\_indices}]

Lottery Ticket: There exist sparse subnetworks that train as well as dense:

∃M:train(W0⊙M)≈train(W0)\exists M: \text{train}(W_0 \odot M) \approx \text{train}(W_0)

OBS/OBD criterion (second-order): Prune weight that minimizes loss increase:

δL≈wi22Hii−1\delta L \approx \frac{w_i^2}{2 H_{ii}^{-1}}

Canonical Papers

The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks

Frankle & Carlin2019ICLR
Read paper →

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

Frantar & Alistarh2023ICML
Read paper →

Connections

Next Moves

Choose the next question to carry this object forward.