Diffusion-LM Improves Controllable Text Generation
Paper · 2022 · Xiang Lisa Li, John Thickstun, Ishaan Gulrajani et al.
Summary
A request to generate text can specify how its words must fit together. A restaurant description may need a particular kind of phrase at a particular position. A sentence inserted into a story has to make sense in light of both the opening and the ending. These requirements are difficult to enforce one word at a time. An early choice can put a later phrase in the wrong place, and the usual left-to-right decoder has already committed to that choice by the time the problem becomes visible. The authors ask whether a generator can handle such requests at decoding time, using a fixed language model.
Diffusion-LM starts with Gaussian noise at every position and gradually turns it into a sequence of word vectors. Each pass works on the sequence as a whole. To adapt this process to text, the authors train the denoiser together with the vectors that represent words, teach it to estimate the clean sequence at every noise level, and learn a final readout that converts vectors into vocabulary items. The intermediate vectors give a separate control classifier something it can change. Its gradients favor changes that satisfy the requested condition, while the diffusion transition favors changes that the generator considers plausible. Requirements that can be expressed through known positions, such as a gap between two fixed pieces of text, can use the same generator without a classifier.
The experiments cover restaurant content, grammatical tag patterns, full parse trees, labeled phrases at specified positions, length, and story infilling. The authors characterize the gains over earlier plug-and-play methods as an approximate doubling of control success across the tasks. Diffusion-LM also beats the task-specific systems on full-tree and span control and is competitive on the other individual controls in that comparison. It retains more of the desired syntax when content and structure are requested together, at a cost in measured fluency. On infilling, its automatic scores are stronger than those of COLD and DELOREAN and slightly better than those of a generator trained specifically to fill gaps. Human evaluation finds no statistically significant advantage for either of the latter two systems. The task-specific systems in the individual control experiments obtain their conditioning ability through fine-tuning.
Learning the word representations helps most on ROCStories, the more varied of the training corpora. Predicting clean vectors also produces stable sample quality across the tested embedding sizes, where predicting the noise becomes unreliable at larger sizes. The authors release the Diffusion-LM code and identify higher perplexity, slower decoding, and slower training convergence as drawbacks. The results show where revising a whole sequence is useful enough to justify the extra work.
Deep dive: Diffusion-LM Improves Controllable Text Generation
Diffusion-LM refines noisy word vectors to steer sentence content and syntax, combine constraints, and fill gaps between given passages. · about 43 minutes to read
The problem and its context
A request can constrain several positions at once
An ordinary generator assigns probabilities to possible strings of words. A control introduces a further criterion for choosing among those strings. A topic can frequently be expressed in many places and in many ways. A sequence of grammatical tags is more specific. It can require the opening word to be a pronoun, the next a verb, and later words to fit further roles in order. A constituent tree goes beyond a sequence of tags. It records how words group into phrases and how those phrases fit inside larger units. A change to the number of words in one phrase can move several other phrases away from their required positions. These are different kinds of requests within text generation.
Consider the distinction between asking for a prepositional phrase somewhere in a sentence and asking for one across a designated interval. In the first case, a decoder can satisfy the condition when it reaches a convenient point. In the second, it has to arrange what precedes the phrase so that the phrase starts at the right position, then give the phrase the right extent. A tree can impose several related requirements of this sort at once. The difficulty comes from coordinating decisions that a decoder would otherwise make at separate times. The controls draw on syntax and grammar.
Infilling makes the problem visible without a grammatical annotation. The story is presented with a missing middle and observations on either side. The ending can suggest an action or event that the opening alone would give little reason to choose. A conventional prefix decoder can use the opening immediately. To make use of the ending, a system needs some way to bring that information into the decision about the gap. This is a question about generation order as well as a question about whether the resulting story is plausible.
Giving a fixed generator a new criterion
Supervised conditional training is a direct way to make a generator respond to a request. Supply text paired with the condition it meets, then train the system to produce text when given that condition. This lets the generator learn the relationship using its own parameters. The paper points to the cost of updating those parameters for different controls. Independently trained generators also leave a composition problem when someone wants the text to meet several requirements at the same time. The paper places conditional training in the tradition of CTRL.
Plug-and-play control assigns the two jobs to separate components. The generator learns general preferences from unlabeled text. A task scorer learns from labeled examples which text fits a particular control. Together they favor outputs that combine ordinary plausibility with evidence of compliance. A probabilistic parser, for instance, can supply a score for a proposed tree. This arrangement moves the work of adapting to a new policy for generation into the scorer and the decoding procedure.
The left-to-right form of earlier plug-and-play methods matters because intervention happens within that order. FUDGE scores a prefix by estimating whether it can grow into a sequence that meets the request, then uses the estimate to favor some next words over others. That strategy asks the scorer to infer properties of material yet to be written. GeDi and DExperts likewise influence the choice of the next word, using smaller generators trained for control. In a tag or tree task, the scorer has to account for how a choice will interact with positions beyond the prefix. One example of next-word reweighting is GeDi.
The closest precedent for changing a continuous representation through gradients is PPLM. It adjusts the autoregressive generator’s internal activations to influence the next prediction. The distinction between an activation and a sampled word is central. A gradient can change the former and thereby tilt the next choice. The decoder still takes the existing words as its prefix, so any earlier choice that made the target impossible stays in place. The authors use that distinction to motivate where they apply gradients in Diffusion-LM. The earlier intervention is Plug and Play Language Models.
Earlier infilling methods already offered ways to bring information from the right into a generation problem. The paper describes specialized training and also methods that use a continuous relaxation at decoding time. A relaxation replaces discrete choices with continuously adjustable quantities during the search for an answer. COLD uses this opportunity to propagate information from right context into earlier positions. The issue for Diffusion-LM is therefore whether a generator trained to refine a continuous sequence of latents provides a better starting point for control than a relaxation built around a generator trained to emit successive words.
Why use a diffusion process?
The paper draws on work in which diffusion learns to generate images or audio by reversing successive additions of noise. Each reverse step processes a representation of the complete object. Applied to language, that arrangement would allow a scorer to assess the relationships among positions while the sentence is still forming. A change to a later portion of the latent sequence could accompany a change to an earlier one. This can happen at several stages of refinement, each with a different amount of uncertainty. The basic procedure comes from work such as Deep Unsupervised Learning using Nonequilibrium Thermodynamics.
The authors distinguish their approach from earlier diffusion over discrete text. A discrete corruption process can, for instance, replace a word with a random item or send it into a designated absorbing state. The object at each position is still a member of a finite set. Continuous diffusion gives each position coordinates that can be adjusted by arbitrarily small amounts. If a scorer is differentiable with respect to those coordinates, its gradient identifies a direction in which to move them. The price of this interface is that the decoder eventually has to turn each resulting vector into a word.
There were also non-autoregressive approaches outside open-ended language generation. The paper discusses work on speech and translation, where the source input can restrict the set of reasonable answers. The authors cite evidence that methods developed for such settings struggled when used for general language modeling. Giving a generator a flexible output order thus leaves an important burden on the generative process itself. The vector sequence has to develop dependencies that make it read like ordinary text, even when the generation request supplies only a sparse condition. One antecedent is Non-Autoregressive Neural Machine Translation.
The method, step by step
What happens to a sentence during training and generation
During training, the authors know the words of the sentence. They turn those words into a row of vectors, one per position, and produce noisy versions of that row. The denoiser sees a noisy version together with an indication of how far along the corruption process it is. It learns to infer a clean vector sequence from that input. A word readout learns to identify the original vocabulary items. The representation, the prediction of clean vectors, and the final recovery of the words are parts of the same training problem.
During generation, the decoder has no original sentence to corrupt. It draws a starting row from Gaussian noise. The denoiser makes a tentative prediction about the clean sequence, and the reverse process uses that prediction to propose a less noisy row. A control scorer can assess the proposal and move it toward a target before it becomes the starting point for the next step. The final state is read as text. Training shows what the finished sequence should look like in vector space. Decoding repeatedly asks how the current state could get closer to such a sequence.
Learning and using a diffusion decoder for text
The steps in order.
For comparison, the paper uses the usual factorization of text probability into a sequence of conditional word probabilities.
pLM(w) = pLM(w₁) · ∏[i=2,…,n] pLM(wᵢ | w<ᵢ)
Here pLM is the generator’s probability distribution, w is a sequence of n words, and w₁ is its initial word. The index i designates a position, wᵢ is the word there, and w<ᵢ consists of the words before that position. The product ∏ multiplies the indicated conditional probabilities. The bar means “given.” In the diffusion decoder, a step advances through a noise schedule and has a representation for each position, including those that will eventually hold the last words.
Adding noise to a representation of text
An embedding is a vector associated with a vocabulary item. Putting the vectors in their original order records where their words came from. The denoiser works on this ordered collection of word embeddings.
Emb(w) = [Emb(w₁), …, Emb(wₙ)] ∈ ℝⁿᵈ
Emb names the learned mapping, w is the input text, and w₁ through wₙ are the words at its n positions. The brackets concatenate the word vectors and the ellipsis stands for the intervening positions. Each vector has d real coordinates. The symbol ∈ indicates that the concatenation belongs to ℝⁿᵈ, the space of real vectors with nd coordinates.
Diffusion starts near this embedding sequence. The paper inserts a Gaussian transition from the observed text to the clean continuous state.
qφ(x₀ | w) = 𝒩(x₀ ; Emb(w), σ₀I)
qφ is the probability density of the initial vector x₀ given the text w, and φ denotes the trainable embedding parameters. 𝒩 is the Gaussian density evaluated at x₀. Its mean is the concatenated embedding Emb(w), and its covariance is σ₀I, where σ₀ is the initial covariance scale and I is the identity matrix. This first sample can be close to the word vectors while still being a continuous random variable.
After this initial transition, the corruption rule is fixed. It attenuates the preceding state and adds independent Gaussian noise to its coordinates.
q(xₜ | xₜ₋₁) = 𝒩(xₜ ; √(1 − βₜ) xₜ₋₁, βₜI)
q denotes the fixed corruption process for the vector states. The index t is a diffusion step, xₜ is the state reached at that step, and xₜ₋₁ is the preceding state. The Gaussian 𝒩 has the scaled preceding state as its mean. The coefficient βₜ sets the variance of the new noise in each coordinate through βₜI. The square root √ gives the scale of the signal carried forward in the mean. The sequence of noise amounts is a design choice.
Composing Gaussian transitions gives a Gaussian at any noise level given the clean state. The paper denotes the cumulative retained signal by ᾱₜ. It comes from multiplying the retained-signal factors of the transitions up to that level.
ᾱₜ = ∏[s=0,…,t] (1 − βₛ)
ᾱₜ is the cumulative coefficient at step t, ∏ denotes the product, and s indexes the steps in the paper’s notation for that product. Each βₛ is the noise coefficient at step s. The factor in parentheses is the complementary signal coefficient. The Gaussian marginal can then be expressed as a scaled copy of the clean state plus a scaled sample of fresh noise.
xₜ = √ᾱₜ x₀ + √(1 − ᾱₜ) ε
xₜ has the forward distribution at time t given x₀, the clean state. ε is a draw from a Gaussian with mean zero and identity covariance. The square roots scale the clean vector and the noise by amounts determined by ᾱₜ. This expression describes a sample at a specified noise level. The individual steps remain relevant for defining how states along a single forward path relate to one another.
The authors choose a square-root schedule for how quickly the signal declines.
ᾱₜ = 1 − √(t/T + s)
Here ᾱₜ is the schedule value at step t, T is the diffusion horizon, and s now denotes a small offset for the starting noise level. The quotient t/T expresses progress along the schedule. The authors give 1e-4 for the offset and 2000 for the horizon, and describe the starting noise standard deviation as 0.1. They report a rapid change over the first 50 steps followed by a slower increase in noise.
Their explanation begins with the vocabulary geometry. A slightly perturbed vector can still have the same nearest word embedding as the original vector. If the task is ultimately to identify that word, many tiny changes in the low-noise region can leave the recovery problem nearly the same. The schedule allocates relatively little of the chain to such changes. It also slows the additions of noise after the early steps, because recovering meaningful text from very noisy states can be difficult. A schedule thereby influences which denoising problems the shared network encounters throughout training.
Learning to run the process in reverse
A standard continuous diffusion decoder starts from an approximately standard Gaussian endpoint. It learns a distribution over the preceding, less noisy state, given the current state and the timestep.
pθ(xₜ₋₁ | xₜ) = 𝒩(xₜ₋₁ ; μθ(xₜ, t), Σθ(xₜ, t))
pθ is the learned reverse transition, and θ denotes its parameters. The density is evaluated at xₜ₋₁, the proposed next state in the reverse direction, given xₜ. The Gaussian 𝒩 has mean μθ(xₜ, t) and covariance Σθ(xₜ, t). These functions depend on the input vector sequence and the step index t. Diffusion-LM uses a shared denoiser over all timesteps. Processing all the positions lets a prediction for one word use information from elsewhere in the latent sequence. The denoiser uses a Transformer.
The continuous diffusion objective compares the learned generation process with reverse transitions inferred from corrupted data. Its variational form uses a known forward path to construct a bound. Written as a loss to minimize, it upper-bounds negative log likelihood. Taking its negative gives a lower bound on log likelihood.
L_vlb(x₀) = E[q(x₁:ₜ | x₀)] {
log[q(xₜ | x₀)/pθ(xₜ)]
+ ∑[t=2,…,T] log[q(xₜ₋₁ | x₀, xₜ)/pθ(xₜ₋₁ | xₜ)]
− log pθ(x₀ | x₁)
}
In this block the endpoint and path in the first two lines are indexed by the horizon T: xₜ in the first logarithm denotes the terminal state, and x₁:ₜ denotes the path through that endpoint. Within the sum, t ranges over the indicated timesteps. L_vlb is the variational loss at the clean state x₀, and E averages the bracketed terms over paths drawn from the fixed corruption process q. The first log takes the logarithm of the ratio between the terminal corruption density and the generation prior pθ there. The sum ∑ compares, at each interior transition, the forward process’s posterior given both x₀ and xₜ with the learned reverse distribution given xₜ. The last term is the negative log density assigned to x₀ by the last reverse step from x₁.
These terms have distinct roles. The endpoint comparison tests whether the corruption process ends in the region from which generation starts. The middle terms compare how the learned decoder and the forward process distribute their probability over a less corrupted state. The final term assesses recovery of the clean example. For a known training sentence, access to the clean state makes the middle posterior tractable. This provides a target even though the learned decoder has to do its work with a noisy input.
The paper follows previous work in simplifying the variational objective for practical training. In the Gaussian comparison, the part of an intermediate loss that depends on the means is a weighted squared error. The paper writes that relationship as follows.
E[log(q(xₜ₋₁ | x₀, xₜ)/pθ(xₜ₋₁ | xₜ))]
= E[(1/(2σₜ²)) · ‖μθ(xₜ, t) − μ̂(xₜ, x₀)‖²] + C
E averages over forward paths given x₀, the clean state. The log ratio compares the Gaussian posterior q for xₜ₋₁ at step t with the learned reverse density pθ at that state. μ̂(xₜ, x₀) is the posterior mean when the current state xₜ and clean state are known. μθ(xₜ, t) is the predicted mean. The squared norm ‖·‖² sums squared coordinate errors. σₜ² is the variance in the weighting of that error, and C is the constant in the Gaussian comparison.
Dropping the variance weights and constants gives the familiar mean-prediction surrogate used in the paper’s development of the text objective.
L_simple(x₀) = ∑[t=1,…,T] E[q(xₜ | x₀)] ‖μθ(xₜ, t) − μ̂(xₜ, x₀)‖²
L_simple is the simplified loss at x₀. The sum goes over steps t through the horizon T. For each step, E takes an expectation over the noisy state drawn from the forward marginal q(xₜ | x₀). The two means are the predicted reverse mean μθ and the forward process’s posterior mean μ̂, with the last-step target corresponding to reconstruction. The squared norm measures the difference between the two vectors. The surrogate trades the likelihood-bound interpretation for a regression problem whose terms can be easier to optimize. Stability of variational diffusion training is also the subject of Improved Denoising Diffusion Probabilistic Models.
Making the endpoints work for words
A continuous decoder can return a vector at each position, but each position ultimately needs a vocabulary choice. The authors attach a readout that assigns probabilities over the vocabulary separately at every position.
pθ(w | x₀) = ∏[i=1,…,n] pθ(wᵢ | x₀,ᵢ)
pθ(w | x₀) is the probability of the observed word sequence w given the clean latent sequence x₀. The index i ranges across n positions, and wᵢ is the word read at position i. The corresponding vector is x₀,ᵢ. Each factor is a softmax distribution, which normalizes the vocabulary scores into probabilities, and ∏ multiplies the probabilities of the observed words. At inference, picking the most probable word at each position gives the sequence selected by this readout.
That last factorization concerns the conversion to text. The vector at one position has already been processed along with all the others by the denoiser. It can reflect dependencies learned over the whole sentence before the readout assigns word identities. The positionwise computation also lets the training objective charge a reconstruction cost for every observed word, including cases where a vector carries contextual information but is difficult to identify as a particular item.
The end-to-end variational loss incorporates the initial word-to-vector transition and the final vector-to-word transition.
L_e2e,vlb(w) = E[qφ(x₀ | w)] {
L_vlb(x₀) + log qφ(x₀ | w) − log pθ(w | x₀)
}
L_e2e,vlb names the end-to-end variational loss for w, the observed sentence. The expectation E averages over clean vectors x₀ sampled through the learned embedding density qφ. L_vlb(x₀) is the continuous loss just described. Its two companions are the log density of the sampled vector under qφ and the negative log probability of recovering the original words under the readout pθ. The parameters of that first density influence the input to the entire denoising problem. The parameters of the readout influence which vectors can be decoded successfully.
To let gradients reach the learned embeddings through a random Gaussian sample, the authors use reparameterization. The random draw supplies an offset independently of the mean. For a particular draw, the coordinates of the sample still depend differentiably on the embedding. Training can use that dependence to adjust the representation according to what happens during denoising and reconstruction. The paper draws on the technique used in Auto-Encoding Variational Bayes.
A compact expression in the paper gives the simplified end-to-end objective in terms of the continuous denoising loss and two terms for the word boundary.
L_e2e,simple(w) = E[qφ(x₀:ₜ | w)] {
L_simple(x₀) + ‖Emb(w) − μθ(x₁, 1)‖² − log pθ(w | x₀)
}
L_e2e,simple is the simplified loss for text w. The path x₀:ₜ in this expectation extends from the clean state to the terminal timestep T. The expectation E uses qφ, the path law beginning at the learned embedding transition and continuing under fixed corruption. L_simple(x₀) denotes the continuous denoising loss. The squared norm compares the learned embedding sequence Emb(w) with the reverse mean μθ(x₁, 1) from the first corrupted state. The final term is the negative log probability of reading w from x₀ under pθ. The appendix distinguishes the noisy endpoint, the intermediate denoising comparisons, and the reconstruction terms explicitly.
This design gives the embedding space a job. Word vectors have to remain useful after Gaussian perturbation, and the vectors produced near the clean end have to support word identification. The authors tried fixed random vectors and fixed pretrained representations before choosing joint training for generation and control. Pretrained vectors encode distances acquired for another purpose. An embedding learned with the denoiser can adapt its geometry to the corruptions and predictions actually used by the decoder. A pretrained representation considered in the preliminary experiments is GloVe.
From a nearby noisy state to a clean prediction
Predicting the preceding noisy state can reward accuracy at a particular noise level without requiring the prediction to indicate a precise vocabulary item. Near the end of generation, this becomes a problem. The decoder has to identify words from vectors that may still sit ambiguously between candidates. The authors change the training target so that the denoiser makes a prediction of the clean state at every noise level. The amount of corruption can vary considerably across training examples. Each prediction is compared with a target on the clean side of that corruption.
L_x₀-simple(x₀) = ∑[t=1,…,T] E[q(xₜ | x₀)] ‖fθ(xₜ, t) − x₀‖²
L_x₀-simple denotes the clean-state version of the simple denoising loss. fθ is the network’s prediction of x₀, with learned parameters θ, from the input xₜ at step t. E averages over forward corruption q at that step. The sum ∑ covers the steps through T, and the squared norm measures the coordinate error in the clean prediction. The objective thereby rewards recovering the same clean sample at different noise levels.
The reason a clean estimate can drive a reverse transition is that the Gaussian posterior mean is available from the current and clean vectors. At inference, the current vector is known and the network estimates the other input.
μ̂(xₜ, x₀) =
(√ᾱₜ₋₁ βₜ / (1 − ᾱₜ)) x₀
+ (√αₜ (1 − ᾱₜ₋₁) / (1 − ᾱₜ)) xₜ
The symbol μ̂ is the mean of the posterior for xₜ₋₁ given xₜ and x₀. The current transition has noise coefficient βₜ and retained-signal coefficient αₜ, the complement of βₜ. ᾱₜ and ᾱₜ₋₁ are the cumulative signal coefficients through the current and preceding levels. The square roots and ratios give the weights on the clean and current vectors. When the paper substitutes the predicted clean vector, the second term stays the same. The error in the inferred reverse mean is consequently a scaled version of the error in the clean vector. The scale varies with the timestep. Using the clean error directly changes the relative weight given to different steps.
In the complete objective, the authors retain the word reconstruction term along with a penalty associated with the noisy endpoint. The clean estimate at the last reverse step is compared with the embedding of the observed sentence.
L_e2e,x₀-simple(w) =
E[qφ(x[0:T] | w)] {
‖m(x[T], x₀)‖² + ∑[t=2,…,T] ‖x₀ − fθ(xₜ, t)‖²
}
+ E[qφ(x[0:1] | w)] {
‖Emb(w) − fθ(x₁, 1)‖² − log pθ(w | x₀)
}
L_e2e,x₀-simple is the full clean-prediction surrogate for w. The expectations E use the learned-forward path distribution qφ conditioned on the text. x[0:T] is the full sequence of latent states and x[0:1] is its initial segment. m(x[T], x₀) names the forward endpoint mean given x₀, whose squared norm measures its displacement from zero. The sum over t scores the clean estimates fθ(xₜ, t) against x₀. In the second expectation, the estimate from x₁ is scored against Emb(w), the embedding sequence, and − log pθ(w | x₀) charges for word reconstruction. The norm in each term measures squared coordinate error.
The endpoint term addresses a shortcut available to learned embeddings. When a schedule leaves some clean signal at its endpoint, embeddings with large norms can be easy to recognize after corruption. That can make the intermediate reconstruction problems easier during training and simultaneously move the terminal states away from the zero-centered Gaussian used to begin generation. The endpoint penalty discourages that outcome. If the schedule removes the signal completely, the endpoint mean is already zero and the term is constant.
Using a vocabulary estimate during sampling
At decoding time the authors can constrain the clean estimate to lie on learned word embeddings. They call this operation clamping. For each position it finds the vocabulary embedding nearest to the denoiser’s proposed clean vector. The sampler uses the resulting row of embeddings to construct its next proposal. The paper illustrates the replacement using a Gaussian expression.
xₜ₋₁ = √ᾱ · Clamp(fθ(xₜ, t)) + √(1 − ᾱ) ε
Here xₜ₋₁ is the less noisy sample, fθ(xₜ, t) is the clean estimate from the current state xₜ and step t, and Clamp replaces each estimate by its nearest word embedding. ᾱ is the cumulative coefficient for the noise level in this Gaussian sampling expression, √ denotes a square root, and ε is standard Gaussian noise. The appendix describes reverse sampling using the Gaussian posterior conditioned on the current state and the estimated clean state. Clamping changes the estimate that is supplied to the sampling calculation.
The operation gives the sampler a clear word identity to work with at each position in that prediction. The next latent is still a continuously valued sequence. When it goes through the denoiser, the proposed words can change again. This is how intermediate clamping can coexist with revision. Final rounding has a separate role. It uses the learned vocabulary probabilities to turn the last latent state into the discrete output. The authors regard clamping under heavy noise as a potentially premature commitment, since the current vector may offer little evidence for choosing a word. They treat the step at which to start clamping as a possible decoding setting.
Steering a reverse transition
The Bayesian description of control begins with a product. Ordinary text probability favors plausible outputs. The probability of a target given a candidate supplies the preference specific to the request.
p(w | c) ∝ pLM(w) · p(c | w)
w is a candidate sequence and c is the requested condition, such as a grammatical pattern. p(w | c) is the target distribution, pLM(w) is the generator’s probability for the sequence, and p(c | w) is the probability a classifier assigns to the target when given that sequence. The dot means multiplication, and ∝ leaves out the normalizing constant for a fixed request. This formulation gives a precise meaning to preferring candidates that do well according to both components.
Diffusion-LM steers the latent path by applying this reasoning to each step from the current state to the proposed less noisy state. The authors assume the proposed state is sufficient for the classifier’s estimate of the target, so the control factor can be written as a function of that state alone. The reverse-transition probability still depends on the current state. Taking logarithms makes the factors additive, and the gradient with respect to the proposal decomposes accordingly.
∇[xₜ₋₁] log p(xₜ₋₁ | xₜ, c)
= ∇[xₜ₋₁] log p(xₜ₋₁ | xₜ) + ∇[xₜ₋₁] log p(c | xₜ₋₁)
∇[xₜ₋₁] denotes differentiation with respect to the coordinates of the proposed state xₜ₋₁. The log on the left gives the conditional reverse density with the current state xₜ and control c held fixed. The first log on the right gives the ordinary diffusion transition density. The last log gives the classifier score for target c on the proposed state. Conditional independence is what permits the classifier term to omit the noisier xₜ. The normalization in the conditional density is constant with respect to the proposal and disappears from this derivative. The authors relate this treatment of guidance to Score-Based Generative Modeling through Stochastic Differential Equations.
The actual decoding objective weights the transition probability explicitly. An update can then favor a proposal that improves the classifier score while charging for a move into a region the generator considers unlikely.
λ log p(xₜ₋₁ | xₜ) + log p(c | xₜ₋₁)
λ sets the strength of the reverse log density log p(xₜ₋₁ | xₜ) relative to the control log probability log p(c | xₜ₋₁). The vector being moved is xₜ₋₁, and xₜ and c are fixed during these updates. The authors call the reverse-density term fluency regularization. It measures the preference of the reverse transition in vector space. Their experimental fluency score is computed later on the output text.
The guided decoder starts from a stochastic proposal and runs 3 AdaGrad updates per diffusion step. AdaGrad adapts how the gradients change the coordinates of the latent. The optimization is over the current proposal, so the denoiser can keep its learned parameters across different requests. In the hyper-parameter search, the authors consider 0.05, 0.1, 0.15, and 0.2 as latent learning rates. They consider 0.1, 0.01, 0.001, and 0.0005 for the fluency weight. They reduce the number of reverse steps to 200 in the E2E setup to offset some of the work of classifier guidance. The ROCStories decoding setup keeps 2000 steps.
The task scorers learn to read the noisy latents. For semantic content, a GPT-2 small architecture is trained to predict a field and its value from the input. The score for the target uses log probabilities of the value’s tokens. For grammatical tags, each position receives a softmax over tags. The log probabilities of the required tags are added across positions. This gives each position a contribution to the control even when several words are still uncertain. The tagger uses a base architecture from BERT, and its task is part-of-speech tagging.
The tree scorer predicts a category for each candidate interval of positions. Its alternatives include an outcome for intervals that form no constituent. A whole-tree score adds the log probabilities for the intervals that have a requested label and the intervals that the target tree leaves without one. A span score uses the same parser and asks only for the probability of the requested category over the chosen interval. A single trained parser can therefore supply distinct objectives for a local phrase and a complete hierarchical structure. The architecture follows Constituency Parsing with a Self-Attentive Encoder.
The decoder can add the log scores from separate classifiers when a request specifies several properties. Each scorer acts on the same proposed sequence. For example, a value that the semantic classifier favors may have to appear in a position where the syntactic scorer favors a matching grammatical category. The combined gradient reflects both demands. The procedure makes combining the signals straightforward. How well they can be realized together depends on their compatibility and on how well the scorers identify useful changes.
Keeping known positions and selecting a candidate
The length and infilling tasks use controls specified directly in the sequence. A length request constrains where the output ends. An infilling request gives an opening and a closing observation at known parts of the sequence, leaving material between them to generate. The generator can accommodate that layout through its latent positions. Diffusion-LM uses these controls without training separate classifiers to infer the requested length or recognize the given observations. The infilling system is trained on ordinary story text, where the model learns how words and sentences connect throughout a sequence.
For a task that calls for a single answer, the paper uses minimum Bayes risk decoding. The decoder draws a set of candidates, then scores each candidate by its average loss against the set itself. Agreement depends on the choice of loss. For example, negative BLEU favors a candidate with more overlap with the other samples. The overlap measure is BLEU score.
ŵ = argmin[w ∈ S] ∑[w′ ∈ S] (1/|S|) L(w, w′)
S is the set of sampled sequences and |S| is its size. w denotes a candidate and w′ denotes a sampled comparison sequence, with ∈ indicating membership in S. L(w, w′) is the loss for choosing the candidate when compared with that sequence. ∑ adds the losses and 1/|S| gives each comparison the same weight. The argmin operator returns a candidate achieving the smallest average, and ŵ is that chosen sequence. The set serves as an empirical view of the outputs the generator finds plausible. A candidate with little support from the rest can lose to one that better reflects the collection. This decoding procedure comes from Minimum Bayes-Risk Decoding for Statistical Machine Translation.
Experiments and results
Training corpora and evaluation settings
The authors train on E2E and ROCStories. E2E contains 50K restaurant descriptions, annotated with 8 fields that include food type, price, and customer rating. A field supplies the category of information to mention, and its annotated value supplies a concrete target. ROCStories contains 98K five-sentence stories about everyday events, with a vocabulary of 11K words. The authors regard the stories as harder to model because they cover a wider range of meanings and relationships among events. The restaurant corpus comes from The E2E Dataset.
The main diffusion generator has 80M parameters and a sequence length of 64. It uses a BERT-base architecture and is trained with 2000 diffusion steps. The authors consider embedding dimensions of 16, 64, 128, and 256, choosing 16 for E2E and 128 for ROCStories. They train with AdamW, a batch size of 64, dropout of 0.1, and a linearly decaying learning rate starting at 1e-4. Training runs for 200K iterations on E2E and 800K on ROCStories. For scale, the paper reports approximately 5 hours for 200K training iterations on a single A100.
In the control-target setup, the authors draw 200 targets from validation splits and generate 50 samples per target. The meaning of success depends on the request. They separately report the perplexity of generated text under a fine-tuned GPT-2 teacher, calling that measure lm-score. Lower values mean the teacher assigns greater probability to the text in the sense captured by perplexity. The fine-tuned evaluator can handle the unknown-word token used by both the base autoregressive generator and Diffusion-LM. This score measures something different from the probability assigned to corpus examples by the generator itself.
What the individual control tasks measure
For restaurant content, the requested field identifies the information of interest. The experiment checks for an exact match to its value. This makes the success test specific enough to distinguish a request for a particular rating or business name from a general demonstration that the output concerns restaurants. A system can favor restaurant vocabulary broadly and still fail to produce the actual requested value.
A tag-sequence request assigns a grammatical tag to each word position. An evaluator tags the generated words and the reported success measure is word-level exact match with the requested tags. Full-tree control is evaluated by parsing the output and reporting F1 against the target tree. F1 incorporates the agreement of the recovered constituents with those requested, accounting for both missing and extra constituents. This leaves room for partial success. An output that brings later constituents back into alignment can recover credit even when an earlier constituent has the wrong boundaries.
Span control singles out an interval and a label, such as prepositional phrase. Success is the fraction of these requests for which the designated span matches exactly. That task places a local requirement inside a sentence whose surrounding structure can vary. The length task asks for counts from 10 through 40 and accepts a generated length within ± 2 of the target. Diffusion-LM uses direct positional control for length. The other systems in the control comparison use task conditioning or a control scorer.
Infilling has a separate protocol. The given left and right observations come from aNLG, and the generated sentence is meant to explain a plausible connection between them. The authors report automatic and human evaluation from Genie. This asks for more than preservation of the known words. A proposed sentence can use vocabulary from both observations and still leave a poor causal or temporal transition between them.
Comparison with methods that steer a prefix
PPLM and FUDGE use a GPT-2 small generator trained from scratch. PPLM is evaluated on semantic content because its classifier in this experiment lacks the positional information needed by the other controls. FUDGE scores partial sentences using a future discriminator trained for the relevant task. A separate set of GPT-2 comparisons trains on pairs of controls and texts. These systems are identified as FT-sample when outputs are sampled at temperature 1.0, and FT-search when decoded by beam search with beam size 4. The paper’s term “oracle” for fine-tuning refers to supervised access to the control during training.
The authors report that Diffusion-LM outperforms the plug-and-play comparisons across the individual control evaluation. The gains over the fine-tuned systems are concentrated in parse-tree and syntax-span control. For content, grammatical tag patterns, and length, the paper describes performance as similar to fine-tuning. Its overall description of the gain over earlier plug-and-play approaches is close to a doubling of success. The separate metrics matter to this reading. A tree F1 score, exact value occurrence, and success within a length tolerance all credit different kinds of behavior.
PPLM performs poorly on the semantic content comparison. The authors conjecture that a method designed to move a sentence toward a broad attribute is less suited to causing a particular expression to appear. FUDGE does well on semantic content and has more trouble with the remaining controls. When a prefix assigns a position the wrong tag, the future discriminator can give low scores to every available continuation. With a target span or length, the discriminator also has to forecast the arrangement of material that is still absent. The authors propose those demands as reasons for the observed pattern.
The tree examples provide a concrete view of how a mismatch can affect an output. In an example generated by Diffusion-LM, an early phrase has 1 more word than its target. The sentence omits a conjunction later, with the result that subsequent spans match the requested boundaries again. In an example from fine-tuning, a phrase is 1 word shorter than intended and several following spans remain out of alignment. These outputs illustrate localized and propagated errors. They show how the final sentences align with their trees, while the general claim about the decoder’s ability to revise comes from its sequence-level construction.
The authors suggest that the diffusion states offer opportunities for control on different scales. In a highly noisy state, the classifier can act on variables representing the entire sentence before specific words are settled. Later in the chain, a change to a few positions can help realize a more detailed requirement. The advantages observed on structural and positional tasks are consistent with that explanation. The benchmark compares complete systems, each with its own training and decoding procedure.
What happens when the request specifies content and syntax
The composition experiment pairs restaurant content with either a full tree or a sequence of tags. Diffusion-LM adds the scores of the independent task classifiers during inference. The comparisons are FUDGE and FT-PoE. The latter is a product of experts built from separate fine-tuned systems, so its score reflects the preferences of both systems. The experiment tests whether doing well on the individual requests carries over to a decoding problem in which each request limits the options available to satisfy the other.
The authors report high success on both components for Diffusion-LM, with its clearest advantages on the structural components. FUDGE’s syntax performance is weak in the combined setting, as it is when syntax is controlled alone. The separate fine-tuned systems can perform well on semantic content and tags individually, but their product loses success on both tasks when the controls are combined. This gives an example where independently effective conditional predictors are difficult to use together.
The composition gains come at a cost in lm-score. Outputs that satisfy more of the requested structure can be less probable under the fluency teacher. The result therefore has a practical condition. Choosing primarily for strong agreement with both requests can produce a different set of sentences from choosing primarily for ordinary text probability. The two components of a composition also have their own success scores. It matters whether a method preserves the syntactic demand alongside the content demand, especially when content is the easier part of the pair.
Filling the middle of a story
The infilling experiment compares Diffusion-LM with two methods that relax discrete text into a continuous space and with a generator trained specifically to fill gaps. DELOREAN uses a left-to-right generator and updates a continuous representation of the proposed output to improve its connection to the right context. COLD samples in a continuous space using an energy that incorporates fluency from both directions and a coherence term based on lexical overlap. Both methods round their continuous results into text.
AR-infilling takes a dedicated training route. It reorders ROCStories examples so that the two observed pieces precede the middle sentence. The autoregressive decoder learns to write the middle after reading both observations. This design makes the right context available through the prefix at inference. Diffusion-LM instead handles the gap with the known material on its two sides, using a decoder learned from story sequences without that infilling-specific rearrangement.
The paper reports stronger automatic results for Diffusion-LM than for COLD and DELOREAN, whose comparison scores come from their earlier papers. Diffusion-LM also scores slightly higher automatically than AR-infilling. The human evaluation finds no statistically significant difference between Diffusion-LM and AR-infilling. In this experiment a general diffusion generator can thus produce competitive infills against a generator that received training specifically organized for the task. The human comparison supports similar performance at the resolution of that evaluation, while the automatic scores supply a separate comparison against the references.
Probability assigned to text and time spent decoding
Negative log likelihood asks how much probability a generator assigns to observed text, with lower values preferred. For the diffusion system exact likelihood involves integrating over latent paths, so the authors report a variational upper bound on negative log likelihood. The comparison with an autoregressive Transformer is given in nats per token. These results concern likelihood-oriented variants of Diffusion-LM.
Reported negative log likelihood on E2E by generator
The autoregressive Transformer records the lower value in the likelihood comparison.
The numbers
| System or setting | NLL, nats per token |
|---|---|
| Autoregressive Transformer | 1.77 |
| Diffusion-LM (this paper) | 2.28 |
Reported negative log likelihood on ROCStories by generator
The diffusion model's variational bound is higher than the autoregressive Transformer result.
The numbers
| System or setting | NLL, nats per token |
|---|---|
| Autoregressive Transformer | 3.05 |
| Diffusion-LM (this paper) | 3.88 |
The likelihood appendix uses vocabulary-sized one-hot vectors, with a coordinate marking each vocabulary item. It trains in continuous time against a likelihood bound and learns a noise schedule intended to reduce loss variance. The output uses a softmax, and training replaces squared-error terms with cross-entropy terms to help optimization. The evaluation retains the original squared-error objective. The appendix also describes a transformation of each noisy input before it enters the Transformer layers.
x_new = softmax(α(t)x + β(t))
x_new is the transformed input and x is the original vector at time t. α(t) is a learned scalar that scales the input. β(t) is a learned vector with a coordinate for every vocabulary item, and it shifts those coordinates before the transformation. Both functions are computed by learned multilayer networks. The softmax normalizes the resulting coordinates. These time-dependent functions in the likelihood variant are distinct from the fixed corruption coefficients used to describe the generation setup. The likelihood variant also omits the rounding procedure discussed for the main decoder.
The likelihood comparisons include Transformers of roughly 100M and 300M parameters. For a larger-data condition, the authors fine-tune GPT-J on ROCStories, generate 8M synthetic training examples, and use them for pretraining before fine-tuning and evaluating on the original corpus. In the combined scaling experiment, the diffusion negative log-likelihood bound on ROCStories goes from 3.88 to 3.10. The authors report that their likelihood improvements yielded no corresponding improvement in generation quality in their experiments. That observation motivated using the embedding-based variant for the control evaluations.
Decoding has a different cost profile from left-to-right generation. An autoregressive generator advances by word position. The diffusion generator advances through successive noise levels, processing the sequence at each level. Even at 200 steps, the authors report ordinary diffusion decoding to be 7x slower than their autoregressive comparison. The appendix gives about 1 minute to decode 50 sequences of length 64 in its discussion of the full diffusion chain.
The relative timings change when the comparison systems also do extra work to enforce a control. The authors report that guided Diffusion-LM is 1.5x slower than FUDGE and 60x faster than PPLM. In the appendix, both Diffusion-LM and FUDGE generate 50 controlled samples with batching, taking about 80 seconds and 50 seconds, respectively. PPLM takes about 80 minutes for 50 samples without batching. The discussion attributes its time to repeated gradient updates per word. The guided diffusion decoder instead calls its classifier at each reverse step. These timings describe the stated decoding and batching regimes.
What the ablations show
The representation affects generated text
The main ablations score 500 generated samples with lm-score. Comparing random and learned embeddings changes the representation on which the denoiser operates. Learned embeddings give better sample quality on both corpora by this measure, with a more pronounced advantage on ROCStories. The finding supports letting the word vectors adapt to denoising, especially on the corpus with the larger vocabulary and more varied subject matter.
The authors also project the learned embeddings into a visualization and mark words by grammatical tag. Words with the same tag tend to group together in the projection. This is a qualitative observation about the trained representation. It gives a plausible indication that the vector space preserves some distinctions of use to syntax control. The embedding ablation measures sample fluency after swapping the representation design. The projection shows one kind of organization that the learned vectors acquire. A scorer’s quantitative dependence on that organization would require a comparison that isolates it.
The likelihood variant puts the generation ablation in context. The paper found fixed vocabulary-simplex representations helpful for the held-out likelihood objective. Its learned, lower-dimensional vectors give the better generation and control behavior described in the main experiments. The result therefore depends on which outcome is optimized. An embedding can make corrupted word vectors easier to recover and read while a different representation serves an objective centered on probability estimates.
The recovery target matters as the embedding grows
The other main ablation compares predicting the clean sequence with predicting the noise added during corruption. With the forward coefficients and current state, a noise prediction can be converted into a clean estimate. Nevertheless, applying squared error to the noise imposes different weighting across the denoising problems from applying it to clean vectors. The practical comparison consequently matters even though the prediction targets are mathematically related.
The noise predictor gives acceptable results at small embedding dimensions and deteriorates sharply at larger ones. The clean predictor maintains good performance across the dimensions explored. The experiment measures this through the fluency of completed samples, so its direct result is about sample quality and its sensitivity to dimension. The connection to word identity comes from the objective. A predictor trained directly on clean vectors gets a target tied to the word representations at each noise level, including stages where the preceding noisy state alone would be a weak signal about how precisely the final vectors need to identify words.
Clamping acts at a different point. It changes what the sampler does with an estimate after training. Applying it throughout decoding had little adverse effect in the authors’ experience, in spite of their concern about selecting vocabulary embeddings early. The objective comparison gives evidence for the importance of learning to predict clean vectors. The clamping observation indicates that using vocabulary locations during sampling can be compatible with subsequent revision. Its reported support is qualitative.
Schedule and architecture effects are conditional on the setup
The additional ablations compare the square-root schedule with the linear and cosine schedules used in earlier image work. The square-root schedule performs consistently across the dimensions and parameterizations tested. Its advantage is less pronounced when the prediction target is already the clean state, with a stronger robustness benefit under alternatives such as noise prediction. Thus an ablation of the schedule alone would give different impressions depending on the training objective held fixed. Both choices affect the emphasis placed on problems at different noise levels.
The authors also adapt a U-Net from image diffusion, replacing its two-dimensional convolutions with convolutions along the sequence. The Transformer performs better in the resulting comparison. This gives empirical support for the sequence backbone used in the main experiments. It evaluates a particular adapted U-Net under the authors’ diffusion setup. How these backbones compare can depend on their capacity, training, and treatment of long-range relationships among positions.
Shortening the reverse chain is another controlled comparison with a direct implication for runtime. The authors sample on a coarser version of the original schedule, reducing 2000 diffusion steps to 200. Quality is largely preserved for E2E and declines for ROCStories. The same change in the sampler thus buys time at different costs, depending on the corpus. The result explains the difference in decoding schedules used in the experimental setup and shows why a speedup measured on the restaurant descriptions cannot simply be carried over to the stories.
Finally, replacing AdaGrad with stochastic gradient descent makes the latent updates more sensitive to hyper-parameter choices in the authors’ trials. They also report that the diffusion term in the guidance objective is important for fluency. These observations concern different parts of decoding. The optimizer determines how a scored direction is translated into a move in vector space. The regularizer determines how a move that pleases the classifier is weighed against the probability of the reverse transition. The paper gives a qualitative account of these effects alongside its main sample-quality ablations.
Limitations
Limits identified by the authors
The authors identify higher perplexity, slower decoding, and slower training convergence as limitations of the diffusion systems they built. The likelihood experiment gives quantitative evidence for the first concern. Its diffusion values are bounds, so their precision as comparisons of exact likelihood depends on the tightness of those bounds. They are also obtained from variants designed for likelihood, with a different representation and loss from the versions used for the headline control results. Improving the likelihood bound did not improve generated samples in the authors’ tests.
The decoder’s repeated passes account for the second cost. It makes a sequence-level prediction at each noise level, and guided generation adds gradient updates between passes. Fewer steps reduce the amount of work, with the study of step skipping showing a quality cost for the more challenging story corpus. The measured timings also depend on batching. In particular, PPLM’s appendix timing uses unbatched samples, while the diffusion and FUDGE timings use batches. The comparison establishes how the reported implementations behaved under those settings.
Training convergence is a separate issue. The exact variational training setup needs gradient clipping at 1.0 and importance sampling of loss terms for stability in the authors’ experiments. The simplified end-to-end objective avoids those requirements in their setup. For the likelihood runs on the original small corpora, the authors also report reaching minimum test loss early and then overfitting. These observations concern distinct aspects of training. One concerns the optimization of a difficult objective, and the other concerns how long improvements on the training distribution continue to carry over to held-out data.
Limits visible in the measurements and scope
Semantic success on E2E is defined by a value match. That establishes whether the requested wording appears. A request to correctly attribute a value within a more involved statement would need an evaluator sensitive to the relationship between the words, including their context. The grammatical evaluations likewise depend on the tagger and parser used to score the outputs. A strong tree F1 score demonstrates agreement under that evaluator and allows partial credit for a close tree. A requirement for exact agreement over a whole sentence would demand a different success statistic.
The teacher fluency score describes the output through the probabilities of a separately trained GPT-2. This gives a common automatic measure across the individual and composed controls. A lower fluency score under that teacher and stronger compliance with a constraint are distinct outcomes. Human judgments are reported for infilling, so they address the quality of the connection between observations in that setting. The absence of a statistically significant difference from AR-infilling leaves uncertainty about how large a difference the evaluation could resolve.
Plug-and-play control here depends on having a scorer that accepts diffusion latents. A parser that handles finished sentences does not automatically supply useful gradients from a highly noisy vector sequence. The authors train task-specific scorers on diffusion representations for the classifier-guided experiments. The demonstration is that the generator can be reused with such scorers. Length and infilling illustrate another possibility when the necessary information is available from positions and known context.
The composition results cover pairs of controls on the same kind of output. They establish that adding scores can work for those combinations. They leave open how the decoder behaves when many requests compete or when two strong scores consistently prefer incompatible words. Adding gradients is straightforward to implement, while deciding how competing requirements should be traded off is an additional problem. The observed loss in teacher fluency gives a concrete case in which stronger constraints already affect another quality criterion.
The main generation setup uses short restaurant descriptions and short commonsense stories, with sequences of length 64. The tasks provide evidence about phrase placement, sentence-level syntax, and the relationship between given observations. Evidence about revision across long documents would require outputs where distant parts of a document constrain each other. The larger synthetic story corpus supplies evidence about scaling the likelihood experiment. The paper’s controls are evaluated under their own settings, so the likelihood improvement by itself leaves open what would happen to structural control at larger scale.
The authors also discuss possible societal uses and risks of stronger control. They consider steering away from toxic text or inaccurate statements, and they note the possibility of targeted disinformation. They suggest watermarking as another case where a generator might be asked to balance distinguishability and fluency. These are proposals and projections. The paper’s empirical evidence concerns the content, syntax, length, and infilling tasks that it scores.
What came after
Diffusion for a sequence conditioned on another sequence
Diffusion-LM shows how a decoder can refine an output sequence while receiving information about the desired outcome. A fixed input sequence provides a different source of information from a parser score or a requested restaurant field. A sequence-to-sequence task asks for an output related to that supplied sequence. The later DiffuSeq work puts diffusion into that setting, carrying the idea of iterative text generation to a different form of conditioning. DiffuSeq
DiffuSeq-v2 takes up the connection between discrete and continuous text spaces with accelerated sequence-to-sequence generation as its stated goal. That connection was already a substantive part of Diffusion-LM. The generator needs a continuous representation suitable for its reverse steps and a vocabulary representation suitable for reading the result. Moving between those representations can affect the work a decoder does. The later work makes the design of that interface part of the speed problem in sequence-to-sequence diffusion. DiffuSeq-v2
Defining what a partially generated sequence contains
DiffusionBERT brings diffusion to generative masked language modeling. Masking describes an incomplete sequence in terms of positions whose contents are hidden. Diffusion-LM’s continuous states describe uncertainty through corrupted coordinates at each position. In either case, generation can refine a representation that already covers several positions. The choice of state changes the learning problem, including what the network sees when information about a word has been removed. DiffusionBERT
Simple and Effective Masked Diffusion Language Models develops the masked approach as a language generation method in its own right. The relationship to Diffusion-LM is the repeated recovery of a sequence from a corrupted state. Under masking, a word can be missing as a discrete item. In continuous diffusion, a vector remains present and can carry a varying amount of information about its clean origin. This distinction matters for control because Diffusion-LM’s classifier gradients operate directly on those continuous coordinates. Simple and Effective Masked Diffusion Language Models
Simplified and Generalized Masked Diffusion for Discrete Data takes the masked formulation as a subject in its own right and places it in the broader setting of discrete data. It develops a route that shares Diffusion-LM’s concern with choosing a corruption process appropriate to the objects being generated. The mathematical tools follow the state space. Gaussian posterior calculations organize the original paper’s reverse transitions, while masking allows the later work to formulate corruption over discrete states. Simplified and Generalized Masked Diffusion for Discrete Data
Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution pursues another quantity for learning about a discrete generative process. Its stated focus is the estimation of ratios in the data distribution. Diffusion-LM learns a clean-state estimate and uses it to construct a reverse Gaussian prediction. The later work takes the estimation problem into the data’s discrete state space. The two directions illustrate how a change of state representation changes what the network can be trained to predict. Discrete Diffusion Modeling by Estimating the Ratios of the Data Distribution
Scale and guidance by program structure
Large Language Diffusion Models takes up diffusion in the setting of large language generators. Scale was an explicit open issue in the original paper, whose control experiments use short outputs and whose larger-data comparison focuses on likelihood. The later work’s stated scope moves the question of diffusion for language into that larger setting. It continues the architectural direction of using iterative refinement for text generation. Large Language Diffusion Models
TreeDiff brings tree guidance into diffusion-based code generation through abstract syntax trees. A constituency tree in Diffusion-LM describes how words form the phrases of a natural-language sentence. An abstract syntax tree describes the organization of a program. In both settings, a structural request relates several positions and gives the generator something more specific to satisfy than a broad attribute. TreeDiff applies that connection between iterative generation and structural guidance to code. TreeDiff
Institutions
Fields, topics and concepts
Shelves 5The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 worksArts and Humanities · 17,959 worksLanguage and Linguistics · 17,789 worksComputer Vision and Pattern Recognition · 3,621 works
Topics 1Research subjects and languages the work is about.Text generation · 214 works
Cite
Cite as Xiang Lisa Li, John Thickstun, Ishaan Gulrajani, Percy Liang and Tatsunori B. Hashimoto. 2022. Diffusion-LM Improves Controllable Text Generation. arXiv:2205.14217.
@misc{li2022diffusion,
title = {{Diffusion-LM Improves Controllable Text Generation}},
author = {Xiang Lisa Li, John Thickstun, Ishaan Gulrajani, Percy Liang and Tatsunori B. Hashimoto},
year = {2022},
doi = {10.48550/arxiv.2205.14217},
eprint = {2205.14217},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2205.14217}
}References
- Jacob Austin, Daniel D. Johnson, Jonathan Ho, Daniel Tarlow, and Rianne van den Berg. Structured denoising diffusion models in discrete state-spaces. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=h7-XixPCAL. our card
- Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Wen tau Yih, and Yejin Choi. Abductive commonsense reasoning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=Byg1v1HKDB. OpenAlex ↗ · Scholar ↗
- Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 1877–1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf. our card
- Nanxin Chen, Yu Zhang, Heiga Zen, Ron J Weiss, Mohammad Norouzi, and William Chan. Wavegrad: Estimating gradients for waveform generation. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=NsMLjcFaO8O. OpenAlex ↗ · Scholar ↗
- Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam M. Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Benton C. Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier García, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Oliveira Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathleen S. Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022. our card
- Sumanth Dathathri, Andrea Madotto, Janice Lan, Jane Hung, Eric Frank, Piero Molino, Jason Yosinski, and Rosanne Liu. Plug and play language models: A simple approach to controlled text generation. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=H1edEyBKDS. our card
- Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. ArXiv, abs/1810.04805, 2019. our card
- Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=AAWuCvzaVt. OpenAlex ↗ · Scholar ↗
- Chris Donahue, Mina Lee, and Percy Liang. Enabling language models to fill in the blanks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2492–2501, Online, July 2020. Association for Computational Linguistics. . URL https://aclanthology.org/2020.acl-main.225. our card
- John C. Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. In J. Mach. Learn. Res., 2010. OpenAlex ↗ · Scholar ↗
- Jiatao Gu, James Bradbury, Caiming Xiong, Victor O.K. Li, and Richard Socher. Non-autoregressive neural machine translation. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=B1l8BtlCb. our card
- Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, pages 6840–6851, 2020. OpenAlex ↗ · Scholar ↗
- Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=rygGQyrFvH. our card
- Emiel Hoogeboom, Didrik Nielsen, Priyank Jaini, Patrick Forré, and Max Welling. Argmax flows and multinomial diffusion: Towards non-autoregressive language models. arXiv preprint arXiv:2102.05379, 2021. OpenAlex ↗ · Scholar ↗
- Emiel Hoogeboom, Alexey A. Gritsenko, Jasmijn Bastings, Ben Poole, Rianne van den Berg, and Tim Salimans. Autoregressive diffusion models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=Lm8T39vLDTE. OpenAlex ↗ · Scholar ↗
- N. Keskar, B. McCann, L. R. Varshney, Caiming Xiong, and R. Socher. Ctrl: A conditional transformer language model for controllable generation. ArXiv, abs/1909.05858, 2019. our card
- Daniel Khashabi, Gabriel Stanovsky, Jonathan Bragg, Nicholas Lourie, Jungo Kasai, Yejin Choi, Noah A. Smith, and Daniel S. Weld. Genie: A leaderboard for human-in-the-loop evaluation of text generation. ArXiv, abs/2101.06561, 2021. OpenAlex ↗ · Scholar ↗
- Diederik P Kingma and Max Welling. Auto-encoding variational bayes. International Conference on Learning Representations (ICLR), 2014. our card
- Diederik P Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. Variational diffusion models. arXiv preprint arXiv:2107.00630, 2021. OpenAlex ↗ · Scholar ↗
- Nikita Kitaev and Dan Klein. Constituency parsing with a self-attentive encoder. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2676–2686, Melbourne, Australia, July 2018. Association for Computational Linguistics. . URL https://aclanthology.org/P18-1249. our card
- Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. Diffwave: A versatile diffusion model for audio synthesis. arXiv preprint arXiv:2009.09761, 2020. OpenAlex ↗ · Scholar ↗
- Ben Krause, Akhilesh Deepak Gotmare, Bryan McCann, Nitish Shirish Keskar, Shafiq Joty, Richard Socher, and Nazneen Fatema Rajani. GeDi: Generative Discriminator Guided Sequence Generation. arXiv preprint arXiv:2009.06367, 2020. our card
- Shankar Kumar and William Byrne. Minimum Bayes-risk decoding for statistical machine translation. In Proceedings of the Human Language Technology Conference of the North American Chapter of the Association for Computational Linguistics: HLT-NAACL 2004, pages 169–176, Boston, Massachusetts, USA, May 2 - May 7 2004. Association for Computational Linguistics. URL https://aclanthology.org/N04-1022. our card
- Alisa Liu, Maarten Sap, Ximing Lu, Swabha Swayamdipta, Chandra Bhagavatula, Noah A. Smith, and Yejin Choi. DExperts: Decoding-time controlled text generation with experts and anti-experts. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 6691–6706, Online, August 2021. Association for Computational Linguistics. . URL https://aclanthology.org/2021.acl-long.522. our card
- Gautam Mittal, Jesse Engel, Curtis Hawthorne, and Ian Simon. Symbolic music generation with diffusion models. arXiv preprint arXiv:2103.16091, March 2021. OpenAlex ↗ · Scholar ↗
- Nasrin Mostafazadeh, Nathanael Chambers, Xiaodong He, Devi Parikh, Dhruv Batra, Lucy Vanderwende, Pushmeet Kohli, and James Allen. A corpus and cloze evaluation for deeper understanding of commonsense stories. In Proceedings of the 2016 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 839–849, San Diego, California, June 2016. Association for Computational Linguistics. . URL https://aclanthology.org/N16-1098. OpenAlex ↗ · Scholar ↗
- Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. arXiv preprint arXiv:2102.09672, 2021. our card
- Jekaterina Novikova, Ondřej Dušek, and Verena Rieser. The E2E dataset: New challenges for end-to-end generation. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, pages 201–206, Saarbrücken, Germany, August 2017. Association for Computational Linguistics. . URL https://aclanthology.org/W17-5525. our card
- Jeffrey Pennington, Richard Socher, and Christopher Manning. GloVe: Global vectors for word representation. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1532–1543, Doha, Qatar, October 2014. Association for Computational Linguistics. . URL https://aclanthology.org/D14-1162. our card
- Lianhui Qin, Vered Shwartz, Peter West, Chandra Bhagavatula, Jena D. Hwang, Ronan Le Bras, Antoine Bosselut, and Yejin Choi. Back to the future: Unsupervised backprop-based decoding for counterfactual and abductive commonsense reasoning. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 794–805, Online, November 2020. Association for Computational Linguistics. . URL https://aclanthology.org/2020.emnlp-main.58. our card
- Lianhui Qin, Sean Welleck, Daniel Khashabi, and Yejin Choi. Cold decoding: Energy-based constrained text generation with langevin dynamics, 2022. URL https://arxiv.org/abs/2202.11705. OpenAlex ↗ · Scholar ↗
- Alec Radford and Karthik Narasimhan. Improving language understanding by generative pre-training. https://openai.com/blog/language-unsupervised/, 2018. OpenAlex ↗ · Scholar ↗
- Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. https://openai.com/blog/better-language-models/, 2019. OpenAlex ↗ · Scholar ↗
- Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, April 2022. our card
- Yi Ren, Jinglin Liu, Xu Tan, Zhou Zhao, Sheng Zhao, and Tie-Yan Liu. A study of non-autoregressive model for sequence generation. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 149–159, Online, July 2020. Association for Computational Linguistics. . URL https://aclanthology.org/2020.acl-main.15. OpenAlex ↗ · Scholar ↗
- Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014. our card
- Chitwan Saharia, William Chan, Saurabh Saxena, and Mohammad Norouzi. Non-autoregressive machine translation with latent alignments. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 1098–1108, 2020. our card
- Lei Sha. Gradient-guided unsupervised lexically constrained text generation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 8692–8703, Online, November 2020. Association for Computational Linguistics. . URL https://aclanthology.org/2020.emnlp-main.701. OpenAlex ↗ · Scholar ↗
- Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 2256–2265, Lille, France, 07–09 Jul 2015. PMLR. URL https://proceedings.mlr.press/v37/sohl-dickstein15.html. our card
- Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=PxTIG12RRHS. our card
- Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 2008. OpenAlex ↗ · Scholar ↗
- Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30, pages 5998–6008. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf. our card
- Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax, May 2021. OpenAlex ↗ · Scholar ↗
- Kevin Yang and Dan Klein. FUDGE: Controlled text generation with future discriminators. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 3511–3535, Online, June 2021. Association for Computational Linguistics. . URL https://aclanthology.org/2021.naacl-main.276. our card
- Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, Todor Mihaylov, Myle Ott, Sam Shleifer, Kurt Shuster, Daniel Simig, Punit Singh Koura, Anjali Sridhar, Tianlu Wang, and Luke Zettlemoyer. Opt: Open pre-trained transformer language models, 2022. URL https://arxiv.org/abs/2205.01068. our card
This page in Markdown https://md.research.elamur.ai/free/en/papers/li-2022-diffusion-lm-improves-controllable-text/