DL0113 VLM Object Hallucination

Explain the primary causes of Object Hallucination in VLMs, for a captioning feature built on a model like LLaVA or Qwen2-VL.

Answer

Object hallucination is the case where a vision-language model asserts an object that is not present in the image, and it is not one bug but the sum of four largely independent failure sources stacked along the encode → project → decode pipeline. The vision tower is usually a frozen contrastively-trained ViT, so it encodes globally discriminative semantics and is measurably weak on small objects, counts, duplicates, and absence; the projector then compresses the image to a fixed budget of visual tokens (576 for CLIP ViT-L/14 at 336 px, only 32 query tokens for a BLIP-2 style Q-Former), discarding spatial detail the decoder can never recover. On the language side, the decoder was pretrained on text alone and carries a strong object co-occurrence prior, so whenever the visual evidence for a token is weak the prior decides: “dining table” pulls in “fork”, “kitchen” pulls in “refrigerator”. Instruction tuning makes this worse rather than better, because much visual SFT data is written by a text-only model from captions and bounding boxes and therefore contains ungrounded details, and the training objective rewards confident, fluent, detailed answers with no penalty term for an unsupported noun. Finally, decoding itself drifts: attention to visual tokens concentrates on a few early anchor positions and decays with sequence position, so late sentences are generated nearly blind, and once a wrong noun is emitted it conditions everything after it, producing the well-documented snowball effect.

(1) Weak Visual Features: a contrastive image-text objective optimizes for retrieval-level discrimination, not localization, so paired images differing in one small detail can receive nearly identical embeddings.
(2) Token And Resolution Budget: a fixed low-resolution grid plus projector compression means thin, small, or crowded objects arrive at the decoder as a few blurred features.
(3) Language Co-occurrence Prior: the text-pretrained decoder completes plausible scenes, and objects that frequently co-occur with the true content are the ones hallucinated first.
(4) Instruction Data Noise And Yes-Bias: SFT data generated from captions and boxes contains details never visible, and presence questions are answered affirmatively far more often than chance.
(5) Objective Mismatch: next-token cross-entropy has no grounding loss, and helpfulness-oriented preference tuning rewards verbosity, which mechanically increases the number of nouns at risk.
(6) Autoregressive Drift: visual attention mass decays over the generated sequence and hallucinated nouns become context, so error rate grows with output length rather than with model size.

Pipeline diagram: a 336 by 336 image enters a frozen ViT-L/14 encoder, a projector emits 576 visual tokens, a text-pretrained LLM decoder generates a caption, with four labelled causes attached to the encoder, projector, decoder, and the autoregressive feedback loop

Figure 1: Each stage can independently drop or overwrite visual evidence: the frozen contrastive encoder loses fine detail, the projector loses spatial resolution, the text-only prior fills the gap, and the sampling loop recycles its own mistakes.

The two benchmark families separate these causes reasonably well. CHAIR parses generated captions against a fixed object vocabulary and reports the fraction of mentioned objects that are absent, which makes drift visible because the metric worsens as captions get longer. POPE instead asks balanced yes/no presence questions and splits the negatives three ways: random objects, popular objects, and adversarial objects chosen because they co-occur most often with the ground-truth objects. The gap between the random and adversarial splits is close to a direct measurement of language-prior dominance, and the reported yes-ratios above 90% for several 2023-era models are a direct measurement of the SFT affirmation bias. A useful diagnostic in the same spirit is to score a candidate token twice, once with the image and once with the image removed, since a near-zero difference means the prior, not the pixels, chose that word.

Mathematical Formulation:
s_t = \log p_\theta(y_t \mid v, x, y_{1:t-1})
s_t^{\mathrm{lang}} = \log p_\theta(y_t \mid x, y_{1:t-1})
\Delta_t = s_t - s_t^{\mathrm{lang}}
s_t^{\mathrm{cd}} = (1 + \alpha)\, s_t - \alpha\, s_t^{\mathrm{dist}}
\mathrm{CHAIR}_i = \frac{|H|}{|M|}

Where:

  • y_t is the token generated at step t and y_{1:t-1} the tokens already committed, which is why an early mistake is irreversible.
  • v is the sequence of projected visual tokens (576 for a ViT-L/14 336 px grid, 32 for a Q-Former) and x is the text prompt.
  • s_t^{\mathrm{lang}} is the same score with the image dropped, so \Delta_t is the visual grounding margin; \Delta_t \approx 0 means the token was chosen by the language prior alone.
  • s_t^{\mathrm{dist}} is the score under a distorted or noised image and \alpha \geq 0 the contrast strength, giving the contrastive decoding adjustment used by VCD-style mitigations.
  • M is the set of object mentions parsed from a caption and H \subseteq M the subset absent from the annotation, so \mathrm{CHAIR}_i is an instance-level hallucination rate in [0, 1].
  • Required condition for the margin test: both scores must be computed at the same step with identical y_{1:t-1}, otherwise the two distributions are not comparable.
Two panel schematic chart: left panel shows attention mass on visual tokens declining from 0.30 to 0.06 across six generated sentence indices, right panel shows hallucinated object rate rising from 0.03 to 0.40 across the same indices

Figure 2: Schematic of the drift pattern reported by attention-analysis studies and by CHAIR-versus-length ablations: as generation proceeds, attention mass on visual tokens falls while the hallucinated-object rate rises, so long free-form captions hallucinate far more than short answers from the same model.

AspectVisual encoding bottleneckLanguage prior dominanceDecoding-time drift
Typical symptomMisses or confuses small, thin, or duplicated objects; counting and absence errorsInvents objects that usually co-occur with what is really there, such as a fork beside a dining tableFirst sentence accurate, later sentences increasingly invented; repeated nouns
Diagnostic probeMMVP-style image pairs differing in one visual detail; linear probes on frozen featuresPOPE adversarial split versus random split; the grounding margin with and without the imageCHAIR plotted against caption length or max_new_tokens
Effect of a bigger decoderLittle help; the same weak features are described more confidentlyOften worse, because a stronger text prior overrides weak visual evidenceRoughly unchanged; this is a sequence-length effect, not a capacity effect
Cheapest effective fixHigher input resolution or dynamic tiling, more visual tokens, unfreezing the tower late in trainingContrastive decoding against a distorted image, plus preference tuning on grounded and ungrounded response pairsShorter outputs, beam-level over-trust penalties, post-hoc detector verification

Login to view more content


Log in to track your progress

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *