ConTex: Reformulating Counterfactual Input Generation For Time Series Forecasting
Abstract
Deep time series forecasting models achieve strong predictive performance, yet their inverse behavior remains opaque: they do not reveal the temporal drivers of desired alternative forecasts or how these inputs must change to reach them. Understanding this target-dependent inverse behavior enables auditing of learned temporal dependencies and, when appropriate feasibility constraints are available, can support decision-making. Existing counterfactual explanation methods address this through instance-wise optimization, which incurs high computational costs, inconsistent solutions across similar inputs, and limited real-time applicability. We address this as a target-conditioned inverse forecasting problem and introduce GenCF as a direct amortized realization of this formulation. Building on this perspective, we further improve transparency into a model's target-conditioned inverse behavior by separating model-level counterfactual explanations into target-relative temporal relevance and modification magnitude. To this end, we introduce ConTex, a forecaster-architecture-agnostic intervention function that maps an input and desired forecast trajectory to model-level counterfactual modifications. We further introduce target-conditioned intervention relevance, identifying which timesteps matter for inducing a desired forecast rather than retrospectively explaining the current prediction. ConTex operationalizes this notion through a learned temporal selection score and a corresponding modification strength, revealing where and how the input must change. Across multiple forecasting architectures and benchmark datasets, ConTex achieves highly competitive target validity while producing substantially sparser input counterfactuals. Additionally, ConTex reduces total computational cost by 12–36× and enables several-thousand-fold faster per-sample inference relative to instance-wise optimization. These results establish ConTex as a promising foundation for extending forecasting models with explanations of their inverse behavior, supporting interpretability, auditing, and model diagnostics.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.