Beginner · 02
How machines learn
Guess, check, adjust, repeat. Every model on Earth learns with the same simple loop.
5 min read · Tap underlined words for a definition
Swipe up to begin
Imagine learning to throw a paper ball into a bin across the room. You throw, you miss to the left, you aim a little more right. Throw again. Closer. Adjust again. is exactly that, done millions of times very fast.
The model makes a guess
A model is just a big mathematical function with lots of adjustable knobs called parameters (or ).
At the start the knobs are set randomly, so its guesses are rubbish.
We measure the mistake
We compare the guess with the right answer. A loss function turns "how wrong" into a single number.
Big number = very wrong. Small number = nearly right.
We nudge the knobs
An algorithm works out which direction to turn each knob to make the loss smaller, and turns it a tiny bit.
This is called optimisation. The most famous method is (you'll meet it in Intermediate).
Repeat… a lot
One pass through all the is an epoch. Models often train for many .
A big language model's knobs get nudged trillions of times during training.
What does the loss function tell us?
Training vs. using
Training is the slow, expensive learning phase, where the knobs change.
Inference is using the finished model. The knobs are frozen; it just answers. When you chat with an AI, you're doing .
When you ask a chatbot a question, the model is…
Before you drift off
- A model is a function with adjustable parameters.
- Training loop: predict → measure loss → adjust → repeat.
- Training changes the parameters; inference just uses them.
Terms in this lesson
Go deeper, free and open
- But what is a neural network? (video series) · 3Blue1Brown (Grant Sanderson) · Beautiful visual intuition
- ML Crash Course: Linear regression & loss · Google · CC BY 4.0
That's the lesson
How machines learn · 5 min
Each lesson you finish lights a star.
Spotted a mistake? Suggest an edit
Previous: What is AI, really?