Action-Conditioned Transition Irreversibility for Out-of-Distribution Detection in Reinforcement Learning
Organizations: School of Information Technology Deakin University Geelong, Australia 3220 · Institute of Innovation, Science and Sustainability Federation University Australia Mt Helen, Australia 3350
Abstract
Reinforcement-learning agents shape the observations they encounter; consequently, detecting out-of-distribution (OOD) states requires analysing action-conditioned trajectories rather than treating inputs as independent samples. We propose Action-Conditioned Transition Irreversibility (ACTI), a detector that evaluates forward and backward transition likelihoods, calibrates this comparison against the in-distribution profile at each timestep, and smooths the score over a short window, using no future information. We tested ACTI across six environments and fifteen detectors within OOD-RL-Bench, using the four anomaly mechanisms that qualified in every environment, with ten policy replicates per environment. All primary metrics are matched-time: each score after anomaly onset is compared with a clean twin rollout's score at the same timestep. Our method secured the top macro matched-time AUROC, outperforming the dynamics-model baseline (PEDM), while scoring transitions roughly two orders of magnitude faster. Compared to the state-only variant, ACTI achieved a small but consistent AUROC gain and a shorter detection delay. The capacity-matched forward-only baseline, ACTI-Forward, secured a statistically significant advantage in AUPRC alongside a reduced detection delay. The discrepancy in AUROC did not reach statistical significance. Ablation studies suggest instead that performance improvements stem from action conditioning, calibration at each timestep, and smoothing of the transition-likelihood scores. Based on these results, we recommend using ACTI-Forward.
Figures & tables
| Environment | Observation | Action | Policy | Role |
|---|---|---|---|---|
| LunarLander-v3 | 8-D state | 4 discrete | DQN ( Mnih et al., 2015 ) | Discrete-action control |
| Acrobot-v1 | 6-D state | 3 discrete | DQN | Discrete-action transfer |
| HalfCheetah-v5 | 17-D proprioception | 6-D continuous | TD3 ( Fujimoto et al., 2018 ) | Regular locomotion |
| Ant-v5 | 27-D proprioception | 8-D continuous | TD3 | Contact-rich control |
| Humanoid-v5 | 45-D proprioception | 17-D continuous | TD3 | Model-capacity stress |
| Breakout (MinAtar) | binary 128-D projection | 3 discrete | DQN (convolutional) | Visual representation stress |
| Anomaly | LL | AC | HC | HU | BR | AN |
|---|---|---|---|---|---|---|
| Gaussian state noise | P | P | P | P | P | P |
| State-feature dropout | P | P | P | P | P | P |
| Regime switch | P | P | P | P | P | P |
| Stuck actuator | P | P | P | P | P | P |
| Correlation break | S | — p | S | S | S | S |
| Observation delay | S | — r | — r | — r | S | — r |
| Detector | LunarLander | Acrobot | HalfCheetah | Ant |
|---|---|---|---|---|
| Mahalanobis distance | ||||
| KDE density | ||||
| Ensemble disagreement | ||||
| Forward reconstruction error | ||||
| State autoencoder | ||||
| CUSUM |
| Metric | ACTI STI | ACTI ACTI-Forward | ACTI PEDM |
|---|---|---|---|
| Matched-time AUROC | ( ) | ( ) | ( ) |
| Matched-time AUPRC | ( ) | ( ) | ( ) |
| Matched-time FPR@95%TPR | ( ) | ( ) | ( ) |
| Detection delay (steps) | ( ) | ( ) | ( ) |
| Contrast | AUROC effect | Delay effect | Interpretation |
|---|---|---|---|
| ACTI ACTI-Forward | No significant AUROC difference; ACTI-Forward is faster | ||
| ACTI reverse-only | AUROC and delay intervals include zero | ||
| ACTI STI | Action conditioning: accuracy and latency | ||
| ACTI+O ACTI | Occupancy term: no gain, slower | ||
| Timestep global calibration | Drift correction: both axes improve | ||
| Window 20 window 1 | Higher AUROC; longer delay |
| Detector | Clean alarm rate | Matched-time FPR at 95% TPR | Detection delay (steps) |
|---|---|---|---|
| Mahalanobis distance | |||
| KDE density | |||
| Ensemble disagreement | |||
| Forward reconstruction error | |||
| State autoencoder | |||
| CUSUM |
| Detector | Fit (s) | Parameters |
|---|---|---|
| Mahalanobis distance | 0.003 [0.001, 0.009] | — |
| KDE density | 0.765 [0.347, 0.833] | — |
| Ensemble disagreement | 17.485 [9.204, 17.777] | 37,550 [25,950, 104,640] |
| Forward reconstruction error | 3.814 [2.180, 3.892] | 7,510 [5,190, 20,928] |
| State autoencoder | 4.683 [2.652, 4.730] | 3,869 [1,160, 22,058] |
| CUSUM | 0.053 [0.027, 0.065] | — |
| Check | What it tests | Outcome |
|---|---|---|
| Temporal-drift null | Counterfactual post-onset labels on fully clean trajectories: does within-episode score drift alone look like detection? | 8/15 detectors separate them (incl. ACTI and PEDM) |
| Matched-signal check | Paired block-swap on real matched data: does each detector carry genuine matched-time signal? | 15/15 significant (Holm) |
| Reward-channel isolation | Reward-only drift with all other channels fixed: do transition-detector scores move? | Scores byte-identical; reward-consuming control detects (AUROC ) |
| Zero-severity identity | Do zero-severity injections reproduce clean trajectories exactly? | Exact (max. abs. difference ) |
| Action-shuffle invariance | Do state-only detector scores change when actions are shuffled? | Byte-identical |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Detector | LunarLander | Acrobot | HalfCheetah | Ant |
|---|---|---|---|---|
| Mahalanobis distance | ||||
| KDE density | ||||
| Ensemble disagreement | ||||
| Forward reconstruction error | ||||
| State autoencoder | ||||
| CUSUM |
| Detector | LunarLander Correlation break | LunarLander Dynamics scaling | LunarLander Gradual drift |
| Mahalanobis distance | |||
| KDE density | |||
| Ensemble disagreement | |||
| Forward reconstruction error | |||
| State autoencoder |
OOD Detection
Out-of-distribution (OOD) detection identifies inputs unlike a model’s training data so systems can flag uncertainty, reject inputs, or adapt safely.
See all 248 papers