The Lottery Ticket Hypothesis in Denoising: Towards Semantic-Driven Initialization

Jiafeng Mao, Xueting Wang, Kiyoharu Aizawa · DOI

Abstract

Text-to-image diffusion models allow users control over the content of generated images. Still, text-to-image generation occasionally leads to generation failure requiring users to generate dozens of images under the same text prompt before they obtain a satisfying result. We formulate the lottery ticket hypothesis in denoising: randomly initialized Gaussian noise images contain special pixel blocks (winning tickets) that naturally tend to be denoised into specific content independently. The generation failure in standard text-to-image synthesis is caused by the gap between optimal and actual spatial distribution of winning tickets in initial noisy images. To this end, we implement semantic-driven initial image construction creating initial noise from known winning tickets for each concept mentioned in the prompt. We conduct a series of experiments that verify the properties of winning tickets and demonstrate their generalizability across images and prompts. Our results show that aggregating winning tickets into the initial noise image effectively induce the model to generate the specified object at the corresponding location.

Introduction

The advent of text-to-image (T2I) diffusion models, such as Stable Diffusion, has democratized high-quality image synthesis. However, these models are inherently stochastic. A common frustration for users is "generation failure," where the model ignores certain prompt tokens or fails to adhere to a desired spatial layout. Currently, achieving a specific result often requires a "trial-and-error" approach, generating numerous images with the same prompt until a "lucky" initialization leads to the desired outcome.

Existing research typically addresses this by intervening in the denoising process—for example, by manipulating cross-attention maps or fine-tuning the model on specific layouts. This paper takes a different approach, investigating the source of this stochasticity: the initial Gaussian noise. We propose that the success of a generation is largely determined before the first denoising step even begins.

Overview of the Semantic-driven Initialization (SemI) framework, showing how winning tickets are identified, collected, and combined to guide image generation.

The Lottery Ticket Hypothesis in Denoising

Drawing inspiration from the original Lottery Ticket Hypothesis in deep neural networks, we posit that randomly initialized Gaussian noise is not merely a blank slate. Instead, it contains sparse, localized structures—which we call "winning tickets"—that are predisposed to evolve into specific semantic concepts during the denoising process.

A "winning ticket" is a specific pixel block (e.g., a 4x4 grid) within the initial 64x64 noise latent that naturally aligns with a particular text token. When these tickets happen to appear in the correct spatial locations relative to the user's intent, the generation succeeds. When they are absent or poorly placed, the model fails to manifest the requested concepts, regardless of the prompt's clarity.

Methodology: Identifying and Collecting Winning Tickets

To turn this hypothesis into a controllable tool, we developed a framework to identify and harvest these tickets.

Identification via Cross-Attention

The core mechanism for identification lies in the U-Net's cross-attention layers. At the very first denoising step ($t=T$), we can observe how much attention each pixel block pays to specific words in the prompt. By analyzing these attention maps, we can quantify the "potential" of a noise block to become a specific object.

Contrastive Prompting and Scoring

To ensure that a ticket is uniquely tied to a concept, we employ contrastive prompting. For instance, using the prompt "a dog and a car," we look for blocks that exhibit high attention scores for "dog" but low scores for "car." This prevents the selection of generic blocks that might respond to any noun.

The technical process of identifying winning tickets. Pixel blocks are mapped to cross-attention scores using contrastive prompts, and high-scoring blocks are stored in a collection.

Semantic-driven Initialization (SemI)

Once a database of winning tickets is established, we can perform Semantic-driven Initialization (SemI). When a user provides a prompt and a desired layout (e.g., "a cat" in the top-left and "a chair" in the bottom-right), we retrieve the corresponding winning tickets from our collection and transplant them into the initial noise at those specific coordinates. The remaining areas are filled with "background" tickets to maintain a coherent global structure.

Key Insights: Migratability and Invariance

A crucial finding of this research is that winning tickets are remarkably robust. They possess two key properties:

  1. Spatial Migratability: A ticket that "wins" for a dog in the center of one noise image will still "win" if moved to the corner of another.
  2. Prompt Invariance: A ticket identified using the prompt "a dog and a car" remains a "dog ticket" even when used in a completely different sentence, such as "a dog running in the park."

Furthermore, while diffusion models are theoretically grounded in Gaussian noise, we found they are surprisingly tolerant of the non-Gaussian distributions created by "stitching" different tickets together. The model successfully smooths these transitions during the denoising process.

Experimental Results

We evaluated SemI using the MS COCO 2017 dataset, utilizing 6,000 samples where captions served as prompts and bounding boxes provided layout guidance.

  • Quantitative Performance: SemI achieved a control success rate ($R_{suc}$) of 21.94%, nearly doubling the performance of vanilla Stable Diffusion (12.14%).
  • Synergy with Denoising Methods: SemI is complementary to existing training-free methods. When combined with attention-steering techniques like "Soft" and "Swap," the success rate improved further to 29.29%, with a significant boost in Intersection over Union (IoU) metrics.
  • Efficiency: The method is highly efficient. Building a prompt-specific ticket collection takes only a few seconds, making it a practical tool for creators.

Conclusion and Future Work

This work shifts the focus of text-to-image control from the denoising process to the initialization phase. By identifying "winning tickets" in random noise, we can transform the stochastic "lottery" of image generation into a more deterministic and controllable process.

Future work will address "property bleeding," where tickets carry over unintended attributes (like color) from their source images. We also aim to improve the blending of background tickets to reduce artifacts and enhance the generation of very small objects. Ultimately, semantic-driven initialization offers a promising path toward more reliable and precise AI-assisted content creation.

Summary updated

BibTeX
@inproceedings{mao2024lottery,
  author = {Jiafeng Mao and Xueting Wang and Kiyoharu Aizawa},
  title = {{The Lottery Ticket Hypothesis in Denoising: Towards Semantic-Driven Initialization}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72904-1\_6},
}
Figure