Definition
In-context learning is a model’s ability to follow a task pattern supplied in the current input without changing its weights. The input can include task instructions, demonstrations, format examples, or other cues about the behavior to perform. The model uses those tokens to generate a response. No training step occurs.
Zero-shot, one-shot, and few-shot describe how many demonstrations the input contains: none, one, or a small set.
Simple example
An application needs to classify support messages as billing, technical, or account. Its prompt contains three reviewed input-output examples, one for each label, followed by a new message. The model returns a label by continuing the demonstrated pattern.
Removing those examples from the next model input also removes their direct influence unless the application includes them again, for example as part of conversation history.
Why it matters
Teams can change instructions, examples, and output formats without a training job. This helps with prototyping and tasks that have few examples. An application can also keep its task definition in configuration.
In-context learning uses request tokens and context capacity. Long example sets leave less input room for user messages, retrieved evidence, and tool definitions. If input and output share a total sequence limit, they can also leave less room for the answer.
One important nuance
In-context learning is not fine-tuning. It does not persist new behavior in model weights. Results can change with example choice, order, wording, and how closely the examples match real inputs. Choose representative examples and test the complete prompt. Examples do not enforce requirements. Validate outputs and enforce permissions in application code.