Policy learning creates fast counterfactual explanations for time series
Scalable Counterfactual Explanations for Time Series via Policy Learning
Machine LearningArtificial Intelligence
Summary
Understanding why time series predictions change can be tricky because time sequences have complex patterns. This paper presents a new method that learns to produce explanations quickly by training a policy that works for many examples, instead of figuring things out from scratch each time. The method uses an autoencoder to simplify the data and a trained agent to generate explanations in one step. This approach was tested on multiple standard datasets and found to produce valid and plausible explanations efficiently.
What this means in practice
- •For data science teams: Generate fast, reliable counterfactual explanations for time series anomaly detection without per-instance optimization.
- •For financial technology developers: Produce scalable explanations for time series models used in risk assessment to improve interpretability and regulatory compliance.
Authors
Peiyu Li, Pouya Hosseinzadeh, Soukaina Filali Boubrahimi, Shah Muhammad Hamdi
Abstract
Generating counterfactual (CF) explanations for time series is challenging due to complex temporal dependencies and the computational inefficiency of traditional instance-specific optimization. We propose a policy learning framework for counterfactual explanation in time series, trained as a one-step contextual-bandit policy-learning problem. By training an actor-critic agent in the latent space of a pre-trained autoencoder, our method learns a transferable policy that captures global structural regularities. Unlike existing methods that rely on iterative optimization for each new input, the learned policy enables direct generation of valid and plausible counterfactuals through a single forward pass, avoiding per-instance optimization at inference time. Experiments on 13 UCR benchmark datasets show that our framework achieves high validity and strong plausibility across multiple anomaly detection metrics. Overall, by decoupling counterfactual generation from per-instance optimization, the proposed method provides an efficient and scalable alternative to existing approaches for time series counterfactual explanations.