Skip to content
Ben Kennedy Explainers · Inside a Transformer
Six stages · One prediction

Context in.
Next word out.

Follow one sentence through a transformer, stage by stage. Tokens become vectors, attention gathers context, and the model ranks every candidate for the next word. Press play, or step through it yourself.

1 of 6
Stage 01 · Goal Predict what should come next
Turning context into probabilities
The big idea

The model is always solving one immediate problem

Given the text it can already see, which token is most likely to come next?

The model never guesses.
It ranks.

Every stage exists to sharpen one ranked list of continuations. Context flows in, probabilities come out, and the top of the list becomes the next word. Then the whole machine runs again.

Ben Kennedy builds privacy-first AI for regulated industries. Founder of Kennedy Applied Sciences, creator of StratoSort, PhD candidate in Artificial Intelligence.