5
Probabilities for the next word
Turn cat's final vector into a score for every token, then into chances that add up to 1.
Hover or tap a token to follow its column, score and chance. Tap empty space to reset.
blue frame: learned weights (training changes them)green frame: numbers worked out for this sentence
One more table, U, has a column for each of the 10 tokens. Cat's row times each column gives that token's score.
scores = h · U (1×3 · 3×10 = 1×10). The scores are called logits.
Scores can be negative and don't add up to anything. Softmax makes them positive chances that add up to 100%.
p = softmax(scores) — the same two moves as in module 4. A probability distribution over the vocabulary.
The model never just “knows” the word. It gives chances, and then one token is picked from them.
Way 1 = greedy (argmax). Way 2 = sampling. Dice rolls here are fixed in code.
The model's answer is a list of 10 chances. Right now “sat” only gets 8.3% and “mat” gets 41%. That's the end of the forward pass. Next: learning from this mistake.