Plug and Play Language Models: a Simple Approach to Controlled Text Generation

12/04/2019
by   Sumanth Dathathri, et al.
13

Large transformer-based language models (LMs) trained on huge text corpora have shown unparalleled generation capabilities. However, controlling attributes of the generated language (e.g. switching topic or sentiment) is difficult without modifying the model architecture or fine-tuning on attribute-specific data and entailing the significant cost of retraining. We propose a simple alternative: the Plug and Play Language Model (PPLM) for controllable language generation, which combines a pretrained LM with one or more simple attribute classifiers that guide text generation without any further training of the LM. In the canonical scenario we present, the attribute models are simple classifiers consisting of a user-specified bag of words or a single learned layer with 100,000 times fewer parameters than the LM. Sampling entails a forward and backward pass in which gradients from the attribute model push the LM's hidden activations and thus guide the generation. Model samples demonstrate control over a range of topics and sentiment styles, and extensive automated and human annotated evaluations show attribute alignment and fluency. PPLMs are flexible in that any combination of differentiable attribute models may be used to steer text generation, which will allow for diverse and creative applications beyond the examples given in this paper.

READ FULL TEXT

page 17

page 29

research
03/20/2021

Attribute Alignment: Controlling Text Generation from Pre-trained Language Models

Large language models benefit from training with a large amount of unlab...
research
11/14/2020

Conditioned Natural Language Generation using only Unconditioned Language Model: An Exploration

Transformer-based language models have shown to be very powerful for nat...
research
04/28/2022

Tailor: A Prompt-Based Approach to Attribute-Based Controlled Text Generation

Attribute-based Controlled Text Generation (CTG) refers to generating se...
research
09/20/2021

A Plug-and-Play Method for Controlled Text Generation

Large pre-trained language models have repeatedly shown their ability to...
research
05/12/2022

Sampling with Attribute-Related Information for Controlling Language Models

The dominant approaches for controlling language models are based on fin...
research
03/11/2021

Topical Language Generation using Transformers

Large-scale transformer-based language models (LMs) demonstrate impressi...
research
12/13/2021

Controlled Cue Generation for Play Scripts

In this paper, we use a large-scale play scripts dataset to propose the ...

Please sign up or login with your details

Forgot password? Click here to reset