The Bigram Model

The From Transformer to LLM board draws the machine that fills in the next blank. This lesson builds the smallest one: the second of six lessons that end with a small GPT built from scratch.
Before you start. A weight is one adjustable number inside a model. Its slope says how much the loss, the model’s wrongness, moves if you nudge that weight. Training nudges every weight a little against its slope, over and over. In Autograd by Hand you built code that finds every slope automatically, by remembering how each number was made and walking that record backwards. From The Maths Floor, Part 2: Probability, Softmax and Temperature: a probability is a share between 0 and 1, the shares add to 1, and sampling draws an outcome in proportion to its share. Also from The Maths Floor, Part 2: Probability, Softmax and Temperature: softmax turns a list of scores into probabilities. From Tokens & Embeddings: every piece of text gets an id, and an id can pick one row out of a table of numbers.