Skip to main content
QUICK REVIEW

[Paper Review] Learning How to Ask: Querying LMs with Mixtures of Soft Prompts

Guanghui Qin, Jason Eisner|arXiv (Cornell University)|Apr 14, 2021
Topic ModelingComputer Science37 references10 citations
TL;DR

This paper proposes learning soft prompts—continuous vector sequences instead of discrete words—for querying pretrained language models, using gradient descent to optimize a mixture of such prompts. The method significantly outperforms prior approaches on factual knowledge probing tasks, even when initialized randomly, demonstrating that language models contain far more accessible knowledge than previously realized.

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 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.

Motivation & Objective

  • To improve the performance of prompting pretrained language models for factual knowledge extraction beyond manually crafted or mined prompts.
  • To investigate whether continuous, learnable 'soft prompts' can outperform traditional discrete word prompts in eliciting knowledge from language models.
  • To explore whether random initialization of soft prompts can match or exceed the performance of informed initialization (e.g., from prior work).
  • To evaluate the effectiveness of a mixture of soft prompts, where each prompt is weighted adaptively based on task and input.
  • To determine whether tuning all layers of the language model (deep prompting) further improves performance over layer-0 tuning alone.

Proposed method

  • Represent prompts as continuous vector sequences ('soft words') instead of discrete tokens, allowing gradient-based optimization in a continuous space.
  • Optimize a mixture of soft prompts using gradient descent, where each prompt is a learnable sequence of continuous embeddings.
  • Use a differentiable mixture mechanism to combine multiple soft prompts, with learnable mixture weights that adapt per input.
  • Train the soft prompts end-to-end using standard language modeling objectives on cloze-style factual probing tasks.
  • Extend the method to tune embeddings across all transformer layers (deep prompting), not just the input layer.
  • Apply temperature-based gating to allow data-dependent mixture weights, enabling dynamic selection of effective prompts per input.

Experimental results

Research questions

  • RQ1Can soft prompts, optimized via gradient descent, significantly outperform manually designed or mined discrete prompts in knowledge probing tasks?
  • RQ2Does random initialization of soft prompts perform as well as or better than initialization based on prior prompts, suggesting that the optimization process is robust?
  • RQ3Can a mixture of soft prompts, with learnable weights, improve generalization and performance across diverse factual relations compared to single prompts?
  • RQ4Does fine-tuning soft prompts across all transformer layers (deep prompting) yield additional gains over layer-0-only tuning?
  • RQ5How do data-dependent mixture weights affect performance, and does the model learn to suppress irrelevant prompt components?

Key findings

  • The proposed soft prompt method achieves state-of-the-art performance on the T-REx and Google-RE datasets, with a P@1 score of 14.5 on BERT-large for Google-RE when initialized randomly.
  • Even with random initialization, the method outperforms all prior methods, including LAMA and LPAQA, by large margins—e.g., +14.5 P@1 over baseline LAMA on Google-RE with BERT-large.
  • Tuning soft prompt vectors (rather than just mixture weights) yields the largest performance gains, with a 12.9 P@1 score on T-REx using mined initialization.
  • The mixture of soft prompts consistently improves over single prompts, with the best system using a mixture of soft prompts initialized from mined prompts and fine-tuned across all layers.
  • Deep prompting (tuning all layers) provides small but consistent improvements, though it degrades performance on RoBERTa, suggesting model-specific sensitivity.
  • Data-dependent mixture weights via temperature gating had minimal effect, as the model learned to set high temperature and effectively ignore input-specific weights.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.