Skip to main content

ICE: Intervention-Consistent Explanation Evaluation

Paper PyPI License: MIT

Official implementation of "ICE: Intervention-Consistent Explanation Evaluation with Statistical Grounding for LLMs" (EMNLP 2026 Findings).

Key Finding

Faithfulness is operator-dependent: switching the intervention operator crosses the positive-evidence threshold in 18% of configurations (5/28), with gaps up to 44 percentage points. Nearly one-third of English deletion configurations are anti-faithful (18/56, worse than random), invisible without randomized baselines.

What ICE Does

ICE evaluates whether model explanations (attention, gradient) identify tokens that are genuinely more important than random tokens, under multiple intervention operators.

Input: "a gorgeous, witty, seductive movie"   (positive sentiment)
Rationale: {gorgeous, seductive}

               Deletion    Retrieval Infill
NSR:           0.79        0.39
Win Rate:      92%         68%
Verdict:       Faithful    Weakly Faithful   <-- operator changes conclusion

Installation

pip install ice-faithfulness

Quick Start

from ice import ICEEvaluator, ICEConfig

config = ICEConfig(
    k_values=[0.2],          # top 20% tokens as rationale
    n_permutations=50,        # random baselines
    operators="lite",         # "lite" (delete+retrieval) or "full"
)

evaluator = ICEEvaluator(model, tokenizer, config)
results = evaluator.evaluate_dataset(dataset, extractor="attention")

print(f"Win Rate: {results.win_rate:.1%}")
print(f"Effect Size (d_null): {results.effect_size:.2f}")

Causal LMs: restrict scoring to label tokens

For prompted classification with causal LMs (Llama, Mistral, Qwen, ...), restrict prediction and scoring to the task's label tokens via candidate_token_ids. Without this, argmax runs over the full vocabulary and most examples are filtered out by the confidence threshold.

# For sentiment classification with causal LMs
pos_id = tokenizer.encode(" positive", add_special_tokens=False)[0]
neg_id = tokenizer.encode(" negative", add_special_tokens=False)[0]

config = ICEConfig(
    k_values=[0.2],
    operators="lite",
    candidate_token_ids=[neg_id, pos_id],  # restrict to task labels
)

Core Modules

Module Purpose
ice.evaluation Main evaluator (ICEEvaluator, ICEConfig)
ice.extractors Attention, gradient, IG, LIME extractors
ice.operators Deletion, mask, retrieval infill operators
ice.metrics NSR scoring, AUC-over-k
ice.stats Randomization tests, bootstrap CI, BH correction
ice.retrieval_operator Leave-one-out retrieval infill

Evaluation Scripts

# English benchmarks (7 models x 4 tasks)
python scripts_for_repo/run_ice_llm.py --model meta-llama/Llama-3.2-3B-Instruct --dataset sst2

# Multilingual (6 languages)
python scripts_for_repo/run_ice_multilingual.py --model Qwen/Qwen2.5-7B-Instruct --languages french german turkish arabic

# Operator comparison
python scripts_for_repo/run_ice_llm_retrieval.py --model mistralai/Mistral-7B-Instruct-v0.3 --dataset esnli

Key Metrics

Metric Range Meaning
Win Rate 0-100% % of random baselines beaten by the rationale
Effect Size d_null Standardized distance from null (>0.8 = large, <0 = anti-faithful)
Operator Agreement bool Both operators give same verdict

Results Summary

Evaluated on 7 LLMs (1.5B-8B), 4 English tasks, 6 non-English languages, 2 attribution methods:

  • Operator gaps reach 44 pp (e.g., Llama-3.2 e-SNLI: 86% deletion vs 43% retrieval)
  • Anti-faithfulness in nearly 1/3 of English deletion configurations (18/56; gradient selects function words)
  • No correlation between faithfulness and human plausibility (|r| < 0.04)
  • Cross-lingual faithfulness spans 12%-83%, not predicted by tokenization alone

Citation

@inproceedings{basu2026ice,
    title={ICE: Intervention-Consistent Explanation Evaluation with Statistical Grounding for LLMs},
    author={Basu, Abhinaba and Chakraborty, Pavan},
    booktitle={Findings of the Association for Computational Linguistics: EMNLP 2026},
    year={2026}
}

License

MIT

Metadata

Release files for ice-faithfulness 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ice-faithfulness 1.0.1
File Size Uploaded Provenance
ice_faithfulness-1.0.1.tar.gz 40.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ice-faithfulness 1.0.1
File Interpreter ABI Platform
ice_faithfulness-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 83.9 kB

Release files / ice_faithfulness-1.0.1.tar.gz

Download URL ice_faithfulness-1.0.1.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4e093b63cbcda8630aea11e95ae1979289b643e52255bdce039cf2ce5b42432f
BLAKE2b-256 checksum
How to use checksums
cae72cd1b93b7e56291d9c2f3ef940324677da646ec1e8b59bd2c01ec3c58ec9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / ice_faithfulness-1.0.1-py3-none-any.whl

Download URL ice_faithfulness-1.0.1-py3-none-any.whl
Size 43.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
128904d53ad3ced419db20d2119d850425ba16611ec8ee98744b00556f3e98dd
BLAKE2b-256 checksum
How to use checksums
d60d0c4db9842b17314cb41693ecd349b3458c56c65ae19dc185f887e54274b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for ice-faithfulness 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page