Diffusion-LM Improves Controllable Text Generation
Controlling the behavior of language models (LMs) without re-training is a major open problem in natural language generation. While recent works have demonstrated successes on controlling simple sentence attributes (e.g., sentiment), there has been little progress on complex, fine-grained controls (e.g., syntactic structure). To address this challenge, we develop a new non-autoregressive language model based on continuous diffusions that we call Diffusion-LM. Building upon the recent successes of diffusion models in continuous domains, Diffusion-LM iteratively denoises a sequence of Gaussian vectors into word vectors, yielding a sequence of intermediate latent variables. The continuous, hierarchical nature of these intermediate variables enables a simple gradient-based algorithm to perform complex, controllable generation tasks. We demonstrate successful control of Diffusion-LM for six challenging fine-grained control tasks, significantly outperforming prior work.1
updating the LM parameters for each control task can be expensive and does not allow for compositions of multiple controls (e.g. generate text that is both positive sentiment and non-toxic). This motivates light-weight and modular plug-and-play approaches [6] that keep the LM frozen and steer the generation process using an external classifier that measures how well the generated text satisfies the control
we propose Diffusion-LM, a new language model based on continuous diffusions. Diffusion-LM starts with a sequence of Gaussian noise vectors and incrementally denoises them into vectors corresponding to words, as shown in Figure 1. These gradual denoising steps produce a hierarchy of continuous latent representations. We find that this hierarchical and continuous latent variable enables simple, gradient-based methods to perform complex control tasks such as constraining the parse tree of a generated sequence.
Autoregressive and Non-autoregressive LMs. Most large pre-trained LMs are left-to-right autoregressive (e.g., GPT-3 [3], PaLM [5]). The fixed generation order limits the models’ flexibility in many controllable generation settings, especially those that impose controls globally on both left and right contexts. One example is infilling, which imposes lexical control on the right contexts; another example is syntactic structure control, which controls global properties involving both left and right contexts. Since autoregressive LMs cannot directly condition on right contexts, prior works have developed specialized training and decoding techniques for these tasks [38, 9, 30]. For example, Qin et al. [31] proposed a decoding method that relaxes the discrete LM outputs to continuous variables and backpropagates gradient information from the right context. Diffusion-LM can condition on arbitrary classifiers that look at complex, global properties of the sentence. There are other non-autoregressive LMs that have been developed for machine translation and speech-to-text tasks [11, 37]. However these methods are specialized for speech and translation settings, where the entropy over valid outputs is low, and it has been shown that these approaches fail for language modeling [35].
Despite their success on attribute (e.g., topic) controls, we will show these plug-and-play methods for autoregressive LMs fail on more complex control tasks such as controlling syntactic structure and semantic content in §7.1. We demonstrate that Diffusion-LM is capable of plug-and-play controllable generation by applying classifier-guided gradient updates to the continuous sequence of latent variables induced by the Diffusion-LM.
Lines of inquiry this paper opens 24
Research framings built by reading the notes related to this paper — the questions it feeds into.
What enables diffusion language models to offer control autoregressive models lack?- Can autoregressive models be trained to produce more cataphoric text?
- Why do autoregressive models fail at controlling syntactic structure and semantic content?
- Does diffusion's control advantage come from speed gains or from architectural differences?
- Can diffusion models condition on right context natively without special training for infilling?
- How does the discrete token bottleneck prevent gradient flow in language model control?
- How can diffusion models predict future tokens without completing prior blocks?
- Why do hybrid paradigms outperform pure autoregressive or pure diffusion approaches?
- How do autoregressive models constrain where chain-of-thought prompts can be positioned?
- What structural differences between diffusion and autoregressive models enable bidirectional prompting?
- Do diffusion language models learn differently than autoregressive models?
- Can diffusion language models match autoregressive inference speed in practice?
- Can diffusion models perform infilling and reverse generation as naturally as forward generation?
- Why is reinforcement learning harder to apply to diffusion language models?
- What makes the embers of autoregression framework predictive?
- Why do diffusion models fail at inherently sequential problems?
- How does selective looping in diffusion models differ from recurrence in autoregressive architectures?
- How do diffusion language models outpace autoregressive generation in speed?
- Can gradient-based control reach properties that autoregressive methods cannot?
- Can autoregressive models learn faithful translation to logical representations without semantic loss?
- Can architecture changes and early stopping combine to close the diffusion inference gap?