In-context learning is a recent paradigm in natural language understanding, where a large pre-trained language model (LM) observes a test instance and a few training examples as its input, and directly decodes the output without any update to its parameters. However, performance has been shown to strongly depend on the selected training examples (termed prompt). In this work, we propose an efficient method for retrieving prompts for in-context learning using annotated data and a LM. Given an input-output pair, we estimate the probability of the output given the input and a candidate training example as the prompt, and label training examples as positive or negative based on this probability. We then train an efficient dense retriever from this data, which is used to retrieve training examples as prompts at test time. We evaluate our approach on three sequence-to-sequence tasks where language utterances are mapped to meaning representations, and find that it substantially outperforms prior work and multiple baselines across the board.
翻译:在自然语言理解方面,一个大型的预先培训语言模式(LM)是最近的一种范例,它将一个测试实例和几个培训实例作为输入,直接解码产出,而不更新参数。但是,业绩显示在很大程度上取决于选定的培训实例(术语迅速)。在这项工作中,我们提出了一个有效的方法,用附加说明的数据和一个LM来检索文内学习的提示。根据一对投入-产出,我们估计了产出的概率,根据输入和候选人培训实例,将培训实例标为快速的,并根据这一概率将培训实例标为正或负的。我们随后从这些数据中培训一个高效的密集检索器,用于检索测试时提示的培训实例。我们评估了我们关于三种顺序到顺序的任务的方法,其中语言的表达被映射为表达,并发现它大大超越了以前的工作和跨局的多个基线。