Diffusion-LM Improves Controllable Text Generation
Xiang Lisa Li, John Thickstun, Ishaan Gulrajani, Percy Liang, Tatsunori Hashimoto Computer Science Department, Stanford University {xlisali, jthickst,igul, Xiang Lisa Li Stanford University、John Thickstun Stanford University、Ishaan Gulrajani Stanford Univeristy、Percy Liang Stanford Univeristy、Tatsunori B. Hashimoto Stanford Univeristy
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). 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.111Code is available at https://github.com/XiangLi1999/Diffusion-LM.git
中文速览
大规模语言模型虽然能生成流畅文本,却很难在不重新训练的情况下精确控制生成内容的复杂属性,比如让输出句子符合特定的句法结构。为此,研究团队提出了 Diffusion-LM,一种基于连续扩散模型(continuous diffusion model)的非自回归语言模型:它从一串高斯噪声向量出发,逐步去噪得到词向量,在这个过程中自然形成一系列连续的中间隐变量。正是这些连续、层次化的隐变量让基于梯度的控制方法成为可能——只需在去噪过程中对隐变量施加来自外部分类器的梯度更新,就能同时兼顾文本流畅性和控制目标,而无需修改模型参数。在情感、语义内容、句法树等六项精细控制任务上,Diffusion-LM 的成功率几乎是此前最优插件式方法的两倍,并能灵活组合多个控制条件。这项工作首次将连续扩散模型引入文本生成,为无需重训练的复杂可控文本生成开辟了新路径。
原文 arXiv:2205.14217;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2205.14217v1