In-context learning (ICL) is often treated as a reliable lever for boosting large language model (LLM) performance. The intuition seems straightforward: by providing a few examples (few-shot prompting), we give the model a behavioral compass, clarifying the task's format, style, and underlying logic.
However, a growing body of research reveals a counterintuitive phenomenon: adding few-shot examples can paradoxically degrade a model's performance compared to a zero-shot baseline. Rather than clarifying the task, demonstrations can introduce contextual interference, distract the model's attention, and conflict with its internal training.
To understand why this happens, we must look at how few-shot examples interact with a model's alignment, its attention allocation, and the logical consistency of the prompt.
The Alignment Tradeoff: Instruction Tuning vs. In-Context Learning
The first reason few-shot examples fail stems from a fundamental tension between how models are trained and how they are prompted. Modern LLMs undergo extensive instruction tuning and Supervised Fine-Tuning (SFT) to make them helpful, zero-shot conversational partners. This optimization, however, can come at the expense of their ability to learn from context.
When a model is heavily optimized for dialogue, it learns to overfit to instruction-only formats. As Yuzhen Huang et al. demonstrate in C-Eval: A Multi-Level Multi-Discipline Chinese Evaluation Suite for Foundation Models, conversational models frequently experience performance declines when presented with few-shot exemplars. The structured, example-based format conflicts with the chat-based optimization the model received during alignment. This pattern is echoed by Ashmari Pramodya et al. in SinhalaMMLU: A Comprehensive Benchmark for Evaluating Multitask Language Understanding in Sinhala and Sshubam Verma et al. in MILU: A Multi-task Indic Language Understanding Benchmark, who note that instruction-tuned models often prioritize conversational patterns over the specific structural cues provided in few-shot prompts, leading to performance stagnation or outright drops.
Standard Pipeline:
[Pre-training] ──> [Instruction Tuning] ──> Overfits to direct instructions
└──> Struggles to process few-shot context
A similar friction occurs when models undergo task-specific specialization. Fine-tuning updates a model's internal parametric memory, but it can degrade its non-parametric flexibility (its ability to use context). Dawei Gao et al. observed this in Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation, noting that specialized parameter updates cause a decline in the model's capacity for in-context learning, making it ignore or become confused by external demonstrations.
When a model is forced to choose between its newly minted internal parameters and the external examples in a prompt, it often defaults to its internal weights. As Chen Li et al. argue in Towards Demonstration-Aware Large Language Models for Machine Translation, standard fine-tuned models become biased toward their internal parameters, causing few-shot demonstrations to actively decrease performance compared to zero-shot inference.
Contextual Noise and Meta-Task Distraction
The second mechanism behind few-shot degradation is informational noise. In an ideal scenario, a model extracts the abstract pattern connecting the few-shot examples. In reality, the model often latches onto surface-level features—like style, length, or specific vocabulary—and prioritizes them over the actual instructions.
For example, when a task requires a model to perform meta-analysis (such as evaluating text or instructions), the few-shot examples themselves contain text that acts as a powerful distractor. In Find the Intention of Instruction: Comprehensive Evaluation of Instruction Understanding for Large Language Models, Hyeonseok Moon et al. show that providing few-shot examples introduces an inverse relationship between context length and accuracy. Because the examples contain instruction-formatted text, the model struggles to distinguish between the meta-instruction it is supposed to execute and the content within the examples.
Prompt Structure with High Distraction:
┌────────────────────────────────────────────────────────┐
│ Meta-Instruction: "Identify the intent of the text." │
├────────────────────────────────────────────────────────┤
│ Example 1: Text: "Write a poem" -> Intent: Generation │ <-- Distractor: Model's attention
│ Example 2: Text: "Solve for X" -> Intent: Math │ latches onto "Write a poem"
├────────────────────────────────────────────────────────┤
│ Target Query: Text: "Summarize this report" │
└────────────────────────────────────────────────────────┘
This distraction manifests in several ways across different domains:
- Constraint Satisfaction: Jiao Sun et al. in Evaluating Large Language Models on Controlled Generation Tasks found that providing examples for numerical planning tasks causes models to mimic the length and style of the examples, completely overriding the explicit numerical constraints given in the prompt.
- Open-Ended Evaluation: In Help Me Write a Story: Evaluating LLMs' Ability to Generate Writing Feedback, Elizabeth Clark et al. found that few-shot prompting causes models to copy specific advice directly from the examples rather than performing a novel analysis on the input text.
- Model Capacity Constraints: Smaller or open-source models are particularly vulnerable to this noise. As shown by Xinlin Zhuang et al. in TOREE: Evaluating Topic Relevance of Student Essays for Chinese Primary and Middle School Education and Amir Zait et al. in The Ability of Large Language Models to Evaluate Constraint-satisfaction in Agent Responses to Open-ended Requests, out-of-context or complex examples easily overwhelm a smaller model's limited context window, confusing its internal reasoning process and making zero-shot prompting significantly more reliable.
Concept Shift and the 'Poison Pill' Effect
The final mechanism involves the logical relationship between the examples and the target query. For ICL to work, the underlying "rules" governing the examples must perfectly align with the target task. If there is a mismatch—or if the task requires non-repeating logic—few-shot examples act as a trap.
In Generalization vs Specialization under Concept Shift, Alex Nguyen et al. mathematically explore how concept shift—where the underlying rules change between the provided context and the test instance—turns context into a liability. When a concept shift occurs, increasing the context length actively degrades predictive accuracy because it forces the transformer architecture to adhere to patterns that are completely irrelevant to the target query.
This is particularly devastating in lateral thinking or puzzle-solving tasks. Akshett Rai Jindal et al. demonstrate this in DaVinci at SemEval-2024 Task 9: Few-shot prompting GPT-3.5 for Unconventional Reasoning. When a task consists of problems with non-repeating logical pivots (where the trick to solving Puzzle A has nothing to do with Puzzle B), few-shot examples cause the model to overfit to the specific logic of the examples, destroying its zero-shot capacity to find a novel solution.
Ultimately, this can culminate in what Jiayu Liu et al. term the "poison pill" effect in What Makes In-context Learning Effective for Mathematical Reasoning. In complex reasoning tasks, a single misleading, static, or slightly misaligned demonstration can completely derail a model's internal reasoning path, causing it to fail a problem it would have easily solved in a zero-shot setting.
Designing Around the Pitfalls
Understanding why few-shot prompting fails shifts our engineering focus from blindly adding examples to dynamically managing context. To prevent performance degradation, recent architectures and frameworks rely on three main paradigms:
- Dynamic, Automated Retrieval: Instead of static examples, systems like the one proposed by Daixuan Cheng et al. in UPRISE: Universal Prompt Retrieval for Improving Zero-Shot Evaluation use a lightweight retriever model to dynamically select examples tailored to the specific query, minimizing formatting and domain interference.
- Contextual Rejection Mechanisms: To counter the "poison pill" effect, researchers have introduced selection frameworks that evaluate internal model stability. If a few-shot example is predicted to disrupt the model's reasoning path, a rejection mechanism dynamically filters it out, defaulting to a zero-shot structure.
- Autonomous In-Context Generation: Rather than relying on human-annotated parallel data that might introduce out-of-domain noise, methods like the one introduced by Dohyun Lee et al. in Exploring In-context Example Generation for Machine Translation allow the model to autonomously generate its own highly relevant, dynamic in-context examples on the fly, ensuring alignment with its internal priors.
Few-shot prompting is not a guaranteed upgrade. When designing prompts for complex reasoning, instruction analysis, or highly aligned models, treating context as a precious, potentially noisy resource is essential to keeping models on track.
Key Foundational Work
TAPE: Assessing Few-shot Russian Language Understanding (2022) — contributed 2 concept elements to this direction.
Extractive Summarization via ChatGPT for Faithful Summary Generation (2023) — contributed 1 concept elements to this direction.
Text-to-SQL Empowered by Large Language Models: A Benchmark Evaluation (2023) — contributed 1 concept elements to this direction.