SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.10496 · ACL · 2023

Incorporating Attribution Importance for Improving Faithfulness Metrics

Zhixue Zhao, Nikolaos Aletras

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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, 2 violated it and 0 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; 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/2305.10496.json · badge: /api/ran/2305.10496.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
casszhao/softfaith marked official in Papers with Code
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
batch_from_dict_ Ran
ran, honoured the contract we drafted
casszhao/softfaith/src/evaluation/experiments/soft_erasure_tests.py
code served (permissive licence) · get_code("f940433dac18e055")
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 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

torch.manual_seed(0)

# batch_data dict with 'annotation_id' key containing list of IDs
batch_data = {
    'annotation_id': [0, 1]
}

# metadata dict mapping annotation IDs to dicts with 'original prediction' key
metadata = {
    0: {'original prediction': 0.5},
    1: {'original prediction': 0.7}
}

# target_key parameter
target_key = 'original prediction'

ARGS = {
    'batch_data': batch_data,
    'metadata': metadata,
    'target_key': target_key
}
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 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
comprehensiveness_ Ran
ran, violated the contract we drafted
casszhao/softfaith/src/evaluation/experiments/soft_erasure_tests.py
code served (permissive licence) · get_code("eda072e0ca8422bb")
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 ndarray, ndim 1, dtype family float, shape (5,) 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 numpy as np

# Create small numpy arrays for the function parameters
# full_text_probs: probability array when using full text
full_text_probs = np.array([0.8, 0.9, 0.7, 0.6, 0.5])

# reduced_probs: probability array when using reduced/masked text
reduced_probs = np.array([0.3, 0.4, 0.2, 0.5, 0.6])

ARGS = {
    "full_text_probs": full_text_probs,
    "reduced_probs": reduced_probs,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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
create_only_query_mask_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
casszhao/softfaith/src/evaluation/experiments/soft_erasure_tests.py
code served (permissive licence) · get_code("0aff2e4643840a7d")
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 Tensor, ndim 2, dtype family int, shape (2, 8) 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

torch.manual_seed(0)

# The function expects:
# 1. batch_input_ids: a tensor of shape (batch_size, seq_length) containing token ids
# 2. special_tokens: a dict with 'sep_token_id' key containing a tensor with at least one element

# Looking at the function body:
# - It iterates over batch_input_ids sequences
# - For each seq, it finds indices where seq == special_tokens['sep_token_id'][0].item()
# - It needs at least 2 sep_token occurrences (accesses sos_eos[-2] and sos_eos[-1])

batch_size = 2
seq_length = 8

# Create batch_input_ids with sep tokens at specific positions
# We need at least 2 sep tokens in each sequence
batch_input_ids = torch.tensor([
    [1, 2, 3, 4, 5, 7, 7, 7],  # sep_token_id=7 at indices 5, 6, 7
    [2, 3, 4, 5, 6, 7, 7, 7],  # sep_token_id=7 at indices 5, 6, 7
], dtype=torch.long)

# Create special_tokens dict with sep_token_id
sep_token_id_tensor = torch.tensor([7], dtype=torch.long)
special_tokens = {
    'sep_token_id': sep_token_id_tensor
}

ARGS = {
    'batch_input_ids': batch_input_ids,
    'special_tokens': special_tokens,
}
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 Tensor, ndim 2, dtype family int, shape (2, 8) — shape (2, 8) 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
sufficiency_ Ran
ran, violated the contract we drafted
casszhao/softfaith/src/evaluation/experiments/soft_erasure_tests.py
code served (permissive licence) · get_code("7043d7897ec44ae6")
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 ndarray, ndim 2, dtype family float, shape (2, 4) 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 numpy as np

# Create small numpy arrays for the function arguments
# full_text_probs: probabilities from the full text model
# reduced_probs: probabilities from the reduced text model

np.random.seed(0)

# Create two distinct probability arrays with shape (2, 4)
# Batch size 2, 4 probability values each
full_text_probs = np.array([
    [0.9, 0.7, 0.85, 0.6],
    [0.75, 0.8, 0.65, 0.95]
], dtype=np.float32)

reduced_probs = np.array([
    [0.8, 0.6, 0.9, 0.5],
    [0.7, 0.75, 0.7, 0.85]
], dtype=np.float32)

ARGS = {
    "full_text_probs": full_text_probs,
    "reduced_probs": reduced_probs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
normalized_comprehensiveness_ Not yet run
unverified (harvested, no recorded run)
casszhao/softfaith/src/evaluation/experiments/soft_erasure_tests.py
code served (permissive licence) · get_code("334744c643688296")
How it ran

no invocation recorded.

soft_conduct_tests_ Not yet run
unverified (harvested, no recorded run)
casszhao/softfaith/src/evaluation/experiments/soft_erasure_tests.py
code served (permissive licence) · get_code("a1791575b9a13cc4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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

Feature attribution methods (FAs) are popular approaches for providing insights into the model reasoning process of making predictions. The more faithful a FA is, the more accurately it reflects which parts of the input are more important for the prediction. Widely used faithfulness metrics, such as sufficiency and comprehensiveness use a hard erasure criterion, i.e. entirely removing or retaining the top most important tokens ranked by a given FA and observing the changes in predictive likelihood. However, this hard criterion ignores the importance of each individual token, treating them all equally for computing sufficiency and comprehensiveness. In this paper, we propose a simple yet effective soft erasure criterion. Instead of entirely removing or retaining tokens from the input, we randomly mask parts of the token vector representations proportionately to their FA importance. Extensive experiments across various natural language processing tasks and different FAs show that our soft-sufficiency and softcomprehensiveness metrics consistently prefer more faithful explanations compared to hard sufficiency and comprehensiveness. 1

For agents

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

get_harvested_code_for_paper("2305.10496")
get_code_for_paper("2305.10496")
have("2305.10496")

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

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

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

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

Connect an agent — have() is free.