Next-word playground
A GPT-style model does one thing: given the text so far, it gives every word in its vocabulary a probability of coming next. Writing is that step repeated. Type the start of an English sentence and see what our tiny model expects.
The 10 most likely next words
Anna has a small
After temperature 1.0 and top-k 10. At temperature 1 with every word, the model gives its top word 13.1 %.
Temperature and top-k
The model's last layer gives each word a score; the softmax turns scores into probabilities. Temperature divides the scores first: below 1 the differences grow and the top word takes more of the probability, above 1 they shrink and unlikely words get a chance. Top-k keeps only the k most likely words and shares the probability among them. These are the same two settings an LLM API offers, doing exactly this.
Greedy writing always takes the top word, so it is repeatable and safe, and can be dull. Sampling draws a word at random with those probabilities, so the same start can continue differently; fixing the seed makes the draw repeatable.
Our model knows only the simple English of its corpus and was trained in minutes, so it predicts well inside that world and nowhere else. It is built as GPT-2 is (decoder only, normalisation before each sub-layer, learned positions, GELU), at about a thousandth of the size of the smallest GPT-2.