Prompting · 5 Interactives

The Skill That Lives in Your Prompt

Show a language model three examples of a task it has never been trained on, and it suddenly performs the task — with zero weight updates. Nothing inside the model changed. The "learning" lives entirely in the prompt, and dies with it. The five machines below let you feel exactly how that trick works, and how it breaks.

Few-shot climb Hypothesis collapse Format matters Poisoned examples The amnesia test
EP 01

Zero training, five examples — watch accuracy climb

The task: reverse the word. Our little in-page learner has never been told this rule — it only sees whatever example pairs you put in the prompt, and must guess the pattern. Give it 0, 1, 3 or 5 examples and watch it grade itself on six fresh test words. The accuracy number is computed live from the learner's actual beliefs, not scripted.

Simulated Bayesian pattern-learner, not a real LLM — but the shape of the curve (useless → shaky → locked-in) is exactly what few-shot curves look like in GPT-class models.

The punchline: nothing was trained. The same frozen network goes from ~7% to ~95% on a made-up task purely because the prompt contains demonstrations. This is why "few-shot prompting" was the headline result of the GPT-3 paper — the prompt became the new training set.
EP 02

Inside the guess — watch wrong theories die

How can examples "teach" a frozen model? Think of the model as holding many candidate theories at once — echo the word, uppercase it, reverse it, take the first letter… Each example you feed is evidence, and every theory that contradicts it gets killed. Pick a secret rule, feed examples one at a time, and watch the survivor emerge. Notice: ambiguous examples keep several theories alive; sharp ones massacre them.

No examples yet — every theory is still on the table.

The bars are the learner's live posterior: prior belief × consistency with every example so far. Struck-out theories have been contradicted by at least one example.

The mental model: in-context learning is closer to recognition than training — pretraining stocked the shelf with patterns, and your examples point at one. This is why ICL works instantly and why it can only select behaviors the model already contains.
EP 03

Same examples, messy handwriting — format is half the trick

Here are the exact same four demonstrations written two ways: a clean, consistent input → output layout, and a sloppy version with random separators and stray capitals. The information content is identical — but the learner can only use an example it can parse. Toggle between them and compare the expected accuracy (estimated live from 800 simulated readings of the prompt).

Pick a format above.

In the simulation each messy example is sometimes skipped and sometimes mis-read as evidence for the wrong rule (those stray CAPITALS whisper "uppercase!"). Real LLMs degrade the same way when demonstrations are inconsistently formatted.

Why prompt engineers obsess over delimiters: demonstrations only teach if the model can tell where input ends and output begins. Consistent arrows, colons or JSON keys aren't cosmetic — they are the difference between five examples of evidence and two.
EP 04

Poison the well — contradictory examples kill the pattern

Five clean demonstrations of the reverse rule. Click any card to corrupt it — its output flips to UPPERCASE, a contradictory pattern. One bad example barely matters. Two make the learner wobble. Three, and it flips to the wrong rule entirely. All numbers below are recomputed live from the poisoned prompt.

The real-world version: mislabeled rows in your few-shot prompt, or a RAG snippet that contradicts your instructions, do exactly this to production LLMs. ICL has no way to know which examples are wrong — it just fits whatever pattern explains most of them.
EP 05

The amnesia test — clear the chat, lose the skill

If the model really learned reversal, the skill should survive a new chat. Run the test: ask with the examples in context, then wipe the context and ask again. Watch the answer — and watch the weights checksum, a fingerprint of every parameter in the model, recomputed after each run.

The weights grid on the left never changes. Run both buttons and check.

The checksum is genuinely computed from the (frozen) weight array each time you click — it is identical before and after "learning" because nothing was ever written.

Learning without learning: gradient descent writes to the weights; in-context learning only reads them. That's why your carefully-taught ChatGPT trick evaporates in a new conversation — and why context windows, RAG and memory features exist: they re-inject the "skill" on every single request.
Keep playing
Language Models
Perplexity
How surprised is the model? Measure it
Language Models
Chain-of-Thought
Why writing the steps changes what it can solve