🔮

Tiny Transformer

The next step past the Word Predictor: one self-attention head decides which of the 4 words to focus on. This is how modern LLMs work.

Training data

Epoch
0
Loss
Perplexity
Log-likelihood
Loss (cross-entropy) per epoch

Predict the next word

Your 4 words
Model's next word

Attention

When predicting, the last word looks back at all 4 words. Thicker green = more attention. Watch it change as the model learns (and when you change the words).