[论文解读] What Makes Good In-Context Examples for GPT-$3$?
这篇论文表明,通过 KATE 检索在语义上相似的上下文示例,可以显著提升 GPT-3 少量示例学习在情感分析、表格到文本生成和开放领域问答中的性能,且任务相关的句子编码器进一步放大收益。
GPT-$3$ has attracted lots of attention due to its superior performance across a wide range of NLP tasks, especially with its powerful and versatile in-context few-shot learning ability. Despite its success, we found that the empirical results of GPT-$3$ depend heavily on the choice of in-context examples. In this work, we investigate whether there are more effective strategies for judiciously selecting in-context examples (relative to random sampling) that better leverage GPT-$3$'s few-shot capabilities. Inspired by the recent success of leveraging a retrieval module to augment large-scale neural network models, we propose to retrieve examples that are semantically-similar to a test sample to formulate its corresponding prompt. Intuitively, the in-context examples selected with such a strategy may serve as more informative inputs to unleash GPT-$3$'s extensive knowledge. We evaluate the proposed approach on several natural language understanding and generation benchmarks, where the retrieval-based prompt selection approach consistently outperforms the random baseline. Moreover, it is observed that the sentence encoders fine-tuned on task-related datasets yield even more helpful retrieval results. Notably, significant gains are observed on tasks such as table-to-text generation (41.9% on the ToTTo dataset) and open-domain question answering (45.5% on the NQ dataset). We hope our investigation could help understand the behaviors of GPT-$3$ and large-scale pre-trained LMs in general and enhance their few-shot capabilities.
研究动机与目标
- 激发并理解 GPT-3 对上下文示例选择的敏感性。
- 研究基于检索的上下文示例选择是否优于随机抽样以获得更好的性能。
- 评估任务相关的句子编码器如何影响检索示例的质量及下游的 GPT-3 预测。
- 展示非参数检索增强(KATE)在多种自然语言处理任务中的有效性。
提出的方法
- 将上下文学习形式化为条件文本生成,其中上下文 C 由 k 个上下文示例及其标签组成。
- 通过经验比较在句子嵌入空间中最近邻的检索选取与随机上下文抽样。
- 提出 KATE(KNN-Augmented in-Context d E xample selection)从训练集中检索测试样本的 k 个最近邻,并将它们用作 GPT-3 提示中的上下文示例。
- 评估多种句子编码器,包括在 SNLI/MNLI 和 STS-B 上微调的 RoBERTa 基模型,作为检索嵌入。
- 分析上下文示例数量、检索的训练集规模以及上下文示例的顺序对性能的影响。
实验结果
研究问题
- RQ1基于检索的上下文示例选择是否相较于随机抽样提升 GPT-3 的少量示例性能?
- RQ2以句子嵌入衡量的检索示例的语义质量如何影响 GPT-3 的结果?
- RQ3任务相关的句子编码器和更大规模的检索集合是否在情感分析、表格到文本生成和问答等任务上带来更强的提升?
- RQ4上下文示例的数量和顺序如何影响 KATE 的有效性?
主要发现
- 基于检索的上下文示例选择在多项任务上持续优于随机抽样。
- 在任务相关数据(如 NLI、STS-B、SST-2)上微调的句子编码器带来更强的检索结果和更高的 GPT-3 性能。
- KATE 在 ToTTo 表格到文本生成和开放领域问答数据集上取得显著提升,相对于基线有显著改进。
- 通常增加检索示例数量能提高性能,使用任务对齐的编码器可进一步提升收益。
- 检索得到的示例为 GPT-3 提供更详细且相关的上下文,减少幻觉并提高答案的可靠性。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。