Diffusion Language Models › Controllability
Language AI HandbookAll chapters 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 , the two positions reveal together half the time. The unconditional sampler assigns mass and assigns first-token mass . Conditioning that model on first-token gives second-token probability . If the first is fixed before denoising, every prediction for the remaining position instead uses the data conditional given that visible . The toy data put all that conditional mass on , so the clamped sampler assigns the second 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 , 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)
Here denotes the unconditional case and 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 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!