How Language Models Work (in Plain English) › The Autocomplete Analogy

Michael BrenndoerferJune 5, 20252 min read
AI Agent HandbookAll chapters
Part 2 of 15Language Models - The Brain of the Agent
Chapter 4How Language Models Work (in Plain English) › The Autocomplete Analogy
Reading section 2 of 12 · The Autocomplete Analogy · 2 minSection 2 of 12 · 2 min

Book contents

Section 2 of 12 · 2 min read

How Language Models Work (in Plain English) › The Autocomplete AnalogyOne section · Sections in this chapter2 / 12 ↓

Let's start with something familiar. Imagine you're writing an email and you type:

The cat sat on the

What word comes next? You'd probably guess "mat," "floor," "chair," or something similar. You definitely wouldn't guess "elephant" or "democracy." Why? Because you've read thousands of sentences in your life, and you've learned patterns about how English works and what makes sense in context.

Language models learn the same way, except they've "read" billions of pages of text from many sources. During training, they see countless examples of sentences and learn to predict what comes next. Over time, they build up an incredibly rich understanding of:

  • Grammar and syntax: How words fit together ("the cat sat" not "sat cat the")
  • Common phrases: Idioms and typical word combinations
  • Factual knowledge: Paris is in France, water boils at 100°C, Shakespeare wrote plays
  • Context: How earlier words influence what should come later

The key insight is this: by learning to predict the next word really well, the model implicitly learns about language, facts, reasoning patterns, and more. It's like how learning to play chess well requires strategic and tactical thinking, even though the basic rules are simple.