Lune

EMNLP Findings2021

A Plug-and-Play Method for Controlled Text Generation

Damian Pascual, Beni Egressy, Clara Meister, Ryan Cotterell, Roger Wattenhofer

Abstract

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

Ask Lune

Ask anything. The answer quotes the paper.

Lune reads all of it and the papers around it, then shows you the passages behind every answer.

Questions to start from

Lune answers from

the full paper · 16 top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Cited by top-tier papers16

  1. Generating Training Data with Language Models: Towards Zero-Shot Language UnderstandingYu Meng, Jiaxin Huang, Yu Zhang, Jiawei HanNeurIPS 2022 · 309 citations
  2. DFX: A Low-latency Multi-FPGA Appliance for Accelerating Transformer-based Text GenerationSeongmin Hong, Seungjae Moon, Junsoo Kim, Sungjae Lee et al.MICRO 2022 · 107 citations
  3. Tuning Language Models as Training Data Generators for Augmentation-Enhanced Few-Shot LearningYu Meng, Martin Michalski, Jiaxin Huang, Yu Zhang et al.ICML 2023 · 64 citations
  4. SSD-LM: Semi-autoregressive Simplex-based Diffusion Language Model for Text Generation and Modular ControlXiaochuang Han, Sachin Kumar, Yulia TsvetkovACL 2023 · 23 citations
  5. Gradient-based Constrained Sampling from Language ModelsSachin Kumar, Biswajit Paria, Yulia TsvetkovEMNLP 2022 · 22 citations

Builds on9

  1. The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes et al.ICLR 2020 · 4,112 citations
  2. Plug and Play Language Models: A Simple Approach to Controlled Text GenerationSumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung et al.ICLR 2020 · 1,166 citations
  3. Neural Text Generation With Unlikelihood TrainingSean Welleck, Ilia Kulikov, Stephen Roller, Emily Dinan et al.ICLR 2020 · 683 citations
  4. CommonGen: A Constrained Text Generation Challenge for Generative Commonsense ReasoningBill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou et al.EMNLP Findings 2020 · 239 citations
  5. GeDi: Generative Discriminator Guided Sequence GenerationBen Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar et al.EMNLP Findings 2021 · 219 citations

Related papers

  1. Fine-Grained Controllable Text Generation Using Non-Residual PromptingFredrik Carlsson, Joey Öhman, Fangyu Liu, Severine Verlinden et al.ACL 2022
  2. Plug-and-Play Conversational ModelsAndrea Madotto, Etsuko Ishii, Zhaojiang Lin, Sumanth Dathathri et al.EMNLP Findings 2020 · 46 citations
  3. Controlled Text Generation with Natural Language InstructionsWangchunshu Zhou, Yuchen Eleanor Jiang, Ethan Wilcox, Ryan Cotterell et al.ICML 2023 · 121 citations
  4. G2: Guided Generation for Enhanced Output Diversity in LLMsZhiwen Ruan, Yixia Li, Yefeng Liu, Yun Chen et al.EMNLP 2025
  5. Parallel Refinements for Lexically Constrained Text Generation with BARTXingwei HeEMNLP 2021 · 34 citations
Dusk over the sea between two cliffs drawn in fine vertical lines