Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 03 · AI · Past the basics · about 18 min to read

Play it as a journeyTutor comes with a plan

What the model ate: pretraining data and the recipe

From Transformer to LLM
From Transformer to LLM · Open board

The board that draws how a transformer becomes a language model. This lesson is about what goes into the pretraining step on that board, and the settings that keep it from breaking.

Before you start. From From Transformer to LLM: pretraining shows the model huge amounts of text with one word hidden, and the text is its own answer sheet. From Tokens & Embeddings: text is cut into tokens, small word-pieces, and sizes are counted in tokens. From How It Learns (loss, gradient descent, backprop): the loss is one number for how wrong the model is, and the learning rate is how far each step moves the weights. From Why the Loss Won't Go Down: a learning rate that is too large makes the loss jump up.

Lesson 38 of 83 in AI

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • A run that went wrong about 20 times
  • Deduplication: remove the same text read many times
  • Data mixture: how many times each source is read
  • Learning-rate warmup: start with small steps
  • Gradient clipping: cap the size of one step
  • Loss spike: when the loss jumps even with all of this
  • Filtering, and text written by another model
  • What the schedule and the clip do
  • All of it in code
  • Why a spike needs both the batch and the state

Terms it explains: deduplication, data mixture, learning-rate warmup, learning-rate schedule, Gradient clipping, loss spike, Common mistakes, Synthetic data, alignment, autoregressive, base model, Chinchilla, decoder-only, distribution, emergent ability, in-context learning, logits, next-token prediction, parameters / data / compute, pretraining, scaling laws, self-supervised.

Related papers

Review AI