Chapter 4 of 14 · How machines learn

Teach a machine by reading to it

Here is a baby word machine. It knows nothing yet.

Read it some sentences. It counts which word comes after which.

Then press "Let it talk", and it makes new sentences from what it counted.

The more it reads, the better it gets.

Your turn

Tap sentence cards to read them to the machine. Then let it talk.

Toy calculation· a counting machine running in your browser

1. Read to the machine

It has read 0 sentences and knows 0 words.

2. Let it talk

It doesn't know any words yet!

Look inside: what comes after…

Empty! Read it a sentence and its counting table appears here.

What you learned

Machines learn from lots and lots of reading.

Finish "Your turn" to earn the Teacher sticker.
Grown-up corner: the precise version
  • counting machine = bigram model

This is a bigram model: the next word depends only on the current word, with probabilities equal to counts. Claude Shannon built text this way in 1948.

A real language model looks at the whole text so far (up to 32,768 tokens for Qwen3-8B) and stores what it learned in billions of weights, not in a count table. It is trained by gradient descent, which is the next chapter.