CountSteer: Steering Attention for Object Counting in Diffusion Models

Hyemin Boo, Hyoryung Kim, Myungjin Lee, Seunghyeon Lee, Jiyoung Lee +2 more
11/14/2025
cs.CV

No confident code implementation found for this paper.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{boo2025countsteer,
  title  = {CountSteer: Steering Attention for Object Counting in Diffusion Models},
  author = {Hyemin Boo and Hyoryung Kim and Myungjin Lee and Seunghyeon Lee and Jiyoung Lee and Jang-Hwan Choi and Hyunsoo Cho},
  year   = {2025},
  eprint = {2511.11253},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2511.11253v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2511.11253.svg)](https://codeofpaper.com/paper/2511.11253)

Discussion