Lesson 002 · Foundations · ~6 min read

How AI Actually Learns

Last updated: October 2026 7 min read Builds on Lesson 001

Written and reviewed by Manish Kulkarni · About the author

Learning from examples, not instructions

Traditional software runs on rules a programmer wrote: "if X happens, do Y." Machine learning flips that. Instead of writing the rule, you show the system many examples and it works out the pattern itself.

Example: to build a spam filter the old way, you would try to list every suspicious phrase. With machine learning, you feed it thousands of emails already marked "spam" or "not spam", and it finds the patterns that separate them, including ones you would never have thought to write down.

The learning loop in three steps

  1. Guess. The model makes a prediction. At the very start it is close to random.
  2. Measure the error. Compare the guess with the correct answer and work out how wrong it was.
  3. Adjust. Nudge the model's internal numbers slightly so the same mistake is a little less likely next time.

Repeat that millions of times and the guesses get steadily better. That repeated loop is what "training" means. The numbers being nudged are the model's parameters (see What "Parameters" Actually Means).

A loop of three steps: guess, measure the error, adjust, repeated many times.
The learning loop behind most machine learning.

The main ways a system learns

How we know a model has really learned

Builders keep part of the data aside and never show it to the model during training. After training, they test on that held-back data. If the model scores well on what it practised but badly on what it has never seen, it has memorised instead of learned. This is called overfitting, and it is why test results on unseen data matter more than training results.

Does more data always mean a better model?

Often, but not automatically. A model trained on 500 examples can latch onto coincidences, and one trained on millions has less room to be fooled by noise. But quality counts as much as quantity. A huge pile of duplicated, biased or low-quality data can produce a worse model than a smaller, carefully chosen set.

Where it can go wrong

For what happens after training finishes, see Training vs Inference.

Frequently asked

Does an AI model "understand" what it's saying?

Not in the way a person does. It's identifying statistical patterns in language and generating text consistent with those patterns — it doesn't hold beliefs or intentions.

How long does training actually take?

It varies hugely — a small model might train in hours on a laptop; a large language model can take weeks on thousands of specialised chips.

← Lesson 001   Next: Machine Learning vs Deep Learning →