Learning How to Ask: Querying LMs with Mixtures of Soft Prompts

21389

Authors

nan

Abstract

AbstractNatural-language prompts have recently been used to coax pretrained language models into performing other AI tasks, using a fill-in-the-blank paradigm (Petroni et al., 2019) or a few-shot extrapolation paradigm (Brown et al., 2020). For example, language models retain factual knowledge from their training corpora that can be extracted by asking them to “fill in the blank” in a sentential prompt. However, where does this prompt come from? We explore the idea of learning prompts by gradient descent—either fine-tuning prompts taken from previous work, or starting from random initialization. Our prompts consist of “soft words,” i.e., continuous vectors that are not necessarily word type embeddings from the language model. Furthermore, for each task, we optimize a mixture of prompts, learning which prompts are most effective and how to ensemble them. Across multiple English LMs and tasks, our approach hugely outperforms previous methods, showing that the implicit factual knowledge in language models was previously underestimated. Moreover, this knowledge is cheap to elicit: random initialization is nearly as good as informed initialization.

Keywords

nan

Full Content

Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 5203–5212 June 6–11, 2021. ©2021 Association for Computational Linguistics 5203 Learning How to Ask: Querying LMs with Mixtures of Soft Prompts Guanghui Qin and Jason Eisner Department of Computer Science, Johns Hopkins University gqin2@jhu.edu jason@cs.jhu.edu Abstract Natural-language prompts have recently been used to coax pretrained language models into performing other AI tasks, using a fill-in-the- blank paradigm (Petroni et al., 2019) or a few-shot extrapolation paradigm (Brown et al., 2020). For example, language models retain factual knowledge from their training corpora that can be extracted by asking them to “fill in the blank” in a sentential prompt. However, where does this prompt come from? We ex- plore the idea of learning prompts by gradi- ent descent—either fine-tuning prompts taken from previous work, or starting from random initialization. Our prompts consist of “soft words,” i.e., continuous vectors that are not necessarily word type embeddings from the language model. Furthermore, for each task, we optimize a mixture of prompts, learning which prompts are most effective and how to ensemble them. Across multiple English LMs and tasks, our approach hugely outperforms previous methods, showing that the implicit factual knowledge in language models was pre- viously underestimated. Moreover, this knowl- edge is cheap to elicit: random initialization is nearly as good as informed initialization. 1 Introduction Pretrained language models, such as ELMo (Pe- ters et al., 2018), BERT (Devlin et al., 2019), and BART (Lewis et al., 2020a), have proved to pro- vide useful representations for other NLP tasks. Re- cently, Petroni et al. (2019) and Jiang et al. (2020) demonstrated that language models (LMs) also con- tain factual and commonsense knowledge that can be elicited with a prompt. For example, to query the date-of-birth of Mozart, we can use the prompt “Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart Mozart was born in ,” where we have filled the first blank with “Mozart,” and ask a cloze language model to fill in the second blank. The prompts used by Petroni et al. (2019) are manu- ally created, while Jiang et al. (2020) use mining and paraphrasing based methods to automatically augment the prompt sets. Finding out what young children know is diffi- cult because they can be very sensitive to the form of the question (Donaldson, 1978). Opinion polling is also sensitive to question design (Broughton, 1995). We observe that when we are querying an LM rather than a human, we have the opportu- nity to tune prompts using gradient descent—the workhorse of modern NLP—so that they better elicit the desired type of knowledge. A neural LM sees the prompt as a sequence of continuous word vectors (Baroni et al., 2014). We tune in this continuous space, relaxing the con- straint that the vectors be the embeddings of actual English words. Allowing “soft prompts” consisting of “soft words” is not only convenient for optimiza- tion, …

Content truncated to 500 words

Labeled Text

AbstractNatural-language prompts have recently been used to coax pretrained language models into performing other AI tasks, using a fill-in-the-blank paradigm (Petroni et al., 2019) or a few-shot extrapolation paradigm (Brown et al., 2020). For example, language models retain factual knowledge from their training corpora that can be extracted by asking them to “fill in the blank” in a sentential prompt. However, where does this prompt come from? We explore the idea of learning prompts by gradient descent—either fine-tuning prompts taken from previous work, or starting from random initialization. Our prompts consist of “soft words,” i.e., continuous vectors that are not necessarily word type embeddings from the language model. Furthermore, for each task, we optimize a mixture of prompts, learning which prompts are most effective and how to ensemble them. Across multiple English LMs and tasks, our approach hugely outperforms previous methods, showing that the implicit factual knowledge in language models was previously underestimated. Moreover, this knowledge is cheap to elicit: random initialization is nearly as good as informed initialization.

Publication Details

Paper ID:
21389
Year:
2021
Publication:
TIPSTER
Publication Type:
conf
DOI:
nan