In-context learning
In-context learning is when a language model adapts its behaviour from examples shown in the prompt — no weights change, no fine-tuning.
In more detail
What it means
In-context learning (ICL) is the foundation of every prompting technique that supplies demonstrations. Few-shot prompting is the most common form. The model uses the examples as a soft specification of the task and generalises from them at inference time. ICL works because pretrained models have learned to model the underlying distribution well enough that a handful of examples shifts their behaviour meaningfully. Long-context models (Gemini Pro, Claude with long context) now support 'many-shot' ICL — hundreds of examples — which can approach fine-tune quality for narrow tasks without changing weights.
Part 1 of 2
When to use it, and when not
Use it for
- Steering tone, format, or domain-specific style.
- When you cannot fine-tune (closed model, low data).
- Tasks with edge cases that zero-shot keeps missing.
Part 2 of 2
Common mistakes
- Using non-representative examples.
- Forgetting that ICL is sensitive to example ORDER, not just content.
FAQ
Questions readers ask.
What is in-context learning?
In-context learning is when a language model adapts its behaviour from examples shown in the prompt — no weights change, no fine-tuning.
When should you use in-context learning?
Steering tone, format, or domain-specific style. When you cannot fine-tune (closed model, low data). Tasks with edge cases that zero-shot keeps missing.
What are the common mistakes with in-context learning?
Using non-representative examples. Forgetting that ICL is sensitive to example ORDER, not just content.
Last updated: 2026-11-15. Raw markdown: https://promtable.com/glossary/in-context-learning.md. Found a mistake? Tell us.