Diffusion Language Models › Controllability

Michael BrenndoerferNovember 17, 20263 min read
Language AI HandbookAll chapters
Part 19 of 67Alternative Sequence and Generative Architectures
Chapter 136Diffusion Language Models › Controllability
Reading section 8 of 13 · Controllability · 3 minSection 8 of 13 · 3 min

Section 8 of 13 · 3 min read

Reading settings

Definitions

Choose how many terms have tooltips.

Article links

Make inline references clickable

Notes & comments

This is where diffusion language models differ rather than merely compete.

Keep known tokens visible and mask the positions to fill. The copy-through rule preserves those fixed tokens. An arbitrary visible assignment can have zero support under the data distribution. The clamped procedure induces its own completion distribution, which can differ from conditioning the original generative joint.

In the two-token model with T=2T=2, the two positions reveal together half the time. The unconditional sampler assigns bbbb mass 12(0.2)(0.3)=0.03\frac12(0.2)(0.3)=0.03 and assigns first-token bb mass 0.20.2. Conditioning that model on first-token bb gives second-token bb probability 0.03/0.2=0.150.03/0.2=0.15. If the first bb is fixed before denoising, every prediction for the remaining position instead uses the data conditional given that visible bb. The toy data put all that conditional mass on baba, so the clamped sampler assigns the second bb probability zero.

Left-to-right sequence models also define conditional distributions given a suffix when the conditioning event has positive probability. Evaluating or sampling that conditional efficiently can require search, rearranged training examples, or another generation procedure. A fill-in-the-middle training setup provides one such interface.

Soft constraints via guidance. To steer toward a control variable cc, train predictions with and without the control input and combine their logits. This applies the classifier-free guidance idea to categorical predictions. Ho and Salimans (2022)

ℓγ(xt,c)=(1+γ) ℓθ(xt,c)−γ ℓθ(xt,∅),\ell_\gamma(x_t, c) = (1+\gamma)\,\ell_\theta(x_t, c) - \gamma\,\ell_\theta(x_t, \varnothing),

Here ∅\varnothing denotes the unconditional case and γ\gamma sets the strength of the extrapolation. A softmax over the adjusted logits supplies the next lexical distribution. The relative conditional and unconditional scores determine which tokens gain probability. Increasing γ\gamma does not guarantee higher adherence or lower entropy. Diffusion-LM used a different guidance method, applying gradients from an external attribute classifier to the continuous latent state.

Hard constraints need an enforcement rule. Return only completions that pass the test. Rejection sampling can produce an accepted completion when valid outputs have positive mass. Repair can propose edits for another check. A left-to-right decoder can also enforce constraints that admit a suitable next-token test, such as a prefix restriction derived from a JSON grammar.

Comments

Add to the conversation

A question, a correction, or an example from your own work.

No comments yet. Be the first to share your thoughts!

Newsletter

Stay up to date

Get new articles, book updates, and notes on AI and technology.

Unsubscribe at any time. Privacy policy