Algorithmic Recourse in Abnormal Multivariate Time Series

Xiao Han, Lu Zhang, Yongkai Wu, Shuhan Yuan

TL;DR

This paper introduces RecAD, a novel framework for generating actionable recommendations (algorithmic recourse) to fix abnormal patterns in multivariate time series data. By leveraging "backtracking counterfactual reasoning" and modeling anomalies as external interventions, RecAD provides explanations for why a time series became abnormal and suggests specific actions to restore it to a normal state.

What Problem Does This Paper Address?

Algorithmic recourse, which aims to provide actionable advice to change undesirable machine learning predictions, has seen significant progress in static data like tables and images. However, applying it to time series data, which has inherent temporal dependencies and complex dynamics, is much less explored. Anomalies in time series, such as system failures or health deterioration, are particularly challenging because interventions at one point can have cascading effects. Existing methods often struggle to account for these temporal dependencies and causal relationships, making it difficult to provide effective and interpretable recourse actions for abnormal time series.

Methods

The core of RecAD is its use of backtracking counterfactual reasoning. This approach assumes that the underlying causal relationships of the time series remain intact, and anomalies are caused by changes in exogenous variables (external factors). RecAD models these anomalies as external interventions on these exogenous variables.

The framework involves:

  1. Causal Modeling: Using a Generalized Vector Autoregression (GVAR) model to capture the causal relationships within the multivariate time series.
  2. Anomaly Detection: Employing a score-based anomaly detection function to identify abnormal time windows.
  3. Recourse Function: A neural network (specifically, an LSTM combined with feed-forward networks) that takes the observed time series window and predicts a perturbation to the exogenous variables (the recourse action). This function is trained end-to-end.
  4. Abduction-Action-Prediction (AAP): A procedure to infer the downstream effects of the proposed recourse action on future time steps, ensuring the entire future subsequence is restored to normal.
  5. Optimization: Formulating the problem as a constrained maximization of the likelihood of the exogenous variables, aiming to restore normal states while minimizing the cost of the recourse action. This is achieved through a differentiable loss function.

Datasets

The paper evaluates RecAD on:

  • Two semi-synthetic datasets:
    • Linear Dataset: A time series dataset with linear interaction dynamics.
  • Lotka-Volterra: A nonlinear time series model simulating a prairie ecosystem. These datasets allow for controlled anomaly injection and ground truth evaluation.

  • One real-world dataset:

    • Multi-Source Distributed System (MSDS): A 10-dimensional time series dataset from an industrial system.

Key Insights and Ideas

  • Time Series Recourse is Fundamentally Different: Unlike static data, interventions in time series can have ripple effects, making it crucial to consider temporal dependencies and causal relationships. RecAD's approach of modeling anomalies as external interventions and using backtracking counterfactuals directly addresses this.
  • Backtracking Counterfactuals are Key: By assuming causal laws remain constant and only exogenous variables change, this reasoning method provides a more intuitive and systematic way to trace anomalies back to their plausible external causes and suggest corrective actions.
  • End-to-End Learning for Recourse: Training a neural network directly to predict recourse actions allows for a more integrated and efficient approach, optimizing for both flipping the anomaly and minimizing intervention costs.
  • External Interventions as the Primary Anomaly Source: The paper focuses on anomalies caused by external factors, which is a common scenario in many real-world systems.

Key Results

  • High Flipping Ratios: RecAD consistently achieved the highest "flipping ratios" across all datasets and anomaly types (point and sequential, external and structural interventions), indicating its effectiveness in successfully flipping abnormal states to normal ones. For example, on the Linear dataset for sequential anomalies, RecAD achieved a flipping ratio of 0.944±0.041, significantly outperforming baselines.
  • Low Action Costs and Steps: RecAD also demonstrated lower action costs (||θt||²) and action steps compared to baselines, suggesting more efficient and cost-effective recourse actions. For instance, on the MSDS dataset, RecAD achieved an action cost of 6.747±1.543 and an action step of 1.249±0.068.
  • Effectiveness on Structural Interventions: While primarily designed for external interventions, RecAD showed promising results even for anomalies caused by structural interventions, achieving high flipping ratios.
  • Component Importance: Ablation studies confirmed the necessity of both the LSTM (for temporal context) and the feed-forward network (for deviation signals) in RecAD's architecture for effective recourse prediction.

Limitations and Future Work

  • Focus on External Interventions: The paper primarily addresses anomalies caused by external interventions on exogenous variables. While it briefly discusses structural interventions, their explanation and recourse are noted as areas for future study.
  • Sequence Anomaly Length: Determining the optimal length of a sequence of recourse actions for sequential anomalies is mentioned as a challenge.
  • Unknown Anomaly Types: For real-world datasets like MSDS, the exact nature of anomalies is unknown, requiring the model to be robust to various types.
  • Future Work: The authors suggest extending the framework to handle sequence anomalies more comprehensively and further exploring recourse for structural interventions. They also highlight the potential for using RecAD as a general framework for time series recourse.

Summary updated

BibTeX
@article{han2025algorithmic,
  author = {Xiao Han and Lu Zhang and Yongkai Wu and Shuhan Yuan},
  title = {{Algorithmic Recourse in Abnormal Multivariate Time Series}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=kzxFc2Suo5},
}
Figure