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

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Xiang, Yanzheng, Yan, Hanqi, Gui, Lin, He, Yulan
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916276507508736
author Xiang, Yanzheng
Yan, Hanqi
Gui, Lin
He, Yulan
author_facet Xiang, Yanzheng
Yan, Hanqi
Gui, Lin
He, Yulan
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2402_15637
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models
Xiang, Yanzheng
Yan, Hanqi
Gui, Lin
He, Yulan
Computation and Language
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.
title Addressing Order Sensitivity of In-Context Demonstration Examples in Causal Language Models
topic Computation and Language
url https://arxiv.org/abs/2402.15637