Machine learning, in one robot
The forward robot squares a number. The backwards robot figures out that squaring is the rule.
2026-05-17
Here is a robot. It has three parts. An input arm on the left, a rule box in the chest, and an output arm on the right. You feed a number into the input arm, the rule box does something to it, and the result comes out the output arm.
That’s the whole metaphor. The only thing that changes between regular programming and machine learning is whether the rule box is something you wrote, or something an algorithm has to figure out from examples.
The forward robot — this is programming
Set the rule box to x². Feed in a number. Get a number back. We wrote the rule; the machine executes it. Every program you’ve ever used works this way.
But programming isn’t the only way to fill in that box. Imagine the same robot, with the rule slot sealed. You can see the input arm and the output arm — you just can’t see inside. What you do have is the list of pairs the machine produced.
| x | rule | y |
|---|---|---|
| 1 | x² | ??? |
| 2 | x² | ??? |
| 3 | x² | ??? |
| 4 | x² | ??? |
| 5 | x² | ??? |
| x | rule | y |
|---|---|---|
| 1 | ??? | 1 |
| 2 | ??? | 4 |
| 3 | ??? | 9 |
| 4 | ??? | 16 |
| 5 | ??? | 25 |
The left table is the world of regular programming: we declared the rule, and the machine generated the outputs. The right table is the world of machine learning: inputs and outputs known, the rule unknown. Could the rule be x²? Sure. Could it also be |x|·x or exp(2·ln|x|) — all of which agree on these five points? Also sure. Machine learning doesn’t know the rule. It searches for one.
The backwards robot — this is machine learning
To search for a rule given only inputs and outputs, machine learning needs four ingredients.
-
1
An algorithm
A family of possible rules to choose from. We have to commit to what kind of thing the rule could be before we can search for the best one. A common starting family is
y = a·x² + b·x + c— three knobs (a,b,c) that can be turned to give any parabola, including flat lines and tilted lines. -
2
A loss function
A number that says how wrong the current guess is. Standard choice: squared error. For every data point, take the difference between what the algorithm predicts and what the robot actually output, square it, average across all the points. Zero means perfect; bigger means worse.
-
3
An optimizer
A procedure that nudges the knobs so the loss goes down. The classic is gradient descent: compute which direction to move each knob to lower the loss the fastest, take a small step, recompute, repeat.
-
4
Iteration
Do it thousands of times.
Why this is the whole story
That loop — guess, measure how wrong, nudge, repeat — is the engine underneath every modern machine learning system. What changes between this toy and an industrial model is the size and shape of the rule box.
A linear regression has a handful of knobs. A gradient-boosted tree has a few thousand. A modern image classifier has tens of millions. A large language model has hundreds of billions. The inputs and outputs get more complex too — pixels in, label out; text-so-far in, next-word-probabilities out — but the four ingredients are exactly the same. Algorithm. Loss. Optimizer. Iteration.
What this means
The honest constraint worth keeping in mind: the loop can only find a rule that lives inside the algorithm’s family. Pick a family that’s too narrow and the rule it finds will be the closest bad approximation. Pick one that’s too flexible and it’ll memorize the training data instead of finding the underlying pattern.
Choosing the family used to feel like the obvious place the “machine learning is automated” story broke down — somebody had to pick. That’s less true now. An LLM can read a problem description and pick a reasonable model, often better than a junior practitioner. But the human choice doesn’t disappear; it migrates. The LLM is picking from a menu humans built, using judgment compressed from a corpus humans curated, shaped by an architecture and objective humans designed. The human role in machine learning doesn’t vanish. It just gets harder to see.