Lune

EMNLP2025顶会

Where to show Demos in Your Prompt: A Positional Bias of In-Context Learning

Kwesi A. Cobbina, Tianyi Zhou

摘要

In-context learning (ICL) is a critical emerging capability of large language models (LLMs), enabling few-shot learning during inference by including a few demonstrations (demos) in the prompt. However, it has been found that ICL's performance can be sensitive to the choices of demos and their order. This paper investigates an unexplored new positional bias of ICL for the first time: we observe that the predictions and accuracy can drift drastically when the positions of demos, system prompt, and user message in LLM input are varied. This bias, we refer to as DEMOS' POSITION IN PROMPT bias (DPP bias). We design a systematic evaluation pipeline to study this type of positional bias across classification, QA, summarization, and reasoning tasks. We introduce two metrics, ACCURACY-CHANGE and PREDICTION-CHANGE, to quantify net gains and output volatility induced by demos' position change. Extensive experiments on ten LLMs from four open-source model families (QWEN, LLAMA3, MISTRAL, COHERE) verify that the bias significantly affects their accuracy and predictions: placing demos at the start of prompt yields the most stable and accurate outputs with gains of up to +6 points. In contrast, placing demos at the end of the user message flips over 30% of predictions without improving correctness in QA tasks. Smaller models are most affected by this sensitivity, though even large models do remain marginally affected on complex tasks.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 3 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Efficient Streaming Language Models with Attention Sinks 引用了 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • In-Context Learning as Rate–Distortion Optimization 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Fair-CCD: Mitigating Bias in Large Language Models for Tabular Classification Through Context-Contrastive Decoding 引用了 Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Chain-of-Thought Prompting Elicits Reasoning in Large Language Models 引用了 Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Efficient Reasoning with Balanced Thinking 引用了 Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper3

  1. Efficient Reasoning with Balanced ThinkingYulin Li, Tengyao Tu, Li Ding, Junjie Wang 等ICLR 2026 · 7 次引用
  2. In-Context Learning as Rate–Distortion OptimizationJiayu Zhang, Changbang Li, Canran XiaoICML 2026
  3. Fair-CCD: Mitigating Bias in Large Language Models for Tabular Classification Through Context-Contrastive DecodingDonghan Liu, Han Sun, Zhaohui Wang, Qin Li 等ACL 2026

它引用的 Paper11

  1. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma 等NeurIPS 2022 · 22,562 次引用
  2. FlashAttention-2: Faster Attention with Better Parallelism and Work PartitioningTri DaoICLR 2024 · 2,600 次引用
  3. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein 等ICML 2021 · 1,843 次引用
  4. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han 等ICLR 2024 · 1,714 次引用
  5. Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel 等ACL 2022 · 1,494 次引用

相关 Paper

  1. Characterizing Positional Bias in Large Language Models: A Multi-Model Evaluation of Prompt Order EffectsPatrick Schilcher, Dominik Karasin, Michael Schöpf, Haisam Saleh 等EMNLP Findings 2025 · 1 次引用
  2. How Many Demonstrations Do You Need for In-context Learning?Jiuhai Chen, Lichang Chen, Chen Zhu, Tianyi ZhouEMNLP Findings 2023 · 12 次引用
  3. Rapid Selection and Ordering of In-Context Demonstrations via Prompt Embedding ClusteringKha Pham, Hung Le, Man Ngo, Truyen TranICLR 2025
  4. Hierarchical Demonstration Order Optimization for Many-shot In-Context LearningYinhan He, Wendy Zheng, Song Wang, Zaiyi Zheng 等NeurIPS 2025 · 2 次引用
  5. Selecting Demonstrations for Many-Shot In-Context Learning via Gradient MatchingJianfei Zhang, Bei Li, Jun Bai, Rumei Li 等ACL Findings 2025
黄昏的海面,两侧是细线勾勒的悬崖