Abstract
Diffusion models have quickly become the go-to paradigm for generative modelling of perceptual signals (such as images and sound) through iterative refinement. Their success hinges on the fact that the underlying physical phenomena are continuous. For inherently discrete and categorical data such as language, various diffusion-inspired alternatives have been proposed. However, the continuous nature of diffusion models conveys many benefits, and in this work we endeavour to preserve it. We propose CDCD, a framework for modelling categorical data with diffusion models that are continuous both in time and input space. We demonstrate its efficacy on several language modelling tasks.
Introduction
Diffusion models have revolutionized generative AI for continuous signals like images and audio. However, language is inherently discrete—it's made of distinct tokens (words or sub-words). Most previous attempts to apply diffusion to text either used "discrete diffusion," which loses the mathematical elegance and sampling flexibility of continuous models, or struggled with the "score function" (the gradient of the data distribution), which is mathematically undefined for discrete points.
DeepMind researchers have introduced CDCD (Continuous Diffusion for Categorical Data), a framework that allows the powerful continuous diffusion models used in image generation to work directly on discrete text. By embedding tokens in a continuous space and using a novel "score interpolation" technique, they achieve high-quality language generation that rivals standard autoregressive models.
The CDCD Framework
The authors propose CDCD, which treats categorical data as points in a continuous Euclidean space. The framework consists of three main pillars:
- Score Interpolation: This is the core innovation. Instead of trying to calculate a standard score function, the model predicts a probability distribution (logits) over the vocabulary for a noisy input. It then "interpolates" the score by taking the expectation of the score function over all possible tokens. This allows the model to be trained using the familiar cross-entropy loss, making training more stable and allowing the embeddings to be learned jointly with the model.
- Time Warping: Not all noise levels are equally informative. The authors introduce an active learning strategy called "time warping" that automatically adjusts the distribution of noise levels sampled during training to "linearize" the learning process.
- Self-Conditioning: To improve sample quality, the model is given access to its own predictions from previous sampling steps, allowing it to refine its output iteratively.
The architecture uses a standard Transformer that, unlike GPT-style models, does not require a causality mask. It can see the entire sequence at once, similar to BERT, but for generation rather than just representation.
Optimizing Training with Time Warping
A key insight of the CDCD framework is that the entropy of model predictions should ideally increase linearly with noise. The "time warping" heuristic provides a principled way to schedule noise that is more efficient than manual tuning. By learning the cumulative distribution function (CDF) of the loss over time $t$, the system can sample noise levels $u$ uniformly to ensure the model spends more time on noise levels where it is actively resolving uncertainty.
Key Results and Advantages
The researchers evaluated CDCD across several large-scale benchmarks, including MassiveText, C4, and WMT translation tasks.
- The "Continuous" Advantage: By staying in continuous space, CDCD can use advanced ODE (Ordinary Differential Equation) solvers. This allows users to trade off computation time for quality at inference time without retraining the model.
- Human-like Text: On the MAUVE metric, which measures how close generated text is to the human distribution, the 1.3B CDCD model outperformed or matched strong autoregressive baselines.
- Translation: While CDCD still lags behind state-of-the-art autoregressive models in raw BLEU scores, it showed significant gains when using Minimum Bayes-Risk (MBR) decoding, suggesting that the model captures a diverse and useful distribution of translations.
- Avoiding Early Commitment: In discrete models, the model must "commit" to a token early. In CDCD, the model can represent a "superposition" of possible tokens in the embedding space, only committing to a specific word at the very end of the sampling process.
Limitations and Future Work
Despite the progress, the authors note several hurdles. The model occasionally suffers from repeated or missing tokens, a common issue in non-autoregressive generation. Additionally, handling variable-length output gracefully remains an open research question, as diffusion models typically operate on a fixed-size "canvas." Future work may involve combining CDCD with latent diffusion by using a VQ-VAE to learn a more structured latent space for text.
Summary updated