SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.20158 · 2026

Rethinking Visual Attribution for Chest X-ray Reasoning in Large Vision Language Models

Aidong Zhang, Guangzhi Xiong, Sanchit Sinha, Qiao Jin, Zhiyong Lu

arXiv · PDF · Open in the Atlas

Code that ran

3 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 0 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2605.20158.json · badge: /api/ran/2605.20158.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
gzxiong/medfocus canonical (classifier label)
classifier basis: census
3 ran · 2 no recorded run
FunctionStatusWhere it lives
load_medfocus Ran
ran; our contract draft was wrong, not the code
gzxiong/medfocus/medfocus/config.py
code served (permissive licence) · get_code("3a93f131e45db10d")
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 MedFocusConfig. 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 tempfile
from pathlib import Path
import yaml
import os

# Create a temporary YAML file with valid configuration
temp_dir = tempfile.mkdtemp()
config_path = Path(temp_dir) / "medfocus_config.yaml"

config_data = {
    'ot': {
        'epsilon': 0.05,
        'lambda_marginal': 0.1,
        'selection_grid': 14,
        'transfer_grid': 56,
        'sinkhorn_max_iter': 500,
        'sinkhorn_tol': 1e-06,
        'mass_quantile': 0.75,
    },
    'medsam': {
        'model_id': 'flaviagiammarino/medsam-vit-base',
    },
    'intervention': {
        'baseline': 'zero',
        'tau': 0.75,
    },
    'concepts': ['concept_a', 'concept_b', 'concept_c'],
    'composites': {
        'composite_1': ['concept_a', 'concept_b'],
        'composite_2': ['concept_c'],
    },
}

with open(config_path, 'w') as f:
    yaml.dump(config_data, f)

ARGS = {
    'path': config_path,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MedFocusConfig — a MedFocusConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MedFocusConfig 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
load_models Ran
ran; our contract draft was wrong, not the code
gzxiong/medfocus/medfocus/config.py
code served (permissive licence) · get_code("67d92ceb8287dd78")
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 ModelsConfig. 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 tempfile
import os
from pathlib import Path
import yaml

# Create a temporary YAML file with valid model configuration
temp_dir = tempfile.mkdtemp()
yaml_path = Path(temp_dir) / "models.yaml"

# Write a valid YAML configuration
config_data = {
    'models': {
        'model1': {
            'hf_id': 'meta-llama/Llama-2-7b',
            'family': 'llama',
            'dtype': 'bfloat16',
            'image_token': '<image>'
        },
        'model2': {
            'hf_id': 'openai/clip-vit-base-patch32',
            'family': 'clip',
            'dtype': 'float32'
        }
    }
}

with open(yaml_path, 'w') as f:
    yaml.dump(config_data, f)

ARGS = {
    'path': yaml_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ModelsConfig — a ModelsConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModelsConfig 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
overlay_boxes Ran
ran; our contract draft was wrong, not the code
gzxiong/medfocus/medfocus/attribution/visualization.py
code served (permissive licence) · get_code("e29e667b66eddee5")
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 Image. 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.

from PIL import Image, ImageDraw

# Create a small test image
img = Image.new('RGB', (100, 100), color='white')

# Create a list of bounding boxes in xyxy format
boxes = [
    [10, 10, 30, 30],
    [40, 40, 70, 80],
    [5, 50, 25, 75]
]

# Define all arguments
ARGS = {
    'img': img,
    'boxes': boxes,
    'color': 'red',
    'width': 2,
    'label': 'test_label'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
get_model_spec Not yet run
unverified (harvested, no recorded run)
gzxiong/medfocus/medfocus/lvlm/registry.py
code served (permissive licence) · get_code("9ba8f6b71d963c0d")
How it ran

no invocation recorded.

map_mask_through_ot Not yet run
unverified (harvested, no recorded run)
gzxiong/medfocus/medfocus/ot/mapping.py
code served (permissive licence) · get_code("38364efb53297836")
How it ran

no invocation recorded.

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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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.

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-23.

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) show promise in medical applications, but their inability to faithfully ground responses in visual evidence raises serious concerns about clinical trustworthiness. While visual attribution methods are widely used to explain LVLM predictions, whether these explanations actually reflect the visual evidence underlying the model's decision is largely unverified, since groundtruth annotations for internal model reasoning are typically unavailable. We address this question for chest X-ray (CXR) reasoning by developing a causal evaluation framework that retains only CXR-VQA samples for which the expert-annotated region is verified, via counterfactual editing, to be causally responsible for the model's prediction. Using this framework across 11 attribution methods, six opensource LVLMs, and two output modes (direct answer and step-by-step reasoning), we find that existing attribution methods often fail to identify the evidence used by LVLMs. To address this failure, we propose MedFocus, a concept-based attribution method that localizes clinically meaningful anatomical regions via unbalanced optimal transport and measures their causal effect on model outputs through targeted interventions. MedFocus produces spatial, concept-level, and token-level attributions and substantially outperforms prior methods, taking a step toward more trustworthy attribution for medical LVLMs. Our data and code are available at https://github.com/gzxiong/medfocus/.

For agents

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

get_harvested_code_for_paper("2605.20158")
get_code_for_paper("2605.20158")
have("2605.20158")

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

curl https://syntology.ai/api/ran/2605.20158.json

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

[![Syntology run record](https://syntology.ai/api/ran/2605.20158.svg)](https://syntology.ai/paper/2605.20158)

Connect an agent — have() is free.