Diffusion-LM Improves Controllable Text Generation

Xiang Lisa Li, John Thickstun, Ishaan Gulrajani, Percy Liang, Tatsunori B. Hashimoto
5/27/2022
1,683 citations
cs.CLcs.AIcs.LG

Official code: XiangLi1999/Diffusion-LM (1,248 stars, Python, Apache-2.0, last commit 2024-08-08).

Abstract

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

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Diffusion-LM

1,248163Python, Jupyter NotebookMay 25, 20222 years agoApache-2.0

Similar Papers

Cite this paper

@article{li2022diffusionlm,
  title  = {Diffusion-LM Improves Controllable Text Generation},
  author = {Xiang Lisa Li and John Thickstun and Ishaan Gulrajani and Percy Liang and Tatsunori B. Hashimoto},
  year   = {2022},
  eprint = {2205.14217},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2205.14217}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2205.14217.svg)](https://codeofpaper.com/paper/2205.14217)

Discussion