mlsanityData to 7 Oct 2026

Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models

arXiv 2402.15637 ↗First posted 23 Feb 2024cs.CLcited by 12

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2014Adam: A Method for Stochastic Optimizationcited by 36,960
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  6. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  7. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  8. 2023Judging LLM-as-a-Judge with MT-Bench and Chatbot Arenacited by 8,393
  9. 2020Measuring Massive Multitask Language Understandingcited by 7,768
  10. 2018GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understandingcited by 4,854
  11. 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,464
  12. 2016Gaussian Error Linear Units (GELUs)cited by 3,431
16 more
  1. 2023Lost in the Middle: How Language Models Use Long Contextscited by 3,383
  2. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,413
  3. 2021Calibrate Before Use: Improving Few-Shot Performance of Language Modelscited by 1,371
  4. 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
  5. 2021What Makes Good In-Context Examples for GPT-3?cited by 1,184
  6. 2021Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivitycited by 1,122
  7. 2020MPNet: Masked and Permuted Pre-training for Language Understandingcited by 973
  8. 2019Analysing Mathematical Reasoning Abilities of Neural Modelscited by 331
  9. 2022Active Example Selection for In-Context Learningcited by 195
  10. 2022Self-Adaptive In-Context Learning: An Information Compression Perspective for In-Context Example Selection and Orderingcited by 158
  11. 2023Finding Support Examples for In-Context Learningcited by 104
  12. 2023Chain-of-Thought Hub: A Continuous Effort to Measure Large Language Models' Reasoning Performancecited by 102
  13. 2023In-context Example Selection with Influencescited by 60
  14. 2022Data Curation Alone Can Stabilize In-context Learningcited by 58
  15. 2023How Do In-Context Examples Affect Compositional Generalization?cited by 51
  16. 2023RetICL: Sequential Retrieval of In-Context Examples with Reinforcement Learningcited by 24

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 3; 2025: 5; 2026: 4.

12 papers.