π€ AI / ML
How LLMs Work β A Step-by-Step Explainer
From tokenization to next-token prediction: follow the full pipeline of a large language model with interactive demos at every stage.
You type a question. The model types an answer. But what happens in between? This interactive explainer walks through every stage of the LLM pipeline β from raw text to probability distribution.
HOW IT WORKS
Large Language Models
From raw text to intelligent output
βοΈ Text β Numbers
π Numbers β Vectors
ποΈ Which words matter?
π Deep processing
π― Probabilities β Word
The Pipeline in 5 Steps
| Step | What Happens |
|---|---|
| 1. Tokenization | Text is split into tokens, each mapped to a unique ID |
| 2. Embeddings | Token IDs become high-dimensional vectors |
| 3. Attention | The model figures out which words relate to which |
| 4. Transformer Layers | Deep stacks refine understanding from syntax to meaning |
| 5. Next Token Prediction | A probability distribution picks the most likely next word |
Each step has an interactive demo β watch tokenization happen live, see attention weights in action, or observe the model choosing between candidate tokens.
Why This Matters
LLMs are often treated as magic. Theyβre not. The pipeline is well-understood, mathematically elegant, and surprisingly accessible. Once you see each stage individually, the βblack boxβ dissolves into engineering.