Skip to main content
QUICK REVIEW

[论文解读] Towards Understanding In-Context Learning with Contrastive Demonstrations and Saliency Maps

Fuxiao Liu, Paiheng Xu|arXiv (Cornell University)|Jul 11, 2023
Topic Modeling被引用 5
一句话总结

本文通过对比演示和显著性图,研究了大语言模型(LLMs)中少样本学习(ICL)的机制,旨在理解输入-标签对中哪些部分驱动了预测结果。研究发现,标签翻转会降低真实标签的显著性,输入中性化的影响小于标签翻转,而补充性解释也未能一致提升性能,凸显了预训练知识与任务特定设计在ICL有效性中的关键作用。

ABSTRACT

We investigate the role of various demonstration components in the in-context learning (ICL) performance of large language models (LLMs). Specifically, we explore the impacts of ground-truth labels, input distribution, and complementary explanations, particularly when these are altered or perturbed. We build on previous work, which offers mixed findings on how these elements influence ICL. To probe these questions, we employ explainable NLP (XNLP) methods and utilize saliency maps of contrastive demonstrations for both qualitative and quantitative analysis. Our findings reveal that flipping ground-truth labels significantly affects the saliency, though it's more noticeable in larger LLMs. Our analysis of the input distribution at a granular level reveals that changing sentiment-indicative terms in a sentiment analysis task to neutral ones does not have as substantial an impact as altering ground-truth labels. Finally, we find that the effectiveness of complementary explanations in boosting ICL performance is task-dependent, with limited benefits seen in sentiment analysis tasks compared to symbolic reasoning tasks. These insights are critical for understanding the functionality of LLMs and guiding the development of effective demonstrations, which is increasingly relevant in light of the growing use of LLMs in applications such as ChatGPT. Our research code is publicly available at https://github.com/paihengxu/XICL.

研究动机与目标

  • 通过分析不同演示组件的贡献,理解大语言模型(LLMs)中少样本学习(ICL)的内在机制。
  • 研究对比演示(通过标签翻转、输入中性化及添加解释)对模型预测与显著性模式的影响。
  • 评估补充性解释是否在不同任务中,特别是在情感分类任务中,一致提升ICL性能。
  • 比较在相同演示扰动下,不同规模模型(如GPT-2与InstructGPT)的显著性模式差异。
  • 为实践者提供可操作的建议,以优化大语言模型的演示设计,尤其在ChatGPT等模型日益广泛应用的背景下。

提出的方法

  • 通过翻转真实标签、中性化输入中的情感提示词、以及在原始示例中添加补充解释,构建对比演示。
  • 采用基于梯度的(Integrated Gradients)和基于扰动的(LIME)显著性图方法,量化模型预测中各标记的粒度重要性。
  • 对原始与对比演示的显著性图进行定性与定量分析,比较特征重要性。
  • 在SST-2数据集上复现先前关于标签翻转与模型规模(如Min et al., 2022;Wei et al., 2023)的研究成果,任务为情感分类。
  • 使用T检验评估在20个测试样本中,原始与扰动组件之间平均显著性得分差异的统计显著性。
  • 对每个样本使用5个邻居的LIME方法生成局部、实例级解释,同时承认因计算与API限制带来的局限性。

实验结果

研究问题

  • RQ1在演示中翻转真实标签后,模型预测中标签标记的显著性如何变化?
  • RQ2在输入文本中中性化情感提示词后,其对模型预测的贡献降低程度如何?
  • RQ3在演示中添加补充性解释是否能一致提升情感分类任务中的ICL性能?
  • RQ4在相同扰动下,较小模型(如GPT-2)与较大模型(如InstructGPT)的显著性模式有何差异?
  • RQ5当演示组件被扰动时,预训练知识在驱动预测中扮演何种角色?

主要发现

  • 标签翻转后,演示中真实标签的显著性显著降低,20个测试样本的T检验结果p < 0.001,表明模型不再依赖翻转后的标签。
  • 中性化输入中的情感提示词后,其平均显著性得分低于原始词,GPT-2的p < 0.001,表明模型仍依赖预训练知识。
  • 对于InstructGPT,原始词与中性化词之间的显著性差异不显著(p = 0.17),可能由于LIME生成的显著性图稀疏(含大量零值)。
  • 在GPT-2的20个样本中,16个样本的解释标记平均显著性得分与原始评论标记相当或更高,但并未提升情感分类性能。
  • 解释标记的显著性平均为评论标记的90%,表明解释在注意力机制中与输入具有同等重要性,但并未增强性能。
  • 更大的模型(如InstructGPT)在标签翻转时表现出超越先验知识的新兴能力,而较小的模型(如GPT-2)则不具备此能力,与先前研究结果一致。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。