AI Model Wiki

    Skip to main content
    Back to Glossary

    In Context Learning

    In-context learning (ICL) is the ability of a pretrained language model to perform a new task at inference time by conditioning on examples or instructions placed directly in the prompt, without any update to the model's weights. Unlike Fine-tuning, which permanently adjusts the model's parameters on new data, ICL is entirely ephemeral — the "learning" happens within the forward pass and disappears when the context window closes. The capability emerges at scale: smaller models show limited ICL ability, while large models demonstrate it strongly, suggesting it arises from patterns internalized during Pretraining on diverse text.

    Think of it like handing a skilled generalist a one-page briefing before a meeting: they don't change who they are, but they adjust their behavior for the next hour based purely on what you just told them. Once the meeting ends and the briefing is gone, they revert to their default.

    The most common form of ICL is few-shot prompting, where two to five worked examples are placed before the actual query. For example: "Translate English to French. English: The cat sat on the mat. French: Le chat s'est assis sur le tapis. English: She opened the window. French:" — the model infers the task format from the examples and completes the final line without any French translation training signal during this call. Zero-Shot learning is ICL without any examples — relying solely on a task description.

    ICL is closely tied to Prompt Engineering, Context Window size (more examples require more room), and Chain of Thought prompting, which extends ICL by demonstrating intermediate reasoning steps rather than just input-output pairs. RLHF training improves a model's ability to interpret and follow ICL instructions reliably.

    You will encounter in-context learning whenever you write a prompt that includes examples, when reading research on emergent capabilities of large models, or when designing agent workflows that adapt model behavior through system prompts rather than retraining.

    AI Terminology
    Glossary