LLM Visualizer
See how large language models process text, step by step.
Tokenization
Text is broken into smaller units called tokens. These are the building blocks that LLMs actually process, not words, not characters, but tokens.
Embedding
Each token is converted into a high-dimensional vector, a list of numbers that captures its meaning. Similar words end up close together in this space. Below is a 2D projection of these vectors.
Positional Encoding
The model knows what each token means, but not where it appears. Positional encoding adds a unique signal to each position so the model can distinguish word order.
Same tokens, different meaning. Without a position signal, the model treats both sentences identically. The subscript is each token's position, it changes the final vector.
Self-Attention
Type text in the tokenizer above to see attention in action.
FFN & Residuals
Type text in the tokenizer above to see the feed-forward network in action.
Generation
Type text in the tokenizer above to see next-token prediction.