Part III · How It Learns Chapter 08

Pre-Training: Learning by Guessing

Nobody programs grammar rules, facts, or logic into a Large Language Model. Watch how trillions of tiny nudges turn completely random dials into a fluent mind.

9 min read · 3 interactive labs · Zero equations

Before a Large Language Model reads its very first sentence, it knows nothing. Ask it to finish "The sun rises in the ___" and it will spit out pure keyboard static—random letters, stray punctuation, and nonsense syllables.

That's because inside the skyscraper of layers we explored in Part II sit billions of tiny adjustable dials—called weights (or parameters). At birth, every single dial is spun to a completely random position.

So how do engineers turn billions of random dials into a model that speaks dozens of languages, writes poetry, and knows that the sun rises in the east? They don't hand-tune a single dial. Instead, they play the simplest game imaginable—over and over, trillions of times:

  1. Hide the next word in a real sentence from the internet or a book.
  2. Let the model guess what comes next.
  3. Measure the mistake—how surprised was the model by the real answer?
  4. Nudge every dial a tiny hair in the direction that would have made the mistake slightly smaller.

1. The Giant Knob-Tuning Playground

Imagine a miniature model with just three dials controlling how strongly it pays attention to Direction, Sky, and Time. Right now, those dials are spun to clumsy positions, so its guess for "The sun rises in the ___" is scattered and its Mistake Height is tall.

Try turning the three dials yourself—or click Auto-Nudge to watch the learning loop nudge every dial a tiny hair at a time until east rises to the top!

Interactive 1 The Giant Knob-Tuning Playground
Nudges: 0
"The sun rises in the ___" Real Answer: east
Each time you click Auto-Nudge, the model checks which way turning each dial shrinks the coral Mistake bar—and nudges all three dials simultaneously. A real LLM does this exact same nudge across billions of dials at once.
Aha! Moment · How Does It Know Which Way to Turn?

Think of a blindfolded hiker standing on a foggy hillside. You don't need a satellite map of the whole mountain range to walk downhill—you just feel which way the ground slopes right under your boots, and take one step downward. In AI, feeling that local slope for every dial is called backpropagation: the mistake flows backward from the top floor to the bottom, whispering "a tiny bit left" or "a tiny bit right" to every single dial.

2. Rolling Down the Valley of Mistakes

Picture all possible settings of the model's dials as a vast, rolling terrain of hills and valleys. The height of the terrain at any spot is how big the model's mistake is. High peaks mean terrible guesses; deep valleys mean sharp, accurate predictions.

Training is simply dropping a glowing marble onto this landscape and letting it step downhill. But there is a surprisingly delicate choice to make: how big should each step be? Engineers call this the Step Size (or learning rate).

Experiment with the Step Size slider below and click Drop Marble to watch all three behaviors firsthand.

Interactive 2 Rolling Down the Valley of Mistakes
Step Size: Just Right
Medium
Watch the glowing trail! When Step Size is Too Wild, the marble overshoots the bottom of the valley and rebounds higher than where it started. Finding the sweet spot lets the model descend smoothly without bouncing out.

3. From Gibberish to Fluency

What does it actually look like as a model rolls down that valley over weeks of training on trillions of words?

It doesn't learn everything at once. Just like a child growing up, the model unlocks language in unmistakable waves. First it learns that English uses spaces and common short words (the, and, in). Next it locks onto sentence structure and grammar. Only much later—once the easy mistakes are gone and the only way to shrink the mistake bar further is to actually understand the world—does it begin absorbing geography, history, coding, and reasoning.

Drag the training timeline below from Step 0 to Full Pre-Training and watch both the Mistake Height gauge and the model's live writing transform.

Interactive 3 From Gibberish to Fluency (Training Timeline)
Step 0 · Random Dials
Prompt: "The sun rises in the..." → Model Completes:
Skills Unlocked So Far
Spaces & Words Clean Grammar World Facts Style & Nuance

Notice how the Mistake Height drops steeply at first (learning easy patterns like spaces and common words), then descends more gently as every remaining drop requires deeper world knowledge and reasoning.
Why "Just Guessing the Next Word" Forces Deep Understanding

At first, next-word prediction sounds shallow—like phone autocomplete. Yet to shrink the mistake bar on a mystery novel, a physics textbook, or a broken piece of code, the model must build an internal map of who did what, how gravity works, and where the bug is hiding. Compression is understanding.

Check Your Intuition

During pre-training, what happens if engineers set the Step Size (learning rate) way too high?