AI Glossary Term

What does “In-Context Learning” mean?

Definition

A model's ability to follow patterns from examples provided directly in the prompt.

How In-Context Learning works

Diagram for In-Context Learning, steps in order: Prompt contains examples of the task; then Model reads the pattern; then New input appended; then Output follows the pattern, no weights change.Prompt contains examples of the taskModel reads the patternNew input appendedOutput follows the pattern, no weightschange

Example

You paste three examples of converting messy dates to ISO format and then a fourth messy date. The model returns it correctly formatted, even though it was never retrained for that task.

Why it matters

It lets non-experts adapt models just by writing prompts. The adaptation lasts only for that conversation.

Common questions

Does the model really learn?

Its weights stay unchanged. It uses the examples as context during that request, so nothing is kept afterward.

How is it related to few-shot learning?

Few-shot prompting is the most common way to use in-context learning.

Does it always work?

No. Performance depends on the model, the task, and how clear and relevant the examples are.

Learn more in our free guides

Test yourself

See also