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.
Glossary
Temporal Anomaly Attribution

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.
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.
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.
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.
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.
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.
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.
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.
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.'
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
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.
Related Terms
Core methods for decomposing anomaly scores and identifying the specific time steps and features that triggered a detection event.
Temporal SHAP
Adapts Shapley value calculations to assign importance scores to individual time steps in a sequence model's prediction. For anomaly detection, it decomposes the anomaly score by fairly distributing credit among all input features across the temporal axis, identifying which specific timestamps contributed most to the flag.
- Based on game-theoretic optimal credit allocation
- Satisfies efficiency, symmetry, and additivity properties
- Computationally intensive for long sequences; often uses KernelSHAP or DeepSHAP approximations
Time-Step Ablation
A perturbation-based method that systematically removes or masks individual time steps from a sequence to measure the resulting change in the model's anomaly score. The larger the score drop when a step is removed, the more critical that step was to the detection.
- Simple to implement and model-agnostic
- Can miss interaction effects between time steps
- Often combined with sliding window occlusion for efficiency
Layer-wise Relevance Propagation for Sequences
A decomposition method that backpropagates the anomaly score through the layers of a recurrent or temporal convolutional network to assign relevance scores to each input time step. LRP conserves the total relevance across layers, ensuring no attribution is lost.
- Uses deep Taylor decomposition or epsilon-rules for stability
- Produces heatmaps showing relevance flow over time
- Particularly effective for LSTM-based anomaly detectors
Temporal Integrated Gradients
A gradient-based technique that computes the integral of gradients along a path from a neutral baseline (e.g., zero signal or mean imputation) to the actual anomalous input. This satisfies the completeness axiom, ensuring attributions sum to the difference between the anomaly score and the baseline score.
- Requires careful baseline selection for time-series data
- Identifies both positive and negative contributions to the anomaly score
- Computationally linear in the number of integration steps
Counterfactual Temporal Trajectory
Generates a minimally altered version of the anomalous sequence that would have been classified as normal by the model. The difference between the original and counterfactual trajectories pinpoints exactly which time steps and features needed to change to avoid triggering the alert.
- Provides actionable recourse for operators
- Uses optimization techniques like gradient descent in the input space
- Must respect temporal constraints and feature plausibility
Temporal Occlusion Analysis
Slides a masking window across the time series, occluding contiguous segments to generate a saliency map. The resulting heatmap shows which temporal intervals are most critical for the anomaly prediction, revealing the precise onset and duration of the anomalous event.
- Window size is a critical hyperparameter
- Can be extended to occlude feature subsets simultaneously
- Often visualized as a temporal heatmap overlaid on the raw signal

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us