Search

Search papers and lessons

The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks

Jonathan Frankle, Michael Carbin · 2018

Dense networks contain small subnetworks that, reset to their original random starting weights, train as well as the full network; pruning finds them.

On this page

  • Colour = topic mix
  • Linear algebra
  • Calculus
  • Neural network basics
  • Discrete math
  • Probability
  • Learning basics
  • ReadReady to readNot yet

TL;DR

Pruning can remove more than 90 percent of a trained network's weights without hurting its accuracy, but a pruned network trained from scratch usually does worse. Frankle and Carbin found that the pruning procedure itself finds small subnetworks that train well: if each surviving connection is reset to the value it had before training, the sparse network reaches the original accuracy in at most the same number of steps. They call these subnetworks "winning tickets" and state the lottery ticket hypothesis: a randomly initialized dense network contains such a subnetwork.

Builds on: Pruning, Stochastic Gradient Descent, Xavier (Glorot) Initialization, Early Stopping, Convolutional Neural Network

Why it mattered

Pruning had long been used to shrink models for storage and fast inference, but the usual recipe, train then prune then fine-tune, does not make training itself cheaper. The paper showed that the sparse structure can be trained from the start, provided its starting weights are the lucky ones. This changed how people think about overparameterization: the large network may be useful mainly because it contains many candidate subnetworks, one of which is easy to train.

The idea shaped a large line of follow-up work on sparse training and on finding good sparse networks early in training. It also made clear that the starting point of training matters as much as the architecture. Later papers asked when the effect survives larger datasets and deeper models, which this paper explicitly left open.

The problem

Three things were known by 2018. Trained networks can be pruned by more than 90 percent with little loss, which makes inference cheaper. Sparse networks are harder to train from the start, and a pruned network retrained from random weights typically reaches lower accuracy than the original. And overparameterized networks are easier to train than small ones, though nobody could say why.

The question is why a network that could be made small should not simply be trained small. The paper's answer is that the small network is not the problem; the starting weights are.

How it works

Consider a fully connected network for MNIST digits. A dense network is one where every connection is present. Lenet-300-100 is a small fully connected network with two hidden layers of 300 and 100 units. The procedure has four steps, and the mask mm records which connections survive. A connection is kept when its mask entry is 1 and removed when it is 0.

  1. Initialize. Draw random starting weights θ0\theta_0 for the full network. Call the starting point θ0\theta_0; we will reuse it later.
  2. Train. Run stochastic gradient descent for jj iterations, arriving at trained weights θj\theta_j.
  3. Prune. Remove the 20 percent of surviving weights with the smallest magnitude in each layer. This creates a mask mm with 80 percent of the previous connections still on.
  4. Reset and repeat. Set every surviving weight back to its value in θ0\theta_0, not to its trained value. The network f(x;m⊙θ0)f(x; m \odot \theta_0) is the winning ticket candidate. Train it again and check whether it matches the original.

Here is the arithmetic of repeated pruning. If each round removes 20 percent of the survivors, then after kk rounds a fraction 0.8k0.8^k of the weights remains. After three rounds, 0.83=0.5120.8^3 = 0.512, so about 51 percent of the weights survive. After seven rounds, 0.87≈0.210.8^7 \approx 0.21, so about 21 percent survive. The paper's Lenet experiments follow this schedule, and the winning tickets are judged at each size.

The key step is step 4. If the surviving weights are reset to random new values instead of θ0\theta_0, the same connections learn more slowly and reach lower accuracy. The structure alone does not explain the result; the original initial values matter.

flowchart LR
  A["Random init theta_0"] --> B["Train j steps"]
  B --> C["Prune smallest weights, make mask m"]
  C --> D["Reset survivors to theta_0"]
  D --> E["Train m times theta_0 again"]
  E --> F{"Matches original?"}
  F -->|"yes: winning ticket"| G["Keep, prune further"]
  F -->|"no"| H["Stop"]

Iterative pruning repeats steps 2 to 4 over several rounds. The paper prefers it to one-shot pruning, which trains once, prunes once and resets once. One-shot pruning is cheaper, but its tickets do worse at high sparsity (when most weights are removed).

The math

The network is a function f(x;θ)f(x; \theta) with parameters θ\theta. Its initial parameters are θ=θ0\theta = \theta_0, drawn from a distribution Dθ\mathcal{D}_\theta. The mask is a binary vector m∈{0,1}∣θ∣m \in \{0, 1\}^{|\theta|}, and m⊙θm \odot \theta is the elementwise product that zeroes the masked-out entries.

Sparsity. The paper writes the fraction of surviving weights as

Pm=∥m∥0∣θ∣,P_m = \frac{\lVert m \rVert_0}{|\theta|},

where ∥m∥0\lVert m \rVert_0 counts the ones in the mask. So Pm=25%P_m = 25\% means three quarters of the weights are pruned.

Step 2 in symbols (training). Stochastic gradient descent minimizes a training loss from θ0\theta_0. The iteration jj at which the validation loss is smallest is the early-stopping point, and the test accuracy at that point measures how well the network has learned.

Step 4 in symbols (the ticket). Write the winning ticket as f(x;m⊙θ0)f(x; m \odot \theta_0). Let j′j' be the early-stopping iteration of this network, with accuracy a′a', and let jj and aa be the same quantities for the dense network. The hypothesis predicts a mask mm with

j′≤j,a′≥a,∥m∥0≪∣θ∣,j' \leq j, \qquad a' \geq a, \qquad \lVert m \rVert_0 \ll |\theta|,

that is, commensurate training time, commensurate accuracy and far fewer parameters.

Random reinitialization in symbols. The control replaces θ0\theta_0 with a fresh draw θ0′∼Dθ\theta_0' \sim \mathcal{D}_\theta and trains f(x;m⊙θ0′)f(x; m \odot \theta_0'). The mask is the same, so the comparison isolates the effect of the starting values.

Results

The main results are on Lenet-300-100 for MNIST, and on Conv-2, Conv-4 and Conv-6 (small VGG-style networks) for CIFAR-10.

  • Lenet on MNIST. Iterative pruning to a small fraction of the weights gives winning tickets that reach their best validation loss sooner than the original network and keep or improve test accuracy. The same pruned network with random new starting values does worse, which is the control that gives the result its meaning.
  • Conv-2, Conv-4, Conv-6 on CIFAR-10. The same pattern appears in small convolutional networks: winning tickets train faster and reach accuracy comparable to or better than the dense network at moderate sparsity.
  • VGG and ResNet. For the deeper networks, the paper reports that winning tickets were hard to find at the standard learning rate and appeared only with a learning-rate warmup (a period at the start of training where the learning rate rises gradually).
  • Limits. Experiments cover MNIST and CIFAR-10 only, not ImageNet, because iterative pruning needs a full training run for each round. The pruning is unstructured (individual weights are removed, not whole neurons or channels), so the sparse networks do not map directly onto fast hardware.

Reading guide

Check yourself

QuestionIn one sentence, what is the step that distinguishes a winning ticket from ordinary pruning?Show answer
After pruning, the surviving weights are reset to their original values from the start of training, not left at their trained values, and the sparse network is trained again from that point.
QuestionEach pruning round removes 20 percent of the surviving weights. What fraction of the original weights remains after four rounds? Give the number.Show answer
0.84=0.40960.8^4 = 0.4096, so about 41 percent of the weights remain.
QuestionWhy does the random reinitialization control matter, when the mask is the same in both cases?Show answer
The mask records the structure of the ticket, and the control keeps that structure while changing only the starting values. If the ticket still trains well with its original starting values and poorly with new ones, then the initialization, not just the sparse structure, is responsible for the result.
QuestionA researcher says that because a winning ticket has fewer parameters, it is cheaper to train from scratch than the dense network, so the lottery ticket procedure is a free speed-up. Give one reason this is wrong.Show answer
Finding the ticket requires training the dense network and then pruning and retraining, once per round in the iterative version. The savings apply only to the final sparse network. The paper also limits the claim to small datasets and unstructured sparsity, which do not speed up typical hardware directly.

Sources

Read the full paper

Jonathan Frankle, Michael Carbin, 2018. arXiv:1803.03635