concept

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-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 2 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.

When to use in-context learning

Common mistakes

FAQ

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 I 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 most common mistakes with in-context learning?

Using non-representative examples. Forgetting that ICL is sensitive to example ORDER, not just content.

Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/in-context-learning.md.