-
[2026.06.15] Text attribution has been implemented. Please refer to
efficient-batch-inference-text.py. -
[2026.06.13] Our method supports batch computation. Please refer to
efficient-batch-inference.py. -
[2026.03.20] Video explanation and API-based explanation is update to the tutorial
-
[2026.03.10] Efficient attribution version is update to the tutorial
-
[2026.02.21] Our paper has been accepted by CVPR 2026.
-
[2025.05.03] We begin by investigating the possibility of attribution in multimodal large language models (MLLMs).
For our interpretation method, the packages we use are relatively common. Please mainly install pytorch, etc.
You can experience the interpretability of a single image directly in the Jupyter notebook.
Please explore it from the file tutorial/Qwen25VL-Interpretation.ipynb. You can directly modify the Qwen-VL series models (covering versions from 2 to 3, with different parameter sizes such as 3B and 7B). Below is the interpretation result of the Qwen2.5-VL 3B model.
| Sentence-level Interpretation | Word-level Interpretation cat |
Word-level Interpretation banana |
|---|---|---|
![]() |
![]() |
![]() |
Please explore it from the file tutorial/InternVL3_5-Interpretation.ipynb. You can directly modify the InternVL series models (covering versions from 1 to 3.5, with different parameter sizes such as 4B and 8B). Below is the interpretation result of the InternVL 4B model.
| Sentence-level Interpretation | Word-level Interpretation cat |
Word-level Interpretation banana |
|---|---|---|
![]() |
![]() |
![]() |
Please explore it from the file tutorial/Qwen25VL-Hallucination-Interpretation.ipynb. You can directly modify the Qwen-VL series models (covering versions from 2 to 2.5, with different parameter sizes such as 3B and 7B). Below is the interpretation result of the Qwen2.5-VL 3B model.
Question: Is there a handbag in the image?
| Hallucination Results Interpretation | Interpreting and Mitigating Hallucination |
|---|---|
![]() |
![]() |
Please explore it from the file tutorial/Video_interpretation.ipynb.
Please explore it from the file tutorial/API_interpretation.ipynb.
| ChatGPT-5.2 | Qwen2.5-VL | InternVL-3.5 |
|---|---|---|
![]() |
![]() |
![]() |
Result:
Prepare the datasets following here.
To get the original EAGLE explanation files (sentence-level explanation):
python -m faithfulness_explanation.Qwen25-VL-3B.Qwen25-VL-3B-coco-caption
You will get the json files and npy files at fold ./interpretation_results/Qwen2.5-VL-3B-coco-caption/slico-1.0-1.0-division-number-64.
More models or tasks please see fold ./faithfulness_explanation/
For faitufulness metrics computing:
python -m evals.eval_AUC_faithfulness \
--explanation-dir ./interpretation_results/Qwen2.5-VL-3B-coco-caption/slico-1.0-1.0-division-number-64You will get Insertion AUC, Deletion AUC, and Average Highest Confidence.
For location metrics computing (only for word-level explanation in our paper):
python -m evals.eval_point_game \
--explanation-dir ./interpretation_results/interpretation_results/LLaVA-1_5-7B-coco-object/slico-1.0-1.0-division-number-64You will get Point Game (Box) and Point Game (Mask) metrics.
For hallucination explantion evaluation:
python -m evals.eval_hallucination_correction \
--explanation-dir interpretation_results/LLaVA-1_5-7B-RePOPE/slico-1.0-1.0-division-number-64You will get Insertion AUC, Average Highest Confidence, Average Minimal Correction Region (AMCR), and Correction Success Rate under Budget (CSR@10%).
For sentence-level explanation visualizaiton:
python visualize_ours.py \
--Datasets datasets/coco/val2017 \
--explanation-dir ./interpretation_results/Qwen2.5-VL-3B-coco-caption/slico-1.0-1.0-division-number-64You will get the visualization in fold interpretation_results/Qwen2.5-VL-3B-coco-caption/slico-1.0-1.0-division-number-64/visualization
For word-level explanation visualization:
python visualize_ours_w_object.py \
--Datasets datasets/coco/val2017 \
--explanation-dir ./interpretation_results/interpretation_results/LLaVA-1_5-7B-coco-object/slico-1.0-1.0-division-number-64You will get the visualization in fold interpretation_results/interpretation_results/LLaVA-1_5-7B-coco-object/slico-1.0-1.0-division-number-64/visualization
For hallucination explanation visualization:
python visualize_hallucination.py \
--Datasets datasets/coco2014/val2014 \
--explanation-dir interpretation_results/LLaVA-1_5-7B-RePOPE/slico-1.0-1.0-division-number-64You will get the visualization in fold interpretation_results/LLaVA-1_5-7B-RePOPE/slico-1.0-1.0-division-number-64/visualization
We provide baselines like LLaVA-CAM, IGOS++, and TAM.
For example, to get LLaVA-CAM:
python -m baseline_comparison.Qwen25-VL-3B.Qwen25-VL-3B-coco-caption-llavacamYou will get the attribution results at ./baseline_results/Qwen2.5-VL-3B-coco-caption/LLaVACAM
Then you need to inference the results based on the npy file to get the json file (so this can be easy for visualization or faithfulness metrics computing):
python -m baseline_comparison.Qwen25-VL-3B.Qwen25-VL-3B-inference \
--Datasets datasets/coco/val2017 \
--eval-list datasets/Qwen2.5-VL-3B-coco-caption.json \
--eval-dir ./baseline_results/Qwen2.5-VL-3B-coco-caption/LLaVACAMAfter that, you can computing the faithfulness metrics (like section 3)
python -m evals.eval_AUC_faithfulness \
--explanation-dir ./baseline_results/Qwen2.5-VL-3B-coco-caption/LLaVACAMYou can also visualizing the results (like section 4):
python visualize_ours.py \
--Datasets datasets/coco/val2017 \
--explanation-dir ./baseline_results/Qwen2.5-VL-3B-coco-caption/LLaVACAMWe provide an efficient batch inference pipeline for pure text attribution in efficient-batch-inference-text.py. The script first renders the system and user prompts with the Qwen chat template, generates the model response, builds input-side text regions, and then runs perturbation-based attribution over those regions in batches.
A basic run is:
python efficient-batch-inference-text.py \
--model-name Qwen/Qwen3-8B \
--system-prompt "You are a precise assistant. Answer with a concise explanation." \
--user-prompt "Explain why batch inference can make perturbation-based attribution faster." \
--output-dir ./text_attribution_outputs/demoBy default, the input prompt is attributed at sentence granularity to keep the candidate regions sparse. You can change the input region granularity with --input-granularity:
# Sentence-level input attribution, the default sparse setting
python efficient-batch-inference-text.py --input-granularity sentence
# Message-level input attribution, one region for the system prompt and one for the user prompt
python efficient-batch-inference-text.py --input-granularity message
# Original fine-grained behavior: word/CJK-run/punctuation readable spans
python efficient-batch-inference-text.py --input-granularity readableUseful runtime options include --batch-size for batched perturbation inference, --search-scope, --pending-samples, and --update-step for the efficient submodular search, --mask-strategy replace|attention for input masking, and --target-token-limit if you only want to explain the first generated tokens.
The output directory contains:
text_attribution_result.json: full attribution metadata, selected input regions, generated output, and insertion/deletion curves.insertion_deletion_scores.csv: step-wise insertion, deletion, and SMDL scores.text_attribution_visualization.htmlandtext_saliency_map.svg: input-side attribution visualizations.output_token_input_influence.*: per-output-token input influence reports.combined_attribution_report.svg: a compact report combining input attribution and output influence.
@inproceedings{chen2026mllms,
title={Where MLLMs Attend and What They Rely On: Explaining Autoregressive Token Generation},
author={Chen, Ruoyu and Guo, Xiaoqing and Liu, Kangwei and Liang, Siyuan and Liu, Shiming and Zhang, Qunli and Wang, Laiyuan and Zhang, Hua and Cao, Xiaochun},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={17057--17066},
year={2026}
}









