CountSteer: Steering Attention for Object Counting in Diffusion Models

Text-to-image diffusion models generate realistic and coherent images but often fail to follow numerical instructions in text, revealing a gap between language and visual representation. Interestingly, we found that these models are not entirely blind to numbers-they are implicitly aware of their own counting accuracy, as their internal signals shift in consistent ways depending on whether the output meets the specified count. This observation suggests that the model already encodes a latent notion of numerical correctness, which can be harnessed to guide generation more precisely. Building on this intuition, we introduce CountSteer, a training-free method that improves generation of specified object counts by steering the model's cross-attention hidden states during inference. In our experiments, CountSteer improved object-count accuracy by about 4% without compromising visual quality, demonstrating a simple yet effective step toward more controllable and semantically reliable text-to-image generation.

Paper

References (10)

072022. High-resolution image synthesis with latent diffusion modelsProceedings of the IEEE/CVF conference on computer vision and pattern recognition
082022. Lora: Low-rank adaptation of large language modelsICLR
092023a. T2i-compbench: A comprehensive benchmark for open-world compositional text-to-image generationAdvances in Neural Information Processing Systems
102024. T2i-adapter: Learning adapters to dig out more controllable ability for text-to-image diffusion modelsProceedings of the AAAI conference on artificial intelligence , volume 38

Similar papers

© 2026 NYSGPT2525 LLC