TL;DR
Large Vision-Language Models (LVLMs) often hallucinate objects that aren't in an image, and the standard fix—contrastive decoding—acts like a sledgehammer, intervening on every single generated word and accidentally ruining perfectly good outputs. Enter HALMES (named after Sherlock Holmes), a lightweight detective module that monitors the model's internal attention patterns to catch hallucinations before they happen. By shifting from constant, indiscriminate meddling to surgical, on-demand intervention, HALMES cuts down hallucinations while keeping normal generations intact.
What Problem Does This Paper Address?
Give an LVLM a photo of a black dog on a sofa, and it might confidently describe a black cat on a sofa. This is "object hallucination," usually caused by the model leaning too heavily on language habits rather than actually looking at the pixels.
A popular, training-free fix is contrastive decoding (CD). It works by running a second, intentionally distorted pass (like blurring the image to amplify language bias) and subtracting those "bad" probabilities from the original output distribution. The catch? Standard CD applies this subtraction at every single token step.
As Figure 1 illustrates, if the model is already on the right track, shoving its probability distribution around at every step introduces nasty side effects. In correcting "cat" to "dog," full-stage CD might accidentally turn the "black" dog "grey" and morph the "sofa" into a "bench." Meanwhile, existing hallucination detectors only flag the noun after or as it is spoken—too late to guide the trajectory leading up to it. We need an early-warning system.
Methods
Instead of treating hallucination as a sudden, single-token slip-up, the authors reframe detection as a token-segment-level problem, looking for subtle tremors in the sequence of words preceding an object noun.
First, they extract five intuitive, cross-modal attention metrics at each decoding step:
- Visual Attention Ratio (VAR): How much attention goes to image tokens across all layers.
- Prompt Attention & Generated-Text Attention: Reliance on the user's question versus the model's own prior words.
- Text-Visual Ratio: The tug-of-war balance between reading its own text and looking at the image.
- Outgoing Attention Entropy: How scattered or unfocused the model's attention is across all visible tokens.
What is new here is HALMES, a lightweight, 2-layer MLP "gate" that sits alongside any standard LVLM and contrastive decoding method. During inference, HALMES collects these five attention features over a sliding window of recent tokens, normalizes them on the fly, and outputs a real-time hallucination risk score. Using a trend-aware, double-threshold switch (to avoid flickering on local noise), HALMES leaves normal decoding alone—and flips contrastive decoding ON only when the model enters an anomalous, hallucination-prone segment.
Datasets
- Training & Pattern Discovery: The authors built a custom token-segment dataset by sampling 5,000 images from MSCOCO train2014, generating captions with target LVLMs (Qwen3VL-8B and InternVL3.5-8B), and using the CHAIR metric to label the token prefixes leading up to real vs. hallucinated nouns.
- Evaluation: Object hallucination was tested on MSCOCO val2014 and AMBER. Broader multimodal capabilities and overall response quality were evaluated on MMHal-Bench and Bingo.
Key Insights and Ideas
- Hallucinations cast a shadow before they arrive: Before an LVLM invents an object, its attention noticeably drifts. As decoding approaches a hallucinated noun, reliance on the prompt and prior text drops, while attention entropy spikes—meaning the model loses focus and its attention scatters.
- Late visual attention can't save a derailed train: Looking at layer-by-layer visual attention (Figure 2b), normal generations ground themselves in the image in the early layers. Hallucinated generations actually show higher visual attention in middle and deep layers—suggesting the model tries to look back at the image too late, after its generation trajectory has already gone off the rails.
- Timing beats frequency: HALMES triggers CD on roughly 70% of steps. To prove it isn't just winning by "doing less CD," the authors tested random and periodic 70% schedules. Both performed worse than full-stage CD, proving that knowing when to intervene is what actually matters.
Key Results
Tested as a plug-and-play add-on across two LVLMs (Qwen3VL-8B, InternVL3.5-8B) and five modern CD methods (VCD, M3ID, AVISC, SID, Self-Aug), HALMES consistently boosts performance:
- Strong Detection: Using full-layer attention features, the lightweight detector hits 91.31% AUROC on Qwen3VL-8B and 90.52% AUROC on InternVL3.5-8B.
- Fewer Hallucinations: On MSCOCO, where some full-stage CD methods actually worsened hallucinations over standard decoding, adding HALMES yielded across-the-board reductions—slashing sentence-level hallucination ($C_S$) by up to 25.3% relative (9.80 percentage points with AVISC on Qwen3VL) and AMBER hallucination rates by up to 27.6% relative (10.67 points with VCD on InternVL3.5).
- Rescuing Good Outputs: Sample-level analysis shows HALMES rescues roughly 60% of the test cases where full-stage CD originally degraded a healthy base generation.
Limitations and Future Work
HALMES isn't completely immune to trade-offs. On MSCOCO, making the model more cautious slightly lowered ground-truth object coverage in a few settings, and gains on open-ended benchmarks like Bingo were modest, occasionally showing slight dips in expression completeness. Furthermore, HALMES introduces a small "collateral risk" (around 7%–24%), occasionally failing to trigger on samples that originally benefited from full-stage CD. Future work aims to refine the triggering mechanism to cut down false activations and improve robustness across diverse tasks and decoding strategies.
Summary updated