Lesson 1

From phone autocomplete to ChatGPT

What a language model is, why the phone keyboard goes round in circles, and what changed to give us ChatGPT.

1Does your phone guess your next word?

Yes. While you type, your phone shows three words above the keyboard. Those three words are its guesses for your next word.

Now play a game. Tap only the middle word, again and again, and type nothing yourself.

I am going to

bethework
Step 1 of 10

A toy keyboard with made-up suggestions. It looks only at your last word. The middle word, with the green border, is the one tapped in the next step.

So the phone does guess. It just guesses badly, because it looks at very little of what you typed. Section 5 shows this.

2How does a program guess anything?

A program guesses with a model.

A model is a program that looks at what has happened so far and makes its best guess about what comes next.

Example: a weather model. It makes the forecast in your phone's weather app.

📥 Goes in: the weather so far31°C, cloudy, wind from the sea
Weather model
📤 Comes out: a guess for tomorrow70% chance of rain

Made-up weather and made-up numbers.

Is the guess always right? No. That is why the app says 70% chance of rain, and not it will rain.

3Can a model guess words?

Yes.

A model that guesses the next word is called a language model.

Try it yourself first: fill in the blank in I have a pet ___.

A language model learns the same way:

I have a pet  

Chance that each word comes next

  1. dog38%
  2. cat31%
  3. fish9%
  4. parrot6%
  5. lion<1%

The model gets the words before the blank.

It gives a chance to every word that could come next.

The word with the highest chance goes into the blank.

Step 1 of 3

Made-up numbers. Only the top 5 words are shown. All the other words share what is left. Tap the other sentence for a second example.

4How does ChatGPT write whole answers?

ChatGPT writes one word at a time. After each word, the whole text so far goes back into the model, and the model guesses the next word.

Each round has four steps:

When does it stop? Besides words, the model can also pick a stop mark. On this page: ⏹ end = the model's stop mark. When the model picks ⏹ end, it stops writing.

📥 Text going in (the whole text so far)The cat sat on the
🤖 Language model

Chance that each word comes next

  1. mat34%
  2. floor18%
  3. sofa14%
  4. ⏹ end<1%
Picked: mat📤 Text nowThe cat sat on the mat↩ This whole text goes back into the model for the next round.

Round 1: "The cat sat on the" goes in. The model picks "mat" and adds it to the end.

Round 2: the whole text, "The cat sat on the mat", goes back in. The model picks "and".

Round 3: the whole text goes back in again, now ending in "and". The model picks "purred".

Round 4: the whole text goes back in. The model picks a full stop.

Round 5: the whole text goes back in. This time the model picks ⏹ end, so it stops writing.

Step 1 of 5

Made-up numbers. Only the top 4 options are shown. ⏹ end is the model's stop mark, not a word.

This loop is what people mean when they say an LLM "generates text".

LLM stands for large language model.

It is called large for two reasons:

5Why does the phone go round in circles when ChatGPT doesn't?

The phone keyboard and the model inside ChatGPT both guess the next word. The biggest difference is how much of your text each one reads before it guesses.

Look at this sentence, and guess the last word yourself.

Phone keyboard reads only the last word

My dog hates the postman. Every morning, when the gate opens, my ___

guesses: phonemomfriend

LLM reads the whole sentence

My dog hates the postman. Every morning, when the gate opens, my ___

guesses: dog

This is the sentence. Both the phone and the LLM get the same words.

The phone reads only the last word: "my".

From "my" alone, the phone guesses phone, mom or friend.

The LLM reads the whole sentence. It notices "My dog" at the start.

So the LLM guesses dog.

Step 1 of 5

Made-up guesses.

The LLM could do this because of three changes:

And your phone today?

6Is ChatGPT just GPT-3 with a chat box?

No. GPT-3 is a model, and ChatGPT is an app. GPT-3 is like an engine. ChatGPT is like a whole car. The engine inside ChatGPT is newer, and it was trained more to reply.

Send the same question to both, and compare what comes back.

GPT-3 a model that only continues text

🧑 You send

What is 1 + 1?

⚙️ A model like GPT-3 sends back this text

2. What is 1 + 1 + 1? 3. What is 1 + 1 + 1 + 1?

ChatGPT an app with a model trained to reply

🧑 You send

What is 1 + 1?

💬 ChatGPT replies

2

You send "What is 1 + 1?" to GPT-3.

A model like GPT-3 sends back text that continues yours. It is one piece of text, written line after line. It is not a list of choices. It is not the answer either.

You send the same question to ChatGPT.

ChatGPT sends back the answer: 2.

Step 1 of 4

The continued text is a book's example (Hands-On Large Language Models, figure 12-5). The book shows it for a model trained only to continue text, the kind GPT-3 is. We did not run this on GPT-3.

  1. 2017
    The Transformerdesign

    Looks at all the earlier words, not only the last few.

  2. 2020
    GPT-3model

    175 billion learned numbers (17,500 crore). Continues the text you send.

  3. 30 November 2022
    ChatGPTapp

    A chat app on a model built from GPT-3.5, trained to reply.

  4. 2026
    ChatGPT todayapp

    The same app on newer models, the GPT-6 family.

Step 1 of 4

The models keep getting newer, but the job is the one your phone does: guess the next word, again and again.

One question is still open: how does a model learn which word is likely in the first place? The next lesson starts there.

All lessons  ·  Next lesson →

Where this comes from

  • 2017, the Transformer: Vaswani et al., "Attention Is All You Need", arXiv v1 12 June 2017: "the Transformer, based solely on attention mechanisms". arxiv.org/abs/1706.03762. Looking at every earlier word: Hands-On Large Language Models (Alammar, Grootendorst; O'Reilly 2024), ch.1-3.
  • 2020, GPT-3, 175 billion (17,500 crore): Brown et al., "Language Models are Few-Shot Learners", arXiv v1 28 May 2020: "we train GPT-3, an autoregressive language model with 175 billion parameters". What it read (web pages from Common Crawl and WebText2, two book collections, Wikipedia): the same paper, section 2.2. arxiv.org/abs/2005.14165. The API: Wikipedia, "GPT-3": "On June 11, 2020, OpenAI announced that users could request access to its user-friendly GPT-3 API". en.wikipedia.org/wiki/GPT-3. The 5,500 years is our arithmetic: 175,000,000,000 seconds ÷ 31,557,600 seconds in a year ≈ 5,545 years.
  • The ⏹ end mark: How Large Language Models Work (Raff, Farris, Biderman; Manning 2025), ch.3, PDF p.63: the vocabulary includes "an end of sequence (EoS) token"; "the EoS token is one of the options it can generate. If the EoS is generated, we know it is time to stop the loop".
  • 30 November 2022, ChatGPT: Wikipedia, "ChatGPT": "Originally released on November 30, 2022"; "ChatGPT gained one million users in five days" (10 lakh). en.wikipedia.org/wiki/ChatGPT. Wikipedia, "GPT-3": ChatGPT "was fine-tuned from a model in the GPT-3.5 series".
  • Trained to reply, people marking better answers: Hands-On Large Language Models, ch.12 (instruction tuning and preference tuning). The "What is 1 + 1?" continuation is that book's figure 12-5 (p.490), shown for a model that has only been trained to continue text.
  • 2026, the GPT-6 family: Wikipedia, "GPT-6" (Astra released 4 September 2026); Wikipedia, "ChatGPT", infobox engine "GPT-6 Astra". en.wikipedia.org/wiki/GPT-6.
  • Transformer in the iPhone keyboard: Apple Newsroom, "iOS 17 makes iPhone more personal and intuitive" (June 2023): "Autocorrect receives a comprehensive update with a transformer language model". apple.com/newsroom. Phone models limited by size and by how much they read: Rahul's course blueprint, Part 5 (notes/llm-course-blueprint.md).
  • Made up on purpose: the toy keyboard's suggestions, the weather forecast, every percentage, and the phone and LLM guesses in section 5. Each is labelled where it appears. All web pages accessed 2026-10-31.