Inferensys

Glossary

Temporal Anomaly Attribution

The process of decomposing an anomaly score generated by a time-series model to identify the specific time steps and features that contributed most to the detection of an unusual event.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
TIME-SERIES EXPLAINABILITY

What is Temporal Anomaly Attribution?

The process of decomposing an anomaly score to identify the specific time steps and features that contributed most to the detection of an unusual event.

Temporal Anomaly Attribution is the process of decomposing an anomaly score generated by a time-series model to identify the specific time steps and features that contributed most to the detection of an unusual event. It transforms a single, opaque anomaly alert into a granular diagnostic map, enabling engineers to answer not just that something went wrong, but when and why the model flagged it.

This technique applies feature attribution methods like Temporal SHAP or Integrated Gradients to the temporal dimension, assigning importance scores to individual lags. By isolating the exact sensor reading at the precise moment of deviation, it moves operations teams from reactive alert investigation to proactive root cause analysis in industrial IoT and financial systems.

TEMPORAL ANOMALY ATTRIBUTION

Key Attribution Techniques

Core methodologies for decomposing anomaly scores in time-series models to identify the specific time steps and features driving unusual event detection.

01

Reconstruction Error Decomposition

The foundational technique for autoencoder-based anomaly detection. The total anomaly score is the reconstruction error, which is decomposed by computing the per-timestep squared error between the input and the reconstructed output. By summing errors across feature dimensions at each time step, a temporal saliency map is generated, directly showing which moments the model failed to reconstruct. This method is inherently faithful, as the explanation is the error signal itself.

02

Forecast Error Contribution Analysis

Used when anomaly detection relies on forecasting models. The anomaly score is the deviation between the predicted and actual value. Attribution is performed by backpropagating this forecast error through the model to compute the gradient with respect to each input time step. Techniques like Temporal Integrated Gradients accumulate these gradients along a path from a baseline to the input, satisfying the completeness axiom and ensuring the sum of attributions equals the total anomaly score.

03

Attention Weight Aggregation

For Transformer-based anomaly detectors, attention weights provide a direct, albeit debated, signal for attribution. The process involves extracting the attention matrices from all heads in the final layer and aggregating them (e.g., via mean or max pooling) across heads. The resulting vector shows the attention paid to each past time step. Attention rollout extends this by propagating attention weights through all layers, accounting for the mixing of information in deeper representations to produce a more faithful attribution.

04

Time-Step Ablation and Occlusion

A model-agnostic perturbation method. To attribute an anomaly, individual time steps or contiguous windows are systematically masked or replaced with a baseline value (e.g., zero, mean, or a forecast). The change in the anomaly score is measured for each perturbation. A large drop in the score indicates a critical time step. Temporal Occlusion Analysis slides a fixed-size window across the sequence to generate a saliency map, identifying the precise temporal interval responsible for the anomaly.

05

Shapley Value Adaptation for Sequences

Temporal SHAP adapts game-theoretic Shapley values to the time-series domain. Each time step is treated as a player in a cooperative game where the payout is the anomaly score. The method computes the marginal contribution of each time step by averaging its impact across all possible subsets of other time steps. To handle the exponential complexity, approximations like KernelSHAP or DeepSHAP are used, providing a theoretically sound, additive feature attribution that fairly distributes the anomaly score across the sequence.

06

Counterfactual Temporal Trajectory

Instead of assigning importance scores, this technique generates a minimally perturbed alternative sequence that would have been classified as normal. The difference between the original anomalous sequence and the counterfactual highlights the critical time steps and features. Optimization methods like gradient descent in the input space find the smallest change required to flip the model's decision, providing a highly intuitive explanation: 'If these specific values had been different, no anomaly would have been detected.'

TEMPORAL ANOMALY ATTRIBUTION

Frequently Asked Questions

Clear answers to the most common questions about decomposing anomaly scores in time-series models to identify the specific time steps and features responsible for triggering an alert.

Temporal anomaly attribution is the process of decomposing an anomaly score generated by a time-series model to identify the specific time steps and input features that contributed most to the detection of an unusual event. When a model flags an anomaly, the raw score alone offers no insight into why the alert fired. Attribution methods systematically assign responsibility to individual points in the sequence. The process typically works by comparing the model's output against a baseline or expected distribution, then using techniques like Temporal SHAP, Temporal Integrated Gradients, or attention flow analysis to backpropagate the anomaly signal to the input space. The result is a saliency map—a heatmap overlaid on the time series—showing exactly which timestamps and which sensor readings (e.g., temperature, pressure, vibration) drove the anomaly score above threshold. This transforms a black-box alert into an auditable, actionable diagnostic for engineers in finance, IoT, and industrial monitoring.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.