TL;DR
Training-free diffusion segmentors—which extract semantic maps from generative models without extra training—surprisingly fail to improve when paired with more powerful models like SDXL or Flux. This paper introduces GoCA (Generative scaling of Cross-Attention), a method that uses auto-aggregation and per-pixel rescaling to bridge the gap between raw model activations and accurate semantic masks, finally allowing segmentation performance to scale alongside generative power.
What Problem Does This Paper Address?
Text-to-image diffusion models "understand" visual concepts well enough to generate them, so researchers have long used their internal cross-attention maps (which link text tokens to image pixels) for semantic segmentation. Ideally, a more powerful generator (like Flux) should produce more accurate segments than an older one (like Stable Diffusion v1.5).
However, the authors observed a "scaling wall": existing training-free methods often perform worse on advanced models. They identify two primary culprits:
- The Aggregation Gap: Modern models have hundreds of attention heads and layers. Manually tuning weights to combine these into a single "global" map is no longer feasible.
- The Semantic Correlation Gap: Raw attention scores are imbalanced. Special tokens (like
<sos>) and foreground objects (like "cat") often "drown out" background tokens (like "grass"), making direct score comparisons across pixels unreliable.
Methods
The authors propose GoCA, which consists of two main components:
- Auto Aggregation: Instead of manual tuning, GoCA calculates aggregation weights dynamically.
- Head-wise: It measures the dot-product similarity between each head's output and the total layer output. Heads that contribute more to the final generation get higher weights.
- Layer-wise: It uses "pseudo self-attention" derived from dense features as a proxy for a global map, then weights layers based on how closely their individual attention maps match this proxy.
- Per-Pixel Rescaling: To fix score imbalances, the method filters out special tokens and stop words. It then rescales the remaining content word scores at every individual pixel so they sum to 1. This prevents "attention sinks" (special tokens) from distorting the relative importance of actual objects in different parts of the image.
Datasets
The researchers evaluated their method across five standard semantic segmentation benchmarks:
- Pascal VOC 2012
- Pascal-Context-59
- COCO-Object
- Cityscapes
- ADE20K
For the image generation experiments, they used the COCO-30k dataset (a subset of COCO 2014).
Key Insights and Ideas
- Generative Power requires Smarter Extraction: As models get "smarter" (more parameters, complex MMDiT architectures), their internal representations become more specialized. Simple averaging of attention maps is no longer sufficient to capture the model's full "knowledge."
- The "Attention Sink" is a Bug for Discriminators: While special tokens are vital for the model's generative stability, they act as noise for discriminative tasks. By explicitly excluding them and rescaling per-pixel, the authors reveal the "hidden" semantic accuracy of the background.
- Model-Agnostic Scaling: GoCA is designed to work across different architectures, including U-Net (SDXL), DiT (PixArt-Sigma), and MMDiT (Flux), proving that the underlying logic of cross-attention remains a viable signal for segmentation regardless of the backbone.
Key Results
- Consistent Scaling: Using GoCA, segmentation performance finally follows generative power. On Pascal VOC, the mIoU (mean Intersection over Union) improved from 60.7 (SD v1.5) to 70.7 (Flux).
- Outperforming Baselines: On the Pascal Context benchmark, GoCA with Flux achieved 51.1 mIoU, significantly higher than the "Vanilla" Flux baseline of 48.4 and the SD v1.5 baseline of 35.4.
- Generative Improvements: When integrated into S-CFG (a technique that uses segmentation to guide image generation), GoCA improved both FID (image quality) and CLIP scores (text alignment), particularly in background regions which are traditionally difficult for diffusion models to ground accurately.
Limitations and Future Work
- Small Object Sensitivity: The authors note that the method still struggles with very small objects. They attribute this to the VAE (Variational Autoencoder) compression used in latent diffusion models, which can "smear" fine-grained details.
- Reliance on External Detectors: To generate the prompts for segmentation, the method currently relies on an external LLM (like GPT-4o) to identify which objects are present in the image.
- Future Directions: The authors suggest extending this training-free approach to more complex discriminative tasks like object detection and depth estimation, potentially creating a "universal" training-free discriminative suite for any new diffusion model.
Summary updated