xrl-bench-eval
XRL-Bench: A Benchmark for Evaluating and Comparing Explainable Reinforcement Learning Techniques — Xiong et al. (2024) (arXiv:2402.12685, 2024)
What this evaluates
Evaluates the fidelity and stability of state-explaining methods in Reinforcement Learning across tabular and image-based environments. It measures how accurately explanations identify critical states and how consistently they perform under perturbations.
Datasets
Metrics
AIM (primary) — range: [0, 1] | other
- Area Under the Importance curve; computed by zero-padding the top-K most important states and measuring the drop in policy performance. Lower values indicate higher fidelity.
AUM — range: [0, 1] | other
- Area Under the Masking curve; computed by zero-padding the bottom-K least important states. Higher values indicate higher fidelity.
PGI — range: [0, 1] | other
- Prediction Gain for Important states; measures the difference in target action probability when important states are perturbed. Higher is better.
PGU — range: [0, 1] | other
- Prediction Gain for Unimportant states; measures the difference in target action probability when unimportant states are perturbed. Lower is better.
RIS — range: [0, 1] | other
- Residual Importance Score; measures the stability of explanation scores across multiple runs. Lower indicates higher stability.
Input / output format
Input: State observations (tabular vectors or image frames) from RL environments, passed to a trained policy network to obtain action probabilities, alongside explainer-generated state importance scores.
Output: Scalar fidelity and stability metric values (AIM, AUM, PGI, PGU, RIS) aggregated over K-sized state subsets and environments.
Scoring recipe
def compute_fidelity(importance_scores, state, policy, K_range, mask_type='top'):
indices = np.argsort(importance_scores)
if mask_type == 'top': indices = indices[-K_range:]
else: indices = indices[:K_range]
auc_values = []
for K in K_range:
masked_state = state.copy()
masked_state[indices[:K]] = 0
pred_diff = abs(policy(state) - policy(masked_state))
auc_values.append(pred_diff)
return np.trapz(auc_values)
# For PGI/PGU, compute prediction difference on target action only.
# For RIS, compute variance of importance scores across runs.
Common pitfalls
- Top-K state selection can use absolute or original importance values; the paper reports the better of the two, which can mask method weaknesses.
- For image-based environments, computing AUC over all K values is computationally prohibitive; the benchmark approximates it using K mod 10.
- Perturbation-based explainers (SARFA, PS, LIME) lack a solid theoretical framework, leading to high variance and unstable fidelity scores compared to gradient-based methods.
Evidence (verbatim from paper)
The values of the four fidelity evaluation metrics were calculated based on the Area Under the Curve (AUC) over all values of K. For AIM and AUM, zero-padding was employed to mask the most and least important states.
Citation
@misc{xiong2024xrlbench,
title={XRL-Bench: A Benchmark for Evaluating and Comparing Explainable Reinforcement Learning Techniques},
author={Xiong et al. (2024)},
year={2024},
note={arXiv:2402.12685}
}
1---2name: xrl-bench-eval3description: Evaluates the fidelity and stability of state-explaining methods in Reinforcement Learning across tabular and image-based environments. It measures how accurately explanations identify critical states and how consistently they perform under perturbations. Use when the user wants to benchmark on XRL-Bench Environments (DunkCityDynasty-v1, LunarLander-v2, CartPole-v0, FlappyBird-v0, Breakout-v0, Pong-v0), or asks about evaluating this task. Reports AIM.4---56# xrl-bench-eval78> XRL-Bench: A Benchmark for Evaluating and Comparing Explainable Reinforcement Learning Techniques — Xiong et al. (2024) (arXiv:2402.12685, 2024)910## What this evaluates1112Evaluates the fidelity and stability of state-explaining methods in Reinforcement Learning across tabular and image-based environments. It measures how accurately explanations identify critical states and how consistently they perform under perturbations.1314## Datasets1516- **XRL-Bench Environments (DunkCityDynasty-v1, LunarLander-v2, CartPole-v0, FlappyBird-v0, Breakout-v0, Pong-v0)** — total ?; splits: evaluation (-1); repo https://github.com/fuxiAIlab/xrl-bench1718## Metrics1920- `AIM` **(primary)** — range: [0, 1] | other21 - Area Under the Importance curve; computed by zero-padding the top-K most important states and measuring the drop in policy performance. Lower values indicate higher fidelity.22- `AUM` — range: [0, 1] | other23 - Area Under the Masking curve; computed by zero-padding the bottom-K least important states. Higher values indicate higher fidelity.24- `PGI` — range: [0, 1] | other25 - Prediction Gain for Important states; measures the difference in target action probability when important states are perturbed. Higher is better.26- `PGU` — range: [0, 1] | other27 - Prediction Gain for Unimportant states; measures the difference in target action probability when unimportant states are perturbed. Lower is better.28- `RIS` — range: [0, 1] | other29 - Residual Importance Score; measures the stability of explanation scores across multiple runs. Lower indicates higher stability.3031## Input / output format3233**Input**: State observations (tabular vectors or image frames) from RL environments, passed to a trained policy network to obtain action probabilities, alongside explainer-generated state importance scores.3435**Output**: Scalar fidelity and stability metric values (AIM, AUM, PGI, PGU, RIS) aggregated over K-sized state subsets and environments.3637## Scoring recipe3839```python40def compute_fidelity(importance_scores, state, policy, K_range, mask_type='top'):41 indices = np.argsort(importance_scores)42 if mask_type == 'top': indices = indices[-K_range:]43 else: indices = indices[:K_range]44 auc_values = []45 for K in K_range:46 masked_state = state.copy()47 masked_state[indices[:K]] = 048 pred_diff = abs(policy(state) - policy(masked_state))49 auc_values.append(pred_diff)50 return np.trapz(auc_values)5152# For PGI/PGU, compute prediction difference on target action only.53# For RIS, compute variance of importance scores across runs.54```5556## Common pitfalls5758- Top-K state selection can use absolute or original importance values; the paper reports the better of the two, which can mask method weaknesses.59- For image-based environments, computing AUC over all K values is computationally prohibitive; the benchmark approximates it using K mod 10.60- Perturbation-based explainers (SARFA, PS, LIME) lack a solid theoretical framework, leading to high variance and unstable fidelity scores compared to gradient-based methods.6162## Evidence (verbatim from paper)6364> The values of the four fidelity evaluation metrics were calculated based on the Area Under the Curve (AUC) over all values of K. For AIM and AUM, zero-padding was employed to mask the most and least important states.6566## Citation6768```bibtex69@misc{xiong2024xrlbench,70 title={XRL-Bench: A Benchmark for Evaluating and Comparing Explainable Reinforcement Learning Techniques},71 author={Xiong et al. (2024)},72 year={2024},73 note={arXiv:2402.12685}74}75```7677- arXiv: 2402.12685