[论文解读] Compositional Exemplars for In-context Learning
CEIL 模型对上下文示例的联合概率进行建模,采用 conditional DPP,通过对比学习目标训练,以选择多样且相关的演示集合用于上下文学习,在12个任务/数据集上实现了最先进的结果,并展示了可迁移性和组成性。
Large pretrained language models (LMs) have shown impressive In-Context Learning (ICL) ability, where the model learns to do an unseen task via a prompt consisting of input-output examples as the demonstration, without any parameter updates. The performance of ICL is highly dominated by the quality of the selected in-context examples. However, previous selection methods are mostly based on simple heuristics, leading to sub-optimal performance. In this work, we formulate in-context example selection as a subset selection problem. We propose CEIL (Compositional Exemplars for In-context Learning), which is instantiated by Determinantal Point Processes (DPPs) to model the interaction between the given input and in-context examples, and optimized through a carefully-designed contrastive learning objective to obtain preference from LMs. We validate CEIL on 12 classification and generation datasets from 7 distinct NLP tasks, including sentiment analysis, paraphrase detection, natural language inference, commonsense reasoning, open-domain question answering, code generation, and semantic parsing. Extensive experiments demonstrate not only the state-of-the-art performance but also the transferability and compositionality of CEIL, shedding new light on effective and efficient in-context learning. Our code is released at https://github.com/HKUNLP/icl-ceil.
研究动机与目标
- 通过优化示例选择来推动鲁棒的上下文学习(ICL),而不是依赖手工设计的启发式方法。
- 建模上下文示例之间的相互关系,以避免冗余并提升对任务的覆盖。
- 开发一个可学习的检索器,联合选择一个以测试输入为条件的示例子集。
- 通过对比学习目标将示例子集质量与语言模型(LM)的引导对齐。
提出的方法
- 定义一个条件 DPP 内核,将与测试输入的相关性与示例之间的多样性结合起来。
- 引入一个用于输入和示例的学习型嵌入以计算 DPP 内核;引入一个权衡参数 lambda,用于平衡相关性和多样性。
- 使用基于对比学习的损失(InfoNCE 或逐对边际)进行训练,利用 LM 派生的子集分数对示例子集进行排序。
- 在测试时使用贪心算法(带 Cholesky 更新)执行 MAP 推断,以实现高效的子集选择。
- 使用两阶段检索设置采样候选子集并训练检索器,而不需要地面真相的示例集。
实验结果
研究问题
- RQ1条件 DPP 基于检索器是否能捕捉示例之间的交互,从而提升 ICL 性能?
- RQ2在示例选择中联合建模相关性与多样性是否比独立检索方法 yields 更好的下游结果?
- RQ3CEIL 训练得到的示例是否可以在不同的 LM 和数据集之间迁移,CEIL 是否能揭示示例的组成性?
- RQ4示例子集大小和权衡参数如何影响跨任务的性能?
主要发现
- CEIL 在12个数据集和7个任务上显著超越了无学习和基于学习的基线,包括 NLI、情感、常识推理和代码生成。
- CEIL 展现出在不同 LM(GPT-Neo、GPT-2 XL、Codex)和不同数据集上的可迁移性,在某些情况下实现了无学习部署。
- CEIL 天生具备学习组合示例的能力,在组合语义解析任务中提升了性能,并在组合性分割中显示出优势。
- 较小的示例集对许多任务有利,CEIL 即使在提示长度受限时也能保持强劲表现。
- 与 EPR 和 TopK-BERT 相比,CEIL 在大多数任务上取得一致的绝对增益,且在 NLI 任务上尤其显著。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。