TimeInf: Time Series Data Contribution via Influence Functions

## Abstract

Abstract Evaluating the contribution of individual data points to a model’s prediction is critical for interpreting model predictions and improving model performance. Existing data contribution methods have been applied to various data types, including tabular data, images, and texts; however, their primary focus has been on i.i.d. settings. Despite the pressing need for principled approaches tailored to time series datasets, the problem of estimating data contribution in such settings remains unexplored, possibly due to challenges associated with handling inherent temporal dependencies.
This paper introduces TimeInf , a data contribution estimation method for time-series datasets. TimeInf uses influence functions to attribute model predictions to individual time points while preserving temporal structures. Our extensive empirical results demonstrate that TimeInf outperforms state-of-the-art methods in identifying harmful anomalies and helpful time points for forecasting. Additionally, TimeInf offers intuitive and interpretable attributions of data values, allowing us to easily distinguish diverse anomaly patterns through visualizations. Code: https://github.com/yzhang511/TimeInf

## 1 Introduction

Understanding the impact of time series data is important, particularly in fields like finance and healthcare where decisions heavily rely on model predictions. The presence of anomalies or low-quality samples in the time series can significantly affect the accuracy of model predictions. In such instances, anomaly detection helps us identify unusual events that might disrupt the normal time series behavior.
Moreover, the identification of influential time points allows a model to focus on meaningful patterns and relationships within the data. From these motivations, the attribution of a value to each data point, distinguishing between beneficial and detrimental ones, is crucial to various applications, including anomaly detection and the recognition of valuable data patterns. Therefore, estimating the contribution of time series data is essential for understanding and building trustworthy and effective time series models.

Various data contribution methods have been proposed to explain the quality of model predictions at the level of individual data points [, , , ].
[] suggest using empirical influence functions [] to attribute model predictions to individual observations. Influence function, a valuable tool from robust statistics introduced by [], plays a central role in reflecting the impact of changes in individual data points on model parameters in an independent and identically distributed (i.i.d.) setting. Nonetheless, complications arise in the domain of time series data, where data is typically not i.i.d. due to temporal dependencies among time points, presenting a unique challenge when applying influence functions to time series models. Merely applying the state-of-the-art data contribution estimation methods without accounting for the dependency structure in the sequence overlooks the contribution of past events and the underlying temporal structure in the data. We provide an example in Section 2.

Several approaches have been explored to employ influence functions while preserving temporal structure. [] introduces influence functions for autoregressive (AR) processes. Extending Hampel’s influence functions from i.i.d. settings to time series contexts, [] examines the influence of overweighting an observation on AR model parameters. Taking a further step, [] propose influence functionals designed for general stationary processes. Instead of focusing on a specific observation, [] consider stochastic processes, enabling the measurement of the influence of observations with various temporal arrangements.
While the influence functionals proposed by [] provide a general notion of influence for time series data, they require assuming a predefined process for the observation of interest.
This raises uncertainty about their applicability to data contribution estimation, where the focus is on specific observed temporal patterns.

We draw inspiration from []’s influence functions for AR models.
To preserve the dependency structure of the original time series, we utilize overlapping blocks of consecutive time series observations.
Such an approach is commonly used in time series analysis and machine learning, serving as a means to extend jackknife and bootstrap methods to time series data [, , ]. With this blocking technique, we employ influence functions to measure the impact of past observations on time series model predictions.
The assignment of a data value to a specific time point involves integrating data values across consecutive time series observations that encompass the time point of interest.

#### Our Contributions

In this work, we introduce TimeInf, a data contribution estimation method for time-series datasets that utilizes influence functions to assess the impact of individual time points on model predictions. On multiple real-world datasets, our method, TimeInf, outperforms existing approaches in detecting harmful anomalies and helpful time points for time series forecasting. TimeInf provides intuitive data value attributions, facilitating the identification of diverse temporal patterns through visualizations. Furthermore, its computational efficiency empowers scalable data contribution estimation, making it well-suited for large datasets containing millions of time points.

## 2 Motivation

Hampel’s influence functions from robust statistics quantify the impact of a single observation on estimators [, ]. [] extend this concept to assess how perturbation of observations affects model predictions. While their influence function captures the influences in i.i.d. settings, it does not adequately handle non-i.i.d. settings. In particular, [] find that the approximate influences underestimate the actual effects on correlated data groups.
This section highlights two key challenges that can arise when extending existing influence functions by [] to temporally dependent data.

#### Overlooking Temporal Dependency

The original influence function [] measures how removing a training point affects the test loss. For a linear regression problem with centered inputs $x_{i}\in\mathbb{R}^{p}$ and outputs $y_{i}\in\mathbb{R}$, and parameters $\theta\in\mathbb{R}^{p}$, a natural choice of the objective function is the mean squared error loss.

$$ $\displaystyle\frac{1}{n}\sum_{i=1}^{n}L(x_{i},y_{i},\theta)=\frac{1}{n}\sum_{i =1}^{n}(y_{i}-x_{i}^{\top}\theta)^{2}.$ $$

In this case, changing each instance $x_{i}$ with the same input features by the same amount produces an equal effect on predicting $y_{i}$, as all $x_{i}$’s share the same parameters $\theta$. However, this is not necessarily true for time-series datasets due to temporal dependency among data points. Specifically, we consider a time series forecasting problem with a $m$-th order univariate autoregressive model. For $\theta=(\theta_{1},\dots,\theta_{m})\in\mathbb{R}^{m}$, the objective function is

$$ $\displaystyle\frac{1}{n}\sum_{i=1}^{n}L(x_{i-m+1},\dots,x_{i},x_{i+1},\theta)= \frac{1}{n}\sum_{i=1}^{n}\left(x_{i+1}-\sum_{t=1}^{m}x_{i-t+1}\theta_{t}\right )^{2}.$ $$

In this example, a time point’s influence on model predictions depends on its location. Even if $x_{i}$ and $x_{i-m+1}$ are changed equally, their effects on predicting $x_{i+1}$ differ due to time point ordering. Previous influence functions [] neglect such temporal dependencies and local structures. To preserve local structure, we construct blocks of consecutive time points $(x_{i+1},x_{i},...,x_{i-m+1})$ from the original time series and assess how changing the entire block impacts model predictions.

#### Overlooking Different Contamination Patterns

The original influence function [] overlooks the effects of different contamination patterns on the model, as shown by the lag-one correlation coefficient

$$ $\displaystyle\hat{\rho}=\frac{\sum_{i=1}^{n-1}x_{i}x_{i+1}}{\sum_{i=1}^{n}x^{2 }_{i}}.$ $$

If $k$ isolated contaminating points have value $\xi$, then $\hat{\rho}\rightarrow 0$ as $\xi\rightarrow\infty$. But if $k$ contiguous points have value $\xi$, then $\hat{\rho}\rightarrow(k-1)/k$ as $\xi\rightarrow\infty$. This illustrates that distinct arrangements of the contaminating time points yield different effects on model parameters. The original influence function [] focuses only on one contamination pattern (Section 3), overlooking potential influences from different patterns.

## 3 Influence Functions for Autoregressive Models

Since the original influence functions [, ] overlook temporal dependencies in time series data and arrangements of contaminating time points, we consider consecutive observations to properly define influence functions for time series models [, ]. Given time series observations $\{x_{i}\}_{i=1}^{n},x_{i}\in\mathbb{R}^{p}$ from a stationary ergodic process [], we construct $n-m+1\,(m<n)$ overlapping time blocks of consecutive observations $x^{[m]}_{i}:=(x_{i}^{\top},\dots,x_{i-m+1}^{\top})^{\top}$ with empirical $m$-dimensional marginal distribution $\hat{F}^{m}$ defined as

$$ $\displaystyle\hat{F}^{m}=n^{-1}\sum_{i=1}^{n}\delta_{(x_{i}^{\top},\,\dots,\,x _{i+m-1}^{\top})^{\top}},$ $$

where $\delta_{x^{[m]}}$ is the point mass distribution at $x^{[m]}\in\mathbb{R}^{m\times p}$, and $\hat{F}^{m}\in\mathcal{M}_{\text{stat}}^{m}$, where $\mathcal{M}_{\text{stat}}^{m}$ is the $m$-dimensional marginals of stationary process. By the ergodic theorem [], $\hat{F}^{m}\overset{a.s.}{\to}F^{m}$ as $n\to\infty$. Here, $F^{m}\in\mathcal{M}_{\text{stat}}^{m}$ is the distribution of $X_{t_{1}},\dots,X_{t_{m}}$ of a given random process $\{X_{t}\}$, where $t_{1},\dots,t_{m}\in\mathbb{N}$.

One way to introduce influence functions for autoregressive models is through the concept of a contaminated distribution function.

###### Definition 3.1 ( Contaminated Distribution Function ) .

Suppose $F^{m},G^{m}\in\mathcal{M}_{\text{stat}}^{m}$. For $0<\epsilon<1$, the contaminated distribution function is defined as

$$ $\displaystyle F^{m}_{\epsilon}(z^{[m]})=(1-\epsilon)F^{m}+\epsilon G^{m},$ $$

where $z^{[m]}\sim G^{m}$.

Intuitively, $F^{m}_{\epsilon}(z^{[m]})$ is a contaminated distribution in which the original distribution $F^{m}$ is contaminated by a sample $z^{[m]}$ from the contaminating distribution $G^{m}$.

Denote $\theta\in\Theta\subseteq\mathbb{R}^{q}$ as the time series model parameters, and $\hat{\theta}$ as an estimator. We define the influence function for time series models [, ] as follows.

###### Definition 3.2 ( Influence Function for $m$ -Dimensional Marginal ) .

The influence function of $\hat{\theta}$ at $F^{m}$, $\mathcal{I}_{\hat{\theta}}:\mathbb{R}^{m}\times\Theta\to\mathbb{R}^{q}$ is defined as

$$ $\displaystyle\mathcal{I}_{\hat{\theta}}(z^{[m]})=\lim_{\epsilon\searrow 0} \frac{\mathbb{E}_{G^{m}}\left[\hat{\theta}(F^{m}_{\epsilon}(z^{[m]}))-\hat{ \theta}(F^{m})\right]}{\epsilon}.$ (1) $$

That is, influence functions measure the infinitesimal effect of upweighting $z^{[m]}$ by $\epsilon$ to $\hat{\theta}$ evaluated at $F^{m}$. When $G^{m}$ is a point mass $\delta_{z^{[m]}}$ and $m=1$, this corresponds to the setup in the original influence function [, ], which places all mass at the observation $\{z^{[m]}\}$, considering only this specific contamination pattern.

To compute influence functions, we need a specific choice of $\hat{\theta}$. Most machine learning estimators involve optimizing a criterion function. We focus on a general class of such estimators []:

###### Definition 3.3 ( M-estimators ) .

If the loss function $\rho:\mathbb{R}^{m}\times\Theta\to\mathbb{R}$ is differentiable and convex, we define M-estimators as solutions to a minimization problem over the data

$$ $\displaystyle\hat{\theta}=\underset{\theta\in\Theta}{\text{argmin}}\,\int\rho( x^{[m]},\theta)d\hat{F}^{m}(x^{[m]}),$ $$

which can be expressed as the solution to a set of equations

$$ $\displaystyle\int\psi(x^{[m]},\theta)d\hat{F}^{m}(x^{[m]})=0,\quad\psi(x^{[m]} ,\theta):=\frac{d\rho(x^{[m]},\theta)}{d\theta}.$ $$

This class includes the maximum likelihood estimator (MLE) and ordinary least square (OLS) estimator. In practice, under some regularity condition [], the empirical influence function [, ] of $\hat{\theta}$ at $\hat{F}^{m}$ is

$$ $\displaystyle\mathcal{I}_{\hat{\theta}}(z^{[m]})=-\left(\int\frac{d\psi(x^{[m] },\hat{\theta})}{d\theta}d\hat{F}^{m}(x^{[m]})\right)^{-1}\int\psi(z^{[m]}, \hat{\theta})dG^{m}(z^{[m]}).$ (2) $$

See Appendix Section A for derivations of Equation (2) and [] for detailed proof.

###### Definition 3.1 ( Contaminated Distribution Function ) .

###### Definition 3.2 ( Influence Function for m 𝑚 m italic_m -Dimensional Marginal ) .

###### Definition 3.3 ( M-estimators ) .

## 4 TimeInf: Time Series Data Contribution via Influence Functions

$\mathcal{I}_{\hat{\theta}}$ captures how training data contamination from time blocks sampled from $G^{m}$ impacts model parameters. To understand a specific time block’s influence on predictions instead, we replace $G^{m}$ with $\delta_{z^{[m]}}$ and use the chain rule to derive the influence function for a time block:

$$ $\displaystyle\mathcal{I}_{\text{block}}(z^{[m]},z_{\text{test}}^{[m]})=-\psi(z _{\text{test}}^{[m]},\hat{\theta})^{\top}\left(\int\frac{d\psi(x^{[m]},\hat{ \theta})}{d\theta}d\hat{F}^{m}(x^{[m]})\right)^{-1}\psi(z^{[m]},\hat{\theta}),$ (3) $$

which measures the impact of overweighting $z^{[m]}$ on predicting $z_{\text{test}}^{[m]}$ in the test set. Derivations of Equation (3) are included in Appendix Section A.

To assess the impact of a particular time point $z$ rather than a time block $z^{[m]}$, we propose “TimeInf”, which samples $z^{[m]}$ from the $m$-dimensional marginal distributions $\hat{G}^{m}$ of an empirical contaminating process to obtain a time point’s contribution to model predictions:

###### Definition 4.1 ( TimeInf ) .

Let $S_{z,\hat{F}^{m}}$ be the set of overlapping time blocks $z^{[m]}\sim\hat{F}^{m}\in\mathcal{M}_{\text{stat}}^{m}$ containing time point $z$. For $\hat{G}^{m}=\frac{1}{|S_{z,\hat{F}^{m}}|}\sum_{z^{[m]}\in S_{z,\hat{F}^{m}}}
\delta_{z^{[m]}}$, we define TimeInf as the integration of $\mathcal{I}_{\text{block}}(z^{[m]},z_{\text{test}}^{[m]})$ with respect to $\hat{G}^{m}$:

$$ $\displaystyle\mathcal{I}_{\text{time}}(z,z_{\text{test}}^{[m]})$ $\displaystyle:=\int\mathcal{I}_{\text{block}}(z^{[m]},z_{\text{test}}^{[m]})d \hat{G}^{m}(z^{[m]})$ $\displaystyle=-\psi(z_{\text{test}}^{[m]},\hat{\theta})^{\top}\left(\int\frac{ d\psi(x^{[m]},\hat{\theta})}{d\theta}d\hat{F}^{m}(x^{m})\right)^{-1}\int\psi(z ^{[m]},\hat{\theta})d\hat{G}^{m}(z^{[m]}).$ (4) $$

Each $z$ is in multiple blocks with distinct time point configurations. Integrating across blocks containing $z$ in Equation (4) computes the expected influence of $z$ under different temporal arrangements.

###### Definition 4.1 ( TimeInf ) .

### 4.1 Variants of TimeInf

Depending on the task, different TimeInf variants can be used for data contribution estimation. When the goal is to estimate data quality, particularly in anomaly detection, self-influence provides a means to quantify the impact of a specific time point on its own prediction:

$$ $\displaystyle\mathcal{I}_{\text{self}}(z)=\frac{1}{|S_{z,\hat{F}^{m}}|}\sum_{z ^{[m]}\in S_{z,\hat{F}^{m}}}\mathcal{I}_{\text{block}}(z^{[m]},z^{[m]}),$ (5) $$

The key idea is that anomalies, being rare and distinct, are hard to predict using normal data but easier using anomaly data itself. Thus, anomaly points are expected to be most influential for their own predictions.

For time series forecasting, to understand how changing a time point affects test predictions, we can average $\mathcal{I}_{\text{time}}$ from Equation (4) across all test set time blocks:

$$ $\displaystyle\mathcal{I}_{\text{test}}(z)=\frac{1}{|S_{\text{test},\hat{F}^{m} }|}\sum_{z^{[m]}_{\text{test}}\in S_{\text{test},\hat{F}^{m}}}\mathcal{I}_{ \text{time}}(z,z^{[m]}_{\text{test}}),$ (6) $$

where $S_{\text{test},\hat{F}^{m}}$ is the set of time blocks in the test set.

### 4.2 TimeInf Example: AR( m 𝑚 m italic_m ) Model

Although any differentiable models can be used to compute TimeInf (Appendix Section B), our primary focus in this paper is on linear AR models due to their powerful performance and computational efficiency [, ]. For linear AR models with the MSE loss $\rho(x_{i}^{[m]},x_{i+1},\hat{\theta})=(x_{i+1}-{x_{i}^{[m]}}^{\top}\hat{
\theta})^{2}$, the solution of TimeInf corresponds the least squares estimator and thus it has a closed-form solution. Specifically, the influence of overweighting $z_{l}^{[m]}$ on the model parameters is given by:

$$ $\mathcal{I}_{\hat{\theta}}(z_{l}^{[m]})={\left(\frac{1}{n}\sum_{i=1}^{n}{x_{i} ^{[m]}}{x_{i}^{[m]}}^{\top}\right)}^{-1}{z_{l}^{[m]}}(z_{l+1}-{z_{l}^{[m]}}^{ \top}\hat{\theta}).$ $$

The influence of overweighting $z_{l}^{[m]}$ on the test prediction is:

$$ $\displaystyle\mathcal{I}_{\text{block}}(z_{l}^{[m]},z^{[m]}_{\text{test},r})=- {(z_{\text{test},r+1}-{z^{[m]}_{\text{test},r}}}^{\top}\hat{\theta})^{\top}{z^ {[m]}_{\text{test},r}}^{\top}{\left(\frac{1}{n}\sum_{i=1}^{n}{x_{i}^{[m]}}{x_{ i}^{[m]}}^{\top}\right)}^{-1}{z_{l}^{[m]}}(z_{l+1}-{z_{l}^{[m]}}^{\top}\hat{ \theta}).$ $$

### 4.3 Implementation of TimeInf

The challenge in computing TimeInf lies in the inversion of the Hessian in Equation (3), expressed as $\int\frac{d\psi(x^{[m]},\hat{\theta})}{d\theta}d\hat{F}^{m}(x^{[m]})$. With $n$ training points and $\theta\in\mathbb{R}^{q}$, this involves $O(nq^{2}+q^{3})$ operations. While it is feasible to directly compute the inverse of the Hessian for linear AR models with a small $q$, for deep neural networks with millions of parameters, this computation becomes prohibitively expensive. To approximate this computation efficiently, we resort to the conjugate gradient (CG) method, as suggested by [], and the TracIn approach introduced by []. The CG method converts the matrix inversion into an optimization problem solvable in $O(nq)$ time. TracIn replaces the inverse Hessian matrix with an identity matrix, reducing the main computation bottleneck of the influence function to only the dot product of gradients. Once equipped with the influence of a time block, $\mathcal{I}_{\text{block}}$, we can compute the influence of a time point, $\mathcal{I}_{\text{time}}$, self-influence, $\mathcal{I}_{\text{self}}$, and the influence of a time point on the test prediction, $\mathcal{I}_{\text{test}}$, according to Equations (4), (5) and (6).

## 5 Use Cases of TimeInf

This section investigates the effectiveness of TimeInf in two downstream tasks: time series anomaly detection and data pruning tasks.
With applications to real-world datasets, we demonstrate that TimeInf outperforms several state-of-the-art anomaly detection methods (Section 5.1) and accurately identifies influential time patterns for forecasting (Section 5.2). Additionally, we present extensive ablation studies (Section 5.3 and Appendix Section E), demonstrating that TimeInf is model-agnostic as well as robust against various hyperparameters.

### 5.1 Time Series Anomaly Detection

The ability to identify anomalies in time series enables timely interventions and optimized decision-making across different domains, providing early warnings, detecting faults, and preventing fraud [, , ].
In this section, we showcase the effectiveness of TimeInf in time-series anomaly detection.

Experimental Settings. Unlike conventional approaches in time series anomaly detection literature that first train models on a well-curated clean subset without anomalies and then detect anomalies in a contaminated evaluation dataset, we consider a practical situation where a training dataset is contaminated and the proportion of contamination is unknown [].
The idea is that we want to know whether there are anomalies in the training set, not the evaluation dataset, and attempt to detect them using the data contribution. This framework aligns more closely with real-world scenarios where curating a completely clean training dataset is often challenging []. We provide implementation details in Appendix Section C.

Datasets. We extensively evaluate TimeInf on five benchmark datasets: UCR [], SMAP [], MSL, NAB-Traffic, and SMD []. Detailed descriptions of these datasets and results on additional datasets are provided in Appendix Section C.

Table: Table 1: Anomaly detection performance and time cost of TimeInf and baseline methods. For both F1 and AUC metrics, a higher value indicates a better performance. TimeInf demonstrates superior performance over state-of-the-art time series anomaly detection methods across five real-world datasets, while being computationally efficient.

Baselines. For anomaly detection, we use self-influences $\mathcal{I}_{\text{self}}$.
For univariate time series, we compute the self-influence directly for each time point, normalizing the results to a range between 0 and 1 to obtain anomaly scores. In the case of multivariate time series, we first apply self-influence to each dimension separately and then average the anomaly scores across all dimensions to obtain the final anomaly scores for individual time points. Although we can apply self-influences to all dimensions of the multivariate time series and obtain one set of anomaly scores, empirical results suggest that it is less effective than taking the average of anomaly scores obtained separately from each dimension. We provide detailed discussion in Appendix Section F.

We compare TimeInf to the four commonly used anomaly detectors, covering classic approaches like Isolation Forest [], a Long Short-Term Memory (LSTM)-based detector [], AR integrated moving average model (ARIMA) and vector AR model (VAR),
and a state-of-the-art transformer-based method named Anomaly Transformer []. For AR-based models, we use ARIMA for univariate time series, and VAR for multivariate time series.

Evaluation.
Since all methods but Isolation Forest require time blocks as input, we initially apply them to generate anomaly scores for time blocks of length 100. We select a block length of 100 based on empirical results showing that the baselines consistently achieve optimal performance with this choice. Beyond this point, the performance gain becomes marginal.
Subsequently, we obtain the anomaly score for each time point by averaging the anomaly scores across time blocks that contain this specific time point, as in Equation (4). For Isolation Forest, we directly apply it to score each time point.

Following the practice [], we apply the $k$-Means clustering algorithm to the calculated anomaly scores in our method, using a cluster of two to partition the scores into clusters of normal and anomaly time points. For other baselines, we consider the two sets of anomaly predictions: (i) the $k$-Means clustering-based method used for TimeInf and (ii) the top-$k$ anomaly score-based method, where $k$ is the true number of anomalies. When computing performance metrics, we select the highest score between these two classification approaches. In practice, the exact number of anomalies is unknown, making this scoring procedure favorable to the other baselines. Evaluation metrics include F1 and AUC for detecting accuracy, along with the computation time cost for each method. We calculate the AUC by comparing the ground truth anomaly labels (0 for normal and 1 for anomalous data) with the anomaly scores produced by each baseline.

Figure: Figure 1: Qualitative example of TimeInf and baseline methods in the UCR dataset. The first row displays the raw time series, while the subsequent rows show the anomaly scores generated by each method. For better visualizations, we normalize the anomaly scores from each method to a range between 0 and 1. The ground truth anomaly intervals are marked in red segments. TimeInf outperforms state-of-the-art time series anomaly detection methods in identifying diverse anomaly patterns in terms of AUC, and it also provides more interpretable attributions.
Refer to caption: x1.png

#### Main Results.

As shown in Table 1, our method outperforms the other baselines in the UCR, SMAP, MSL, and NAB-Traffic datasets for anomaly detection. On the SMD dataset, our method achieves higher AUC than other methods. Although we maintain a consistent block length of 100 across all datasets for a fair comparison, using a block length optimized for each dataset could potentially yield even better results, as shown by the ablation study in the Appendix (Figure 6). Additionally, TimeInf requires substantially less computation time than most baseline methods except Isolation Forest, enabling efficient data contribution assessment for large datasets (see Appendix C for data sizes).

We investigate reasons behind our superior performance with a qualitative analysis using the UCR dataset []. Figure 1 compares the anomaly scores of TimeInf with other baselines across various types of time series anomalies, namely point anomaly, noisy data, local contextual, and global contextual anomalies.
Our method better captures challenging local and global contextual anomalies, whereas other baselines tend to identify only large deviations in data values, struggling to distinguish abrupt changes in a local or a global context. For point anomalies and noisy data, while other baselines can detect them, our method produces very low anomaly scores for the normal points, effectively distinguishing them from anomalies.

The effectiveness of TimeInf compared to Isolation Forest lies in our consideration of temporal structure, allowing it to better handle contextual anomaly patterns. Unlike deep learning-based approaches such as LSTM and Anomaly Transformer, our method does not rely on training on an anomaly-free subset before being applied to detect anomalies in the contaminated subset. Due to this difference, TimeInf generally performs better than other prediction-based methods in identifying anomalies within the training dataset.

We have added more visualizations in Figures 8 and 9 in the Appendix to further compare the performance of different anomaly detectors. Moreover, we have explored other datasets, which can be found in Appendix Section C.

### 5.2 Data Pruning

Identifying the most influential time patterns in the training dataset can improve forecasting performance by prioritizing patterns that contribute significantly to accurate predictions. In this section, we demonstrate TimeInf’s ability to identify helpful time patterns for forecasting through a data pruning experiment.

Figure: Figure 2: Data pruning results for TimeInf and other data contribution methods. We estimate the contribution of each time block in the training data using various baselines. For each method, we iteratively remove the most influential time block from the training set and track the resulting performance degradation, measured by $R^{2}$. The better the data contribution method, the lower the $R^{2}$ curve. TimeInf shows a steeper decrease than state-of-the-art data contribution methods, demonstrating superior performance in identifying helpful data patterns for time series forecasting across four real-world datasets.
Refer to caption: extracted/5750502/figs/data_pruning.png

Experimental Settings. For each dataset, we conduct 100 independent experiments, each time randomly sampling 5,000 consecutive data points.
These points are then sequentially partitioned into a training set, a validation set, and a test set, with fixed sizes of 3000, 1000, and 1000 points, respectively.

Contrary to the point removal benchmark commonly used in data valuations [], our experiment employs a block-wise data pruning approach, which is more in line with common practices in time series forecasting. We divide the time series into equally sized blocks. Each block within the training dataset is assigned a value indicating its contribution to future time series forecasting. Subsequently, the blocks are removed in descending order of the values. After each block is removed, we train a linear model on the remaining dataset and assess its performance on a held-out test set.

Datasets.
We consider the four datasets: Traffic, Solar Energy, Electricity [], and Exchange Rate [].
Detailed descriptions of these datasets can be found in Appendix Section D.

Baselines. For each block in the training dataset, we assess its impact by averaging the score $\mathcal{I}_{\text{block}}$ from Equation (3) across all blocks in the validation set. We fix the block length as 100. For anomaly detection, standard methods are available, but for data pruning, no established method exists. Therefore, we employ the state-of-the-art data valuation methods as baselines: Shapley-value-based data valuation methods, namely KNN Shapley [], and out-of-bag estimates of data contribution, such as Data-OOB []. We exclude Data Shapley [] from consideration due to its computational inefficiency, making it difficult to apply to our datasets.

Evaluation.
To evaluate model predictions, we use $R^{2}$ as the metric. A larger $R^{2}$ corresponds to a better prediction performance.

#### Main Results.

Figure 2 illustrates the effectiveness of TimeInf in identifying the most valuable patterns for forecasting in four real-world datasets. We found that predictive performance declines more rapidly with TimeInf, suggesting its superior efficacy compared to other baseline methods. For instance, in the Traffic dataset, we observe a more than 10% drop in $R^{2}$ after removing 30% of the blocks, whereas other methods result in less than a 2% decrease. We also provide qualitative examples in Appendix Section D demonstrating how TimeInf successfully identifies influential periodic patterns for test forecasting. Additionally, we track the performance of TimeInf in identifying the least helpful patterns for forecasting compared to the baselines (Figure 5 in the Appendix).

### 5.3 Model Agnosticity

Although previous sections used linear AR models to compute TimeInf for anomaly detection and data pruning, TimeInf is model-agnostic; see details in Appendix Section B. To understand the variation in performance and computation time across different models, we compare TimeInf computed using linear AR models against an RNN (1,153 params), LSTM (4,513 params), transformer-based PatchTST [] (299,073 params), and a gradient boosting regressor with 100 trees of max depth 3.
All models use MSE as the loss function. For RNN and LSTM, we apply the CG used in [] to compute TimeInf for differentiable black-box models. For the large nonlinear PatchTST [] model, we use the scalable TracIn [] method to compute TimeInf. For gradient boosting, we compute nonparametric TimeInf according to []; see details in Appendix Section B. To ensure fair comparisons, all models are thoroughly trained and perform well on held-out validation sets.

We evaluate TimeInf computed with different model choices on the SMAP and MSL datasets, as shown in Figure 3. Panel (A) shows that the performance of TimeInf in anomaly detection improves with the transition from a linear AR model to nonlinear models such as LSTM, RNN and PatchTST. In Panel (B), there is a slight increase in computation time when a nonlinear model is used. The computation of nonparametric TimeInf is time-consuming due to the need for data subsampling and model re-training.

In summary, using higher dimensional or more complex models improves TimeInf performance but increases computation time. The choice between a complex model for better performance or a simple linear AR for efficiency depends on user needs. Moreover, these findings suggest that the results in Table 1 and Figure 6 could be further improved using flexible deep neural network models. We highlight that the computation time for TimeInf is small, even for moderately-sized transformers (300K parameters). Therefore, TimeInf can potentially scale to large over-parameterized models, enabling interpretability of time series foundation models. See the ablation study in the Appendix (Figure 7) for detailed performance comparisons across model sizes.

Figure: Figure 3: The performance and computation time of TimeInf across different model choices on the SMAP and MSL datasets. Panels (A) and (B) show the mean AUC and mean runtime in seconds for each model choice. Linear AR models provide the fastest computation for TimeInf, with negligible time costs not visible in panel (B) due to their small computation time. Choosing a more complex model improves the performance of TimeInf but at the expense of increased computation time.
Refer to caption: x2.png

## 6 Related Work

There is limited prior research on quantifying the contribution of time series training data to model predictions. TimeSHAP [] approximates Shapley values by sampling temporal coalitions of time points, grouped into a historic (distant past) and considered (immediate past) set. It only attributes data values to the considered group, overlooking data contribution from the distant past, and not fully preserving time series dependencies like periodic patterns across the full sequence. [] propose a similar KernelSHAP-based [] approach that replaces the linear surrogate with a time series model like VAR to better account for the temporal component.

The aforementioned approaches, although applicable to time series data, are not suitable for addressing data contribution problems. Both methods modify KernelSHAP to compute the importance of each time point within a block of $(x_{t},x_{t-1},\dots,x_{t-m+1})$ to the one-step ahead prediction $x_{t+1}$, treating these time points as features of an instance. In contrast, our goal is to quantify the impact of each time point in the training data on the prediction of time points in the test set, essentially studying the long-range impact of a training time point $x_{\text{train},t}$ on the model prediction. This emphasis on training dataset curation to improve model forecasting differs from the conditional feature attribution problem addressed by the aforementioned methods. Moreover, TimeSHAP and []’s approaches are computationally expensive, limiting their applicability to large time series datasets, whereas TimeInf enables efficient computation of data contribution in much larger datasets.

## 7 Concluding Remarks

We develop an efficient method using TimeInf to measure the contribution of time series data to model predictions. TimeInf can effectively identify harmful time points through anomaly detection and find helpful temporal patterns for time series forecasting.

Beyond the discussed applications, we find that TimeInf can potentially improve the curation of anomaly detection datasets. Although our method excels in many real-world datasets, it faces challenges in the KDD-Cup99 [], PSM [], and NAB-Tweets [] datasets. Upon closer examination, we discover issues with the reliability of ground truth anomaly labels in these datasets [, , ]. In Appendix Figures 10-12, we provide examples of problematic ground truth annotations, showcasing how TimeInf can expose potential mislabeling in data. This highlights a novel application for debugging and enhancing the quality of anomaly detection datasets.

While our preliminary results focus on moderately-sized black-box models (e.g., LSTM, RNN, or PatchTST), exploring TimeInf’s application to understand data contributions in larger time series foundation models across various tasks presents an interesting future research topic.

## A. Deriving Influence Functions for M-Estimators

Let $\{X_{t}\}$ denote the random process. Denote $F^{m}$ the distribution of $X_{t}^{[m]}=(X_{t_{1}},\dots,X_{t_{m}})$. An M-estimator $\hat{\theta}$ for model parameters $\theta$ is the solution to a minimization problem over the data:

$$ $\displaystyle\hat{\theta}=\underset{\theta\in\Theta}{\text{argmin}}\,\mathbb{E }_{F^{m}}[\rho(X_{t}^{[m]},\theta)].$ $$

We consider a class of M-estimators for which $\rho$ is differentiable and convex [, ], enabling us to express the estimate as the solution to a set of equations:

$$ $\displaystyle\mathbb{E}_{F^{m}}[\psi(X_{t}^{[m]},\theta)]=0,\quad\psi(X_{t}^{[ m]},\theta)=\frac{d\rho(X_{t}^{[m]},\theta)}{d\theta}.$ $$

Influence functions compute the infinitesimal change in the estimator if the original distribution $F^{m}$ is contaminated by $Z^{[m]}$ from $G^{m}$ by some small $\epsilon$ amount, giving us a contaminated estimator $\hat{\theta}_{\epsilon}=\underset{\theta\in\Theta}{\text{argmin}}\,\mathbb{E}_
{F^{m}_{\epsilon}}[\rho(X_{t}^{[m]},\theta)]$. For the contaminated distribution $F^{m}_{\epsilon}$,
$\hat{\theta}_{\epsilon}$ must satisfy:

$$ $\displaystyle\mathbb{E}_{F^{m}_{\epsilon}}[(1-\epsilon)\psi(X_{t}^{[m]},\hat{ \theta}_{\epsilon})+\epsilon\psi(Z^{[m]},\hat{\theta}_{\epsilon})]=(1-\epsilon )\mathbb{E}_{F^{m}}[\psi(X_{t}^{[m]},\hat{\theta}_{\epsilon})]+\epsilon\mathbb {E}_{G^{m}}[\psi(Z^{[m]},\hat{\theta}_{\epsilon})]=0.$ $$

We can differentiate to determine the effect of changing $\epsilon$ on $\hat{\theta}$:

$$ $\displaystyle\frac{d}{d\epsilon}(1-\epsilon)\mathbb{E}_{F^{m}}[\psi(X_{t}^{[m] },\hat{\theta}_{\epsilon})]$ $\displaystyle=-\frac{d}{d\epsilon}\epsilon\mathbb{E}_{G^{m}}[\psi(Z^{[m]},\hat {\theta}_{\epsilon})]$ $\displaystyle-\mathbb{E}_{F^{m}}[\psi(X_{t}^{[m]},\hat{\theta}_{\epsilon})]+(1 -\epsilon)\mathbb{E}_{F^{m}}[\frac{d\psi(X_{t}^{[m]},\hat{\theta}_{\epsilon})} {d\theta}]\frac{d\hat{\theta}_{\epsilon}}{d\epsilon}$ $\displaystyle=-\mathbb{E}_{G^{m}}[\psi(Z^{[m]},\hat{\theta}_{\epsilon})]- \epsilon\mathbb{E}_{G^{m}}[\frac{d\psi(Z^{[m]},\hat{\theta}_{\epsilon})}{d \theta}]\frac{d\hat{\theta}_{\epsilon}}{d\epsilon}.$ $$

Around $\epsilon=0$, the estimator must satisfy $\mathbb{E}_{F^{m}}[\psi(X_{t}^{[m]},\hat{\theta})]=0$, thus the influence function for model parameters in Equation (2) is

$$ $\displaystyle\frac{d\hat{\theta}_{\epsilon}}{d\epsilon}\Big{|}_{\epsilon=0}=- \mathbb{E}_{F^{m}}[\frac{d\psi(X_{t}^{[m]},\hat{\theta})}{d\theta}]^{-1} \mathbb{E}_{G^{m}}[\psi(Z^{[m]},\hat{\theta})].$ $$

Applying the chain rule, the effect of changing $\epsilon$ on the loss evaluated at a test point $z_{\text{test}}$ in Equation (3) is then

$$ $\displaystyle\frac{d\rho(z_{\text{test}},\hat{\theta}_{\epsilon})}{d\epsilon} \Big{|}_{\epsilon=0}=\frac{d\rho(z_{\text{test}},\hat{\theta})}{d\theta}\frac{ d\hat{\theta}_{\epsilon}}{d\epsilon}\Big{|}_{\epsilon=0}=-\psi(z_{\text{test}} ,\hat{\theta})\mathbb{E}_{F^{m}}[\frac{d\psi(X_{t}^{[m]},\hat{\theta})}{d \theta}]^{-1}\mathbb{E}_{G^{m}}[\psi(Z^{[m]},\hat{\theta})].$ $$

The only difference is that $G^{m}$ is a point mass distribution in Equation (3).

## B. Black-Box Models and Non-Differentiable Losses

Although we focus on linear AR models in the main paper due to their computational efficiency, the computation of TimeInf is model-agnostic, allowing us to explain any models of interest under our proposed framework. For “black-box” models with differentiable losses, like RNN and LSTM, we compute the Hessian $\mathbb{E}_{\hat{F}^{m}}[\frac{d\psi(X_{t}^{[m]},\hat{\theta})}{d\theta}]$ in Equation (3) using automatic differentiation packages. The primary challenge lies in computing the inverse Hessian-vector products, and various solutions proposed by [], [], [], [], [], and others have scaled this computation to deep neural networks. For linear AR models, we simply compute the inverse of the Hessian. However, for black-box models, this computation becomes intractable. Therefore, we employ the CG method in [] and TracIn [] to approximate the inverse of the Hessian.

For non-differentiable models such as tree-based models and ensemble models, we compute nonparametric influence functions []. The idea is to calculate a Leave-One-Out (LOO) data value by excluding a data point from the training set, retraining the model, and evaluating the impact of this removal on prediction performance. Given its computational costs, [] employs data subsampling to approximate LOO. The nonparametric counterpart of $\mathcal{I}_{\text{block}}$ in Equation (3) is:

$$ $\displaystyle\mathcal{I}_{\text{nonparametric}}(z^{[m]},z^{[m]}_{\text{test}}) =\mathbb{E}_{k\sim[K]}[\rho(z^{[m]}_{\text{test}},\hat{\theta}_{S_{k}})\mid z^ {[m]}\in S_{k}]-\mathbb{E}_{k\sim[K]}[\rho(z^{[m]}_{\text{test}},\hat{\theta}_ {S_{k}})\mid z^{[m]}\notin S_{k}],$ $$

where $\rho$ denotes the loss function, $\hat{\theta}$ represents the learned parameters of the model under consideration. The notation $\hat{\theta}_{S_{k}}$ is used for the parameters of the model fitted on a subset $S_{k}$. The process involves $K$ subsets denoted as $S_{k}$, which are randomly sampled from the training data of size $n$ with a smaller sample size $n_{\text{subset}}\ll n$. Subsequently, the models of interest are trained separately on each sampled subset. Once equipped with $\mathcal{I}_{\text{nonparametric}}$, we can compute the influence of a time point, $\mathcal{I}_{\text{time}}$, self-influence, $\mathcal{I}_{\text{self}}$, and the influence of a time point on the test prediction, $\mathcal{I}_{\text{test}}$, according to Equations (4), (5) and (6).

## C. Anomaly Detection Datasets

In the main paper, we extensively evaluate TimeInf on five benchmark datasets. The univariate datasets include UCR [], featuring 250 time series from diverse fields, and NAB-Traffic, which contains real-time traffic data from the Twin Cities Metro area. For multivariate datasets, MSL (Mars Science Laboratory) and SMAP (Soil Moisture Active Passive satellite) are NASA datasets [] monitoring spacecraft telemetry anomalies. SMD (Server Machine Dataset) is a dataset from an Internet company [].

In Table 2, we include additional datasets: (i) NAB-Tweets [] comprises Twitter mentions of publicly-traded companies such as Google and IBM. (ii) NAB-Taxi [] records NYC taxi passenger numbers with anomalies during events like the NYC marathon and holidays. (iii) The Pooled Server Metrics (PSM) [] dataset from eBay
captures anomalies in application server nodes. (iv) The Secure Water Treatment (SWaT) [] dataset features data collected from a sewage water treatment facility, where the anomalies
are caused due to cyberattacks. (v) The Water Distribution (WADI) [] dataset is a distribution system consisting of a large number of water distribution pipelines. (vi) KDD-Cup99 [] contains network connection data for intrusion detection in a military network environment. (vii) NAB-AdExchange collects online advertisement clicking rates. Details of all datasets are summarized in Table 3. Although our method performs well in many real-world datasets, TimeInf faces challenges in these datasets due to issues with the reliability of ground truth anomaly labels. Visual examples of problematic anomaly annotations are in Figure 10, 11, and 12, illustrating how TimeInf can expose potential mislabeling in the data.

The UCR, SMAP, MSL, SMD, PSM, and SWaT datasets have a pre-partitioned structure: a clean training set without anomalies and a contaminated test set with anomalies. In these datasets, we exclusively train and evaluate the baseline anomaly detection methods on the contaminated test set. Conversely, WADI, KDD-Cupp99, NAB-Traffic, NAB-Tweets, and NAB-Taxi have a single contaminated dataset with dispersed anomalies. For these datasets, baseline methods are trained and evaluated on the entire dataset.

Table: Table 2: Quantitative results for TimeInf and other anomaly detectors across seven real-world datasets. For both F1 and AUC metrics, a higher value indicates a better performance. TimeInf faces challenges in these datasets due to issues with the reliability of ground truth anomaly labels; see Appendix Section C for details.

**Table 3: Details of the anomaly detection datasets. Note that all discrete-valued dimensions are excluded from each dataset. The term “Average Length” refers to the average length across all time series in the dataset.**
| Dataset | Dimensions | Num. of Time Series | Average Length | Average Anomaly Ratio |
| --- | --- | --- | --- | --- |
| UCR | 1 | 250 | 56,205 | 0.8% |
| SMAP | 25 | 55 | 8,068 | 12.8% |
| MSL | 55 | 27 | 2,730 | 10.5% |
| NAB-Traffic | 1 | 7 | 2238 | 10.0% |
| SMD | 38 | 28 | 25,300 | 4.2% |
| NAB-AdExchange | 1 | 6 | 1602 | 10.0% |
| NAB-Tweets | 1 | 10 | 15863 | 9.9% |
| NAB-Taxi | 1 | 1 | 10320 | 5.2% |
| PSM | 25 | 1 | 87841 | 27.8% |
| SWaT | 51 | 1 | 449919 | 12.1% |
| WADI | 123 | 1 | 172,751 | 5.7% |
| KDD-CUP99 | 42 | 1 | 494,021 | 19.7% |

## D. Data Pruning Datasets

In the data pruning experiment, four time series datasets commonly used in time series forecasting literature [] are used. The Traffic dataset(^1^11[https://pems.dot.ca.gov/](https://pems.dot.ca.gov/)) aggregates hourly road occupancy rates over 48 months from 862 sensors across California. The Solar Energy dataset(^2^22[https://www.nrel.gov/grid/solar-power-data.html](https://www.nrel.gov/grid/solar-power-data.html)) comprises records from 137 photovoltaic power plants in Alabama State. The Electricity dataset includes the electricity consumption patterns of 321 clients from 2012 to 2014 []. The Exchange Rate dataset includes daily exchange rates for 8 countries, covering the period from 1990 to 2016 []. Additionally, we also perform data pruning on an anomaly detection dataset, MSL.

For a fair comparison, we consistently employ a linear AR model across all baseline data valuation methods. We assign a data value to each time block in the training dataset and iteratively remove time blocks, starting from the most helpful to the least helpful for forecasting on the validation set. After each removal, we train a linear AR model on the remaining dataset and assess the model predictions on the held-out test set. Figure 4 illustrates a qualitative example from the Electricity, which clearly showcases the performance of TimeInf.

Additionally, TimeInf is compared to baseline methods in identifying the least helpful (or most harmful) patterns for forecasting. Time blocks are iteratively removed from least helpful to most helpful based on data values assigned by each method. After each removal, a linear AR model is trained and evaluated. TimeInf can correctly identify the least helpful temporal patterns in most datasets except the Solar dataset, as shown in Figure 5.

Figure: Figure 4: Qualitative results of the data pruning experiment for TimeInf on the Electricity dataset. The first row shows the raw test time series, with subsequent rows depicting the most influential (green) and detrimental (red) time blocks in the training data linked to the example test block (black) based on TimeInf. TimeInf effectively captures the periodic pattern in the time series, offering valuable insights for forecasting.
Refer to caption: extracted/5750502/figs/data_pruning_examples.png

Figure: Figure 5: Quantitative results for TimeInf and other data contribution methods from a data pruning experiment across four real-world datasets. We estimate the contribution of each time block in the training data using various baselines. For each method, we iteratively remove the least helpful time block from the training set and track the resulting performance degradation, measured by $R^{2}$, aiming for a less rapid decrease or even an increase in performance.
Refer to caption: extracted/5750502/figs/data_pruning_ascending.png

## E. Ablation Study

This section explores how three hyperparameters of TimeInf – the block length, the time stride used for constructing the empirical contaminating distribution $\hat{G}^{m}$ in Equation (4), and the model size – affect the downstream task performance through an ablation study.

#### Experiments on Different Block Lengths.

The performance of TimeInf in anomaly detection can be affected by the block length, which determines the order of the AR model used in its computation. Figure 6 shows how AUC and computation time vary across block lengths of 25, 50, 100, and 150 for each anomaly detector. In Figure 6 (A), we observe that the AUC of TimeInf improves when block length becomes larger across most datasets, as larger block length enables TimeInf to better capture contextual anomalies that persist for an extended duration. Panel (B) indicates an increase in computation time when block length increases for most methods. This is because an extended block length increases the dimension of the model parameters, and thus increases the time needed for computing the inverse Hessian. In summary, TimeInf consistently outperforms other methods in anomaly detection across a wide range of block lengths, while requiring significantly less time.

Figure: Figure 6: The performance and computation time of TimeInf and baseline methods across different block lengths. Panels (A) and (B) show the mean AUC and mean runtime in seconds at the block lengths of 25, 50, 100, and 150. Compared to other methods, TimeInf achieves a higher AUC while requiring significantly lower computation time across various datasets.
Refer to caption: x3.png

#### Experiments on Time Stride.

The time stride, which determines the number of time blocks a time point appears in, affects the anomaly detection performance of TimeInf. Table 4 shows that as the time stride increases, the AUC decreases, with the threshold varying across datasets. Larger strides provide fewer time blocks containing the point, limiting the sampling of temporal configurations around it. Consequently, with fewer samples, TimeInf estimate becomes less reliable, which is why we choose stride 1 in our experiments.

**Table 4: The performance of TimeInf across different time strides. Ablation studies on the SMAP and SMD datasets show that the anomaly detection AUC decreases as the time stride increases.**
| Time Stride | 1 | 5 | 10 | 20 | 50 |
| --- | --- | --- | --- | --- | --- |
| SMAP | 0.73 | 0.64 | 0.65 | 0.61 | 0.58 |
| SMD | 0.87 | 0.88 | 0.88 | 0.83 | 0.70 |

#### Experiments on Model Size.

Experiments are conducted to examine the effect of model size on TimeInf’s performance. The anomaly detection results on the MSL and SMAP datasets using TimeInf computed with models of different sizes are compared. As depicted in Figure 7 panel (A), the anomaly detection performance of TimeInf improves with increasing model size on the MSL dataset, with the transformer-based PatchTST model scoring the highest. For the SMAP dataset, although PatchTST performs worse, the nonlinear RNN model achieves the best performance. Despite the computation time increasing with model size, PatchTST with over 300 thousand parameters remains fast, enabling scaling to larger deep learning models.

Figure: Figure 7: The performance and computation time of TimeInf across different model sizes on the SMAP and MSL datasets. Panels (A) and (B) show the mean AUC and mean runtime in seconds for each model size. Linear AR models are the smallest and provide the fastest TimeInf computation, with negligible time costs not visible in panel (B) due to their small computation time. Choosing a larger model improves the performance of TimeInf but at the expense of increased computation time.
Refer to caption: x4.png

## F. Applying TimeInf to Multivariate Time Series

For anomaly detection in multivariate time series, we first apply self-influence to each dimension individually, and then average the anomaly scores across all dimensions to derive the final anomaly scores for individual time points. We refer to this approach as “SepInf” for simplicity. We empirically find that “SepInf” demonstrates better performance than directly applying self-influence to the multivariate time series, which we refer to as “MultiInf”. In this section, we explore potential challenges associated with using MultiInf and illustrate why it may not be suitable for anomaly detection.

Suppose we have $T$ training time blocks of size $m$, $\{x_{t}^{[m]}\}_{t=1}^{T},\,x_{t}^{[m]}=(x_{t},x_{t-1},\dots,x_{t-m+1})\in
\mathbb{R}^{m\times p}$, where $p$ is the dimension of the multivariate time series. To compute MultiInf, we fit a vector AR model, i.e., multivariate linear regression, as follows

$$ $\displaystyle x_{t+1}=x_{t}\theta+u+\epsilon_{t+1},$ (7) $$

where, $x_{t+1}\in\mathbb{R}^{p}$ represents the one-step ahead prediction, while $x_{t}^{[m]}\in\mathbb{R}^{m\times p}$ denotes the past time blocks used for prediction. Additionally, $u\in\mathbb{R}^{p}$ and $\epsilon_{t+1}\in\mathbb{R}^{p}$ correspond to the intercept and error terms, respectively. The parameters of the AR model, denoted as $\theta=\{\theta_{j}\}_{j=1}^{p}\in\mathbb{R}^{p\times m\times p}$, are capable of capturing correlations across each dimension of the multivariate time series, between timesteps within a time block, and between each timestep in a time block and each dimension. This is expressed as follows:

$$ $\displaystyle\theta_{j}=\begin{bmatrix}\theta_{j11}&\theta_{j12}&\dots&\theta_ {j1p}\\ \theta_{j21}&\theta_{j22}&\dots&\theta_{j2p}\\ \vdots&\cdots&\cdots&\vdots\\ \theta_{jm1}&\theta_{jm2}&\dots&\theta_{jmp}\\ \end{bmatrix}\in\mathbb{R}^{m\times p}$ (8) $$

There are two practical challenges associated with computing the influence functions and over-weighting a time block on the parameters $\theta$: (1) Anomalies may not occur simultaneously in all dimensions of the time series. Consequently, capturing correlations among feature dimensions could result in poor anomaly scores because the ground truth anomaly labels may depend only on anomalies in some dimensions but not the others; see Figures 9, 10 and 11 in the Appendix for examples. (2) There may not be enough training samples to accurately estimate the high-dimensional parameters $\theta$ of size $p\times m\times p$. Inaccurately estimated $\theta$ can lead to the computation of inaccurate influence functions. For instance, when fitting the model to a 100-dimensional time series with a block length of 100, we have to learn 1 million model parameters, demanding a large amount of training data. (3) Additionally, using MultiInf causes issues computationally because the inversion of the Hessian matrix scales with the number of model parameters.

In contrast, SepInf is computed by initially applying self-influence to each dimension separately and then averaging the anomaly scores (scaled self-influences) across all dimensions of the multivariate time series. This is equivalent to fitting a multiple linear regression in the same form as Equation (7) under the assumption that each dimension is independent. This requires learning $\{\theta_{j}\}_{j=1}^{p}$ with

$$ $\displaystyle\theta_{j}=\begin{bmatrix}\theta_{j1}&\theta_{j2}&\dots&\theta_{ jm}\end{bmatrix}\in\mathbb{R}^{m},$ $$

since the off-diagonal entries in Equation (8) are zero. This approach effectively reduces the number of parameters to learn. Furthermore, since anomaly patterns are often vastly different between dimensions, and the ground truth anomaly labels may be influenced by only some feature dimensions, computing SepInf effectively separates the influences of time points from different dimensions, thereby mitigating potential issues stemming from multicollinearity. Moreover, computing SepInf is more efficient because it involves fewer parameters when constructing the inverse Hessian matrix.

Figure: Figure 8: Qualitative results for TimeInf and other baseline anomaly detectors on selected channels from the SMAP and MSL datasets. The first row of each panel displays the first dimension of the time series, which captures the major anomaly pattern in the data. The remaining rows of each panel show the anomaly scores generated by each detector. For better visualizations, we normalize the anomaly scores from each method to a range between 0 and 1. The ground truth anomaly intervals are marked in red segments. TimeInf outperforms state-of-the-art time series anomaly detection methods in identifying both single and multiple anomaly patterns in the data.
Refer to caption: x5.png

Figure: Figure 9: Qualitative results for TimeInf and other baseline anomaly detectors on a selected channel from the multivariate SMD dataset. The first seven rows show selected dimensions of the time series, while the remaining rows show the anomaly scores generated by each detector. For better visualizations, we normalize the anomaly scores from each method to a range between 0 and 1. The ground truth anomaly intervals are marked in red segments. TimeInf outperforms state-of-the-art time series anomaly detection methods in identifying anomaly patterns in multivariate time series data.
Refer to caption: extracted/5750502/figs/smd_good_annotation.png

Figure: Figure 10: A qualitative example of mislabeled anomaly points in the KDD-Cup99 dataset. The first seven rows showcase selected dimensions of the time series, while the subsequent rows display the anomaly scores generated by each method. For better visualizations, we normalize the anomaly scores from each method to a range between 0 and 1. The ground truth anomaly intervals are marked in red segments. While not explicitly marked as anomalies, segments within the ranges 0 to 400, 1250 to 1500, and 3500 to 3600 exhibit distinct patterns that set them apart from others. Both TimeInf and Isolation Forest yield elevated anomaly scores for time points within these segments, raising questions about the reliability of the labels in these instances.
Refer to caption: extracted/5750502/figs/kdd_cup99_bad_annotation.png

Figure: Figure 11: A qualitative example of mislabeled anomaly points in the PSM dataset. The first seven rows showcase selected dimensions of the time series, while the subsequent rows display the anomaly scores generated by each method. For better visualizations, we normalize the anomaly scores from each method to a range between 0 and 1. The ground truth anomaly point is marked in red (a single point). While there is a labeled point anomaly around 600, the segment preceding the marked anomaly point appears suspicious. Despite Isolation Forest and LSTM yielding a high score on this example, it does not capture the anomaly point effectively. Thus, the poor performance of all anomaly detectors on this example underscores that a high AUC does not necessarily indicate good performance when annotations are unreliable.
Refer to caption: extracted/5750502/figs/psm_bad_annotation.png

Figure: Figure 12: A qualitative example of mislabeled anomaly points in the NAB-Tweets dataset. In each panel, the first row shows a selected segment from the time series, while the other rows show the anomaly scores generated by each method. For better visualizations, we normalize the anomaly scores from each method to a range between 0 and 1. The ground truth anomaly point is marked in red (a single point). In NAB-Tweets segments 1 and 2, the neighboring parts of the true anomaly point are also labeled as anomaly points. However, this labeling is problematic, as most time points in this anomaly window are not anomalous. In NAB-Tweets segment 3, there seems to be an anomaly pattern between 5000 and 6000. However, it is not labeled as an anomaly point. Thus, no method performs well on these segments due to unreliable annotations.
Refer to caption: x6.png

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 5
presentation: 3
questions: See above.
soundness: 2
strengths: The idea of inferring interpretability and anomaly analysis by measuring the contribution of time series data to the model's output is quite novel. The mathematical derivation is well-developed, and the details are thorough.
summary: This paper presents an interesting approach to time series interpretability research—by using noise perturbations to measure the contribution of data to the model. However, the method designed by the authors is a theoretical extension of existing approaches and lacks more extensive experimental evidence to demonstrate its effectiveness.
weaknesses: 1. Compared to existing methods, the advantages of this approach are not fully emphasized, and the innovative aspects are not clearly defined. The main contribution of the paper can be seen as an extension of existing theory, but the method primarily involves deriving formulas based on Equation (3) and considering the Mixture of \( \delta z^{[m]} \). This operation has limited significance for theoretical extension and does not effectively demonstrate the contribution claimed. I do not believe it addresses the shortcomings of existing methods.
2. The paper conducts experiments on anomaly detection, interpretability, and mislabeled error in datasets. However, the paper does not discuss current state-of-the-art baselines in anomaly detection, such as methods based on LLMs or DCdetector. Moreover, the AUC and F1 results differ significantly from the original work. While the authors' skepticism about dataset quality is commendable, more evidence is needed to support this claim, as only partial visualizations of the data are presented. Additionally, the ablation experiments in the appendix are limited to parameter experiments. Based on my experience, complex theoretical methods often perform unsatisfactorily in neural network training, and more evidence is required to validate the effectiveness of the theory.
3. Compared to traditional machine learning papers, there is no clear and complete process to present the designed algorithm, such as the input, output, and objective function. The majority of the paper is focused on theoretical formulas and related comparisons, making it difficult to understand

---

confidence: 2
contribution: 3
initial_rating: 6
presentation: 3
questions: Please reply to the above weaknesses if I have any misunderstandings. Thank you.

Another question: Can the proposed model process multivariate time series?
soundness: 3
strengths: 1. The paper is well-written and easy to follow.
2. The presented solution is technically solid.
3. The experiments on anomaly detection can demonstrate the efficacy of the proposed method.
summary: This paper presents a new method for measuring the contribution of different timestamp to the final predictions. The major idea is to leverage influence scores to assign model predictions to individual time points while preserving temporal structures between the time points. Experiments in anomaly detection can verify the effectiveness of the proposed method.
weaknesses: 1. The relationship between the proposed model and unsupervised anomaly detection is unclear and should be further explained.

2. The model's generalization ability to other time series tasks (e.g., forecasting, imputation) is uncertain. Specifically, how would the contribution score of historical timestamps be measured for future time points?

3. There is no discussion on scalability. How does the method perform as the number of historical time points increases?

---

confidence: 4
contribution: 2
initial_rating: 6
presentation: 3
questions: See weakness.
soundness: 3
strengths: The primary technical strength of TimeInf lies in its novel and theoretically sound approach to data contribution estimation in time series. It successfully extends influence functions to handle temporal dependencies, addressing a significant gap in time series analysis that previous methods overlooked. The method is built on a strong mathematical foundation combining robust statistics with innovative use of overlapping blocks to preserve temporal structure. This theoretical rigor is balanced with practical efficiency, as TimeInf proves to be computationally faster than deep learning alternatives while remaining scalable to large datasets with millions of time points. The method provides clear, quantifiable influence scores and intuitive visualizations that help users understand both anomaly patterns and forecasting behaviors. Its comprehensive evaluation across multiple real-world datasets demonstrates consistent improvement over existing approaches in both effectiveness and efficiency.
summary: This paper introduces TimeInf, a novel method for estimating data contribution in time series datasets using influence functions. Unlike previous data contribution methods that primarily focus on i.i.d. settings, TimeInf specifically addresses the challenges of temporal dependencies in time series data. The method works by analyzing overlapping blocks of consecutive time points to preserve temporal structure, then uses influence functions to measure how individual time points impact model predictions. TimeInf's key innovation is its ability to integrate data values across consecutive time series observations while accounting for different temporal arrangements of data points. The authors demonstrate TimeInf's effectiveness through extensive experiments on real-world datasets, showing it outperforms existing methods in both identifying harmful anomalies and helpful time points for forecasting. The method is particularly noteworthy for its computational efficiency, interpretable results through visualizations, and strong performance in practical applications, while being theoretically grounded in robust statistics and autoregressive models.
weaknesses: 1. Methodological Limitations:
The paper’s core claim about their “distinctive integration” considering various temporal patterns seems to overlap significantly with existing attention mechanisms, without adequately differentiating itself. The theoretical justification for TimeInf lacks rigorous analysis of its properties, such as consistency or asymptotic behavior. Additionally, the paper doesn’t thoroughly explore the sensitivity of TimeInf to various hyperparameters, like block length or model architecture choices.
	2.	Experimental Issues:
The experimental setup, particularly for anomaly detection tasks, is not clearly described, making result reproduction challenging. The reported results differ significantly from those in original papers for baseline methods, raising questions about comparison fairness. Important baselines in time series anomaly detection such as MTAD-GAT[1], TransAD[2] are missing, limiting the ability to fully assess TimeInf’s performance relative to state-of-the-art methods.  [1] and [2] are using the unspervised learning to learn the distribution and don't use the "clean data assumption" as well. The paper also lacks a comprehensive evaluation of TimeInf’s interpretability claims compared to other approaches.
	3.	Limited Scope and Analysis:
While the paper focuses primarily on anomaly detection tasks, it’s not clear how well TimeInf generalizes to other time series tasks or domains. The computational complexity of TimeInf compared to existing approaches is not thoroughly analyzed, despite mentioning efficiency improvements through conjugate gradient and Hessian-free approaches. The paper lacks a thorough discussion of TimeInf’s limitations or potential failure cases, which is crucial for understanding when and where the method is most applicable. Lastly, the evaluation metrics used are standard (AUC and F1 score), but don’t consider other potentially relevant metrics for time series anomaly detection, such as detection delay or false positive rate at a fixed detection threshold.


[1] Zhao, Hang, et al. "Multivariate time-series anomaly detection via graph attention network." 2020 IEEE international conference on data mining (ICDM). IEEE, 2020.
[2] Tuli, Shreshth, Giuliano Casale, and Nicholas R. Jennings. "TranAD: deep transformer networks for anomaly detection in multivariate time series data." Proceedings of the VLDB Endowment 15.6 (2022): 1201-1214.

---

confidence: 3
contribution: 3
initial_rating: 5
presentation: 2
questions: + Experimentally, TimeInf can effectively identify anomalies in time series. However, in the Data Pruning experiment, the authors claim that TimeInf can identify the most influential time patterns, which appears different from detecting anomalies (removing anomalies should not necessarily lead to a significant drop in model performance). Why is TimeInf able to identify influential time patterns at times, while it detects anomalies at other times? This seems somewhat contradictory.

[1]. Tuli S, Casale G, Jennings N R. TranAD: deep transformer networks for anomaly detection in multivariate time series data[J]. Proceedings of the VLDB Endowment, 2022, 15(6): 1201-1214.

[2]. Xiao C, Gou Z, Tai W, et al. Imputation-based time-series anomaly detection with conditional weight-incremental diffusion models[C]//Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining. 2023: 2742-2751.

[3]. Xu H, Wang Y, Jian S, et al. Calibrated one-class classification for unsupervised time series anomaly detection[J]. IEEE Transactions on Knowledge and Data Engineering, 2024.
soundness: 2
strengths: + TimeInf addresses the gap between existing data contribution methods and the unique requirements of time series data.
+ The proposed influence function is highly versatile, with multiple variants supporting diverse anomaly detection settings. Its model-agnostic nature further enhances its applicability across various models.
+ TimeInf is computationally efficient, leading to significant resource savings.
summary: This work presents TimeInf, a data contribution estimation model for time series. TimeInf overcomes the traditional i.i.d. setting of influence functions, making it more suitable for time series data. By considering multiple time blocks, TimeInf captures contextual information within time series data. Additionally, its model-agnostic design enhances its versatility and flexibility.
weaknesses: + Some key mathematical terms in the paper could benefit from clearer explanations, such as $\delta_{x}[m]$ and $z^[m]$.
+ The paper lacks a clear mathematical definition of the task, especially regarding the tasks targeted by the variants of TimeInf, which could cause confusion.
+ Although the authors describe TimeInf as a data contribution estimation method, its task definition and benchmark choices make it appear primarily as an anomaly detection model. While data pruning experiments are provided in Appendix Section E, more direct evidence would help demonstrate that TimeInf goes beyond anomaly detection.
+ The comparisons would benefit from including more advanced anomaly detection algorithms [1], [2], [3].
+ In Section 4.3, the authors attribute TimeInf's relatively poor performance in Table 4 to mislabeled ground truth annotations. However, they need to clarify why other benchmark models are unaffected by these mislabeled annotations. Demonstrating that other models do adhere to potentially mislabeled annotations would help validate this claim.

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: 1.	Can you elaborate on how TimeInf extends beyond the local historical context to capture a more global perspective as mentioned in Section 3?
2.	Following Q1, regarding Table 3, can you provide baseline comparisons to show the model’s advantages in capturing long-term dependencies?
soundness: 3
strengths: The paper is well-organized with clear problem formulation and concise visualization. It effectively demonstrates the utility of TimeInf across multiple tasks, providing robust results on time-series datasets.
summary: The paper introduces TimeInf, a model-agnostic data contribution estimation method for time-series datasets. It uses influence scores to attribute predictions to individual time points, preserving temporal dependencies. TimeInf shows effectiveness in detecting anomalies, providing interpretable attributions, and identifying mislabeled anomalies in ground truth.
weaknesses: 1.	My main concern is that while TimeInf is presented as a general model-agnostic method, the experiments in the main text focus solely on anomaly detection. It would be better to include more different tasks to support the advantage of this general method rather than only elaborate on one task.
2.	Table 2 contains misformatted bold values that do not reflect the best performance (UCR and SMAP’s F1).
3.	The data pruning experiments use non-standard time-series forecasting metrics; it will be better if more common metrics like RMSE and MAE can be considered.

Meta-review: This paper proposes TimeInf, a data valuation method adapted for time-series that uses an influence-based scoring to identify the contribution of each time point to model predictions. Reviewers generally found the idea promising and the experiments convincing after revisions. Thanks for your responses!

The authors were quite active and responsive during the discussion, adding comparisons to advanced baselines like TranAD and DCdetector, clarifying differences in experimental setups, and addressing labeling issues in certain datasets. The reviewers who initially had doubts ended up mostly satisfied, with two explicitly raising their scores.

In the end, four out of five reviewers moved toward a positive stance, each scoring around marginal acceptance or better, while one remained at a weaker position due to some misunderstandings regarding the experimental setting. 

Still, the authors carefully addressed each concern, showing new experiments and highlighting that differences in AUC/F1 from original references are caused by more realistic (non-clean) training scenarios. Two recurring points were that TimeInf should demonstrate broader applicability beyond anomaly detection, and clarify theoretical and setup details. The authors responded by showing how TimeInf can be used in forecasting tasks and provided more thorough definitions and derivations, which improved the sentiment of most reviewers.

With my personal view, this paper should be accepted.

Decision: Accept (Poster)