Research
Can Vision-Language Models Count? A Synthetic Benchmark and Analysis of Attention-Based Interventions
Can Vision-Language Models Count? A Synthetic Benchmark and Analysis of Attention-Based Interventions Overview Research area: Computer Vision / multimodal vision-language models, specifically the mech
- arXiv
- 2511.17722
- Published
- 2025-11-21
- Authors
- Saurav Sengupta, Nazanin Moradinasab, Jiebei Liu, Donald E. Brown
AI summary
Can Vision-Language Models Count? A Synthetic Benchmark and Analysis of Attention-Based InterventionsOverview
Research area: Computer Vision / multimodal vision-language models, specifically the mechanistic analysis of counting and enumeration behavior in VLMs using synthetic benchmarks and inference-time attention interventions.
Technical level: Advanced. The evaluation framework itself is approachable, but the paper's core contribution — layer-wise attention reweighting inside the language decoder, with discussion of Grouped Query Attention, Mixture-of-Experts architectures, and gradient-weighted layer-wise propagation of visual attention — assumes familiarity with transformer internals.
Scope: A single study introducing a controlled synthetic counting dataset and diagnostic framework to characterize how prompt specificity, visual properties, object count range, and vision-token attention distribution affect counting accuracy in open-source VLMs, plus exploratory decoder attention reweighting experiments tested on synthetic data and the FSC-147 real-world counting benchmark.
What This Paper Is About
Specialized counting systems consistently outperform Vision-Language Models on controlled counting benchmarks, yet robust counting remains essential because VLMs must handle open-ended questions where counting is just one part of a broader task. The authors argue that existing natural-image benchmarks cannot easily isolate why VLMs miscount, so they build a synthetic dataset where image and prompt properties can be varied one at a time. The goal is not to compete on benchmark accuracy but to provide a controlled diagnostic framework that links specific visual and linguistic inputs to measurable changes in model accuracy, error magnitude, and internal attention allocation.
Key Contributions
-
A synthetic counting dataset and evaluation framework. Images are 512×512 pixels containing non-overlapping black circular objects on a pure white background, with 50 images in the initial baseline configuration and object counts varied in buckets of 10 (0–50 in increments of 10), each bucket equally represented. Visual properties (object shape, object color, object texture, background color, background texture) are varied one at a time while object locations are preserved from the base dataset.
-
A multi-axis characterization of VLM counting behavior. The paper measures performance along (a) increasing prompt specificity via a five-level "prompt ladder," (b) object shapes and colors and background colors and textures, (c) object count ranges, and (d) the distribution of attention over vision tokens, using Accuracy and Mean Relative Count Error (MRCE) as metrics and IoU@50 overlap between attention heatmaps and images.
-
A systematic study of decoder attention reweighting. Five strategies are introduced and applied uniformly or to layer groups (early, middle, late): Amplify (α = 2.0), Suppress (β = 0.5), Focus (ε = 10⁻¹⁰), Balance (target visual attention ratio r_v^target = 0.4), and Visual Mask Amplify using SAM3-derived object masks with overlap threshold τ = 0.1, α_obj = 2.0, α_bg = 0.5, plus an ablation without background suppression.
-
Evidence that the identified failure modes transfer beyond synthetic stimuli. Selected interventions are validated on a subset of the FSC-147 real-world counting benchmark, and the qualitative trends are reported to persist despite the increased visual complexity of natural scenes.
Main Findings
-
Counting degrades monotonically with object count. Across all models, errors grow non-linearly beyond 30 objects. In the low-count regime (<10), most models show minimal error (<0.1). The largest observed errors are in the 40–50 bucket, e.g. background texture with Qwen7b at 0.533 and object texture with Qwen7b at 0.515, versus 0.255 (Qwen32b), 0.323 (InternVL), and 0.222 (Kimi) for background texture at 40–50.
-
Prompt specificity has an asymmetric effect depending on feature type. For background features, specificity consistently helps — background texture yields the largest gains, with Qwen7b and Kimi reducing MRCE by 0.433 and 0.355 respectively at P2, persisting through P5. For object texture, specificity monotonically degrades accuracy across all models (Qwen32b ΔAcc = −0.108 at P5), although MRCE improves for some models, which the authors read as errors becoming more systematic rather than random.
-
Model scale does not confer robustness. Qwen32b degrades substantially on object texture despite being the largest model evaluated. Object color and shape show mixed, model-dependent responses: Qwen7b benefits substantially from shape specificity (ΔMRCE = −0.213 at P2), Kimi degrades under the same condition, and InternVL remains largely neutral.
-
High-frequency textures and visually heterogeneous objects drive the largest errors. At Prompt 2, object texture "cr. hatch" yields MRCE of 0.652 (Qwen7b), 0.797 (Qwen32b), 0.362 (InternVL), and 0.700 (Kimi); "multicolor" objects yield 0.362, 0.259, 0.223, and 0.308 respectively. Solid-colored backgrounds and plain single-color objects produce the lowest MRCE.
-
A "cognitive sink" effect at high prompt load. The authors report that the simplest, most general prompt (P1) succeeds because its generality lets the model deploy its most robust internal detector, bypassing the interference that any specific semantic cue creates. Attention overlays for Kimi at prompt P5 (color + texture + shape) confirm attention to object shape is absent, suppressed by the cognitive load of processing texture and color.
-
Attention localization improves with moderate specificity but not beyond it. For background texture images, prompts P2–P3 increase LPV overlap with object regions and decrease overlap with background relative to P1; P4–P5 generally reduce object Grad-CAM attention. For object texture, LPV overlap with the object increases across P2–P5, but beyond P3 relative count error rises again — a non-linear relationship between prompt richness and error reduction.
-
Visual attention patterns are largely invariant to object density. Both Qwen2.5-7B-Instruct and Kimi-VL-A3B-Instruct show consistent attention trajectories for images with fewer than 10 objects and more than 30 objects, even though relative count error is significantly lower in the <10 condition.
-
Reasoning checkpoints do not consistently help. Qwen3-Thinking often fails to produce valid numerical answers in dense scenes; for images with >10 objects it produced only 85 parsable versus 635 non-parsable outputs on background color, and 86 parsable versus 517 non-parsable on object shape. Kimi-Instruct generally outperforms Kimi-Thinking overall (e.g. background color 10–50: 0.128 versus 0.424; object texture 10–50: 0.158 versus 0.474). The authors conclude enumeration errors stem primarily from visual grounding limitations rather than insufficient linguistic reasoning.
-
Mask-guided late-layer amplification is the most consistent intervention. On the synthetic background-texture data, baseline Qwen MRCE/Accuracy is 0.080/0.330 and baseline Kimi is 0.140/0.320. "late_amplify_visual_mask_bg_suppress" is the only strategy to improve Qwen synthetic MRCE (0.080 to 0.070, accuracy 0.330 to 0.350) while also boosting FSC-147 accuracy (0.220 to 0.260), and "early_amplify_visual_mask" transfers to real-world data by improving Qwen FSC-147 MRCE (0.168 to 0.143) and accuracy (0.220 to 0.224).
-
Image-naive strategies are model-specific and unreliable. "uniform_suppress" and "alternating_amp_sup" substantially reduce Kimi synthetic MRCE (0.09 vs. 0.14 baseline) but degrade Qwen, suggesting Kimi's MoE architecture is more tolerant of global suppression than Qwen's dense design. "uniform_balance" improves Qwen FSC-147 MRCE (0.158) while catastrophically inflating Kimi's (0.694). Extreme attention redistribution causes complete model collapse on Qwen ("uniform_focus" and "extreme_visual_early" are undefined for Qwen, accuracy 0.000) while leaving Kimi comparatively unaffected.
Methodology in Plain English
The researchers start by generating images they fully control: black circles on a white background, at 512×512 pixels, with the number of circles varied in buckets of ten and every bucket equally represented. From that baseline they change exactly one thing at a time — the objects' shape, the objects' color, the objects' texture, the background color, or the background texture — while keeping object locations fixed. This controlled-variable design means any change in model accuracy can be attributed to the single feature that was altered.
They pair each image set with a five-step "prompt ladder" that walks from a generic request ("Count the number of distinct objects in this image") up to a high-load compositional request ("Count the number of {pattern} pattern with {color} color {shape} in this image"), so they can separate the contribution of wording from the contribution of image content.
Three open-source VLMs that already perform well on established benchmarks are evaluated — Qwen-VL, Kimi-VL-A3B, and InternVL3-9B — including, for selected models, dedicated reasoning and instruction-tuned checkpoints. Results are scored with Accuracy and Mean Relative Count Error, the average of |predicted count − true count| divided by true count across samples.
To see where the models look, they compute attention heatmaps using Layer-wise Propagation of Visual Attention (LPV) and Grad-CAM across all decoder layers, then measure IoU@50 overlap between high-attention regions and the actual objects. Finally, they intervene directly on the attention weights the language decoder assigns to vision tokens, testing five reweighting schemes — amplify, suppress, focus only on visual tokens, balance visual against textual attention, and mask-guided amplification that uses an off-the-shelf segmentation model (SAM3) to boost object-bearing patches while suppressing background patches — applied either across all layers or to early, middle, or late layer groups. Selected interventions are re-tested on a subset of FSC-147 to check whether the synthetic findings carry over to natural images.
Why This Matters
Impact on research. The paper reframes VLM counting as a diagnostic problem rather than a leaderboard problem. By isolating individual visual and linguistic variables, it exposes failure modes rooted in cross-modal binding that natural-image benchmarks cannot easily separate from confounding factors like occlusion and clutter. Its finding that mask-guided attention amplification in early and late decoder layers transfers from synthetic stimuli to FSC-147 gives the mechanistic-interpretability community a concrete, reusable intervention point, and its negative result — that reasoning checkpoints do not reliably fix enumeration — redirects attention away from chain-of-thought as a remedy and toward visual grounding.
Real-world applications (as framed in the paper and its cited context):
- Robotics, where an agent must count objects in a scene as one step of a broader open-ended task rather than as a dedicated counting problem.
- Medical imaging, where quantities of interest vary across cases and a general-purpose model must handle counting alongside other reasoning.
- Open-world and crowd counting scenarios addressed by specialized systems such as CountGD (grounding plus visual exemplars) and diffusion-based density estimators like CrowdDiff, where VLMs are an attractive general alternative to task-specific tooling.
- Visual question answering over synthetic or chart-based data, where quantity questions arise naturally and where the prompt-specificity effects documented here directly shape how queries should be phrased.
Industry relevance. Teams deploying open-source VLMs should note that model scale did not confer robustness, that highly descriptive prompts can hurt rather than help, and that extreme attention reweighting can collapse a dense-architecture model entirely (accuracy 0.000 in the uniform_focus and extreme_visual_early conditions for Qwen) while leaving a Mixture-of-Experts model comparatively unaffected. Prompt design and any inference-time attention steering must therefore be validated per architecture rather than assumed to transfer.
Future Directions
- Develop specialized attention mechanisms tailored to decoder architectures, building on the finding that mask-guided early and late-layer amplification is the most robust intervention while image-naive strategies remain model-specific and unreliable.
- Address the dissociation between counting accuracy and MRCE through hybrid training objectives, since object texture specificity can improve MRCE for some models while simultaneously degrading raw accuracy.
- Use interpretable probes to identify which network components handle enumeration versus classification, working toward architectures whose functional organization better reflects the modular structure of human visual cognition.
- Extend the framework to real-world conditions involving occlusion, varying scales, and complex spatial arrangements, which the authors list as an essential but unaddressed extension of their controlled synthetic benchmarks. Related open questions include whether the strategies transfer to frontier models that use attention variants such as mixture of depths or sparse attention patterns, and whether proprietary and larger-scale models exhibit qualitatively different failure modes than the open-source models studied here.
Target Audience
Researchers working on vision-language models, multimodal reasoning, and mechanistic interpretability, particularly those interested in counting, visual grounding, and attention-based inference-time interventions. It is also relevant to practitioners who deploy open-source VLMs and need to understand how prompt phrasing and object density affect reliability, and to cognitive scientists studying the parallels between model enumeration limits and human cognitive load effects. Readers without background in transformer attention internals will find the benchmark and the accuracy/MRCE results accessible but the intervention methodology demanding.
Authors’ abstract
Recent research suggests that Vision Language Models (VLMs) often rely on inherent biases learned during training when responding to queries about visual properties of images. These biases are exacerbated when VLMs are asked highly specific questions that require selective visual attention, a demand that mirrors cognitive challenges observed in human enumeration tasks. We build upon this research by developing a synthetic benchmark dataset and evaluation framework to systematically characterize how counting performance varies as image and prompt properties change. Using open-source VLMs, we analyze how performance shifts across controlled perturbations (e.g. number of objects, object color, background color, object texture, background texture, and prompt specificity) and examine corresponding changes in visual attention allocation. We further conduct exploratory attention reweighting experiments in the language model decoder to modulate focus on visual tokens at different layers and assess their effects on counting behavior. Our results reveal that counting accuracy degrades systematically with increasing visual and linguistic complexity echoing human limits and cognitive load effects known from human perception, while targeted attention reweighting yields modest but measurable improvements. Rather than competing on benchmark accuracy, we introduce a controlled diagnostic framework for analyzing VLM enumeration behavior. Through systematic experiments, we expose failure modes rooted in cross-modal binding that natural image benchmarks may not easily isolate, and provide preliminary empirical evidence that targeted attention reweighting in the language decoder can influence how models ground linguistic quantity concepts in visual representations. Code and data available here: https://github.com/ssen7/vlm-count-analysis