Papers › ViT-CX: Causal Explanation of Vision Transformers

ViT-CX: Causal Explanation of Vision Transformers

6 Nov 2022arXiv:2211.03064archive 2025-07-28

Weiyan Xie, Xiao-Hui Li, Caleb Chen Cao, Nevin L. Zhang

Despite the popularity of Vision Transformers (ViTs) and eXplainable AI (XAI), only a few explanation methods have been designed specially for ViTs thus far. They mostly use attention weights of the [CLS] token on patch embeddings and often produce unsatisfactory saliency maps. This paper proposes a novel method for explaining ViTs called ViT-CX. It is based on patch embeddings, rather than attentions paid to them, and their causal impacts on the model output. Other characteristics of ViTs such as causal overdetermination are also considered in the design of ViT-CX. The empirical results show that ViT-CX produces more meaningful saliency maps and does a better job revealing all important evidence for the predictions than previous methods. The explanation generated by ViT-CX also shows significantly better faithfulness to the model. The codes and appendix are available at https://github.com/vaynexie/CausalX-ViT.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2211.03064")

Code

Syntology Ran 1 of 9 code samples harvested from 1 repository linked to this paper; 8 have no recorded run. Of those that ran: 1 ran · violated contract.

By repository: official repository: 9 samples from 1 repository, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

vaynexie/CausalX-ViT officialmentioned in papermentioned on GitHubpytorchCC0-1.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

9 samples harvested; 1 ran; 0 honoured the contract we drafted; 8 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · violated contract
8unverified

Licence: 0 of the 9 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from vaynexie/CausalX-ViT. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

deprocess_image vaynexie/CausalX-ViT/ViT_CX/cam/utils/image.py official repository ran · violated contract fingerprinted CC0-1.0 (permissive) · 672d3d84a89bbafa · report
find_layer_predicate_recursive vaynexie/CausalX-ViT/ViT_CX/cam/utils/find_layers.py official repository unverified CC0-1.0 (permissive) · 383600edf86e6da6 · report
find_layer_types_recursive vaynexie/CausalX-ViT/ViT_CX/cam/utils/find_layers.py official repository unverified CC0-1.0 (permissive) · 401af4c8ee982ca6 · report
get_cos_similar_matrix vaynexie/CausalX-ViT/ViT_CX/ViT_CX.py official repository unverified CC0-1.0 (permissive) · 9da12373ae640999 · report
norm_matrix vaynexie/CausalX-ViT/ViT_CX/ViT_CX.py official repository unverified CC0-1.0 (permissive) · 1bf4c39bc534e65c · report
preprocess_image vaynexie/CausalX-ViT/ViT_CX/cam/utils/image.py official repository unverified CC0-1.0 (permissive) · d5db1adaf17e9890 · report
replace_layer_recursive vaynexie/CausalX-ViT/ViT_CX/cam/utils/find_layers.py official repository unverified CC0-1.0 (permissive) · a112dc051428bbc2 · report
reshape_function_vit vaynexie/CausalX-ViT/ViT_CX/ViT_CX.py official repository unverified CC0-1.0 (permissive) · c2cd700d59efd9ed · report
show_cam_on_image vaynexie/CausalX-ViT/ViT_CX/cam/utils/image.py official repository unverified CC0-1.0 (permissive) · 4dab890a3ffb1e99 · report

Tasks

Explainable Artificial Intelligence (XAI)

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections