Mechanisms of Projective Composition of Diffusion Models

Arwen Bradley, Preetum Nakkiran, David Berthelot, James Thornton, Joshua M. Susskind

Introduction

In the rapidly evolving world of generative AI, a highly sought-after capability is the ability to mix and match distinct concepts at inference time. For instance, if you have one model tuned to generate images of "your dog" and another that generates "oil paintings," you ideally want to combine them to produce an "oil painting of your dog."

Composing a specific dog with the Starry Night style.

Empirically, researchers achieve this by adding the "scores" (the gradients guiding the denoising process) of different diffusion models together. However, the theoretical understanding of why this linear score combination works has been lacking. This paper provides a formal theoretical framework for composing diffusion models, addressing fundamental questions: What does "correct" composition mathematically mean? Why does it enable "length generalization" (generating a scene with many objects when trained on only one)? And why do some concepts mix perfectly while others produce garbled results?

Rethinking Composition: Beyond Bayes

Historically, standard product-of-experts approaches (often called Bayes composition) have been used to combine distributions. However, the authors demonstrate that Bayes composition is mathematically incapable of true out-of-distribution generation because it is restricted strictly to the overlapping supports of the original models.

To overcome this, the authors introduce a new framework centered on two core concepts:

  • Projective Composition: A "successful" composition is defined as a new distribution that, when projected onto specific features (like "style" or "location"), perfectly matches the marginal distributions of the original component models.
  • Factorized Conditionals (FC): For composition to succeed, each model must be "active" on a specific subset of features or coordinates while matching a "common background" everywhere else.

A major theoretical contribution of the paper is proving that if a composition is valid in any invertible latent feature space, simply summing the scores in the standard pixel space will automatically work. Remarkably, the system does not even need to explicitly know what that latent feature space is.

Empirical Validation and Length Generalization

To rigorously test these theories, the authors utilized the CLEVR dataset to create custom geometric object environments. They trained models on "background only" and "single objects," and then tested how well these models could compose multiple objects at inference time.

Projective composition combining single-object models into multi-object scenes.

The results strongly validated the theory of length generalization. Models trained exclusively on single objects were successfully composed to generate coherent scenes containing up to six objects. Quantitatively, using an empty background as a reference achieved 97-100% success in placing the correct number of objects in the correct locations. The choice of the "reference" or background distribution proved critical; composing objects onto an "empty" background is theoretically and empirically much more stable than using a cluttered or unconditional background.

The authors also validated their findings qualitatively using Stable Diffusion XL (SDXL), successfully composing fine-tuned subjects (like the author's dog) with various artistic styles.

Why Do Compositions Fail?

The paper distinguishes between a composition being mathematically valid and being samplable via reverse-diffusion. The secret to samplability is orthogonality.

For a composition to be easily sampled, the "score deltas" of the concepts must be roughly orthogonal. If concepts compete for the same pixels or features—such as trying to compose a "dog" and a "horse" in the exact same subject slot—the diffusion path becomes non-smooth, and standard samplers break down. Conversely, concepts like "dog" and "watercolor" occupy different feature dimensions, allowing for smooth, successful sampling. To help predict this, the authors propose a simple heuristic: if the CLIP embeddings of two concepts (minus the background embedding) are orthogonal, they are highly likely to compose well.

Limitations and Future Directions

While this framework provides a massive leap in understanding diffusion composition, it relies on some idealized assumptions. The "Factorized Conditionals" theory assumes objects are independent, but in reality, objects cast shadows and occlude one another, creating dependencies that can lead to artifacts when composing densely packed scenes.

Furthermore, while the paper explains why sampling fails for overlapping, non-orthogonal concepts, it leaves the development of more robust samplers for these "non-smooth" composition paths as an open challenge. Finally, the theory relies on the existence of a feature space where concepts factorize; automatically discovering or learning these optimal spaces for arbitrary concepts remains an exciting frontier for future research.

Summary updated

BibTeX
@inproceedings{bradley2025mechanisms,
  author = {Arwen Bradley and Preetum Nakkiran and David Berthelot and James Thornton and Joshua M. Susskind},
  title = {{Mechanisms of Projective Composition of Diffusion Models}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=QV0PcBbfTd},
}
Figure