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

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.

🎯 Predictmakes a guess📏 Measureloss = how wrong🔧 Adjustnudge weights📚 Next batchmore examplesrepeatmillions of times
The training loop: the model guesses, we measure how wrong it was, and nudge it to be a bit less wrong next time.

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.

Quick check

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 .

Quick check

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

That's the lesson

How machines learn · 5 min

Each lesson you finish lights a star.

Finish & continue · Up nextThree ways to learnBeginner · 5 min

Spotted a mistake? Suggest an edit

Previous: What is AI, really?