A Plug-and-Play Method for Controlled Text Generation

By Damian Pascual, Béni Egressy, Clara Meister, Ryan Cotterell, Roger Wattenhofer. 2021

109 citations recorded by the source corpus.

Large pre-trained language models have repeatedly shown their ability to produce fluent text. Yet even when starting from a prompt, generation can continue in many plausible directions. Current decoding methods with the goal of controlling generation, e.g., to ensure specific words are included, either require additional models or fine-tuning, or work poorly when the task at hand is semantically unconstrained, e.g., story generation. In this work, we present a plug-and-play decoding method for controlled language generation that is so simple and intuitive, it can be described in a single sentence: given a topic or keyword, we add a shift to the probability distribution over our vocabulary towards semantically similar words. We show how annealing this distribution can be used to impose hard constraints on language generation, something no other plug-and-play method is currently able to do with SOTA language generators. Despite the simplicity of this approach, we see it works incredibly well in practice: decoding from GPT-2 leads to diverse and fluent sentences while guaranteeing the appearance of given guide words. We perform two user studies, revealing that (1) our method outperforms competing methods in human evaluations; and (2) forcing the guide words to appear in the generated text has no impact on the fluency of the generated text.

Subfields: Artificial Intelligence, Computer Vision and Pattern Recognition, Natural Language Processing, Prompting & Reasoning

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Artificial Intelligence

  1. Wayne Xin Zhao
  2. Yulia Tsvetkov
  3. Jiawei Han
  4. Ji-rong Wen
  5. Vidhisha Balachandran
  6. Sachin Kumar
  7. Antonios Anastasopoulos
  8. Jiaxin Huang

In Computer Vision and Pattern Recognition

  1. Ji-rong Wen
  2. Wayne Xin Zhao
  3. Sachin Kumar
  4. Yulia Tsvetkov
  5. Jian-Yun Nie
  6. Vidhisha Balachandran
  7. Jiawei Han
  8. Yu Meng

In Natural Language Processing

  1. Yulia Tsvetkov
  2. Sachin Kumar
  3. Vidhisha Balachandran
  4. Antonios Anastasopoulos
  5. Lucille Njoo
  6. Biswajit Paria
  7. Jiawei Han
  8. Yu Meng

In Prompting & Reasoning

  1. Yulia Tsvetkov
  2. Jiawei Han
  3. Yu Meng
  4. Ji-rong Wen
  5. Tarek F. Abdelzaher
  6. Martin Michalski
  7. Wayne Xin Zhao
  8. Jiaxin Huang

Citations in the corpus