Key points
This forum post is a detailed Chinese-language walkthrough of the paper *On-the-fly Repulsion in the Contextual Space for Rich Diversity in Diffusion Transformers* (Dahary, Koren, Garibi, et al., arXiv:2603.05xxx). Below is a structured English summary of its content.
The problem: typicality bias in text-to-image diffusion models
- Diffusion models learn what images "look real," which in practice means learning the most common patterns in training data. When 80% of training cats are orange, the model treats orange cats as the default.
- The author illustrates this with a gallery metaphor: given the prompt "a cat sitting on a windowsill," every output is nearly identical — same cat color, same lighting direction, same pose. Outputs are individually good but collectively monotonous.
- Diversity matters for creative ideation, synthetic data augmentation, scientific exploration, and user experience.
- Input modification (random seeds, prompt jitter): produces only superficial variation — "more or less salt in the same tomato-egg dish."
- Trajectory-based intervention (early random perturbations in the denoising chain): can break image structure and cause artifacts, and often fails on fast/distilled (Turbo) samplers.
- Sampler/temperature tuning: mainly affects quality, not semantic diversity.
- The intervention point is the multimodal attention inside Diffusion Transformer blocks — the "contextual space" where text conditioning and image tokens fuse.
- Mechanism: 1. Monitor similarity between image tokens in contextual space. 2. Flag overly similar regions (e.g., two cats looking the same direction). 3. Apply repulsion by adjusting attention weights so similar tokens diverge — one looks left, the other right. 4. Because structure is already partially formed at this stage, the intervention diversifies without destroying composition.
- Two variants described in the post:
- Token-wise repulsion:
A'_ij = A_ij - α * sim(i,j)whensim(i,j) > τ, whereA_ijis the attention weight,sim(i,j)token similarity,τa threshold,αrepulsion strength. - Cluster-wise repulsion: cluster similar tokens first, then repel between clusters — more efficient for large images.
- Conditioned repulsion: analyzing the text prompt to modulate repulsion strength, so prompts explicitly demanding identical subjects ("two identical cats") are not undermined.
- Efficiency: the repulsion runs on-the-fly in the forward pass, reuses the existing attention matrices, and adds under ~10% compute — it works even with 4-step Turbo-style samplers where trajectory methods fail.
- Pairwise image similarity across generations for the same prompt drops significantly versus baseline.
- Semantic coverage measured via CLIP embeddings expands notably.
- Human evaluation: diversity improves while text alignment and image quality are preserved.
- Qualitative examples: foxes in snow with varied poses and gaze directions; castles placed off-center, close-up vs. aerial, different times of day; picnic scenes with varied postures, clothing, and interactions.
- Compared against input perturbation (surface-only diversity), trajectory intervention (artifacts, fails on fast samplers), and CFG rescale (quality/diversity trade-off), repulsion produces structural diversity — pose, composition, viewpoint.
- Similarity is computed in feature space, not high-level semantics — the model doesn't know "both regions are cats," risking conflicts with prompts requiring identical or deliberately distinct subjects.
- Hyperparameters (α, τ) need per-application tuning; automated selection is an open problem.
- The ~10% overhead is small but non-trivial for real-time use.
- Cross-image repulsion: making a batch of generations mutually diverse.
- User-controllable diversity: "keep the subject, vary the background."
- Combining with ControlNet, LoRA, and image-editing pipelines.
- Ho et al., *Denoising Diffusion Probabilistic Models*, NeurIPS 2020
- Rombach et al., *High-Resolution Image Synthesis with Latent Diffusion Models*, CVPR 2022
- Peebles & Xie, *Scalable Diffusion Models with Transformers* (DiT), ICCV 2023
- Vaswani et al., *Attention Is All You Need*, NeurIPS 2017
- Dosovitskiy et al., *An Image is Worth 16x16 Words*, ICLR 2021
- Saharia et al., *Photorealistic Text-to-Image Diffusion Models...* (Imagen), NeurIPS 2022
- Ramesh et al. (DALL-E 2), arXiv:2204.06125; Balaji et al. (eDiff-I), arXiv:2211.01324