Introduction
Evaluating the contribution of individual data points to a model's prediction is critical for interpreting behavior and improving performance. In machine learning, "data attribution" helps us understand which training points are responsible for a specific outcome. While this is relatively straightforward for independent and identically distributed (i.i.d.) data—like a collection of images—it is incredibly challenging for time series data. In a time series, a single data point’s meaning is entirely dependent on its neighbors, forming a crucial "temporal context."
Existing methods for time series attribution are often brute-force (like repeatedly retraining the model, which is computationally prohibitive) or restricted to very specific, simple architectures (like basic autoregressive models). To address the pressing need for principled approaches tailored to temporal datasets, researchers have introduced TimeInf, a new, model-agnostic framework that calculates the "influence" of individual data points in a time series.
The TimeInf Approach
TimeInf builds on the mathematical concept of "Influence Functions" but adapts them to respect the inherent dependencies of temporal data.
As highlighted in the method comparison above, TimeInf distinguishes itself from prior techniques by being entirely model-agnostic and evaluating the loss at specific time points using a mixture of distributions. It achieves this through several key mechanisms:
- Overlapping Blocks: Instead of treating a time point as an isolated unit, TimeInf looks at overlapping blocks of consecutive observations. This ensures the temporal structure and the "flow" of the data are preserved.
- Integration of Influence: A single time point appears in multiple overlapping blocks. TimeInf calculates the influence for each of these blocks and then integrates (averages) them. This makes the resulting score robust and less sensitive to the randomness of a single window.
- Model-Agnosticism: By utilizing Hessian-based approximations (such as Conjugate Gradient and Hessian-free methods), TimeInf can be applied to complex deep learning models like LSTMs and Transformers without requiring the model to have a specific internal structure.
- Self-Influence for Anomalies: For anomaly detection, TimeInf employs a "self-influence" variant. The intuition is that anomalies are hard for a model to predict using "normal" data but become much easier to predict if the model is "upweighted" on the anomaly itself. Therefore, points with high self-influence are highly likely to be anomalies.
Key Insights and Applications
Because TimeInf evaluates multiple temporal arrangements, it excels at identifying "contextual anomalies"—points that might have normal absolute values but appear at the wrong time or break an established periodic pattern.
Furthermore, TimeInf serves as a powerful tool for debugging the "ground truth." When TimeInf's scores disagree with human-labeled anomalies, researchers found that it is often because the human labels themselves are flawed or inconsistent. Ultimately, TimeInf provides a practical middle ground between the theoretical rigor of "Leave-One-Out" cross-validation (which is too slow) and the "Conditional Influence" method (which is too limited), approximating the effect of removing data without the need to retrain the model.
Empirical Results
The researchers evaluated TimeInf across a wide variety of real-world scenarios, including anomaly detection benchmarks (UCR, SMAP, MSL, NAB-Traffic, SMD), forecasting tasks, and mislabeled data analysis.
- Superior Anomaly Detection: On the UCR benchmark, TimeInf achieved an AUC of 0.79, significantly outperforming competitors like Isolation Forest (0.57) and state-of-the-art transformer-based detectors like TranAD (0.50) and DCdetector (0.74).
- Computational Speed: Despite its mathematical complexity, TimeInf is remarkably efficient. For example, on the SMD dataset, TimeInf took approximately 20 seconds to run, whereas Block LOOCV took over 15,000 seconds.
- Effective Data Pruning: In forecasting tasks, removing the top 10% of "influential" points identified by TimeInf caused a much sharper drop in model performance compared to other attribution methods. This proves that TimeInf correctly identifies the most "helpful" training data.
Limitations and Future Work
While TimeInf excels on univariate and moderately multivariate data, its performance gains are more marginal on very high-dimensional datasets, likely due to the inherent difficulty of capturing correlations across hundreds of dimensions simultaneously.
Currently, the framework focuses primarily on the validation loss function. Future work could explore how individual points influence other specific metrics, such as fairness or safety constraints. Additionally, using influence functions to detect the most representative patterns under distribution shifts—where the data's behavior changes over time—remains a promising, unexplored direction.
Summary updated