SPARKE: Scalable Prompt-Aware Diversity and Novelty Guidance in Diffusion Models via RKE Score

Mohammad Jalali, Haoyu Lei, Amin Gohari, Farzan Farnia

Generating high-fidelity images with diffusion models like Stable Diffusion is easy, but generating diverse images is surprisingly hard. If you give a model ten slightly different prompts about "a dog in a park," you often end up with ten very similar-looking dogs. This "mode collapse" is a major hurdle for fairness, data augmentation, and creative exploration.

The paper "SPARKE: Scalable Prompt-Aware Diversity and Novelty Guidance in Diffusion Models via RKE Score" introduces a clever way to force models to be more varied without destroying their speed or image quality.

TL;DR

SPARKE is a new guidance method that ensures diffusion models generate diverse outputs even when prompts are semantically similar. By using a mathematical shortcut called the Rényi Kernel Entropy (RKE), the authors reduced the computational cost of diversity guidance from a sluggish $\mathcal{O}(n^3)$ to a lightning-fast $\mathcal{O}(n)$, making large-scale diverse generation finally practical.

What Problem Does This Paper Address?

When we use text-to-image models, we expect the output to reflect the variety of the real world. However, models often gravitate toward "safe," dominant patterns. If you ask for "a doctor," you might get the same demographic repeatedly.

Example prompts demonstrating semantic similarity.

Existing solutions try to fix this by measuring the "entropy" (disorder/diversity) of a batch of images and pushing the model toward higher entropy. But these methods face two massive walls:

  1. Computational Complexity: Standard diversity measures (like the Vendi Score) require complex matrix calculations that scale poorly. As your batch size ($n$) grows, the math becomes $\mathcal{O}(n^3)$, which is too slow for real-time use.
  2. Prompt-Agnosticism: Most methods treat all images in a batch the same. They don't realize that two images should be different if their prompts are similar, but can be similar if their prompts are totally different.
Results from unconditional entropy guidance, highlighting the need for prompt-aware methods.

Methods: How SPARKE Works

The authors propose SPARKE (Scalable Prompt-Aware Rényi Kernel Entropy), which introduces three key innovations:

  • Prompt-Aware Guidance: Instead of just looking at image similarity, SPARKE uses a "Conditional Entropy" approach. It calculates a similarity matrix for the prompts and a similarity matrix for the generated images. By taking the Hadamard product (element-wise multiplication) of these matrices, the model is specifically penalized for generating similar images for similar prompts.
  • The RKE Shortcut: Instead of using standard Shannon entropy (which requires expensive eigenvalue decompositions), SPARKE uses order-2 Rényi Kernel Entropy. This allows them to measure diversity using the Frobenius norm of the matrix—a much simpler calculation. This drops the gradient optimization complexity to $\mathcal{O}(n)$, allowing the model to consider thousands of previous generations when deciding what to make next.
  • Latent Space Guidance: Unlike previous methods that operate on the final pixels or CLIP embeddings (which is slow and can cause visual artifacts), SPARKE applies guidance directly within the latent space of the Diffusion Model. This is more efficient and results in "cleaner" semantic diversity.

Datasets

The researchers evaluated SPARKE across several benchmarks:

  • MS-COCO: 10,000 prompts used to test general text-to-image performance.
  • GeoDE & DollarStreet: Datasets specifically designed to test geographic and socioeconomic diversity.
  • 2D Gaussian Mixture Models (GMMs): Synthetic "toy" datasets used to visualize how well the model covers different "modes" (clusters) of data.

Key Insights and Ideas

  • Soft-Clustering over Hard-Clustering: Previous attempts at prompt-aware diversity required "pre-clustering" prompts into rigid groups. SPARKE handles this dynamically; the math automatically adjusts the "push" for diversity based on how similar the current prompt is to previous ones.
  • Memory Efficiency is King: By moving guidance to the latent space and simplifying the entropy formula, SPARKE uses significantly less GPU memory (~20GB vs ~35GB for baseline methods), making it accessible on consumer-grade hardware like an RTX 4090.
  • The "Novelty" Mode: SPARKE can also be used for "Novelty Guidance." By providing a reference dataset (e.g., images of cats and dogs), you can tell the model: "Generate a lady walking an animal, but make it unlike the animals in this reference set," leading to more creative outputs like a lady walking a red panda or a cheetah.

Key Results

  • Diversity Boost: On Stable Diffusion 2.1, SPARKE achieved a Vendi Score of 405.51, significantly higher than the vanilla model (369.37) and existing baselines like CADS (380.08).
  • Speed: SPARKE adds negligible overhead. Generating a sample takes 1.75 seconds compared to 1.62 seconds for the unguided model. In contrast, the previous state-of-the-art (c-VSG) took nearly double the time (3.07 seconds).
  • Fidelity: Despite the push for diversity, image quality (measured by CLIPScore and KID) remained high, proving that you don't have to sacrifice realism to get variety.

Limitations and Future Work

  • Image Focus: The current paper focuses primarily on 2D image generation. The authors note that extending this to video and 3D generation is a logical next step.
  • Hyperparameter Sensitivity: Like all guidance methods, there is a trade-off. If the diversity scale ($\eta$) is set too high, image quality can eventually degrade.
  • Modality Expansion: The authors suggest that the RKE-based framework could be applied to other generative tasks beyond images, such as diversifying text or audio outputs.

Want to try it out? The authors have released their code on the project page.

Summary updated

BibTeX
@inproceedings{jalali2025sparke,
  author = {Mohammad Jalali and Haoyu LEI and Amin Gohari and Farzan Farnia},
  title = {{SPARKE: Scalable Prompt-Aware Diversity and Novelty Guidance in Diffusion Models via RKE Score}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=1YLpf8nUIq},
}
Figure