Home Tools Glossary In-context Learning
Technique

In-context Learning

LLM In-Context Learning

/in-kon-tekst lur-ning/

The ability of large language models to learn and adapt to new tasks dynamically from examples provided in the prompt.

In plain English
When you give an AI instructions and examples in your prompt and it instantly figures out the task without needing any software updates, that is in-context learning. It uses its general knowledge to adapt on the fly during a single chat session.
Real-world example
Instructing an LLM to parse messy email headers into JSON format using three prompt examples.
Technical definition
In-context learning refers to the emergent phenomenon where pre-trained language models perform downstream tasks by conditioning on prompt sequences containing instructions and exemplars, without updating gradient parameters. Research suggests this mimics implicit meta-optimization within the forward pass activations of attention layers. It powers zero-shot and few-shot inference workflows.