Inside a big randomly initialized network there is a much smaller one that can learn the task on its own. Here you will find it.
In 2018 Jonathan Frankle and Michael Carbin trained a network, deleted most of its weights, and noticed something odd. If they took the weights that survived, reset them to the exact random values they started with, and trained again, the small network learned about as well as the big one. Give those same connections fresh random values and it often learned worse.
They called the surviving subnetwork a winning ticket: a lucky combination of connections and starting values. Training a large network is like buying a huge number of lottery tickets at once. The more tickets you hold, the more likely one of them wins. The Algorithmic Simplicity video uses this idea to explain why bigger networks end up generalizing better instead of overfitting.
The search they used is called iterative magnitude pruning:
The network takes two numbers a and b between −1 and 1, passes them through two hidden layers of tanh units, and learns the chosen operation from 256 random examples. Blue lines are positive weights, red are negative, and thickness shows magnitude. Press Find the winning ticket and watch the network shrink.
Error is normalized mean squared error on a 33×33 grid of test inputs: 1 means no better than guessing the average, below 0.01 counts as solved.
A winning ticket is two things: which connections survive (the mask) and the starting values those connections had. The experiment that made the paper famous separates them. For every round of your search, it trains two controls with the same number of weights per layer:
At this tiny scale the mask carries most of the effect. A mask found by pruning keeps working far below the point where a random mask breaks, often because the random one cuts an input off completely. The benefit of the original starting values is smaller and changes from seed to seed: sometimes the ticket clearly wins, sometimes a fresh start does almost as well. That matches later research. Frankle and colleagues found that in larger networks you usually need to rewind to an early point in training rather than all the way back to θ₀, and other groups found cases where fresh starts work just as well.
Your ticket proves that a network with a few dozen weights can compute the operation. So why not just train a small network from the start? Train small dense networks from 8 different random seeds and count how often they solve it.
Small networks can represent the answer but usually fail to find it, because they start with only a handful of candidate paths and most of them begin in a bad place. A wide network contains an enormous number of overlapping small subnetworks, so gradient descent almost always has a good one to amplify. This is the video’s argument in miniature: extra size is not wasted capacity that invites overfitting. It is more lottery tickets, and with them better odds of a simple solution that generalizes.
Everything runs in your browser with no libraries. Networks are 2-H-H-1 with tanh hidden units, LeCun-normal initialization and zero biases. Training is 500 full-batch Adam steps with a cosine learning rate from 0.01 down to 0.00025. Pruning is per layer by magnitude: the middle layer loses the chosen share each round, the input and output layers lose half that share, as in the original paper. Biases are never pruned. The pruning step never cuts the last connection from an input; random-mask controls get no such protection. This is a toy: real tickets are found in convolutional networks and transformers with millions of weights, where results are noisier and rewinding matters more.