Learning To Retrieve Prompts for In-Context Learning
Citations Over TimeTop 1% of 2022 papers
Abstract
In-context learning is a recent paradigm in natural language understanding, where a large pretrained 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 prompts). In this work, we propose an efficient method for retrieving prompts for in-context learning using annotated data and an LM. Given an inputoutput 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-tosequence tasks where language utterances are mapped to meaning representations, and find that it substantially outperforms prior work and multiple baselines across the board.
Related Papers
- → Few-Shot Semantic Parsing with Language Models Trained on Code(2022)37 cited
- → Improvement of the Recognition Rate of Spoken Queries to the Dialogue System(1999)
- Chinese fK Automatic Recognition Based on HNC Theory(2009)
- → Can Wikipedia Categories Improve Masked Language Model Pretraining?(2020)
- → Few-Shot Semantic Parsing with Language Models Trained On Code(2021)