Compositional Discrete Latent Code for High Fidelity, Productive Diffusion Models

Samuel Lavoie, Michael Noukhovitch, Aaron Courville

Introduction

Researchers have introduced Discrete Latent Codes (DLC), a novel method for representing images as sequences of discrete tokens rather than continuous vectors. By conditioning diffusion models on these "visual words," the authors achieved a new state-of-the-art for unconditional ImageNet generation. Furthermore, this discrete approach enables "productive" synthesis—creating novel, out-of-distribution images (like a dog made of pasta) by simply mixing tokens from different images.

The Challenge of Diversity and Compositionality

While diffusion models like Stable Diffusion are famous for their artistic flair, they have a "diversity problem." When trained without specific labels or text prompts (unconditional generation), they often struggle to capture the full complexity of diverse datasets like ImageNet.

The authors argue that the root of the problem lies in conditioning. Standard methods use either simple labels (which lack detail) or continuous image embeddings (which are mathematically difficult for a model to "guess" or sample from). Furthermore, continuous embeddings aren't naturally compositional. If you have an embedding for a "dog" and one for "pasta," averaging them usually results in a blurry mess rather than a coherent "pasta-dog." This paper seeks a representation that is high-fidelity, easy to generate, and allows the model to recombine known concepts into entirely new ones.

The Discrete Latent Code (DLC) Approach

The researchers propose a pipeline centered around Discrete Latent Codes (DLC):

  1. The DLC Encoder: They use a pre-trained self-supervised model (DINOv2) and add a "Simplicial Embedding" layer. This turns an image into a sequence of discrete tokens (e.g., a sequence of 512 tokens, where each token is chosen from a vocabulary of 256). Think of this as translating an image into a specific "visual paragraph."
  2. The Image Generator: They train a Diffusion Transformer (DiT) to generate images conditioned on these DLCs.
  3. The DLC Generator: To generate images from scratch (unconditionally), they use a discrete diffusion model (SEDD) to first "write" a new DLC, which the DiT then "paints" into an image.
  4. Text-to-DLC: To enable text-to-image capabilities, they efficiently finetune a Large Language Diffusion Model (LLaDA) to translate text prompts into these visual DLC tokens.

Key Insights: Discreteness and Productive Generation

A core insight of this work is that it is much easier for a model to learn a distribution of discrete tokens (like words in a sentence) than to model a high-dimensional continuous manifold. This leads to much better "unconditional" performance.

Because DLCs are sequences, they are inherently compositional. By taking half the tokens from a "Komondor" dog and half from a "Carbonara" pasta dish, the model can generate a "Pasta-dog." The authors call this productive generation—the ability to create things the model has never seen by recomposing parts of things it has.

Examples of high-fidelity and compositional image generation using DLCs, including the novel "pasta-dog" concept.

Models trained with DLC also reach high quality much faster and rely less on "Classifier-Free Guidance," a common trick to boost quality that often inadvertently reduces diversity.

State-of-the-Art Results

  • New SOTA: The model achieved a Fréchet Inception Distance (FID) of 1.59 for unconditional generation on ImageNet (at 256x256 resolution), setting a new state-of-the-art and outperforming previous heavyweights like RCG and MAR-H.
  • Efficiency: DLC-conditioned models converged significantly faster than label-conditioned baselines, reaching better quality in a fraction of the training steps.
  • Qualitative Creativity: Using a subset of just 9 million image-text pairs from LAION to finetune the text-to-DLC pipeline, the model successfully generated concepts not present in ImageNet labels, such as "bonsai" or "a teapot on a mountain," by leveraging the compositional nature of the tokens.
  • Diversity: Using the "Vendi Score" (a metric for diversity), DLC compositions were found to be significantly more diverse and semantically coherent than those created by averaging continuous embeddings.

Limitations and Future Directions

While highly effective, the approach has trade-offs. The authors found that longer sequences (more tokens) produce better images but require more compute to generate. Finding the "sweet spot" for different applications remains an open task. Additionally, the sampling process for the discrete tokens requires a specific "remasking" strategy to maintain high image quality, adding a layer of complexity to the inference process.

Finally, while successful on ImageNet and a 9M subset of LAION, the ultimate test will be scaling this "visual language" approach to the billions of images used by the largest foundation models. The researchers suggest that focusing on the structural properties of representations—like compositionality—is the key to the next generation of creative AI.

Summary updated

BibTeX
@inproceedings{lavoie2025compositional,
  author = {Samuel Lavoie and Michael Noukhovitch and Aaron Courville},
  title = {{Compositional Discrete Latent Code for High Fidelity, Productive Diffusion Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=1iSnpztjbD},
}
Figure