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

  • 2020-01-08 06:05:58
  • Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, Rosanne Liu
  • 0

Abstract

Large transformer-based language models (LMs) trained on huge text corporahave shown unparalleled generation capabilities. However, controllingattributes of the generated language (e.g. switching topic or sentiment) isdifficult without modifying the model architecture or fine-tuning onattribute-specific data and entailing the significant cost of retraining. Wepropose a simple alternative: the Plug and Play Language Model (PPLM) forcontrollable language generation, which combines a pretrained LM with one ormore simple attribute classifiers that guide text generation without anyfurther training of the LM. In the canonical scenario we present, the attributemodels are simple classifiers consisting of a user-specified bag of words or asingle learned layer with 100,000 times fewer parameters than the LM. Samplingentails a forward and backward pass in which gradients from the attribute modelpush the LM's hidden activations and thus guide the generation. Model samplesdemonstrate control over a range of topics and sentiment styles, and extensiveautomated and human annotated evaluations show attribute alignment and fluency.PPLMs are flexible in that any combination of differentiable attribute modelsmay be used to steer text generation, which will allow for diverse and creativeapplications beyond the examples given in this paper.

 

Quick Read (beta)

loading the full paper ...