Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models
Not on the map. Why?
Abstract (arXiv)
In-context learning has become a popular paradigm in natural language processing. However, its performance can be significantly influenced by the order of in-context demonstration examples. In this paper, we found that causal language models (CausalLMs) are more sensitive to this order compared to prefix language models (PrefixLMs). We attribute this phenomenon to the auto-regressive attention masks within CausalLMs, which restrict each token from accessing information from subsequent tokens. This results in different receptive fields for samples at different positions, thereby leading to representation disparities across positions. To tackle this challenge, we introduce an unsupervised fine-tuning method, termed the Information-Augmented and Consistency-Enhanced approach. This approach utilizes contrastive learning to align representations of in-context examples across different positions and introduces a consistency loss to ensure similar representations for inputs with different permutations. This enhances the model's predictive consistency across permutations. Experimental results on five benchmarks suggest that our proposed method can reduce the sensitivity of CausalLMs to the order of in-context examples and exhibit robust generalizability, particularly when demonstrations are sourced from a candidate pool different from that used in the training phase, or when the number of in-context examples differs from what is used during training.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). Builds on 28 of its 35 references that are in the map. First posted on arXiv 23 Feb 2024.
Builds on
28 of 35 references.
References · 28
- 2017Attention Is All You Needcited by 59,932
- 2014Adam: A Method for Stochastic Optimizationcited by 36,960
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
- 2020Measuring Massive Multitask Language Understandingcited by 7,768
- 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
- 2016Gaussian Error Linear Units (GELUs)cited by 3,431
16 more
- 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
- 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
- 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
- 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
- 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
- 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 973
- 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
- 2022Active Example Selection for In-Context Learningcited by 195
- 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 158
- 2023Finding Support Examples for In-Context Learningcited by 104
- 2023Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performancecited by 102
- 2023In-context Example Selection with Influencescited by 60
- 2022Data Curation Alone Can Stabilize In-context Learningcited by 58
- 2023How Do In-Context Examples Affect Compositional Generalization?cited by 51
- 2023RetICL: Sequential Retrieval of In-Context Examples with Reinforcement Learningcited by 24
Built on by
Citing papers per year: 2024: 3; 2025: 5; 2026: 4.
12 papers.
- 2024Many-Shot In-Context Learningcited by 203
- 2025SciReplicate-Bench: Benchmarking LLMs in Agent-driven Algorithmic Reproduction from Research Paperscited by 42
- 2024What Factors Affect Multi-Modal In-Context Learning? An In-Depth Explorationcited by 31
- 2024AdaCQR: Enhancing Query Reformulation for Conversational Search via Sparse and Dense Retrieval Alignmentcited by 14
- 2025Rethinking Invariance in In-context Learningcited by 8
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attentioncited by 8
- 2025Mimicking or Reasoning: Rethinking Multi-Modal In-Context Learning in Vision-Language Modelscited by 7
- 2025Learning-to-Context Slope: Evaluating In-Context Learning Effectiveness Beyond Performance Illusionscited by 1
- 2026PLR: Plackett-Luce for Reordering In-Context Learning Examplescited by 1
- 2026Towards Reliable, Generalizable, and Specific In-Context Knowledge Editing via Multi-Objective Reinforcement Learningcited by 1
- 2026Soft-Prompt Tuning for Fair and Efficient LLM Benchmark Evaluationcited by 0
- 2026Equal Ranking Quality, Different Decisions: Measuring and Reducing Order Dependence in LLM Scorerscited by 0
- 2026Equal Ranking Quality, Different Decisions: Measuring and Reducing Order Dependence in LLM Scorers27 Aug 2026
- 2026Towards Reliable, Generalizable, and Specific In-Context Knowledge Editing via Multi-Objective Reinforcement Learning25 Aug 2026
- 2026Soft-Prompt Tuning for Fair and Efficient LLM Benchmark Evaluation10 Jun 2026
- 2026PLR: Plackett-Luce for Reordering In-Context Learning Examples22 Mar 2026
- 2025Train Once, Reuse Everywhere: Generalizable Implicit In-Context Learning by Routing Attention26 Sep 2025
- 2025Learning-to-Context Slope: Evaluating In-Context Learning Effectiveness Beyond Performance Illusions29 Jun 2025
- 2025Mimicking or Reasoning: Rethinking Multi-Modal In-Context Learning in Vision-Language Models9 Jun 2025
- 2025Rethinking Invariance in In-context Learning8 May 2025
- 2025SciReplicate-Bench: Benchmarking LLMs in Agent-driven Algorithmic Reproduction from Research Papers31 Mar 2025
- 2024What Factors Affect Multi-Modal In-Context Learning? An In-Depth Exploration27 Oct 2024
- 2024AdaCQR: Enhancing Query Reformulation for Conversational Search via Sparse and Dense Retrieval Alignment2 Jul 2024
- 2024Many-Shot In-Context Learning17 Apr 2024