SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.07668 · NeurIPS · 2021

Fast Axiomatic Attribution for Neural Networks

Stefan Roth, Simone Schaub-Meyer, Robin Hesse

arXiv · PDF · Open in the Atlas

Code that ran

4 of 4 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; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2111.07668.json · badge: /api/ran/2111.07668.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
visinf/fast-axiomatic-attribution canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
AttributionPriorExplainer Ran
ran on a synthesized input
visinf/fast-axiomatic-attribution/imagenet/utils/expected_gradients.py
code served (permissive licence) · get_code("ba320595cb4b765b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type and ndim 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
from torch.utils.data import TensorDataset

# Create a simple mock model
class SimpleModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.fc1 = nn.Linear(input_dim, 8)
        self.fc2 = nn.Linear(8, output_dim)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create background dataset
background_data = torch.randn(10, 4)
background_dataset = TensorDataset(background_data)

# Create model
model = SimpleModel(input_dim=4, output_dim=3)

# Create input tensor for explanation
input_tensor = torch.randn(2, 4)

# Sparse labels for multi-class output
sparse_labels = torch.tensor([1, 2])

INIT_ARGS = {
    'background_dataset': background_dataset,
    'batch_size': 2,
    'random_alpha': True,
    'k': 1,
    'scale_by_inputs': True
}

ARGS = {
    'model': model,
    'input_tensor': input_tensor,
    'sparse_labels': sparse_labels
}

METHOD = 'shap_values'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from songweige/contrastive-learning-with-non-semantic-negatives
pointer only · get_code("131a82fd65128218")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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.

gather_nd Ran
ran; our contract draft was wrong, not the code
visinf/fast-axiomatic-attribution/imagenet/utils/expected_gradients.py
code served (permissive licence) · get_code("c07c10d6dabb86be")
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 Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 functools
import operator

torch.manual_seed(0)

# Create a small 2D tensor to index into
params = torch.tensor([
    [1, 2],
    [3, 4],
    [5, 6]
], dtype=torch.float32)

# Create indices tensor - shape (2, 2) meaning 2 indices, each with 2 dimensions
# indices[0] contains row indices, indices[1] contains column indices
indices = torch.tensor([
    [1, 2],
    [1, 0]
], dtype=torch.long)

ARGS = {
    "params": params,
    "indices": indices
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
validate Ran
ran, honoured the contract we drafted
visinf/fast-axiomatic-attribution/imagenet/train_alexnet_vgg.py
code served (permissive licence) · get_code("5c22680084c0ea6f")
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 Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create a minimal model that accepts images and outputs logits
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 10)  # 10 classes for top5 accuracy
    
    def forward(self, x):
        # Flatten input and pass through linear layer
        x = x.view(x.size(0), -1)
        return self.fc(x)

# Create minimal validation loader with 2 batches
val_loader = [
    (torch.randn(2, 1, 2, 2), torch.randint(0, 10, (2,))),
    (torch.randn(2, 1, 2, 2), torch.randint(0, 10, (2,)))
]

# Create model and criterion
model = MinimalModel()
criterion = nn.CrossEntropyLoss()

# Create args object with required attributes
class Args:
    def __init__(self):
        self.gpu = None
        self.print_freq = 1

args = Args()

ARGS = {
    'val_loader': val_loader,
    'model': model,
    'criterion': criterion,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 2 later) and 1 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
accuracy 116 other papers
28 dated earlier, 2 the same month, 86 later · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
validate 6 other papers
1 dated earlier, 5 later
2105.11527 (2021-05)
Unsupervised Visual Representation Learning by Online Constrained K-Means
2206.04762 (2022-06)
Data-Efficient Double-Win Lottery Tickets from Robust Pre-training
2208.06270 (2022-08)
RenyiCL: Contrastive Representation Learning with Skew Renyi Divergence
and 3 more not named here
gather_nd
brick of this paper's assembly: helper
1 other paper
1 dated earlier
1906.10670 (2019-06)
Improving performance of deep learning models with axiomatic attribution priors and expected gradients

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

Repositories linked to this paper

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

Abstract

Mitigating the dependence on spurious correlations present in the training dataset is a quickly emerging and important topic of deep learning. Recent approaches include priors on the feature attribution of a deep neural network (DNN) into the training process to reduce the dependence on unwanted features. However, until now one needed to trade off high-quality attributions, satisfying desirable axioms, against the time required to compute them. This in turn either led to long training times or ineffective attribution priors. In this work, we break this trade-off by considering a special class of efficiently axiomatically attributable DNNs for which an axiomatic feature attribution can be computed with only a single forward/backward pass. We formally prove that nonnegatively homogeneous DNNs, here termed X -DNNs, are efficiently axiomatically attributable and show that they can be effortlessly constructed from a wide range of regular DNNs by simply removing the bias term of each layer. Various experiments demonstrate the advantages of X -DNNs, beating state-of-the-art generic attribution methods on regular DNNs for training with attribution priors. Code and additional resources at https://visinf.github.io/fast-axiomatic-attribution/. 35th Conference on Neural Information Processing Systems (NeurIPS 2021).

For agents

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

get_harvested_code_for_paper("2111.07668")
get_code_for_paper("2111.07668")
have("2111.07668")

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

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

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

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

Connect an agent — have() is free.