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
- Wayne Xin Zhao
- Yulia Tsvetkov
- Jiawei Han
- Ji-rong Wen
- Vidhisha Balachandran
- Sachin Kumar
- Antonios Anastasopoulos
- Jiaxin Huang
In Computer Vision and Pattern Recognition
- Ji-rong Wen
- Wayne Xin Zhao
- Sachin Kumar
- Yulia Tsvetkov
- Jian-Yun Nie
- Vidhisha Balachandran
- Jiawei Han
- Yu Meng
In Natural Language Processing
- Yulia Tsvetkov
- Sachin Kumar
- Vidhisha Balachandran
- Antonios Anastasopoulos
- Lucille Njoo
- Biswajit Paria
- Jiawei Han
- Yu Meng
In Prompting & Reasoning
- Yulia Tsvetkov
- Jiawei Han
- Yu Meng
- Ji-rong Wen
- Tarek F. Abdelzaher
- Martin Michalski
- Wayne Xin Zhao
- Jiaxin Huang
Citations in the corpus
- Language Generation Models Can Cause Harm: So What Can We Do About It? An Actionable Survey (2022, background): “One branch of work adopts logical controls, in which developers directly specify sets of words that should or should not appear in the output (Lu et al., 2021b; Pascual et al., 2021).”
- Generating Training Data with Language Models: Towards Zero-Shot Language Understanding (2022, background): “Adapting PLMs to generate texts of specific attributes can also be realized at inference time without any further training of the PLMs [10, 26, 27, 32, 47, 75].”
- A Survey of Controllable Text Generation Using Transformer-based Pre-trained Language Models (2022, methodology): “…efficient training and inefficient inference; lower text quality; better controllability Guided Strategy [24, 62, 74, 117, 150, 151] [73, 89, 96, 106] Trainable Strategy [25, 59] We list the main characteristics for each categor from a macro perspective, and representative references for…”
- Tuning Language Models as Training Data Generators for Augmentation-Enhanced Few-Shot Learning (2022, background): “…phrases (Chan et al., 2021)) or both (Khal-ifa et al., 2021); at inference time, control over desired attributes can also be enforced without updating the PLM parameters (Dathathri et al., 2020; Krause et al., 2021; Kumar et al., 2021; Liu et al., 2021a; Pascual et al., 2021; Yang & Klein, 2021).”
- Pre-Trained Language Models for Text Generation: A Survey (2022, background): “Aspect Satisfying Text Properties Enhance coherence [107, 173], preserve factuality [29, 37, 105, 135], improve controllable [33, 91, 141].”
- Gradient-based Constrained Sampling from Language Models (2022, methodology): “Open-Ended Keyword Guided Generation In addition to C OMMON G EN , we report results on ROC (Pascual et al., 2021) task where given 5 keywords, the goal is generate a sequence of max length 90 containing those terms.”