Diffusion Guided Language Modeling

Justin Lovelace, Varsha Kishore, Yiwei Chen, Kilian Q. Weinberger
8/8/2024
cs.CLcs.LG

No official code found. Best implementation: justinlovelace/Diffusion-Guided-LM (31 stars, MIT, last commit 2025-10-20).

Abstract

Current language models demonstrate remarkable proficiency in text generation. However, for many applications it is desirable to control attributes, such as sentiment, or toxicity, of the generated language -- ideally tailored towards each specific use case and target audience. For auto-regressive language models, existing guidance methods are prone to decoding errors that cascade during generation and degrade performance. In contrast, text diffusion models can easily be guided with, for example, a simple linear sentiment classifier -- however they do suffer from significantly higher perplexity than auto-regressive alternatives. In this paper we use a guided diffusion model to produce a latent proposal that steers an auto-regressive language model to generate text with desired properties. Our model inherits the unmatched fluency of the auto-regressive approach and the plug-and-play flexibility of diffusion. We show that it outperforms previous plug-and-play guidance methods across a wide range of benchmark data sets. Further, controlling a new attribute in our framework is reduced to training a single logistic regression classifier.

View on arXivView PDF

Code Implementations(1)

MIT
312Shell, PythonJun 5, 20241 years agoMIT

Similar Papers

Cite this paper

@article{lovelace2024diffusion,
  title  = {Diffusion Guided Language Modeling},
  author = {Justin Lovelace and Varsha Kishore and Yiwei Chen and Kilian Q. Weinberger},
  year   = {2024},
  eprint = {2408.04220},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2408.04220v1}
}

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/2408.04220.svg)](https://codeofpaper.com/paper/2408.04220)

Discussion