Back to Home
Inside an LLM

How an AI Model Works

When you ask AI a question, it doesn't instantly know the answer. It processes your request through several steps before generating a response.

This is a simplified educational demonstration showing the overall process used by modern language models.

Interactive Playground
0 / 7
Current Stage

Press Start Pipeline to begin step by step

Live Pipeline
Statistics
Prompt Characters
Estimated Tokens
6
Total Steps
Current Stage
0
Completed
How It Works
🧠 1. What is Artificial Intelligence?
🔤 2. Text becomes Tokens
🔢 3. Tokens become Numbers
📐 4. Numbers become Vectors
⚙️ 5. Transformer processes them
6. Model predicts next token
7. Response appears
Each pipeline step builds on the last, an error in tokenisation compounds through embedding and attention.
The model doesn't look things up in real-time. Everything it knows was baked in during training before you sent your message.
💡
Key Takeaway

Modern AI answers questions by processing text step by step, not by instantly knowing the answer. Each stage builds on the previous one to produce a meaningful response.

The magic isn't that AI "thinks" it's that billions of math operations on patterns from human text produce results that look just like thinking. And the more you understand these steps, the better you'll be at using AI effectively!

Key Concepts Tap a card to flip
🔤
Token
tap to reveal
Token
"playing" → "play" + "ing". AI works with these chunks, not letters.
🪟
Context Window
tap to reveal
Context Window
AI's working memory. Think of it as a whiteboard when it's full, old text is erased.
⚙️
Transformer
tap to reveal
Transformer
Reads ALL tokens at once and maps how each word connects to every other.
🔢
Embeddings
tap to reveal
Embeddings
Tokens become lists of numbers. Similar words get similar numbers.
Prediction
tap to reveal
Prediction
AI picks the most likely next word one at a time until the answer is done.
🎓
Training
tap to reveal
Training
AI studied billions of text examples before you ever used it adjusting billions of numbers.
Myth or Fact? Tap to guess
"AI looks up answers from the internet when you ask it something."
❌ Myth!

Most AI models predict answers from patterns learned during training they don't browse the web live. It's like a well-read person recalling knowledge, not a live Google search.

"AI generates its reply one word at a time, not all at once."
✅ Fact!

Correct! The model predicts one token at a time each new word is influenced by everything that came before it. That's why the typing animation looks the way it does!

"AI always gives correct answers because it was trained on so much data."
❌ Myth!

AI predicts the most likely words not necessarily the true ones. It can confidently produce wrong info ("hallucinations"). Always verify important facts!