AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts

Taylor Shin, Yasaman Razeghi, Robert L. Logan, Eric Wallace, Sameer Singh
10/29/2020
583 citations
cs.CLcs.LG

Official code: ucinlp/autoprompt (643 stars, Python, Apache-2.0, last commit 2026-09-02).

Abstract

The remarkable success of pretrained language models has motivated the study of what kinds of knowledge these models learn during pretraining. Reformulating tasks as fill-in-the-blanks problems (e.g., cloze tests) is a natural approach for gauging such knowledge, however, its usage is limited by the manual effort and guesswork required to write suitable prompts.

Show full abstract

To address this, we develop AutoPrompt, an automated method to create prompts for a diverse set of tasks, based on a gradient-guided search. Using AutoPrompt, we show that masked language models (MLMs) have an inherent capability to perform sentiment analysis and natural language inference without additional parameters or finetuning, sometimes achieving performance on par with recent state-of-the-art supervised models. We also show that our prompts elicit more accurate factual knowledge from MLMs than the manually created prompts on the LAMA benchmark, and that MLMs can be used as relation extractors more effectively than supervised relation extraction models. These results demonstrate that automatically generated prompts are a viable parameter-free alternative to existing probing methods, and as pretrained LMs become more sophisticated and capable, potentially a replacement for finetuning.

View on arXivView PDF

Code Implementations(1)

ucinlp/autopromptOfficial100%
Apache-2.0

AutoPrompt: Automatic Prompt Construction for Masked Language Models.

64386Python, HTMLMar 1, 20203 months agoApache-2.0
evaluationlanguage-modelnlp

Similar Papers

Cite this paper

@article{shin2020autoprompt,
  title  = {AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated Prompts},
  author = {Taylor Shin and Yasaman Razeghi and Robert L. Logan and Eric Wallace and Sameer Singh},
  year   = {2020},
  eprint = {2010.15980},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2010.15980}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2010.15980.svg)](https://codeofpaper.com/paper/2010.15980)

Discussion