JAPE: Joint Anomaly Prediction and Intrinsic Explanation in Multivariate Time Series

arXiv:2608.11801 · cs.LG · Submitted 2026-08-17 · Read on arXiv

Yian Wei, Yuanyuan Yao, Lu Chen, Xiangmin Zhou, Tianyi Li

Zhejiang University · Aalborg University · RMIT University

cs.LG

Submitted: 2026-08-17

Updated: 2026-08-18

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 80/100

The gist: JAPE: Joint Anomaly Prediction and Intrinsic Explanation in Multivariate Time Series Abstract Multivariate time-series anomaly prediction aims to identify whether and when anomalies will occur over a

Terminology

Summary

JAPE: Joint Anomaly Prediction and Intrinsic Explanation in Multivariate Time Series

Abstract

Multivariate time-series anomaly prediction aims to identify whether and when anomalies will occur over a future horizon from historical observations. Existing methods primarily characterize anomalies as deviations in future numerical values, which may overlook subtle dependency changes induced by weak anomaly precursors and provide no native variable-level explanation together with the alert. To bridge these gaps, we propose JAPE, a Joint Anomaly Prediction and Explanation framework that lifts anomaly prediction from numerical-deviation modeling to dependency-structure modeling. JAPE is the first anomaly prediction framework to explicitly model evolving dependency structures for both point-wise alerting and native variable-level explanation. Specifically, JAPE (i) proposes a Decoupled Spatio-Temporal Representation (DSTR) backbone that decouples temporal and spatial modeling and captures lag-aware dependencies via learnable lag aggregation, thereby perceiving structural precursors before numerical deviations emerge; (ii) designs a dual-view alerting mechanism that fuses numerical forecasts with evolving dependency graphs for point-wise anomaly prediction, capturing structural evidence even under subtle numerical deviations; and (iii) presents Native Predictive Explanation (NPE), which directly reuses the predicted dependency graphs to rank variables by structural deviations without additional models or training. Extensive experiments on five real-world benchmarks across three prediction horizons demonstrate that JAPE improves average F1 and AUC-PR by 19.7% and 41.3%, respectively, while improving explainability with 26.6% gain in MRR.

Introduction

In modern cloud-native architectures and large-scale distributed systems, continuous monitoring of multivariate time series (MTS) is essential for maintaining system reliability and service availability. Traditional anomaly detection methods identify abnormal behaviors only after faults have already occurred, providing reactive alerts that are often too late to prevent service degradation or operational losses. As system downtime becomes increasingly costly, there is a growing demand for proactive monitoring capabilities. This has led to a shift from post-hoc anomaly detection toward anomaly prediction, which aims to anticipate future anomalies before their occurrence by leveraging historical observations and temporal patterns.

Existing approaches can be broadly divided into two paradigms. The first paradigm adopts an unsupervised formulation that combines a forecasting model with reconstruction-based anomaly detection to anticipate future anomalies. For example, TranAP first learns forecasting and reconstruction models from entirely normal data; it then forecasts future series from historical observations, reconstructs the predicted series with the learned model, and flags time steps whose reconstruction error exceeds a predefined threshold as potential future anomalies. Going a step further along this line, FCM leverages the forecasted future context to amplify weak anomaly precursors within the observation window. While effective for pronounced numerical deviations, such methods are fundamentally optimized to model normal dynamics, so weak anomaly precursors are often overwhelmed by dominant normal patterns and remain unnoticed until the numerical deviation becomes pronounced. The second paradigm adopts a self-supervised formulation that injects synthetic pseudo-anomalies into normal data to construct auxiliary prediction objectives. For example, A2P injects multi-form pseudo-anomalies through a learnable prompt pool, enabling the model to learn anomaly-related patterns during training. Recent work has also explored supervised anomaly prediction using a limited number of real anomaly labels. F2A, for example, adapts a pretrained model with a joint forecast–anomaly loss and fuses retrieved relevant horizons through retrieval augmentation to improve cross-system generalization. Yet whether the training signal comes from clean normal data, injected pseudo-anomalies, or a pretrained model, these methods are highly consistent in their modeling perspective: they all characterize anomalies essentially as deviations on the future numerical series, and raise alerts accordingly.

Existing value-centric approaches overlook the structural evidence carried by inter-variable relationships. In distributed systems, anomalies may manifest not only as changes in monitored signal values but also as structural changes in variable dependencies. Figure 1 illustrates this phenomenon using an anomalous interval from the SMD dataset. Figure 1a shows the temporal behaviors of an anomalous variable, v4, and several related variables around the anomaly interval. As shown in Figure 1b, the observed change is not merely a fluctuation in correlation strength but a clear structural reorganization: variables that are predominantly positively correlated with v4 under normal conditions become mostly negatively correlated during the anomaly, resulting in a substantial shift in the overall dependency pattern. This observation suggests that inter-variable relationships provide meaningful structural evidence for anomaly-related system changes. Therefore, explicitly modeling evolving dependency structures is essential for both anomaly prediction and variable-level explanation. Consequently, existing value-centric approaches suffer from the following three fundamental limitations: L1: Delayed detection. Under numerical forecasting objectives, weak dependency changes are often absorbed as normal fluctuations and overwhelmed by dominant normal patterns, causing anomaly precursors to remain under-emphasized and alerts to lag behind the progression of faults. L2: Limited anomaly discriminability. During anomaly propagation, anomaly-source variable and other variables often exhibit similar numerical deviations. This challenge is exacerbated when source changes are subtle, making it difficult for value-centric methods to distinguish anomaly sources from propagated responses and reducing prediction accuracy. L3: Lack of intrinsic explainability. Without explicitly modeling dependency-structure evolution, existing methods detect anomalies but cannot directly identify the variables involved, requiring separate post-hoc analysis for interpretation.

To address these three limitations, we propose JAPE, a Joint Anomaly Prediction and Explanation framework that lifts anomaly prediction from numerical-deviation modeling to dependency-structure modeling, trained under a practical setting where a small number of anomaly labels are available.

Decoupled Spatio-Temporal Representation (DSTR)

To address L1, we propose the DSTR backbone that explicitly separates temporal evolution from inter-variable dependency modeling. Instead of jointly learning temporal dynamics and structural dependencies in a single coupled operation, DSTR models them along two dedicated axes: a temporal axis for modeling the evolution of individual variables and a spatial axis for modeling inter-variable dependencies. Along the spatial axis, JAPE employs a lag-aware directional contrast function together with a learnable lag aggregation mechanism to capture evolving lead–lag dependency patterns. By modeling dependency evolution independently of temporal dynamics, DSTR preserves weak structural precursors before they manifest as observable numerical deviations.

Dual-View Alerting Mechanism

To address L2, JAPE complements the numerical view provided by the predicted series X̂ with the structural view provided by the evolving dependency graph A. The numerical view captures the observable responses of individual variables, whereas the structural view explicitly characterizes source-related changes in their pairwise relative influence. The two views are adaptively fused through cross-attention, enabling JAPE to exploit source-aware structural evidence even when the source variable exhibits only a subtle numerical deviation, thereby improving anomaly discrimination.

Native Predictive Explanation (NPE)

To mitigate L3, we reuse the dependency graph generated during prediction to provide native explanations for anomaly alerts. When an anomaly is detected, JAPE ranks variables according to their structural deviations from the normal dependency pattern, thereby identifying those most associated with the predicted anomaly. Because the dependency graph is already constructed during inference, NPE requires neither additional training nor another model forward pass, eliminating the need for a separate post-hoc diagnostic pipeline.

To the best of our knowledge, JAPE is the first anomaly prediction framework that explicitly models evolving dependency structures to jointly achieve early point-wise alerting and native predictive explanation. The contributions are summarized as follows:

  • We develop the Decoupled Spatio-Temporal Representation (DSTR) backbone, which disentangles temporal evolution from dependency modeling to preserve weak structural precursors via dynamic directed dependency graphs.

  • We propose a Dual-View Alerting Mechanism that fuses numerical forecasts with dynamic dependency structures, enabling JAPE to exploit source-aware structural evidence when numerical responses remain subtle and thereby improving point-wise anomaly discrimination.

  • We propose Native Predictive Explanation (NPE), which reuses the graph already produced during prediction and ranks variables via a Graph Deviation Score (GDS) against a normal baseline, yielding explanation at zero additional cost.

  • We conduct extensive experiments on five datasets across three forecasting horizons to demonstrate the effectiveness of our proposed framework. Compared with strong baselines, JAPE achieves 19.7% and 41.3% average gains in F1 and AUC-PR under strict point-wise evaluation, alongside a 26.6% MRR improvement for variable-level explanation.

Preliminaries

A multivariate time series with V variables is represented as a sequence of observations over consecutive timestamps. Given a historical window of length L, the time-series segment is defined as X = [xt−L+1,..., xt] ∈ RL×V, where xt ∈ RV denotes the observation vector at timestamp t, and each dimension corresponds to one variable.

Given a historical observation window X of a multivariate time series and a prediction horizon H, anomaly prediction aims to estimate the future anomaly states over the horizon. The corresponding anomaly labels are defined as Y = [yt+1,..., yt+H] ∈ 0, 1 H, where yt+h = 1 indicates that an anomaly occurs at timestamp t + h. The objective is to learn a mapping f: X → P, where P ∈ [0, 1]H denotes the predicted probabilities of the corresponding anomaly labels in Y. In addition to future anomaly prediction, we further consider variable-level explanation of the predicted anomalies. Given an anomalous prediction, the goal is to identify variables that are most relevant to the anomaly occurrence. The explanation result is represented as a ranking over the V variables.

Method

The proposed JAPE framework consists of three key components: 1) Decoupled Spatio-Temporal Representation (DSTR): It jointly models temporal dynamics and evolving inter-variable dependencies to produce both future numerical forecasts and dynamic directed dependency graphs; 2) Dual-View Alerting Mechanism: It integrates the numerical forecasting view and the structural dependency view to estimate point-wise anomaly probabilities; and 3) Native Predictive Explanation (NPE): Once an anomaly is detected, this component reuses the dependency graphs generated during forecasting and computes Graph Deviation Scores (GDS) to identify the variables most associated with the predicted anomaly.

Anomalies in multivariate time series are often preceded by subtle changes in inter-variable dependencies rather than apparent numerical deviations. A natural solution is to jointly model temporal evolution and cross-variable interactions with spatio-temporal attention. However, relations derived from current-token similarities mainly capture synchronous associations and fail to characterize lagged directional effects. Furthermore, jointly encoding temporal and variable interactions allows dominant temporal patterns to mask weak structural changes, which are easily overlooked under MSE optimization before numerical anomalies arise. To address this issue, DSTR decouples spatio-temporal modeling into two separate axes. After patch embedding, the spatial axis explicitly learns dynamic directed dependencies among variables through lag-aware asymmetric graph construction, while the temporal axis models the evolution of each variable independently. These two axes are applied alternately within each encoder layer. Furthermore, a future-oriented branch extends spatial dependency modeling into the prediction horizon, enabling DSTR to preserve evolving dependency structures for future anomaly prediction.

Patch Embedding

Given an input window X ∈ RL×V, where L is the historical length and V is the number of variables, each univariate series X:,v ∈ RL is divided into overlapping patches. Let Lp denote the patch length and Sp the stride. The patching process produces a patch sequence Xpv ∈ RP×Lp for variable v, where P = (L − Lp)/Sp + 1 is the number of patches. Each patch is mapped to a D-dimensional token through a shared linear projection followed by positional encoding. Thus, each variable is represented by P patch tokens of dimension D, forming Z(0) ∈ RV×P×D, which is passed through N dual-axis encoder layers.

Spatial Axis: Lag-Aware Directed Graph Learning

The spatial axis aims to characterize directed influences among variables and to preserve them explicitly as a graph, independently of numerical magnitude. At patch position i in encoder layer l, let Zi(l−1) = Z:,i,:(l−1) ∈ RV×D denote the input tokens of all variables. Three learnable linear projections produce Qi(l), Ki(l), and Ui(l) ∈ RV×D, which are used to measure pairwise influences across variables.

A score computed solely from the current patch captures only instantaneous association and fails to represent delayed influences. To model such lagged effects, we aggregate the preceding Kmax patch representations via exponentially decayed weighting to construct a lagged representation for the current patch. Specifically, the lag weight is defined as ak = exp[−delta(k − 1)] / Σr=1..Kmax exp[−delta(r − 1)], where delta = exp(theta) > 0, and theta is a learnable parameter and a larger delta assigns higher weight to more recent patches. For any projection Mi(l) ∈ Qi(l), Ki(l), Ui(l), its lagged counterpart is defined as the weighted aggregation of the corresponding projections from preceding patches: M̃i(l) = Σk=1..Kmax ak Mmax(1,i−k)(l), where max(1, i − k) handles sequence boundaries by truncating indices below 1 to the first valid patch.

Similarity-based attention does not explicitly distinguish the two directions of an ordered variable pair. We therefore introduce a lag-aware directional contrast score at each patch position i. The directional score matrix Si(l) ∈ RV×V is defined as: Si(l) = Qi(l)K̃i(l)⊤ − Ki(l)Q̃i(l)⊤. For an ordered pair (u, v), Si,uv(l) measures the difference between the alignment of u's current state with v's lagged state and that of v's current state with u's lagged state. A positive value indicates directional evidence from v to u: the past of v helps predict the present of u. For each target variable, we retain the Kg source variables with the strongest positive dependency scores: Airaw,(l) = TopKKg(ReLU(tanh(Si(l)))), where TopKKg retains the selected dependency scores and sets the others to zero. The resulting Airaw,(l) ∈ RV×V is normalized across the selected source variables for each target variable, yielding Ai(l) ∈ RV×V.

The learned graph guides feature propagation and serves as the structural representation for anomaly prediction. Specifically, each variable aggregates historical features from its selected predecessors: Zi,spat(l) = Zi(l−1) + lambdaAi(l)Ũi(l), where lambda is a learnable residual coefficient. This operation injects dependency-aware information while preserving the original representation through residual learning.

The spatial axis generates a graph at each patch position and encoder layer. For each patch i, we average the normalized graphs across layers as Ai = (1/N)Σl=1..N Ai(l). The resulting sequence Ai i=1..P captures the evolution of inter-variable dependencies over the historical window. The raw graphs Airaw,(l) are averaged in the same manner to preserve edge magnitudes.

Temporal Axis: Channel-Independent Temporal Modeling

Following the channel-independent design of PatchTST, the temporal axis models the evolution of each variable separately while sharing its parameters across variables. For each variable v at layer l, the temporal axis applies self-attention along the patch sequence Zv,:,spat(l) ∈ RP×D, without interaction between different variables on this axis. This yields the layer output Z(l) ∈ RV×P×D. This design keeps temporal evolution separate from the inter-variable dependencies already captured by the preceding spatial axis, preserving the explicit graph structure for subsequent alerting and explanation. We denote the final historical representation by Z = Z(N).

Future-Oriented Branch and Graph Concatenation

While the historical spatial axis captures dependencies within the observed window, anomaly detection also benefits from structural evidence aligned with the future horizon, enabling a before-and-after perspective at the time of alerting. Let Hp = ⌊(H − Lp)/Sp⌋ + 1 denote the number of future patches under the same patching rule. The future-oriented branch maps a stop-gradient copy of the final historical representation Z(N) to Ẑfut ∈ RV×Hp×D. An independent spatial block then constructs Âj j=1..Hp at each future patch position using the same lag-aware directional mechanism. The graph-enhanced representation is decoded into an auxiliary forecast X̂fut ∈ RH×V.

Both forecasting outputs are trained with the same MSE formulation. For the main forecast, we use LMSE = (1/HV)∥X̂ − X+∥2F. For the future-oriented branch, the auxiliary objective is LMSEfut = (1/HV)∥X̂fut − X+∥2F, which provides ground-truth supervision for learning the future dependency graphs. Finally, the historical and future graph sequences are concatenated along the patch dimension to form A ∈ R(P+Hp)×V×V, which is passed to the alerting module.

The Dual-View Alerting Mechanism estimates point-wise anomaly probabilities over the prediction horizon by jointly modeling future numerical evolution and evolving dependency structures. The numerical view captures the future trajectories of individual variables, whereas the structural view encodes the evolution of inter-variable dependencies produced by DSTR. Their combination enables anomaly prediction even when numerical precursors remain weak but structural patterns have already changed.

The dynamic dependency graphs generated by DSTR provide rich structural evidence for anomaly prediction. However, directly using adjacency matrices introduces variable-dependent input dimensions and redundant edge-level information. We therefore summarize each graph slice into a compact structural descriptor with a fixed dimensionality. Let T = P + Hp denote the total number of historical and future graph slices. Let svin and svout denote the incoming and outgoing strengths of variable v, respectively, and define the graph energy at slice t as Et = Σu,v At,uvraw. Within each historical or future graph segment, the final tau portion is treated as the tail, and Δ denotes the change from the preceding portion to the tail. Accordingly, Etail is the mean graph energy over the tail. Each graph slice is represented by a 13-dimensional structural descriptor consisting of two complementary components: five slice-level statistics computed from the normalized graph and eight segment-level statistics computed from the corresponding unnormalized graph sequence. The segment-level statistics are appended to every graph slice within the corresponding historical or future segment. All structural descriptors are organized chronologically as Fstr ∈ RT×13, preserving both the dependency pattern of each graph slice and the structural evolution of its surrounding segment.

We linearly project the predicted vectors at the H future steps into numerical tokens Hx ∈ RH×D and project the structural descriptor matrix Fstr into structural tokens Hg ∈ RT×D. Positional information is added to both sequences, and the structural tokens additionally encode whether they originate from the historical or future graph segment. Using the numerical tokens as queries and the structural tokens as keys and values, cross-view fusion is computed as C = Softmax((HxWQ)(HgWK)⊤/√D)HgWV, where WQ, WK, and WV are learnable projections. The resulting C ∈ RH×D is fused with the numerical tokens through a residual connection and layer normalization.

The fused representations are processed by a temporal Transformer encoder to model interactions across the prediction horizon. A linear output layer maps each encoded token to an anomaly logit, yielding point-wise anomaly probabilities p ∈ [0, 1]H. During this stage, the DSTR backbone is frozen and only the alerting head is optimized using focal loss. The complete two-stage training procedure is described in Appendix D.

Native Predictive Explanation

The dependency graphs generated during anomaly prediction provide structural evidence for identifying variables associated with future anomalies. Instead of introducing an additional attribution model, NPE derives variable-level explanations directly from the predicted dependency graphs by measuring their deviations from normal dependency patterns. Specifically, we design a Graph Deviation Score (GDS) that captures both immediate dependency changes and their propagation along multi-hop dependencies.

For each alerted anomalous segment, we aggregate the predicted graph slices within the segment into a segment-level dependency graph Aanom ∈ RV×V, where Auv denotes the dependency from variable v to variable u. A normal reference graph Anormal is constructed by aggregating dependency graphs from normal reference windows. These normal windows are also used to estimate variable-wise statistics for standardizing the deviation scores, reducing the impact of heterogeneous dependency scales across variables.

The GDS first measures direct dependency changes between anomalous and normal graphs. Let [x]+ = max(x, 0). The direct deviation score of variable v is defined as dvdir = Σu[Auvanom − Auvnormal]+ − betaΣu[Avuanom − Avunormal]+. The first term measures strengthened outgoing dependencies, while the second term penalizes strengthened incoming dependencies. This asymmetric formulation highlights variables exhibiting upstream-related dependency changes during anomalous periods.

Direct dependency deviations capture local structural changes but may overlook variables whose influence propagates through longer dependency chains. To capture such structural propagation, we compare multi-hop dependency patterns between anomalous and normal graphs. Specifically, after row-normalizing each target variable's incoming dependency weights over its selected sources to obtain Āanom and Ānormal, the positive deviation of k-hop dependencies is computed as delta(k) = ReLU((Āanom)k − (Ānormal)k), where delta(k) represents the changed dependency patterns along paths of length k. The multi-hop deviation score is then defined as dvpath = Σk=2..Kpath wk(Σu Δuv(k) − betaΣu Δvu(k)), where wk is a decay weight that reduces the contribution of longer dependency paths. The direct and multi-hop scores are standardized via variable-wise statistics from normal reference windows, producing d̃dir and d̃path. These complementary components are then combined to obtain the initial GDS representation: g(0) = d̃dir + omegad̃path, where omega controls the contribution of multi-hop dependency evidence. To further incorporate normal dependency structures, we refine the scores through residual propagation: g(r+1) = alphagds g(r) + (1 − alphagds)(g(r)Ānormal)/(∥g(r)∥∞ + epsilon), where alphagds controls the balance between preserving the original deviation evidence and incorporating dependency-aware refinement. After R refinement steps, the final explanation score is obtained as s = g(R). Ranking variables according to s produces the variable-level explanation. Since NPE directly reuses the dependency graphs generated during anomaly prediction, it requires no additional attribution model, extra inference process, or root-cause supervision.

Experiments

Experimental Setup

We evaluate JAPE on five public multivariate time-series benchmarks: SMD, WADI, MSL, PSM, and EXATHLON. All five benchmarks provide ground truth anomaly labels for the test sets, which we use directly in our experiments. SMD and WADI additionally provide event-associated variable annotations and is therefore used for the quantitative evaluation of variable-level explanations.

We compare JAPE with three categories of baselines, including unsupervised, self-supervised, and supervised methods. The unsupervised baselines include FCM and RED-F. The self-supervised baseline is A2P. For supervised comparison, we include forecasting–detection pipelines built upon PatchTST and iTransformer, as well as a supervised variant of A2P (A2P-Sup) trained with real anomaly labels.

We evaluate anomaly prediction using F1 and AUC-PR. F1 is computed as F1 = 2PR/(P + R), where P and R denote point-wise precision and recall. We adopt strict point-wise matching, where a prediction is considered correct only if it matches the anomaly label at the same timestamp, without point adjustment or tolerance. AUC-PR measures the area under the precision–recall curve and evaluates anomaly-score discrimination across different thresholds. Both metrics are computed using unadjusted point-wise anomaly scores. For variable-level explanation performance, we report HR@1, HR@3, HR@5, and MRR. HR@k measures the fraction of annotated anomaly events for which at least one ground-truth variable appears among the top-k predicted variables, while MRR measures the average reciprocal rank of the first ground-truth variable.

We use a historical window of length L = 200 and prediction horizons Lout ∈ 50, 100, 200 by default. The DSTR backbone contains N = 3 dual-axis encoder layers with a hidden dimension of D = 128, and the input series is divided into patches of length Lp = 16 with stride Sp = 8. The alerting head is trained with focal loss, with the balancing factor set to alpha = 0.25 and the focusing parameter set to gamma = 2, respectively.

Anomaly Prediction Performance

Table 2 reports the anomaly prediction results of JAPE across five datasets and three prediction lengths. Overall, JAPE achieves the best average performance across all settings, reaching an average F1 of 62.9 and an AUC-PR of 70.9, which outperform the strongest external baseline by 10.4 F1 points (19.7%) and 20.7 AUC-PR points (41.3%), respectively. The improvements are particularly pronounced on datasets with complex dependency evolution patterns. For example, on MSL, forecasting-based methods, including PatchTST, iTransformer, and A2P-Sup, achieve at most 31.8 AUC-PR, whereas JAPE reaches 68.1. This is because future numerical deviations alone are insufficient to capture weak anomaly precursors, whereas JAPE introduces additional structural anomaly evidence by jointly modeling future numerical evolution and variable dependency changes, enabling more robust anomaly identification across different prediction horizons and dataset characteristics.

In addition, the improvement of JAPE on AUC-PR is consistently larger than that on F1. On average, JAPE improves the strongest baseline by 20.7 AUC-PR points (41.3%), compared with 10.4 F1 points (19.7%). This gap is also evident in individual cases. For example, when Lout = 50, JAPE achieves an AUC-PR of 62.8, substantially outperforming A2P-Sup (44.9), while their F1 scores are relatively closer. The larger gains in AUC-PR indicate that JAPE learns a more discriminative anomaly scoring space rather than merely optimizing performance at a specific operating point. Specifically, the jointly predicted dynamic dependency structures enhance the distinction between anomalous and normal states, allowing anomalous timestamps to receive higher and more consistent anomaly scores.

Although A2P-Sup achieves slightly higher F1 under two shorter prediction lengths, JAPE consistently obtains substantially higher AUC-PR, e.g., 62.8 versus 44.9 when Lout = 50. This demonstrates that the advantage of A2P-Sup mainly comes from its performance under a specific threshold selection, whereas JAPE learns a more reliable global ranking of anomaly likelihoods. Therefore, the smaller F1 gap does not imply inferior anomaly discrimination capability of JAPE, but rather reflects the sensitivity of threshold-based evaluation to the selected operating point.

Native Predictive Explanation Evaluation

We evaluate variable-level explanation on SMD and WADI datasets using their released event-associated variable annotations. We compare JAPE with four baselines: Random, Pred-Dev, GRAD, and CF. They respectively provide random ranking, prediction-error-based ranking, gradient-based saliency, and counterfactual attribution. All methods produce variable rankings for alerted events, which are evaluated against the annotated variables.

Compared with the strongest baseline on SMD, JAPE improves HR@1 from 0.235 to 0.333, HR@3 from 0.407 to 0.505, HR@5 from 0.557 to 0.584, and MRR from 0.364 to 0.461, corresponding to a 26.6% relative improvement in MRR. Despite WADI containing only 15 events, the improvements in HR@3 and HR@5 indicate that JAPE more consistently ranks the attacked variables within the top candidates. This advantage comes from the fact that JAPE, through its GDS module, exploits evolving dependency structures as predictive evidence. Unlike Pred-Dev, which only captures future numerical deviations, and attribution-based methods, which infer variable importance from individual model responses, JAPE identifies variables whose roles in system-wide dependency structures change before anomalies fully manifest. These structural changes provide complementary early signals for distinguishing influential variables from correlated but irrelevant ones, leading to more accurate variable ranking. Therefore, JAPE provides native predictive variable-level explanations at alert time without requiring future observations, additional post-hoc diagnosis models, or extra inference stages.

Ablation Study

Table 4 presents the ablation study of two key components in JAPE under Lout = 100: the Decoupled Spatio-Temporal Representation (DSTR) backbone and the dynamic dependency graph.

To evaluate the effectiveness of DSTR, we replace it with two representative forecasting backbones, PatchTST and iTransformer, while keeping the alerting mechanism, training objective, and evaluation protocol unchanged. Since these variants only provide future numerical forecasts to the alerting head, this comparison directly reflects the quality of learned representations. DSTR achieves an average F1 of 62.7%, outperforming PatchTST and iTransformer by 3.3% and 14.7%, respectively. Among the three backbone variants, DSTR achieves the best performance on four of the five datasets and remains close to PatchTST on PSM. These results demonstrate that explicitly decoupling temporal evolution from inter-variable dependency modeling enables more informative representations for future anomaly prediction.

Based on DSTR, JAPE further incorporates the dynamic dependency graph into the alerting mechanism. This improves the average F1 from 62.7% to 65.0% and achieves the best performance on four out of five datasets, with the largest gain of 7.4% on EXATHLON. On WADI, JAPE shows a slight decrease of 1.0%. WADI contains 123 variables, resulting in a substantially larger candidate dependency space than the other datasets. The estimated graph may therefore retain more weak or redundant relations, slightly diluting the useful structural evidence during dual-view fusion. Nevertheless, the overall improvement across datasets demonstrates that the dual-view alerting mechanism effectively fuses two complementary sources of information: future numerical forecasts from the temporal branch capture point-wise deviations, while evolving dependency structures from the spatial branch reveal relational shifts. By leveraging both perspectives, JAPE provides richer evidence beyond what numerical deviations alone can offer, leading to more robust and generalizable anomaly prediction.

Training Efficiency

We compare JAPE with A2P, FCM, and RED-F on SMD, PSM, and MSL to evaluate training efficiency. As shown in Figure 3(a), JAPE achieves the lowest per-epoch training time on all three datasets, requiring only 58.1s, 7.77s, and 6.74s on SMD, PSM, and MSL, respectively. On SMD, JAPE reduces the training cost by 70.5% compared with A2P (196.9s) and achieves nearly 2× acceleration over FCM (115.7s) and RED-F (108.3s). Similar improvements are observed on PSM and MSL, demonstrating consistent efficiency advantages across datasets. These results indicate that JAPE improves anomaly prediction performance without introducing additional training overhead. This efficiency is mainly attributed to the integration of dependency modeling into the forecasting backbone, where structural learning reuses the shared sequence representations and computations rather than introducing an independent modeling branch.

Figure 3(b) further decomposes the runtime of JAPE into DSTR, Alerting, and NPE. Under the same profiling protocol, DSTR accounts for 62.0%–80.2% of the total runtime, while Alerting accounts for 19.4%–37.9%. DSTR exhibits the highest share, which is attributed to its core responsibilities: it performs the main sequence forecasting task and repeatedly constructs dynamic dependency graphs across temporal patches and encoder layers, including the future-oriented branch. These operations involve patch embedding, graph construction, and multi-head attention computations at each layer, which scale with both sequence length and encoder depth. In contrast, Alerting operates on the predicted sequence and compact structural descriptors after the backbone is frozen, requiring only lightweight standardization and neural network inference. NPE accounts for less than 0.5% on every dataset, because it directly reuses the already generated graphs and computes deviation scores without requiring additional forward passes or auxiliary networks, confirming its negligible computational overhead.

Related Work

Time series anomaly detection has been extensively studied through stochastic reconstruction (OmniAnomaly), adversarial reconstruction (USAD), association-discrepancy attention (Anomaly Transformer), and contrastive representation learning (DCdetector). Since these methods identify anomalies from already observed data, their alerts remain reactive. To better capture complex interactions among variables, recent studies have explored graph-based time-series modeling. GDN and MTAD-GAT learn graph-based representations for anomaly detection, while CrossGNN, CATCH, TimeFilter, and DyCAST model cross-variable or dynamic dependencies for general time-series analysis. Meanwhile, some anomaly detection methods provide variable-level interpretations through importance scores (OmniAnomaly, InterFusion), and root-cause analysis methods further infer causal or dependency structures from observed anomaly intervals (AERCA, GCAD, and causality-aware contrastive methods). However, these methods either detect anomalies after they occur or perform post-hoc diagnosis, and therefore cannot exploit evolving dependency changes as predictive evidence before anomaly occurrence.

Time series anomaly prediction instead aims to identify abnormal time steps over an explicit future horizon. Early work detects precursors indicating an imminent anomaly (PoA), while subsequent work formalizes point-wise anomaly prediction over future sequences. Later methods introduce anomaly-related information at different stages of the forecasting-based prediction process. TranAP forecasts future series and evaluates them through reconstruction errors learned from normal data. FCM uses forecasted future context to amplify weak precursors, whereas RED-F contrasts forecasts generated from the original sequence and a reconstructed normal-pattern sequence. A2P introduces anomaly-aware forecasting and synthetic anomaly prompting, MultiRC strengthens anomaly-related representations through multi-scale reconstructive contrast, and F2A adapts time-series foundation models through joint forecast–anomaly optimization and relevant-horizon retrieval.

Despite their different mechanisms, existing anomaly prediction methods primarily derive future alerts from numerical signal patterns or their latent representations. They do not explicitly preserve evolving directed inter-variable dependencies as predictive evidence. JAPE addresses this limitation by jointly modeling future numerical evolution and dynamic dependency structures, combining both views for point-wise anomaly prediction and reusing the predicted dependency graphs for native variable-level explanation.

Conclusion

In this paper, we present JAPE, a joint anomaly prediction and explanation framework that lifts anomaly prediction from numerical-deviation modeling to dependency-structure modeling. JAPE constructs a dynamic directed dependency-graph sequence spanning the observed history and the predicted future through the Decoupled Spatio-Temporal Representation backbone (DSTR), drives point-wise alerting with two complementary views—numerical and structural—and reuses the same graph through Native Predictive Explanation (NPE) to deliver variable-level explanations within the same forward pass via the Graph Deviation Score. Experiments on five real-world benchmarks demonstrate that JAPE achieves competitive prediction performance under a strict point-wise evaluation protocol, while producing explanations at negligible additional cost. In the future, we plan to scale dependency-structure modeling to larger systems with hundreds of variables, explore adaptive graph sparsification strategies to reduce computational overhead, and investigate the potential of structural signals in online continual-learning scenarios where anomaly patterns evolve over time.

Improvements for AI systems

Improvements to AI Systems Based on JAPE:

  1. Structural Precursor Detection: AI systems can now detect anomalies before numerical deviations become apparent by modeling evolving inter-variable dependency graphs. This enables early warning for weak anomaly precursors that value-based methods miss, improving prediction lead time by up to 41.3% in AUC-PR.

  2. Dual-View Anomaly Discrimination: Systems can fuse numerical forecasts with structural dependency evidence through cross-attention, distinguishing anomaly sources from propagated responses even when source variables show subtle numerical changes. This improves F1 by 19.7% on average across benchmarks.

  3. Native Explainability at Zero Cost: AI systems can provide variable-level explanations directly from the predicted dependency graphs without additional models, training, or inference passes. This yields 26.6% improvement in MRR for root-cause identification, enabling real-time diagnostic insights during alerting.

  4. Lag-Aware Dependency Modeling: Systems can capture directional lead-lag relationships between variables using exponentially decayed lag aggregation, identifying which variables influence others over time delays—critical for understanding fault propagation in distributed systems.

  5. Decoupled Spatio-Temporal Representation: AI systems can separately model temporal evolution and inter-variable dependencies, preventing dominant temporal patterns from masking weak structural changes. This preserves structural precursors that would otherwise be lost under MSE optimization.

  6. Future-Oriented Structural Forecasting: Systems can predict dependency graph evolution into the future horizon, enabling before-and-after structural comparisons at alert time—improving both prediction accuracy and explanation quality.

  7. Graph Deviation Scoring for Root Cause: Systems can rank variables by combining direct dependency changes with multi-hop propagation effects, identifying upstream causes versus downstream effects—particularly useful for diagnosing complex system failures.

  8. Efficient Training: Systems achieve faster training (up to 70.5% reduction in per-epoch time) by integrating dependency modeling into the forecasting backbone rather than using separate modules, making advanced anomaly prediction feasible for resource-constrained deployments.

  9. Zero-Cost Explanation Pipeline: Systems can deliver explanations with less than 0.5% additional runtime overhead, enabling real-time alerting with simultaneous root-cause insights—critical for operational response in cloud-native environments.

  10. Robust Cross-Dataset Generalization: Systems maintain strong performance across diverse multivariate time-series benchmarks (SMD, WADI, MSL, PSM, EXATHLON) with varying variable counts and dependency complexities, suggesting applicability to heterogeneous monitoring environments.

Abstract

Multivariate time-series anomaly prediction aims to identify whether and when anomalies will occur over a future horizon from historical observations. Existing methods primarily characterize anomalies as deviations in future numerical values, which may overlook subtle dependency changes induced by weak anomaly precursors and provide no native variable-level explanation together with the alert. To bridge these gaps, we propose JAPE, a Joint Anomaly Prediction and Explanation framework that lifts anomaly prediction from numerical-deviation modeling to dependency-structure modeling. JAPE is the first anomaly prediction framework to explicitly model evolving dependency structures for both point-wise alerting and native variable-level explanation. Specifically, JAPE (i) proposes a Decoupled Spatio-Temporal Representation (DSTR) backbone that decouples temporal and spatial modeling and captures lag-aware dependencies via learnable lag aggregation, thereby perceiving structural precursors before numerical deviations emerge; (ii) designs a dual-view alerting mechanism that fuses numerical forecasts with evolving dependency graphs for point-wise anomaly prediction, capturing structural evidence even under subtle numerical deviations; and (iii) presents Native Predictive Explanation (NPE), which directly reuses the predicted dependency graphs to rank variables by structural deviations without additional models or training. Extensive experiments on five real-world benchmarks across three prediction horizons demonstrate that JAPE improves average F1 and AUC-PR by 19.7% and 41.3%, respectively, while improving explainability with 26.6% gain in MRR.

Sources

Related papers