← Accueil Animation · How an LLM works

How does an LLM chatbot work?

From the user's message to the generated response — an animated walkthrough of each step inside a large language model.

Step 1
User Input
The user types a message. The model receives raw text.
Step 2
Tokenisation
Text is split into sub-word tokens, each mapped to an integer ID.
Step 3
Embeddings
Each token ID becomes a dense vector + positional encoding.
Step 4
Self-Attention
Each token attends to all others. Repeated across N transformer layers.
Step 5
Generation
Output probabilities → next token selected → word-by-word generation.