We introduce kNN-Prompt, a simple and effective technique to use k-nearest neighbor (kNN) retrieval augmentation (Khandelwal et al., 2021) for zero-shot inference with language models (LMs). Key to our approach is the introduction of fuzzy verbalizers which leverage the sparse kNN distribution for downstream tasks by automatically associating each classification label with a set of natural language tokens. Across eleven diverse end-tasks (spanning text classification, fact retrieval and question answering), using kNN-Prompt with GPT-2 Large yields significant performance boosts over zero-shot baselines (14% absolute improvement over the base LM on average). Extensive experiments show that kNN-Prompt is effective for domain adaptation with no further training, and that the benefits of retrieval increase with the size of the model used for kNN retrieval. Overall, we show that augmenting a language model with retrieval can bring significant gains for zero-shot inference, with the possibility that larger retrieval models may yield even greater benefits.
翻译:我们引入了 kNNN-Prompt, 这是一种简单而有效的技术, 用来使用 k- 近邻( kNNN) 检索增强( Khandelwal 等人, 2021 ) 来对语言模型进行零发推断( LMs ) 。 我们的方法之关键是引入模糊的言语, 将分散的 kNNN 分配用于下游任务, 自动将每个分类标签与一套自然语言符号联系起来。 在11个不同的终端任务( 涵盖文本分类、 事实检索和问答)中, 使用 kNN- Prompt 使用 GPT-2 大型产出显著的性能提升超过零发基线( 平均比基准LM 高出14% 绝对改善 ) 。 广泛的实验显示 kNN- Prompt 有效地对域的适应没有进一步培训, 并且检索的好处随着 kNNN 检索所使用的模型的大小而增加。 总的来说, 我们显示, 以检索方式增强语言模型可以给零点推论带来重大收益,, 更大的检索模型可能会产生更大的效益 。