SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2025.acl-long.175 · ACL · 2025

Cracking the Code of Hallucination in LVLMs with Vision-aware Head Divergence

Ming Tang, Jinqiao Wang, Tat-Seng Chua, Yuheng Jia, Junfeng Fang, Zhenglin Hua, Jinghan He, Haiyun Guo, Kuan Zhu

Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2025.acl-long.175.json · badge: /api/ran/2025.acl-long.175.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
jinghan1he/VHR canonical (classifier label)
classifier basis: census
5 ran · 0 no recorded run
FunctionStatusWhere it lives
combine_coco_captions Ran
ran; our contract draft was wrong, not the code
jinghan1he/VHR/eval/chair.py
code served (permissive licence) · get_code("25585704d77cafb4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import json
import tempfile
import shutil

# Create a temporary directory structure with mock COCO caption files
temp_dir = tempfile.mkdtemp()

# Create mock val captions file
val_captions = {
    'info': {'description': 'COCO 2014 Dataset', 'version': '1.0'},
    'licenses': [{'id': 1, 'name': 'Attribution License'}],
    'images': [
        {'id': 1, 'file_name': 'val_image_1.jpg'},
        {'id': 2, 'file_name': 'val_image_2.jpg'}
    ],
    'annotations': [
        {'id': 1, 'image_id': 1, 'caption': 'A cat on a mat'},
        {'id': 2, 'image_id': 2, 'caption': 'A dog playing'}
    ]
}

# Create mock train captions file
train_captions = {
    'info': {'description': 'COCO 2014 Dataset', 'version': '1.0'},
    'licenses': [{'id': 1, 'name': 'Attribution License'}],
    'images': [
        {'id': 3, 'file_name': 'train_image_1.jpg'},
        {'id': 4, 'file_name': 'train_image_2.jpg'}
    ],
    'annotations': [
        {'id': 3, 'image_id': 3, 'caption': 'A bird flying'},
        {'id': 4, 'image_id': 4, 'caption': 'A fish swimming'}
    ]
}

# Write the mock files
with open(os.path.join(temp_dir, 'captions_val2014.json'), 'w') as f:
    json.dump(val_captions, f)

with open(os.path.join(temp_dir, 'captions_train2014.json'), 'w') as f:
    json.dump(train_captions, f)

ARGS = {
    'annotation_path': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
combine_coco_instances Ran
ran; our contract draft was wrong, not the code
jinghan1he/VHR/eval/chair.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from tsunghan-wu/reverse_vlm, is pointer only (licence: NONE) · get_code("66415dc1dd50f555")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from tsunghan-wu/reverse_vlm, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_layers Ran
ran on a synthesized input
jinghan1he/VHR/utils.py
code served (permissive licence) · get_code("31736c6b695804ef")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ModuleList. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model with language_model attribute
class MinimalLanguageModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4),
        ])
    
class ModelWithLanguageModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.language_model = MinimalLanguageModel()

# Create a minimal model without language_model attribute
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            nn.Linear(4, 4),
            nn.Linear(4, 4),
        ])

# Test with model that has language_model attribute
model_with_lm = ModelWithLanguageModel()

ARGS = {
    "model": model_with_lm
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_generated_captions Ran
ran; our contract draft was wrong, not the code
jinghan1he/VHR/eval/chair.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from kigb/DropoutDecoding, is pointer only (licence: NONE) · get_code("c6889eebaff1566f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from kigb/DropoutDecoding, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

scores_each_type Ran
ran on a synthesized input
jinghan1he/VHR/eval/llava_wild.py
code served (permissive licence) · get_code("ad1838578306136b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - types: indexed with enumerate, checked for membership in dict (needs __contains__), used as dict key
# - scores: indexed with enumerate, elements appended to lists, summed and divided
# 
# The function iterates through scores and groups them by type, then computes averages.
# types and scores need to be the same length (both indexed by i)

types = ['A', 'B', 'A', 'C', 'B']
scores = [10.0, 20.0, 30.0, 15.0, 25.0]

ARGS = {
    'types': types,
    'scores': scores
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 later) and 2 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
combine_coco_captions 10 other papers
6 dated earlier, 1 later, 3 same year, order not determinable
2110.01705 (2021-10)
Let there be a clock on the beach: Reducing Object Hallucination in Image Captioning
Huang_OPERA_Alleviating_Hallucination_in_Multi-Modal_Large_Language_Models_via_Over-Trust_CVPR_2024_paper (2024 (year only))
OPERA: Alleviating Hallucination in Multi-Modal Large Language Models via Over-Trust Penalty and Retrospection-Allocation
2402.14545 (2024-02)
Less is More: Mitigating Multimodal Hallucination from an EOS Decision Perspective
and 7 more not named here
combine_coco_instances 8 other papers
5 dated earlier, 1 later, 2 same year, order not determinable
2110.01705 (2021-10)
Let there be a clock on the beach: Reducing Object Hallucination in Image Captioning
Huang_OPERA_Alleviating_Hallucination_in_Multi-Modal_Large_Language_Models_via_Over-Trust_CVPR_2024_paper (2024 (year only))
OPERA: Alleviating Hallucination in Multi-Modal Large Language Models via Over-Trust Penalty and Retrospection-Allocation
2402.14545 (2024-02)
Less is More: Mitigating Multimodal Hallucination from an EOS Decision Perspective
and 5 more not named here
load_generated_captions 1 other paper
1 dated earlier
2412.06474 (2024-12)
Enhancing Vision-Language Model Reliability with Uncertainty-Guided Dropout Decoding

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large vision-language models (LVLMs) have made substantial progress in integrating large language models (LLMs) with visual inputs, enabling advanced multimodal reasoning. Despite their success, a persistent challenge is hallucination-where generated text fails to accurately reflect visual content-undermining both accuracy and reliability. Existing methods focus on alignment training or decoding refinements but primarily address symptoms at the generation stage without probing the underlying causes. In this work, we investigate the internal mechanisms driving hallucination in LVLMs, with an emphasis on the multi-head attention module. Specifically, we introduce Vision-aware Head Divergence (VHD), a metric that quantifies the sensitivity of attention head outputs to visual context. Based on this, our findings reveal the presence of vision-aware attention heads that are more attuned to visual information; however, the model's overreliance on its prior language patterns is closely related to hallucinations. Building on these insights, we propose Vision-aware Head Reinforcement (VHR), a training-free approach to mitigate hallucination by enhancing the role of visionaware attention heads. Extensive experiments demonstrate that our method achieves superior performance compared to state-of-the-art approaches in mitigating hallucinations, while maintaining high efficiency with negligible additional time overhead. The code is available at https://github.com/jinghan1he/VHR.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2025.acl-long.175")
get_code_for_paper("2025.acl-long.175")
have("2025.acl-long.175")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2025.acl-long.175.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2025.acl-long.175.svg)](https://syntology.ai/paper/2025.acl-long.175)

Connect an agent — have() is free.