mlsanityData to 14 Oct 2026

When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning

arXiv 2605.26350 ↗First posted 25 May 2026cs.LG cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) is often motivated by the intuition that demonstrations help because they provide correct input-output examples. However, we reveal a counterintuitive phenomenon: correctness does not guarantee exemplar utility, and some correct demonstrations can even reduce ICL accuracy. To study this correctness-utility gap, we introduce task-preserving perturbations, where only the exemplar input is changed, while the example remains a correct instance of the same task. Concretely, each perturbed exemplar is assigned the target induced by the task mapping. This framework covers both label-updating perturbations, where task-relevant semantics change and targets are recomputed, and stricter target-preserving perturbations, where the original target remains valid. We formalize the resulting failure mode as contextual evidence shift: task-preserving perturbations can change the effective mixture of evidence used by the model for contextual inference, thereby separating exemplar correctness from exemplar utility. Across sentiment classification, logical reasoning, and math word problems, we find that task-preserving perturbed demonstrations can substantially degrade ICL performance, especially for smaller models, harder tasks, and higher perturbation ratios. Our results show that robust ICL requires evaluating not only whether demonstrations are correct, but also how they influence contextual inference. Code is available at https://github.com/Chenghao-Qiu/Task-Preserving-ICL.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 33 of its 36 references that are in the map. First posted on arXiv 25 May 2026.

Builds on

33 of 36 references.

References · 33

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2024The Llama 3 Herd of Modelscited by 14,715
  4. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  6. 2025DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learningcited by 6,330
  7. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  8. 2024Qwen2.5 Technical Reportcited by 4,942
  9. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  10. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  11. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,195
  12. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,135
21 more
  1. 2022Transformers learn in-context by gradient descentcited by 732
  2. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  3. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  4. 2021Learning To Retrieve Prompts for In-Context Learningcited by 648
  5. 2023Larger language models do in-context learning differentlycited by 394
  6. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  7. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
  8. 2022Selective Annotation Makes Language Models Better Few-Shot Learnerscited by 243
  9. 2021Adversarial GLUE: A Multi-Task Benchmark for Robustness Evaluation of Language Modelscited by 232
  10. 2022Active Example Selection for In-Context Learningcited by 196
  11. 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 146
  12. 2023Finding Support Examples for In-Context Learningcited by 104
  13. 2023In-Context Learning through the Bayesian Prismcited by 83
  14. 2023Adversarial Demonstration Attacks on Large Language Modelscited by 63
  15. 2023In-context Example Selection with Influencescited by 61
  16. 2023Coverage-based Example Selection for In-Context Learningcited by 59
  17. 2023Hijacking Large Language Models via Adversarial In-Context Learningcited by 45
  18. 2024Why Larger Language Models Do In-context Learning Differently?cited by 45
  19. 2025Large Language Models Meet Symbolic Provers for Logical Reasoning Evaluationcited by 28
  20. 2023Understanding Emergent In-Context Learning from a Kernel Regression Perspectivecited by 24
  21. 2024Cutting Through the Noise: Boosting LLM Performance on Math Word Problemscited by 14

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2023Towards Understanding In-Context Learning with Contrastive Demonstrations and Saliency Maps
  2. 2025Is In-Context Learning Learning?
  3. 2026How Few-Shot Examples Add Up: A Causal Decomposition of Function Vectors in In-Context Learning
  4. 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
  5. 2025On the Relationship Between the Choice of Representation and In-Context Learning
  6. 2022Can In-context Learners Learn a Reasoning Concept from Demonstrations?
  7. 2026Understanding the Dynamics of Demonstration Conflict in In-Context Learning
  8. 2024From Introspection to Best Practices: Principled Analysis of Demonstrations in Multimodal In-Context Learning