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

上下文学习的生成式校准

Generative Calibration for In-context Learning

Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Meituan(美团);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)

Zhongtao Jiang, Yuanzhe Zhang, Cao Liu, Jun Zhao, Kang Liu

AI总结:

本文提出生成式校准方法,通过蒙特卡洛采样调整标签边际,解决上下文学习对提示配置敏感的问题,在12个任务和12个LLM上显著提升宏F1,最高达27%。

摘要:

作为大型语言模型(LLMs)最令人兴奋的特性之一,上下文学习是一把双刃剑。虽然它允许用户仅凭少量训练示例快速构建任务求解器原型,但其性能通常对提示的各种配置(如训练示例的选择或顺序)敏感。在本文中,我们首次从理论和实证上识别出,这种悖论主要源于上下文模型相对于数据分布的标签偏移,即LLMs在具有良好标签条件$p(x|y)$的同时,偏移了标签边际$p(y)$。基于这一理解,我们可以通过调整标签边际来简单校准上下文预测分布,该边际通过上下文模型上的蒙特卡洛采样(即LLMs的生成)来估计。我们将此方法称为生成式校准。我们使用12个文本分类任务和12个规模从774M到33B的LLMs进行了详尽的实验,普遍发现所提方法在宏F1上大幅且一致地优于ICL及最先进的校准方法,最高提升达27%的绝对值。同时,所提方法在不同提示配置下也保持稳定。

英文摘要:

As one of the most exciting features of large language models (LLMs), in-context learning is a mixed blessing. While it allows users to fast-prototype a task solver with only a few training examples, the performance is generally sensitive to various configurations of the prompt such as the choice or order of the training examples. In this paper, we for the first time theoretically and empirically identify that such a paradox is mainly due to the label shift of the in-context model to the data distribution, in which LLMs shift the label marginal $p(y)$ while having a good label conditional $p(x|y)$. With this understanding, we can simply calibrate the in-context predictive distribution by adjusting the label marginal, which is estimated via Monte-Carlo sampling over the in-context model, i.e., generation of LLMs. We call our approach as generative calibration. We conduct exhaustive experiments with 12 text classification tasks and 12 LLMs scaling from 774M to 33B, generally find that the proposed method greatly and consistently outperforms the ICL as well as state-of-the-art calibration methods, by up to 27% absolute in macro-F1. Meanwhile, the proposed method is also stable under different prompt configurations.

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

↑