This one has 1,251 of them. Each number is the strength of one wire in the diagram. Feed a
point (x, y) in at the left, multiply and add your way along the wires, and three numbers
come out: how much the network thinks the point is red, green, or blue. That’s the whole
thing. Try: drag the slider. You’re changing one of the 1,251 numbers. Watch the
picture on the right change.
1,251 numbers
Every point on this map is a different network.
Left–right changes one number, up–down changes another. Every position is a complete
list of 1,251 numbers — a complete network, nothing missing. Try: move your mouse. The
strip and the picture follow you.
You’ve probably seen networks drawn as stacks of boxes. That drawing is just a way of
laying out the list. The list is the network — and a 70-billion-parameter model’s
checkpoint file is exactly this list, 140 GB long. A single point in a space with 70 billion
axes.
—error
—training points correct
move the pointer over the map
Each network gets a score: how wrong it is.
Show the network the 300 training points, count how far its answers are from the truth, and
you get one number — its error. Colour every point on the map by that number and you get
this: dark where the error is low, bright where it’s high. Try: slide along one
axis — the curve is the error as you change one weight. Two weights give the surface.
This is the famous “loss landscape”.
But there are 1,251 axes, and you can draw two.
The map you’re looking at is a two-dimensional slice through a 1,251-dimensional
landscape. Everything you’ve ever been shown about loss landscapes was a slice like this
one. Act II is about what the slices hide.
—wrong, of 300
—error
Training is a walk: look at the slope under your feet, step downhill, repeat.
At every point the landscape has a slope. Gradient descent measures it, takes a small step
downhill, and measures again. That’s all training is — thousands of these steps.
Try: press step. Each arrow is one real step this network took at the very start of its
training. The step length is the “learning rate”. Remember that name; it comes
back.
0steps taken
—error
Real training never sees the whole landscape.
Checking all 300 points every step is slow — a real model has billions of examples —
so each step looks at a small random batch, and each batch has its own landscape.
Try: next batch. The hills move. The walk happens on ground that shifts every step;
that’s what people mean by the “noise” in stochastic gradient descent. The
landscape you saw before is the average of all of these. Hold that thought: the shifting turns
out to be useful.
—this batch’s error
—all-data error
Every random slice is the same gentle bowl.
Here is the error around one point, on a random slice. Try: let it spin. Slice after
slice — the same bowl. That is not what the landscape looks like. It’s what averaging
over 1,251 directions looks like. Try: click the tallest bar in the chart.
Three are walls. The rest is floor.
The chart is the steepness of the landscape along each of its 1,251 independent directions.
Three tall bars: three canyon walls. Everything else: nearly flat. A random direction is a mix
of all of them, and the mix is flat — which is why every slice was a bowl.
Try: click a bar far to the right. Nothing to see: that’s the floor. Gradient
descent only ever has to deal with the walls.
steepest: — · typical: —
click a bar to look along that direction
It doesn’t roll to the bottom. It bounces.
Watch the dot: that’s the actual sequence of steps the network took, sixty of them, around
this point. Gradient descent walks down into ever-narrower parts of the valley — until the
walls are exactly as steep as its step size can handle. Then it stops getting steeper and
spends the rest of training bouncing wall to wall, still creeping forward. Bigger steps,
gentler walls: the learning rate decides how sharp a place training ends in — we trained
this network at four widths, and the walls came out the same height every time.
The bottom is a valley floor with hundreds of flat directions.
This network has zero error. Try: drag the slider. You’re walking along the
floor; the error stays zero, but look at the picture: the network keeps changing its mind
everywhere it has no data. There isn’t one best network — there’s a connected
floor of perfect ones. Try: swap two neurons. Same wires, different order, same
picture: a different point on the map that computes exactly the same thing. Every network has
1071 of these twins.
—error
—training points correct
—distance walked
—map it now disagrees about
different orderings of this network’s neurons: 32! × 32! ≈ 1071
prefix — type anything
what it thinks comes next
the network: 11,712 numbers− cool · 0 dark · + warm
prefix — type anything
headclick a character to follow what it reads
A language model is the same object.
This one has 11,712 numbers instead of 1,251, and instead of a point in, a
colour out, it takes a string of characters in and gives a probability for what comes next. It
was trained on this machine a few minutes ago — a tiny cousin of the big ones.
Try: type a prefix, then press sample. Its error is the same idea: how surprised it is
by the true next character. Its landscape is the same idea. Its list of numbers is the network.
Everything in Act II still holds; only the count changed.
—how surprised it is, per character
—its confidence in the top guess
parameters: 11,712 · trained for 200 steps on 139,553
characters of Alice’s Adventures in Wonderland
Its one new trick: it can look back.
To guess the next character, each position looks at the earlier ones and decides how much to
read from each — that’s “attention”, drawn here as arcs. Stack a few of
these layers and you have a transformer. Try: change the prefix; watch the arcs move.
This page won’t teach you attention in depth —
3Blue1Brown
and Bycroft’s walkthrough
already do that beautifully. What they don’t show is the geometry, which is where the next
screen goes.
—reading position
—what it reads most
Same shape. Same walls. Same floor.
This is the language model’s landscape: a slice through 11,712
dimensions, with the walk its training took. And its steepness chart: a few dozen walls —
each hundreds of times steeper than a typical direction — and more than eleven thousand
flat ones. The same picture as the 1,251-dimensional toy, and, as far as anyone has measured,
the same picture at 70 billion. The geometry you just walked around in is the geometry of every
model you use.
—steepest direction
—typical direction
Three things you’ve heard of, explained by the floor and the walls.
One real training step of the toy network, taken apart. Almost all of its length lies in
three directions out of 1,251 — the walls. Try: nudge the network the same distance
along a wall, then along the floor.
—error
—training points correct
Fine-tuning a huge model with a few thousand numbers (LoRA) works because
the few directions that matter are all you need to move in.
Two networks trained from different starts, A and B, both perfect. The terrain is the plane
through them and one trained waypoint. Try: the three paths.
—error halfway along
—error at either end
People merge models by averaging their lists. It works when the two lists
are twins of the same floor — and fails when they aren’t.
The trained network’s 1,251 numbers, each rounded to fewer bits.
Try: drag down from 16 bits.
—error
—training points correct
—how far the rounding moved it
—that far in a random direction
—that far along a wall
Rounding every number to 4 bits moves the network 2.8 units
— and lands it in the floor: error 0.17. The same 2.8 units along the wall: error 57.
That’s why an 8-bit or 4-bit model still works, and why it can’t be
any nudge.
What you now know
A network is a point — the list is the network.
Training is a walk on a landscape that shifts with every batch.
The landscape is a few walls and a floor.
The step size picks the sharpness.
The bottom is a connected floor of perfect networks, each with 1071 twins.
A language model is the same object with a longer list.
LoRA, merging and quantization are consequences of the floor and the walls.