What a Neuron Learns — Weights, Networks, and Backprop
Gradient descent showed the training loop, but "the model" was still a black box. This opens it. The smallest real model is a single neuron — a weighted vote — and the model literally is its weights. Train one for real, see the rule it learns, then stack neurons into a network and watch backprop send the error backward to tune every weight. The payoff is operational — what a checkpoint saves, why training eats so much more HBM than inference, and why training and serving run on separate fleets. No calculus.
200Math of Learning (gradient descent)Lesson 2 of 4ShowHide
Chapter 2 of 2 in Math for ML/AI Workloads
- What a Neuron Learns — Weights, Networks, and BackpropYou're here
Prerequisites: Gradient Descent — What "Training" Actually Is
The one-line summary
Gradient descent gave you the loop, but "the model" was still a black box. Here's the whole of it: a model is just a big pile of numbers — weights — and the smallest model is a single . Training nudges those weights (real gradient descent); what they encode is a rule; and stacking neurons into a , tuned by , is how that rule gets complex. Once you see that the model is its weights, the operational facts fall out — what a checkpoint saves, why training is so much more memory-hungry than inference, and why the two run on different fleets.
A neuron is a weighted vote
A neuron takes each input, multiplies it by a learned (how much it listens to that input), adds a (its baseline), and squashes the result with an — here a , which maps anything to a 0–1 score. Past 0.5 it says one class; below, the other. That's .
Train one for real below — drag nothing, just hit Auto Train and watch gradient descent tune the two weights and the bias until the line cleanly separates "buy" from "walk," then predict a new car:
The line it finds is the — the rule the neuron learned, drawn in input space. Nothing was hand-coded; the weights became the rule.
The weights ARE the model
This is the part worth internalizing. The three numbers in that sim — w₁, w₂, b — are the
entire model. Training changed nothing else. Scale the idea up and a real model is the same thing:
millions to billions of weights, just a big of numbers (the
).
One neuron draws a straight line — that's its ceiling
A single neuron can only ever carve a straight decision boundary. Give it data that no straight line can split and it will never get the loss to zero — it's not under-trained, it's under-powered. The fix isn't more epochs; it's more neurons. A straight line is what a purely linear rule gives you — and stacking linear rules just yields another straight line. The activation (the sigmoid squash) makes each neuron nonlinear, and that's what lets a stack of them combine into a bent, curved boundary. That stack is a neural network.
How a network learns — backpropagation
Now the real thing: inputs feed a of neurons, which feeds the output. More weights, so a harder question — when the guess is wrong, which weight gets the blame? The answer is backpropagation. Run the forward pass, measure the error at the output, then send that error backward: each neuron gets a share of the blame — written δ ("delta"), its slice of the error — scaled by how much it contributed (its weight to the output). Every weight then takes the same downhill step from the last topic — gradient descent, applied to each weight individually.
Walk it one stage at a time — forward, error, the blame (δ) flowing backward, the update — then train it and watch the loss fall:
Notice the connection thickness tracks weight magnitude: training grows the paths that matter and starves the ones that don't. That's "what the weights mean," made visible.
Train once, infer forever
Two very different jobs share the same network:
- Training — the slow loop (forward → backprop → update), millions of steps, holding activations and optimizer state. Expensive, stateful, long-running. You do it once (or rarely).
- Inference — a single forward pass on new input. Cheap, stateless, fast. You do it constantly.
Why this matters
- "The model" is a pile of weights. That's what a checkpoint is, what loads onto the chips, and what the parameter count measures — so weights/HBM math (last lesson's What Is a Tensor?) is how you size it.
- Backprop explains the training memory bill. Stored activations + optimizer state are why training needs multiples of the model's own size in HBM — and why a config that serves fine can't necessarily train.
- Train vs infer is a cost split, not a detail. Different fleets, different sizing, different failure modes — all because one job runs the loop and the other runs a single pass.
Put it together
Train a neuron, name the rule
In the first sim, Auto-Train the neuron, then say in one sentence what its decision boundary means and which three numbers are the trained model.
Follow the blame
In the second sim, step to the backprop stage. Explain where the δ comes from and why a hidden neuron with a bigger weight to the output gets more of it.
Size the memory
State why training this same network needs several times the HBM that inference does — name the two things backprop and the optimizer force you to keep resident.
Review
What does a single neuron compute?
Check yourself
An ML team says "the model is 70B." 70 billion what?