Natural-language prompts have recently been used to coax pretrained language models into performing other AI tasks , using a fill-in-theblank 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 . x performed until his death in y . Pretrained language models , such as ELMo ( Peters et al . , 2018 ) , BERT ( Devlin et al . , 2019 ) , and BART ( Lewis et al . , 2020a ) , have proved to provide useful representations for other NLP tasks . Recently , Petroni et al . ( 2019 ) and Jiang et al . ( 2020 ) demonstrated that language models ( LMs ) also contain factual and commonsense knowledge that can be elicited with a prompt . For example , to query the date-of- , " 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 manually 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 difficult 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 opportunity 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 constraint that the vectors be the embeddings of actual English words . Allowing " soft prompts " consisting of " soft words " is not only convenient for optimization , but is also more expressive . Soft prompts can emphasize particular words ( by lengthening their vectors ) or particular dimensions of those words . They can also adjust words that are misleading , ambiguous , or overly specific . Consider the following prompt for the relation date-of-death : This prompt may work for the male singer Cab Calloway , but if we want it to also work for the female painter Mary Cassatt , it might help to soften " performed " and " his " so that they do not insist on the wrong occupation and gender , and perhaps to soften " until " into a weaker connective ( as Cassatt was in fact too blind to paint in her final years ) . Another way to bridge between these cases is to have one prompt using " performed " and another using " painted . " In general , there may be many varied lexical patterns that signal a particular relation , and having more patterns will get better coverage ( Hearst , 1992 ; Riloff and Jones , 1999 ) . We therefore propose to learn a mixture of soft prompts . We test the idea on several cloze language models , training prompts to complete factual and com-mon sense relations from 3 datasets . Comparing on held-out examples , our method dramatically outperforms previous work , even when initialized randomly . So when regarded as approximate knowledge bases , language models know more than we realized . We just had to find the right ways to ask . Well-crafted natural language prompts are a powerful way to extract information from pretrained language models . In the case of cloze prompts used to query BERT and BART models for single-word answers , we have demonstrated startlingly large and consistent improvements from rapidly learning prompts that work-even though the resulting " soft prompts " are no longer natural language . Our code and data are available at https:// github.com / hiaoxui / soft-prompts . How about few-shot prediction with pretrained generative LMs ? Here , Lewis et al . ( 2020b ) show how to assemble a natural language prompt for input x from relevant input-output pairs ( x i , y i ) selected by a trained retrieval model . Allowing fine-tuned soft string pairs is an intriguing future possibility for improving such methods without needing to fine-tune the entire language model .

Challenge: When prompting language models as a knowledge base, existing methods use actual sentences as queries while models may be sensitive to the form of questions.
Approach: They propose to treat prompts as sequences of vectors instead of words to achieve more flexibility and optimize them by gradient descent or fine-tuning.
Outcome: The proposed approach outperforms previous methods across multiple English models and factual and commonsense tasks showing implicit factual knowledge has been underestimated.