Khemshieldhemshield
How AI Actually Works

It doesn't think.
It predicts.

A step-by-step walkthrough of what really happens from the moment you type a prompt to the word that appears on screen.

01 The journey from prompt to response

Walk through each stage in order. Every time the AI generates one word, it repeats all of these stages for the next word.

1 / 6
02 Why context makes it accurate

The AI doesn't just look at your last word, it looks at all the words together and measures how much each one should influence the next word. This is called attention. Click any word below to see what it pays attention to.

Prompt: "The doctor gave the patient a ___"
Attention weights, how much each word looks at every other word:
👆 Click a word above to highlight its attention pattern

Because of all this context, the model heavily predicts:
Remove "doctor" and "patient", and "prescription", "diagnosis", "tablet" all drop dramatically. Context is everything.
03 How it learned, the training game

Before you ever typed a message, the model played this game trillions of times across every book, website, and article humans ever wrote. Each wrong guess nudged its internal numbers slightly toward being right.

The model sees a sentence with a word hidden. It guesses. It learns from the result.
Press "Show guess" to see what the model predicts.
0
Sentences seen
0
Correct guesses
0%
Accuracy
Model improvement (simulated)0%
04 Try it, type a prompt

Type anything below. Watch how the AI generates one word at a time, each word becoming context for the next one.

Output will appear here...
05 So why is it so accurate?

People assume accuracy means intelligence. It doesn't, it means really well-compressed patterns. Here's why it works so well.

📚
Scale of training
It read hundreds of billions of words, textbooks, Wikipedia, research papers, code, conversations. For most topics you'll ask about, it has seen thousands of examples of humans explaining them correctly.
🕸️
Context awareness
Every word you write narrows the prediction. "Capital of France" → "Paris" is overwhelmingly likely. The more specific your question, the more the context pulls it toward the right answer.
🔁
Pattern compression
After enough training, the model stops memorising and starts compressing patterns. It learns that "symptom → disease → treatment" is a structure that appears in medical text. It can apply that structure to new questions.
🎯
RLHF fine-tuning
After base training, humans rated thousands of responses, helpful vs. not helpful, accurate vs. wrong. The model was then trained again to prefer the patterns that humans rated highly.
06 Common misconceptions

Things most people believe, and what's actually true.

"The AI understands what I'm saying"
It has no understanding. It produces text that looks like understanding because it trained on text written by people who did understand. The output is convincing; the process behind it is purely statistical.
"It looks things up like a search engine"
It doesn't search anything at runtime. All knowledge is baked into the weights during training. When it answers a question, it's retrieving compressed patterns, not fetching a webpage.
"It remembers our previous conversations"
By default, every new conversation starts completely fresh. It has no memory between sessions. It only knows what's in the current conversation window, which is why context you give it matters so much.
"If it says something confidently, it must be right"
Confidence is a style, not a signal of accuracy. The model learned that confident-sounding text is what humans write when they know things, so it reproduces that style even when it's wrong. Always verify important facts.
"It chooses the best word every time"
It randomly samples from a weighted distribution, that's temperature and top_p at work. The most probable word doesn't always win. This is intentional: it's what makes responses feel natural, not robotic.