arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2402.15637cs.CL
收藏

解决因果语言模型中上下文演示示例的顺序敏感性问题

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

King’s College London(伦敦国王学院);The Alan Turing Institute(阿兰·图灵研究所)

Yanzheng Xiang, Hanqi Yan, Lin Gui, Yulan He

AI总结:

本文针对因果语言模型对上下文示例顺序敏感的问题,提出一种基于对比学习和一致性损失的无监督微调方法,通过对齐不同位置的表示并增强排列间预测一致性,在多个基准上有效降低了顺序敏感性并提升了泛化能力。

摘要:

上下文学习已成为自然语言处理中的一种流行范式。然而,其性能可能受到上下文演示示例顺序的显著影响。在本文中,我们发现因果语言模型(CausalLMs)与前缀语言模型(PrefixLMs)相比,对这一顺序更为敏感。我们将这一现象归因于因果语言模型内部的自回归注意力掩码,这些掩码限制每个标记无法获取后续标记的信息。这导致不同位置的样本具有不同的感受野,从而造成跨位置的表示差异。为应对这一挑战,我们提出了一种无监督微调方法,称为信息增强与一致性增强方法(Information-Augmented and Consistency-Enhanced approach)。该方法利用对比学习来对齐上下文示例在不同位置上的表示,并引入一致性损失,以确保不同排列下的输入具有相似的表示。这增强了模型在不同排列下的预测一致性。在五个基准上的实验结果表明,我们提出的方法能够降低因果语言模型对上下文示例顺序的敏感性,并展现出稳健的泛化能力,特别是当演示示例来自与训练阶段所用不同的候选池时,或者当上下文示例的数量与训练期间使用的数量不同时。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑