Vol. I · What a Language Model Is Plate 10 of 10drills, review, language models, perplexity, n-grams, samplingALE

Drills: Language Models.

Five questions at a time from the whole volume, until predicting, scoring and sampling feel routine.

This plate has no new material. It draws rounds of five from the questions and predictions of the nine plates before it, in a different order each time, with the reasoning shown after each answer and the plate it came from.

Work through rounds until you can answer without hesitating. The volume’s ideas — a distribution over the next token, the chain rule, surprisal and bits per byte, greedy and sampled generation, sparse counts and generalising networks — are used on almost every later plate.

Below: a round of five. Answer each, read the explanation, and press “Next round” for another five from the pool.

What you will learn
Drills
A round of five questions drawn at random from the volume’s knowledge checks and try-its.

What to carry forward

Four ideas from this volume are used constantly from here on. A language model is a function from a text to a probability distribution over the next token (plate I.1). The probability of a text is a product of those distributions, a sum of surprisals in logarithms (plate I.3). A model is graded by its average surprisal on held-out text, in bits per byte when tokenisers differ (plate I.4). And how the distribution is turned into text is a separate choice from the model itself (plate I.5).

Two more explain why the field moved from counting to networks: long contexts are sparse, so tables cannot generalise (plate I.6), while models that represent tokens as vectors can (plate I.7). The next volume looks at the first thing a model does with a text — cutting it into tokens.

Drill rounds are drawn from the questions on each plate of the volume and from the try-its; questions whose answers depend on a workshop’s current reading are left out.

Terms

Distribution
Probabilities over every possible next token, summing to one.
Cross-entropy
Average surprisal per token on held-out text.
Autoregressive
Generating by feeding each output back as input.
Generalisation
Predicting well on contexts never seen in training.
Drill until the basic arithmetic — bits, perplexity, the chain rule, temperature — needs no thought.