7

Inference: predicting “sat”

Same forward pass with frozen weights: pick a word from the chances, append it, go again.

Hover or tap a token to follow it. In step 2, drag the temperature slider or tap − / +.

blue frame: learned weights (training changes them)green frame: numbers worked out for this sentence
1Same forward pass, trained tables
Module 7, step 1: Same forward pass, trained tables

Exactly modules 1 to 5 again, with the tables from training. Now “sat” wins by far.

Inference = forward pass only. No loss, no gradients, no weight updates.

2Temperature: how bold to be
Module 7, step 2: Temperature: how bold to be

Before rolling the dice, divide every score by the temperature. Low = almost always the top token. High = more variety.

p = softmax(scores / T). Every frame is computed in Python with the same 20 fixed dice rolls.

3Append and repeat
Module 7, step 3: Append and repeat

The picked token is added to the input and the whole forward pass runs again, one token at a time.

This loop is called autoregressive generation.

4Back to our corpus
Module 7, step 4: Back to our corpus

The test: start each sentence from module 1's corpus and let the trained model finish it on its own.

Greedy generation, computed in Python with the trained tables from module 6.

5Training vs inference
Module 7, step 5: Training vs inference

Both run the same forward pass. Only training compares with a right answer and changes the tables.

The full journey: text → tokens → vectors → question, name tag, message → attention → chances → “sat”. Training made the tables; inference just uses them.