Code associated with "Rule of Thumb: Explaining Artificial Intelligence Systems using Partial Information"
0
stars
77
commits
HTML
primary language
Sep 8, 2026
updated
Code to replicate experiments and graphics from the paper "Rule of Thumb: Explaining Artificial Intelligence Systems using Partial Information"
anonymous.4open.science users: if you encounter a persistent "loading" page or a 404 error while navigating this repository, please reload the webpage or try a new incongito window. The site has been tested on chrome, firefox, and safari.
The core implementation for the new Rule of Thumb (RoT) explainer is in rot_class.py, including a subclass designed specifically to operate on text embedding data. This is typically called through a wrapper rule_of_thumb.py to match the standard OpenXAI benchmark interface. Eventually, rot_class.py and rule_of_thumb.py can be generalised into a python package that can be imported and configured by researchers and practitioners, like SHAP or LIME. Each experiment uses these core files, with minor changes as applicable for the particular experiment.
Most experiments consist of a single RUN.sh file that is expected to run the entire experiment end to end, from downloading the data to producing the final plots. Some experiments were carried out via jupyter notebooks instead of orchestrated through shell scripts. The table below links to the relevant subdirectory for each experiment. Each subdirectory has a README.md file explaining the setup and providing basic instructions to replicate figures from the paper.
| SubDirectory | Description |
|---|---|
| ExplanationExampleLocal | Fig. 1 – Explanation Disagreement Example using an Interactive Gradio Demo (Pima Indians Diabetes). |
| ExplanationExampleRemote | Fig. 0 – Explanation Disagreement Example using GPT-4o-mini for Image Classification (Cat/Dog). |
| JudicialCaseOutcomePrediction | Fig. 2 (+ Table 1) – Explaining Case Outcome Prediction using a finetuned RoBERTa model. |
| MovieReviewSentiments | Table 3 – Explaining Movie Review Sentiment Prediction using LLM APIs. |
| SyntheticResumeFiltering | Fig. 3 – Explaining Resume Filtering using LLM APIs. |
| AIAuditing | Fig. 4 (+ Table 2) – XAI for Auditing Proprietary AIs without making Model Inference Calls. |
| ScientificDiscovery | Fig. 5 – XAI for Scientific Discovery. |
| AdversarialAttack | Fig. 6 – Invulnerability to Adversarial Attacks on Explanations. |
| OpenXAIBenchmark | Fig. 7 – OpenXAI Benchmark experiments. |
| Runtimes | Scripts and results for Fig. 9 – Runtime analysis. |
| LitReview | Dataset (CSV files) examining papers which apply SHAP and XAI in scientific discovery. |
All experiments were run on a MacBook Pro with 24 GB memory using python 3.10.0.
Create and activate a virtual environment from the repository root, then install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Use the root-level orchestrator to run all experiments sequentially:
bash run_all_experiments.sh
Execution order:
adversarial_attackscientific_discoveryai_auditingexplanation_example (remote: orchestrate.sh, then local: app.py --non-interactive)openxai_benchmarkresume_filteringmovie_review_sentimentsjudicial_case_outcome_predictionruntimesUseful options:
# Show all step IDs
bash run_all_experiments.sh --list-steps
# Resume from a step index
bash run_all_experiments.sh --from-step 5
# Resume from a step ID
bash run_all_experiments.sh --from-step openxai_benchmark
# Stop at a specific step
bash run_all_experiments.sh --from-step 3 --to-step 7
# Stop immediately on first failure
bash run_all_experiments.sh --fail-fast
# Configure heartbeat and stall warning cadence
bash run_all_experiments.sh --heartbeat-seconds 60 --stall-warn-seconds 300
During execution, the runner now prints periodic ALIVE messages for the current step (default every 60 seconds), including pid, elapsed time, and log age/size. If a running step log does not grow for a while, it prints WARN_STALL.
Use these commands in another terminal:
# Path to the most recent run directory
RUN_DIR="$(cat .experiment_logs/latest_run.txt)"
echo "$RUN_DIR"
# See which steps are currently running/completed/failed
tail -n 20 "$RUN_DIR/summary.tsv"
# Follow the newest step log in real time
tail -f "$(ls -1t "$RUN_DIR"/steps/*.log | head -n 1)"
If you want to inspect a specific step log directly:
tail -f .experiment_logs/runs/<timestamp>/steps/8_judicial_case_outcome_prediction.log
If a step fails, detailed artifacts are saved under .experiment_logs/failures/<timestamp>/<step>/ including:
Run summaries are saved under .experiment_logs/runs/<timestamp>/summary.tsv.
This runner is intentionally terminal-only and does not execute notebooks. Notebook-dependent post-processing/plots remain available in each experiment subdirectory.
77 commits
HTML
46.2%
Jupyter Notebook
33.8%
Python
11.8%
Astro
6.6%
Shell
1.0%
Code associated with "Rule of Thumb: Explaining Artificial Intelligence Systems using Partial Information"
0
stars
77
commits
HTML
primary language
Sep 8, 2026
updated
Code to replicate experiments and graphics from the paper "Rule of Thumb: Explaining Artificial Intelligence Systems using Partial Information"
anonymous.4open.science users: if you encounter a persistent "loading" page or a 404 error while navigating this repository, please reload the webpage or try a new incongito window. The site has been tested on chrome, firefox, and safari.
The core implementation for the new Rule of Thumb (RoT) explainer is in rot_class.py, including a subclass designed specifically to operate on text embedding data. This is typically called through a wrapper rule_of_thumb.py to match the standard OpenXAI benchmark interface. Eventually, rot_class.py and rule_of_thumb.py can be generalised into a python package that can be imported and configured by researchers and practitioners, like SHAP or LIME. Each experiment uses these core files, with minor changes as applicable for the particular experiment.
Most experiments consist of a single RUN.sh file that is expected to run the entire experiment end to end, from downloading the data to producing the final plots. Some experiments were carried out via jupyter notebooks instead of orchestrated through shell scripts. The table below links to the relevant subdirectory for each experiment. Each subdirectory has a README.md file explaining the setup and providing basic instructions to replicate figures from the paper.
| SubDirectory | Description |
|---|---|
| ExplanationExampleLocal | Fig. 1 – Explanation Disagreement Example using an Interactive Gradio Demo (Pima Indians Diabetes). |
| ExplanationExampleRemote | Fig. 0 – Explanation Disagreement Example using GPT-4o-mini for Image Classification (Cat/Dog). |
| JudicialCaseOutcomePrediction | Fig. 2 (+ Table 1) – Explaining Case Outcome Prediction using a finetuned RoBERTa model. |
| MovieReviewSentiments | Table 3 – Explaining Movie Review Sentiment Prediction using LLM APIs. |
| SyntheticResumeFiltering | Fig. 3 – Explaining Resume Filtering using LLM APIs. |
| AIAuditing | Fig. 4 (+ Table 2) – XAI for Auditing Proprietary AIs without making Model Inference Calls. |
| ScientificDiscovery | Fig. 5 – XAI for Scientific Discovery. |
| AdversarialAttack | Fig. 6 – Invulnerability to Adversarial Attacks on Explanations. |
| OpenXAIBenchmark | Fig. 7 – OpenXAI Benchmark experiments. |
| Runtimes | Scripts and results for Fig. 9 – Runtime analysis. |
| LitReview | Dataset (CSV files) examining papers which apply SHAP and XAI in scientific discovery. |
All experiments were run on a MacBook Pro with 24 GB memory using python 3.10.0.
Create and activate a virtual environment from the repository root, then install dependencies:
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
Use the root-level orchestrator to run all experiments sequentially:
bash run_all_experiments.sh
Execution order:
adversarial_attackscientific_discoveryai_auditingexplanation_example (remote: orchestrate.sh, then local: app.py --non-interactive)openxai_benchmarkresume_filteringmovie_review_sentimentsjudicial_case_outcome_predictionruntimesUseful options:
# Show all step IDs
bash run_all_experiments.sh --list-steps
# Resume from a step index
bash run_all_experiments.sh --from-step 5
# Resume from a step ID
bash run_all_experiments.sh --from-step openxai_benchmark
# Stop at a specific step
bash run_all_experiments.sh --from-step 3 --to-step 7
# Stop immediately on first failure
bash run_all_experiments.sh --fail-fast
# Configure heartbeat and stall warning cadence
bash run_all_experiments.sh --heartbeat-seconds 60 --stall-warn-seconds 300
During execution, the runner now prints periodic ALIVE messages for the current step (default every 60 seconds), including pid, elapsed time, and log age/size. If a running step log does not grow for a while, it prints WARN_STALL.
Use these commands in another terminal:
# Path to the most recent run directory
RUN_DIR="$(cat .experiment_logs/latest_run.txt)"
echo "$RUN_DIR"
# See which steps are currently running/completed/failed
tail -n 20 "$RUN_DIR/summary.tsv"
# Follow the newest step log in real time
tail -f "$(ls -1t "$RUN_DIR"/steps/*.log | head -n 1)"
If you want to inspect a specific step log directly:
tail -f .experiment_logs/runs/<timestamp>/steps/8_judicial_case_outcome_prediction.log
If a step fails, detailed artifacts are saved under .experiment_logs/failures/<timestamp>/<step>/ including:
Run summaries are saved under .experiment_logs/runs/<timestamp>/summary.tsv.
This runner is intentionally terminal-only and does not execute notebooks. Notebook-dependent post-processing/plots remain available in each experiment subdirectory.
77 commits
HTML
46.2%
Jupyter Notebook
33.8%
Python
11.8%
Astro
6.6%
Shell
1.0%