Skip to main content
Interactive 3D/In-Context Learning & Few-Shot Prompting
Task
N-Shots
Shots0
Temperature
Temp1.0
How it works
More examples in the prompt → model learns the pattern without any gradient updates.
Accuracy @ 0-shot
51%
P(correct class)
--%

In-Context Learning & Few-Shot Prompting - Interactive Visualization

In-context learning lets LLMs adapt to new tasks at inference time by including examples in the prompt - no weight updates needed. Adding even 1-5 demonstrations shifts the output distribution toward the desired behavior, with diminishing returns beyond ~8 shots. This demo shows how accuracy improves as you add more examples.

  • Zero-shot vs few-shot: see the accuracy gap when zero examples are provided versus 1, 2, 4, and 8
  • Diminishing returns curve: accuracy gains shrink as shot count increases beyond 4-8 examples
  • Output distribution shift: watch how the model prediction changes as demonstrations accumulate
  • Task adaptation at inference time: no gradient updates or fine-tuning required

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.