how wrong: very
A plain-language guide

How machines learn:
they walk downhill.

No equations. Just a hiker, some fog, and the one simple habit that powers nearly all of modern AI.

Start the descent
The whole idea

Learning is just getting less wrong — a little at a time.

Picture yourself on a mountain in thick fog. You can't see the valley, but you want to get there. So you feel the ground under your feet, notice which way slopes down, and take a small step that way. Then you do it again. And again.

That's it. That's the trick a computer uses to learn. The "mountain" is a made-up landscape where height means how wrong the computer's guess is. High up = very wrong. Down in the valley = just about right. Learning is simply the walk down.

Hold on to that picture, because the entire rest of this page is just turning it over in your hands. We'll meet the hill, name the valley, argue about how big to step, get lost in the fog, and discover where this quiet little walk hides inside the apps you use every day. There will be no calculus and nothing to memorize — only a hiker, a slope, and a habit.

First, a fair question

What does it even mean for a machine to learn?

For most of computing history, we didn't teach computers anything. We told them. A programmer worked out the exact rules — "if this, then that" — and the machine followed them to the letter. That works beautifully for taxes and spreadsheets, where the rules are clean and known.

But try writing the rules for "is there a cat in this photo?" Go on — write them down. Cats can be black or ginger, curled or stretched, in shadow, half off the edge, asleep in a sink. After a hundred rules you'd still be missing a thousand more, and you'd still be wrong about a kitten in a teacup. Some things we humans know perfectly well but cannot quite explain. The rule lives in our heads without ever turning into words.

Machine learning flips the whole arrangement around. Instead of handing the computer the rules, you hand it examples — thousands of photos already labelled "cat" or "not cat" — and let it discover the rule for itself. That is what "learning" means here, and it's narrower and humbler than the word sounds: getting measurably better at a task by studying examples, rather than being told the answer step by step.

So how does a machine "discover a rule"? Here's the part that makes everything else click. Inside the model sits a pile of little numbers you can turn — think of them as knobs on a giant control panel. Each setting of the knobs makes the machine behave a certain way: with the knobs in one position it calls everything a cat; in another, nothing. Learning is nothing more glamorous than hunting for the knob settings that make the machine wrong as rarely as possible.

It helps to make those knobs concrete. In the photo example, one knob might end up reacting to pointy ear-shapes, another to whisker-like lines, another to the texture of fur — though nobody decided that in advance, and the knobs rarely line up with anything we'd give a tidy name. They start out as meaningless random numbers. What turns that random noise into something that can actually spot a cat is the search itself: thousands upon thousands of tiny corrections, each one made for a single reason — because it pushed the wrongness down a notch.

And now the metaphor snaps into place. Every possible setting of the knobs is a spot on a landscape. The height at that spot is how wrong the machine is when its knobs are set that way. Learning is the search for the lowest spot — the walk downhill. Everything from here is about how you take that walk when you cannot see the map.

A quiet reframe. Notice we never tell the machine the right rule. We only tell it how to score itself — how to measure its own wrongness — and then let it go looking for less of it. Choosing what to measure turns out to be one of the most important decisions anyone makes in this whole field.
Try it · the hill

You can't see the map. You can only feel the slope.

Here's that foggy hill, drawn as a single curve. Drop a ball anywhere and watch it do the only thing it knows how to do: feel which way is downhill, step that way, repeat — until it settles in the valley.

Tap anywhere to drop a ball ↯

Notice it never looks at the whole hill — it only ever checks the tilt right where it's standing. Tiny local decisions, repeated, carry it all the way down.

This is the single most important habit in the whole field, and it has a name worth keeping: gradient descent. "Descent" because you go down; "gradient" is the fancy word for slope, which we'll properly meet in a moment. The ball is blind. It has no plan, no memory of the mountain, no idea where the valley is. It just keeps asking one tiny question — which way is down from right here? — and trusting the answer. Astonishingly, that's enough.

Naming the height

The height of the hill has a name: the loss.

We've been saying "how wrong" a lot. Engineers have a word for it: the loss (you'll also hear error or cost — same idea). It's a single number that scores how badly the machine did across all of its examples. Big number, badly wrong. Small number, doing nicely. Zero would mean flawless, which almost never happens and usually isn't even the goal.

That one number is what makes the whole landscape exist. Picture it like this: pick any setting of the knobs, run the machine on your examples, add up how far off it was, and you get a height. Move the knobs a little and the height changes. Do that for every possible setting and you've drawn a surface — peaks where the machine is hopeless, valleys where it's sharp. That surface is the loss landscape, and the entire job of learning is to find a low place on it.

Two things are worth sitting with. First, the landscape is invented — it isn't out there in the world, it's a picture of the machine's own mistakes. Second, nobody can ever see the whole thing. In a real model the "map" has not two dimensions but millions, one for every knob, so it can't be drawn or surveyed. All you can ever do is stand at one spot and feel the slope. Which is exactly why the blind downhill walk isn't a clumsy shortcut — it's pretty much the only move available.

How you tot up the misses is itself a choice with consequences. Our line-fitter squared each miss before adding them up — a popular move, because squaring makes a handful of big blunders hurt far more than lots of tiny ones, so the walk hurries to fix its worst mistakes first. Pick a different way to score wrongness and the whole landscape changes shape, valleys and all, and the machine ends up caring about different things. Deciding what counts as "wrong" is half of designing one of these systems; the downhill walk only ever chases the exact number you hand it.

Why "loss" and not "score"? A score goes up when you do well; loss goes down. Framing it as something to minimise is what lets us reuse the one mental image for everything — there's always a hill, and we're always trying to get to the bottom.
Try it · what "wrong" really means

So what is the computer being wrong about?

Let's make the loss real. Here are some dots, and the computer's job is to draw the one straight line that passes as close to all of them as it can. "How wrong" is just how far the line misses, totalled up. Watch it walk downhill — nudging the line, over and over, to miss by less.

Tap to add your own dots
How wrong:

Every wiggle of the line is one downhill step. The little orange whiskers are the misses; the bar shrinking is the ball rolling toward the valley — same idea, just dressed up as a line and some dots.

This humble line-fitter is worth more attention than it looks. It has exactly two knobs — how steeply the line tilts, and how high up it sits — and the loss is the total of all those misses, squared so that big misses hurt extra. Turn the two knobs and the loss changes; that's a little two-dimensional hill, and the line you watched it find is the bottom of it. Scale this same picture up — more knobs, fancier shapes than a straight line — and you have, in spirit, almost everything else. A chatbot is this demo with a few hundred billion knobs and a far stranger notion of "miss."

The word for "downhill"

The gradient is just the arrow that says "this way is steepest."

We've dodged it long enough. The gradient is the slope under your feet — but it carries two pieces of information at once, and both matter. It tells you the direction the ground rises most steeply, and it tells you how steep that rise is. To go downhill, you simply turn around and step the opposite way. To take a sensible-sized step, you lean on the steepness: steep ground, the world is telling you you're badly placed, so a firm step is fine; nearly flat ground, you're close to the bottom, so tread gently.

That last detail is quietly clever. The walk slows itself down as it nears the valley, all on its own, because the slope it's measuring is fading toward zero. Nobody has to tell the ball "you're nearly there." The flattening ground does it.

"But how does a blind ball know the slope without seeing the hill?" Fair. The honest answer is a touch of bookkeeping: the machine can work out, for each knob, which way to nudge it to make the loss a little smaller, just from how the numbers flowed through it. In a big neural network there's a famous, efficient method for doing this for millions of knobs in one sweep, called backpropagation — but you don't need its machinery to get the intuition. The gradient is simply the answer to one question, asked at the spot where you stand: nudge each knob which way, and how hard, to drop the loss fastest?

With more than one knob, the gradient just becomes a whole bundle of little instructions at once — for each knob, which way and how hard to turn it. Some get a firm shove, some barely a touch, a few are left alone because moving them wouldn't help right now. The machine reads off that bundle, turns every knob by its share, and that single coordinated nudge is one step downhill across the entire landscape. Then it measures again. The slope is never assumed; it's re-felt at every new spot, because the ground keeps changing under your feet as you move.

Plain-English glossary so far. Loss = how wrong, as one number. Gradient = which way is uphill, and how steeply. Gradient descent = step the opposite way, a little, again and again. That's three words and you've got the engine.
Try it · the step size

How big should each step be?

This is the one dial that matters most. Take baby steps and you'll crawl down forever. Take giant leaps and you'll jump clean over the valley and bounce around — or fly off the mountain entirely. Slide it and press go.

Step size: just right
tiny stepsgiant leaps
Just right — a smooth, steady walk into the valley.

The pros have a fancy name for this dial — the learning rate — but it's exactly what you're feeling here: how bold each step is.

Get a feel for the three regimes, because every practitioner spends real time fighting this exact dial. Too small and the model learns, but agonisingly slowly — you might wait days for a walk that should take hours. Too big and it overshoots the valley on every step, sloshing back and forth, or worse, leaping higher each time until the numbers blow up entirely and the whole thing "diverges." Just right is brisk but stable: it covers ground fast where the hill is steep, then settles as the slope flattens. There's no single correct value — it depends on the landscape — which is why finding a good learning rate is half art, half patience, and a big part of why training large models is fiddly work.

A common trick threads the needle: start with bigger, braver steps to cover ground quickly while you're far from the bottom, then shrink them as you close in, so the walk can settle gently instead of forever sloshing around the valley. That gradual easing-off is called a schedule, and it mirrors exactly how you'd actually pick your way down a real mountain — long confident strides on the open slope, careful little shuffles near the edge of the stream at the bottom.

Try it · the fog's revenge

Not every valley is the lowest valley.

Real landscapes aren't a single tidy bowl. They're rumpled — full of dips, dimples, and one true deepest valley. A blind walker just settles in whichever hollow it happens to wander into. Drop balls at different spots and watch where they each come to rest.

Tap anywhere · the flag marks the deepest valley
Drop a ball and see which valley it falls into.

Each ball is honest and each ball is blind. It always walks downhill correctly — and still, where it starts decides where it ends. The bottom it finds need not be the bottom that exists.

This is called getting stuck in a local minimum — a valley that's lower than everything right around it, but not the lowest valley on the whole mountain. The downhill rule has an honest blind spot: it can only ever go down from where it is, so once it's in a hollow it has no way of knowing a deeper one lies just over the next ridge. Where you happen to start, and how you happen to step, quietly decide which valley claims you.

How do people fight it? With cheerful, slightly scrappy tricks. They start the walk from several different places and keep the best result. They give the ball a bit of momentum, so it can roll up and out of a shallow dimple instead of stopping dead in it. They add a dash of randomness to the steps, a useful jiggle that shakes it loose from tiny traps. And — one of the happiest surprises of the last decade — it turns out that in the enormous landscapes of big neural networks, most of the valleys you can fall into are nearly as good as the very best one. So "good enough" is usually genuinely good enough, and the blind walk works far better in practice than this little demo might make you fear.

The actual grind

How it practises: again, and again, and again.

A single step barely moves the knobs at all — you saw that on the hill, where one footfall covers almost no ground. Real learning is a staggering number of those footfalls. The model works through its whole pile of examples not once but many times over; one complete pass through the data is called an epoch, and a serious model makes many epochs, each pass nudging the knobs a little closer to the valley than the last.

But there's a wrinkle that turns out to matter enormously. Working out the exact slope from the entire pile before every single step would be brutally slow — imagine surveying the whole mountain before each footfall. So instead the model usually peeks at just a small handful of examples at a time — a mini-batch — estimates the slope from those few, and steps. The estimate is rougher and a touch jittery, but you can take hundreds of cheap, decent steps in the time one perfect step would have cost. This is the real workhorse version of the whole idea, and it carries a suitably grand name: stochastic gradient descent. "Stochastic" is just a fancy way of saying "with a bit of randomness."

And that built-in jitter is a quiet gift. Remember the shallow valleys from a moment ago? A perfectly smooth, careful walk can sink into one and stop. The noisy, slightly-drunk walk of mini-batches keeps jostling the ball — often enough to bump it up and out of a shallow trap and send it on toward somewhere deeper. The very roughness that makes each individual step less precise can make the whole journey end up better. It's one of those happy accidents that make the blind walk far more capable than it has any right to be.

Training, in three numbers. Put together, the whole process boils down to three dials: how big each step is (the learning rate), how many examples you peek at per step (the batch size), and how many full passes you make over the data (the epochs). Set those three, press go, and wait — sometimes minutes, sometimes weeks.
Try it · memorise vs. understand

The goal isn't to ace the practice questions.

A model studies a fixed set of examples — but the whole point is to do well on new things it has never seen. Drag the slider from a calm, simple guess toward a frantic curve that bends to touch every single dot, and watch the two scorecards disagree.

Teal dot = a brand-new example it never studied
simple guessmemorise everything
Misses on dots it studied:
Misses on a brand-new dot:
A calm, simple guess.

Slide right and the curve hits every studied dot perfectly — its practice score becomes flawless — while it misses the fresh teal dot by more and more. That gap is the whole lesson.

This trap has a name: overfitting. The model stops learning the real shape of the world and starts memorising the exact quirks — the random wobble, the noise — of the particular examples it was shown. It's the difference between a student who understands the subject and one who has memorised last year's answer key: the second looks brilliant on the questions they've seen and falls apart on anything new.

Which is why the score that actually matters is the one on data the model didn't get to study. In practice people hide away a chunk of their examples — a test set — and never let the model train on it, precisely so they can check whether it has understood or merely memorised. The ability to do well on the unseen is called generalisation, and it, not a flawless practice score, is the real prize. A model that can't generalise hasn't learned anything; it has just become an expensive way to remember what it was already shown.

So how do you keep a model honest? The bluntest fix is simply more examples — the more of the world it sees, the harder it becomes to memorise all of it, and the more it's forced to find the real pattern underneath. You can also keep the model simpler, giving it fewer knobs so it lacks the room to chase every little wobble. And you can watch that hidden test score as training goes along and stop early — the moment doing better on the practice set starts making things worse on fresh data, you've found the sweet spot and should quit while you're ahead. Different tools, one shared aim: steer the walk toward genuine understanding rather than a flawless memory.

The leap

From one knob to a hundred billion.

Everything you've played with so far had one or two knobs, so the hill fit on a screen. A real model has millions, even billions of them — and the walk downhill is exactly, unbelievably, the same.

A neural network is, underneath the intimidating name, a tall stack of these little knobs arranged in layers. Each layer takes the numbers coming in, mixes and reshapes them with its own knobs, and passes the result up to the next — raw pixels at the bottom slowly becoming "edge," then "ear," then "cat" near the top. There's no rulebook hand-written inside. Every one of those knobs starts at a random value, and learning is the long, patient walk that nudges all of them, together, a hair at a time, toward less wrong.

You can't picture a landscape with a billion dimensions, and you don't have to. The downhill walk never needed the picture — it only ever needed the slope under its feet. So the recipe doesn't change when the model gets gigantic. It just runs the same blind step, over mountains of examples, an enormous number of times. The intelligence isn't in any single step. It's in taking a staggering number of them.

The shopping list

What it actually takes to teach a machine anything.

Strip away the jargon and a learning system needs four plain things, and if any one of them is missing the whole walk falls apart.

First, examples — and usually a great many of them. The machine has no other window onto the world; whatever isn't in its examples may as well not exist. Show it only sunny photos and it will be baffled by rain. The data isn't a detail you sort out later; it quietly decides what the model can ever become.

Second, a way to measure wrong — the loss. Without a single honest number to push downward, there is no hill, no slope, and nothing to descend. And because the machine will chase that number with single-minded devotion, you'd better be sure it's measuring what you actually care about, not some convenient stand-in that drifts away from your real goal.

Third, a model with enough knobs to hold the answer. Too few and even a perfect walk can't reach a good valley — the right shape simply isn't available anywhere on its landscape. Too many and it gleefully memorises the noise, as you saw. Matching the model's flexibility to the problem is its own delicate craft.

Fourth, patience — which in this world usually means computing power. The walk is millions or billions of tiny steps over mountains of examples, and someone, somewhere, has to pay for every footfall. The headline-grabbing models cost stunning amounts of electricity and time to train, not because any single step is clever, but because there are so breathtakingly many of them.

The whole field, honestly summarised. Gather good examples, define what "wrong" means, build something flexible enough to be shaped, and then let it walk downhill — patiently, blindly, relentlessly — until the wrongness is small. Everything else is detail.
The whole recipe

Everything you just saw, in one sentence.

your next guess  =  your current guess  −  one small step  in the  downhill direction

That really is the whole thing. A giant AI just does this same step millions of times, not on one ball but on millions of little knobs at once.

If you've ever seen the scary-looking version — θ ← θ − η∇L — relax: it's this exact sentence wearing a math costume. θ is the guess (all the knobs), η is the step size (the learning rate), and ∇L is just the arrow pointing uphill on the loss (so we step the other way). Same hiker, same fog, fancier handwriting.
A trap worth dodging

"But surely it understands, like I do?"

This is the misconception that trips up almost everyone, and getting clear on it changes how you read every headline about AI.

Myth

The machine learned what a cat is. It knows the meaning of the words it writes. Somewhere in there, it understands.

Really

It found a setting of its knobs that makes its output line up with patterns in the examples it was shown. There's no concept of "cat" in there, no intent, no meaning — just a blind walker that got very, very good at making one number small.

This isn't a put-down; it's the key to reading these systems honestly. Because a model only ever chased patterns in its data, it has no built-in sense of what's true — which is why it can be confidently, fluently wrong, stating a made-up fact in the same calm voice as a real one. And because it soaked up whatever was in its examples, it quietly absorbs their biases too: feed it a lopsided slice of the world and it will faithfully learn the lopsidedness, mistaking "what was common in the data" for "what is right."

None of this means the results aren't impressive — they plainly are. A system that has walked downhill on a large enough slice of human writing can hold a conversation, draft a letter, or explain a hard idea, and that is a genuine achievement. The point is subtler: the impressiveness lives in the patterns, not in any inner grasp of them. The machine is a mirror polished by millions of corrections until it reflects our examples back at us with uncanny smoothness. A very good mirror can still show you a convincing picture of something that was never there.

Keep the hiker in mind and you'll never be fooled. What looks like understanding is an extraordinarily well-tuned echo of the patterns in a mountain of examples. That can be genuinely useful, even a little magical. But it found its answer by walking downhill on its own mistakes — not by knowing anything at all.

Where you've already met it

This quiet little walk runs an astonishing amount of the world.

Whenever something feels like it "learned" from examples, there's a good chance it found its answer by walking downhill on a landscape of its own mistakes:

📷

Your photos app

Learning to spot faces is millions of tiny downhill steps that slowly reduce how often it guesses wrong.

✉️

Spam filters

The line between "spam" and "not spam" is nudged downhill until it misclassifies as few emails as possible.

💬

Chatbots

A model like this one learned to predict the next word by stepping downhill on how surprised it was by real text.

🎬

Recommendations

"Because you watched…" is tuned by walking downhill on how badly its past guesses matched what you actually picked.

🗺️

Translation

Turning one language into another is a vast set of knobs nudged downhill until the output reads less and less wrong.

🩺

Medical imaging

Models that flag a suspicious scan are trained by stepping downhill on how often they miss what doctors have already labelled.

It's not literally every AI method — a few clever ones find their answer other ways. But the downhill walk is the engine humming under nearly all of today's machine learning, from the simplest line-fitter to the largest chatbot. Once you've seen the hiker, you start spotting them everywhere.

Carry this with you

The entire idea, in three moves.

1

Feel the slope

Check which way the ground tilts — the gradient — right where you're standing.

2

Take a small step

Move a little way downhill — not too timid, not too wild. That size is the learning rate.

3

Repeat

Do it again and again until the loss settles — and you've reached the valley.