Manuscript Offprint
arXiv:2610.33330TempShap: When and How Much a Feature Matters in Time-Series Forecasting
ABSTRACT
Attribution for a time-series forecaster should answer two questions that a feature-level scalar cannot: when in the input window a feature acts, and how much its influence changes across the forecast horizon. Most existing Shapley explainers treat each feature as one player and therefore collapse both axes. We propose TempShap, a retrospective, loss-based Shapley framework whose players are the individual input cells . Its attribution tensor yields temporal-localization and horizon-impact profiles. We validate these against planted temporal structures, a tractable exact cell game, and a closed-form attribution oracle for a real linear forecaster. Permutation sharing estimates the cell-level game at localized perturbation cost. Under redundant inputs, one-at-a-time scores under-credit substitutable information, whereas the signed Shapley decomposition preserves total value and yields more reliable held-out deletion rankings under mean masking. A planted counterexample isolates the redundancy mechanism. Experiments show a deletion-ranking advantage across Shapley estimators, forecasting benchmarks, and model families. TempShap therefore makes fine-grained Shapley attribution both practical and operationally useful.
1 INTRODUCTION
Two questions a practitioner cannot avoid when interpreting a multivariate forecaster: when in the input window does a feature exert its influence, and how much does that influence change across the prediction horizon. Yet most existing Shapley explainers (SHAP (Lundberg & Lee, 2017), KernelSHAP, FastSHAP (Jethani et al., 2022), Leverage SHAP (Musco & Witter, 2025), ShapG (Zhao et al., 2025b)) treat each feature as one player, returning one scalar per input feature. This collapses the input-lag and the whole output cell (forecast horizon and target) to that scalar. The standard evaluation does the same: estimators are ranked by a progressive feature-removal score (Petsiuk et al., 2018), a single curve that again collapses the input-lag and horizon axes. ShapTime (Zhang et al., 2024) explains temporal importance to guide forecasting improvements. Other time-series extensions push toward (feature, timestep) space by grouping (TimeSHAP (Bento et al., 2021), WindowSHAP (Nayebi et al., 2023), ShaTS (Franco de la Peña et al., 2025)); finer-grained approaches use cell-level Shapley perturbations (TimeSHAP) or localized per-position sensitivities (PAX-TS), but neither provides a uniform loss-based per-(sample, input-lag, input-feature, horizon, target) Shapley tensor from which temporal profiles are read; that tensor is this paper's contribution.
Our contributions are:
• A cell-level, loss-based Shapley framework (Section 3) whose attribution tensor yields temporal-localization, horizon-impact, and rank-settling profiles (Figure 1).
• Validation and robustness of this framework (Sections A.4 and 5.1): recovery of planted signals, exact-cell and linear-model oracle agreement, baseline-robust localization, and no consistent recency ordering across architectures.
• A signed, efficiency-respecting advantage under redundancy (Section 5.3): accounting for substitutable inputs improves held-out cell-deletion rankings across estimators under mean masking.
• A practical, unbiased estimator (Section 5.2): permutation sharing delivers axiomatic cell attribution at localized perturbation cost.
Shapley attribution for time series. Bento et al. (2021) (TimeSHAP) combine feature-, timestep-, and cell-level (event×feature) KernelSHAP perturbations with sequence pruning for recurrent classifiers; Nayebi et al. (2023) group adjacent timesteps into windows; Franco de la Peña et al. (2025) use per-(feature, segment) groups, and Kim & Park (2026) (GroupSegment-SHAP) make cross-variable groups over time segments the players. Raykar et al. (2023) (TsSHAP) explain forecasters via TreeSHAP on an interpretable surrogate; Kreuzer et al. (2025) (PAX-TS) give model-agnostic multi-granular explanations through localized perturbations. Villani et al. (2022) present closed-form SHAP for VARMAX-class models and Time Consistent SHAP, instantiating the dynamic-game time-consistency of Petrosjan & Zaccour (2003) via separately re-computed prefix sub-games. These deliver horizon-specific, time-segment, or multi-granular explanations; TempShap's contribution is the uniform loss-based per-output-cell tensor over players and the temporal profiles it makes computable. Temporal-Decay Shapley (Pang et al., 2026) is data valuation: it scores training samples, not (input-cell, output-cell) pairs, and is orthogonal despite sounding related.
Non-Shapley attribution. LIME (Ribeiro et al., 2016), Integrated Gradients (Sundararajan et al., 2017), and DeepLIFT (Shrikumar et al., 2017) are general attribution methods applicable to neural forecasters, but saliency fails to reliably identify feature importance over time, conflating the time and feature axes (Ismail et al., 2020). Dynamask (Crabbé & van der Schaar, 2021) is the closest non-Shapley analogue for dense input-cell saliency, though it targets single-output prediction rather than multi-step forecasting.
Faithfulness evaluation. Attribution quality is assessed with deletion-based faithfulness scores such as deletion-AUC (Petsiuk et al., 2018; Hooker et al., 2019) and the weighted-slope deletion score (Zhao et al., 2025b), together with sanity checks (Adebayo et al., 2018).
3 THE TEMPSHAP FRAMEWORK
Figure 1 shows the TempShap workflow in three steps. (a) We treat input cells as players, replace masked cells with their training means, and use each output cell's negative squared error as the payoff. (b) We estimate cell Shapley values and collect them in a tensor. (c) We average their magnitudes to obtain temporal-localization and horizon-impact profiles, then sum horizon impacts to rank features.

Figure 1: TempShap at a glance. (left) Players are the input cells , not whole feature columns (which mask all lags at once and lose which lag matters); a per-output-cell loss game yields (right) the tensor , whose profiles (averages of over the other axes) give (when) and (how much).
3.1 SETTING AND CELL-LEVEL MASKING
Let be input windows ( lags, features), the targets ( forecast steps, target channels), and with . We index samples by , input lags by , forecast steps by , target channels by , and input features by . The players are the input cells: for a coalition , the masked input keeps for and sets otherwise, with , where the baseline is the per-feature training mean, the standard interventional/marginal choice ( on standardized inputs). Plugging in the mean approximates the interventional loss (Chen et al., 2020; Covert et al., 2020). The two agree on our data, so we use the mean throughout; Section A.4 verifies this against a Monte-Carlo marginal expectation and conditional imputers. Masking a single cell replaces feature at lag alone; this per-cell mask, not one broadcast over all lags, is what makes the input-time axis identifiable.
3.2 PER-CELL CHARACTERISTIC FUNCTION AND SHAPLEY VALUES
The characteristic function is the per-output-cell negative squared error
a loss-based game in the sense of SAGE (Covert et al., 2020), structured across the output axes. Because uses the realized , TempShap is a retrospective error attribution, not an online “why-this-prediction” explanation (a prediction-based variant is a robustness check, Section A). The Shapley value of cell is the standard weighted marginal average
giving with per-output efficiency . Because is the negative error, a positive means retaining that cell reduces the error relative to the all-masked reference, and a negative one means it increases the error; this sign is what the deletion experiment of Section 5.3 exploits. Marginalising our tensor over does not recover the -feature time-broadcast game, whose coalitions force all cells of a feature in or out together; the two coalition spaces differ.
3.3 ESTIMATORS AND COST
Full enumeration requires coalitions ( for Jena), so we estimate the cell game by sampling. Our default estimator, cell-pShapley, starts from the fully masked input and restores cells one at a time in a uniformly random order. Each step records the change in negative squared error for every output cell. For brevity, we omit the output indices and write for an input cell. Let order , with the position of . The cells restored before are , so its marginal contribution is
We form antithetic pairs, indexed by . For each pair, we sample a base permutation independently and uniformly and traverse both and its reverse, , starting from the fully masked input each time. Averaging their marginal contributions gives
For each permutation, we evaluate the fully masked input and then re-evaluate after restoring each cell. These evaluations give one marginal contribution per cell (Castro et al., 2009). Section 3.4 establishes its guarantees and analyzes pairing. cell-ShapG instead enumerates all subcoalitions of each cell's bounded graph neighborhood (Zhao et al., 2025b) (built once on the training split (Zhao et al., 2025a)); the restriction is structural, so it targets the graph-restricted game and is biased for the full cell game, a comparison baseline only (Section 5.2).
Cost (model-forwards; one returns the whole output): cell-pShapley , linear in the budget; cell-ShapG , exponential in the neighborhood cap ; Window-SHAP over its time chunks; PAX-TS for perturbation scales (no coalitions); GS-SHAP evaluates few group coalitions but is dominated by its grouping step. Only cell-pShapley is cell-resolved, unbiased, and linear in its budget.
3.4 PROPERTIES OF CELL-PSHAPLEY
Fix the deterministic model, input, target, and masking baseline. For each output cell separately, suppress these indices and draw the base permutations independently and uniformly, pairing each with its reverse. All expectations and variances below concern only this permutation randomness.
Proposition 1 (Unbiasedness). For every , .
Proof. For a uniform permutation and any , exactly permutations place precisely before . Consequently, is the weight of in equation 2, and . Reversal is a bijection on the permutation space, so is uniform too. Both and its average over pairs are therefore unbiased.
Proposition 2 (Efficiency). For every and every collection of sampled permutation pairs, .
Proof. Order the cells as along any permutation . Averaging the following telescoping identity over the sampled forward and reverse permutations proves the claim:
This property holds without an additional constraint; other estimators, such as constrained KernelSHAP (Covert & Lee, 2021), can also enforce finite-sample efficiency.
Proposition 3 (Variance of the paired estimator). Let . Then
Here depends only on interactions of order three and above.
Proof. Function can be represented as follows: , where , and equation 3 takes the form
A singleton contributes the constant . For , exactly one of and puts before , so for every permutation . For larger , define
. The cell is last in with probability in either uniform ordering, so . We obtain
Only the last sum is random, and its variance is
This expression makes the dependence on interaction strengths, signs, and the joint ordering of their cells explicit. Independence across the pairs gives . Since the forward and reverse marginals have the same variance, expanding the variance of their average gives equation 6. Unbiasedness then makes RMSE equal to .
At equal cost, independent permutations have the variance in equation 6 without the covariance term, so pairing helps when that covariance is negative. Pairing can also reduce variance due to higher-order interactions. For example, in the pure three-player interaction game , a cell's unpaired marginal is one with probability and zero otherwise. Averaging two independent permutations has variance . Under reversal, its paired marginal is when that cell is first or last and zero when it is in the middle, giving variance . Thus a variance reduction does not imply the presence of second-order terms.
For games with only single-cell and pairwise effects, one permutation and its reverse are enough to obtain exact Shapley values (Mayer & Wüthrich, 2025, Proposition 3.1). The following corollary applies this result to our squared-loss game.
Corollary 1 (Exactness for affine forecasters). For an affine forecaster under fixed-baseline masking and squared loss, averaging the marginal contributions from any permutation and its reverse gives the exact cell Shapley values.
Proof. Fix an output cell with target . Let be its prediction when input cells in are retained and all others are masked. In particular, masks all cells, while retains only cell . Thus is the change in prediction from restoring cell alone.
For an affine forecaster, this change does not depend on which other cells are retained. The changes therefore add up: . Write for the error with all cells masked. Expanding the squared loss gives
(10)
The constant term does not affect marginal contributions. Every remaining term involves either one cell or a pair of cells. Equation 9 gives . Since the paired estimator is unbiased, even a single permutation pair yields the exact Shapley values.
DLinear (Zeng et al., 2023) adds linear forecasts of a moving-average trend and its residual, so it is an affine forecaster covered by Corollary 1. Table 8 tests this prediction for the squared-loss game, comparing antithetic pairs with independent permutations at equal cost. With pairing, DLinear agrees with the high-budget reference up to numerical precision even at ; independent permutations retain sampling error. For nonlinear forecasters, pairing gains vary by dataset and model and are small for the Exchange-Rate Transformer. These gains reflect the covariance in equation 6, rather than the fraction of second-order interactions. The finite-reference error is discussed in Section A.4.
3.5 TEMPORAL PROFILES AND RANK SETTLING
Write for the cell-wise absolute attribution. The two profiles below are averages of over the axes not shown.
The temporal-localization profile describes feature 's input-lag importance; its centroid answers when, and how localized ( ).
The horizon-impact profile measures the magnitude of feature 's contribution at horizon step ; its trend answers how much the impact changes across the forecast (it need not be monotone; “decay” is reserved for the planted case).
For rank settling, let be the descending feature ranking by cumulative magnitude up to . The correlation and the settling time measure how fast the ranking stabilizes. This is distinct from , which measures magnitude: a ranking can be stable from while every magnitude decays (Section 5.1, C3).
4 EXPERIMENTAL PROTOCOL
We use Jena climate (M = 14, hourly), ETTh1 (Zhou et al., 2021) (M = 7, hourly), and LSTNet Exchange-Rate (Lai et al., 2018) (M = 8, daily). Input and forecast lengths are T = H = 24, with unit-shift windows and Informer 60/20/20 splits (Jena 70/20/10). We report single-target (K = 1) as primary, since it isolates the temporal axes; the targets are temperature (Jena), oil temperature OT (ETTh1), and the AUS rate (Exchange-Rate). On each dataset we explain three distinct architecture families, trained with a single unified budget (40 epochs, early-stopping patience 6, Adam ): an LSTM (recurrent), a small Transformer encoder (attention, learned positional encoding), and DLinear (linear, series-decomposition).
TempShap is estimator-agnostic. We evaluate cell-pShapley and cell-ShapG, the two estimators in Section 3.3, with TimeSHAP-c and cell-Exact as references. cell-pShapley is the deployed default ( for profiles, fewer for rankings) and cell-ShapG ( ) the graph baseline. The references are TimeSHAP-c, a loss-based cell-level attribution on the TimeSHAP player set (Bento et al., 2021) solved by leverage-score sampling (Musco & Witter, 2025), used as an independent agreement check, and cell-Exact, an oracle for a tractable small case.
For deletion faithfulness, we adapt the weighted-slope score of Zhao et al. (2025b) to the cell level: cells are deleted (masked to the mean) in a method's descending importance order, in 10% steps of the grid. Let contain the cells retained after step and . Using the payoff in equation 1, define , the negative squared error averaged over evaluation windows and forecast outputs. Then
so denotes the full input and the all-masked input. Larger indicates earlier performance drops and greater deletion faithfulness. We do not clip , so an input worse than the all-masked reference gives and , flagging harmful surviving inputs. Every method is scored under the identical mean-mask evaluator, so compares rankings, not maskers; rankings are estimated on 24 test windows and on the following disjoint repeated across model-training seeds. Besides cell-pShapley we rank cells by PAX-TS sensitivity, by single-cell leave-one-out (cell-LOO, ), by cell-ShapG and TimeSHAP-c, and by the unsigned cell-pShapley ranking, which averages over ranking windows and forecast outputs.
Here, “disjoint” means that the ranking and evaluation sets contain different window instances, sampled without replacement from the same shuffled test split. It does not exclude overlap in their underlying input or target timestamps, which affects 1–3% of window pairs. A strictly timestamp-disjoint control leaves the ranking comparison of Section 5.3 unchanged.
5 RESULTS
5.1 GROUND-TRUTH VALIDATION
Table 1: Recovery of the planted signal. Centroids (in lags): for C1; for Cell-Exact.
| Construction | Estimator | when centroid | agreement |
|---|---|---|---|
| C1 (T=24, M=8) | planted | (9.5, 17.5) | — |
| cell-pShapley | (9.7, 17.0) | both top-2 | |
| cell-ShapG | (9.3, 16.8) | both top-2 | |
| TimeSHAP-c | (9.7, 16.9) | both top-2 | |
| Cell-Exact (T=6, M=2) | exact oracle | 2.54 | — |
| cell-pShapley | 2.54 | τ = 0.91 | |
| cell-ShapG | 2.46 | τ = 0.55 |

Figure 2: Synthetic ground-truth validation. (a) C1: localization profiles peak at the planted active lags (shaded). (b) C2: the horizon-impact profile tracks the planted . (c) C3: the ranking settles immediately () while the magnitude decays; the ranking and the magnitude are distinct.
We validate these profiles against three planted constructions (C1–C3; details in Section A, summarized in Figure 2). C1 (localization). With feature 0 predictive only at lags [8, 12) and feature 4 only at [16, 20), all three cell estimators recover both planted lags to within a lag and rank both signal features top-2 (Table 1). C2 (decay) plants a -decaying dependence (), and C3 (rank-constant, magnitude-decaying) scales four fixed-ranking features by ; the estimated profiles reproduce both patterns (Figure 2b,c).
In the small exact-oracle experiment (, ), the target is the mean of feature 0 at lags 2 and 3 plus noise, giving a planted centroid of 2.5. On this tractable case ( coalitions), cell-pShapley matches the exact cell oracle's centroid and cell-ShapG is close (Table 1); the non-signal cells carry near-zero attribution, so the oracle is read mainly through the centroid.
For the real-data analytic oracle, we use DLinear's prediction as the payoff, , for a fixed output cell. Let . Since DLinear is affine, restoring cell from its baseline always changes the prediction by the same amount, giving the exact Shapley value . cell-pShapley recovers these values on all three real DLinear forecasters (signed Pearson 1.00, per-cell Kendall- 1.00, 0 lag centroid error; Table 6); cell-ShapG is close (Pearson 0.87–0.99, 0.5 lags). Here finite-budget exactness follows from constant prediction marginals; for the quadratic squared-loss game, it follows from antithetic pairing (Section 3.4). This prediction-based oracle validates the estimator; the planted experiments above validate the loss-based headline game.
5.2 COMPETITOR COMPARISON
Do existing time-series Shapley variants already answer when? We use a variant of C1: the target is the sum of feature 0's mean over lags [8, 11) and feature 4's mean over lags [16, 19), plus noise. Table 2 compares the methods, including GroupSegment-SHAP (Kim & Park, 2026) and PAX-TS (Kreuzer et al., 2025) at the authors' settings. Feature- and chunk-level player sets (Nayebi et al.,
- cannot separate the two planted lags; only cell-level attribution recovers both, consistently across three Shapley estimators and a per-cell permutation control (Breiman, 2001). The per-feature profiles show the same picture (Figure 4). Among cell-level methods, only cell-pShapley is Shapley-axiomatic and runs at perturbation cost. PAX-TS's six-scale perturbation set costs the same as antithetic pairs, and at that budget cell-pShapley localizes at least as sharply. cell-ShapG needs more evaluations and carries the structural offset of Section 3.3 (Figure 7). GS-SHAP is the slowest despite the fewest coalitions: its HSIC (Hilbert–Schmidt independence criterion) and MMD (maximum mean discrepancy) kernel grouping, not the game, dominates its wall-clock.
Table 2: Localization and cost comparison. Top-2 recovery: features 0 and 4 occupy the top two ranks; N/A: no feature ranking; : derived from group-level attributions. Centroids are in lags; windows count model-forward evaluations; times use one GPU. Budgets: (cell-pShapley), (cell-ShapG). All Shapley methods use the same mean baseline.
| Method | Shapley | Attribution granularity | Top-2 recovery | Centroid (true: 9) | Centroid (true: 17) | windows | wall-clock |
|---|---|---|---|---|---|---|---|
| feature-ShapG | yes | feature | Yes | — | — | 5.9k | 1.3 s |
| WindowSHAP | yes | time chunk | N/A | — | — | 25k | 0.2 s |
| GS-SHAP | yes | group×segment | 0.8k | 64.2 s | |||
| PAX-TS | no | cell (t, i) | Yes | 9.4 | 15.2 | 111k | 0.7 s |
| cell-ShapG (graph) | yes | cell | Yes | 9.7 | 16.3 | 706k | 23.6 s |
| cell-pShapley | yes | cell | Yes | 9.4 | 16.4 | 111k | 0.5 s |
5.3 REDUNDANCY AND DELETION FAITHFULNESS
We next test whether redundancy accounting and signed loss contributions yield stronger deletion rankings.
In the redundancy counterexample, features 0, 1 are equally-noisy copies of one latent signal driving the target (six further features are noise); we ask each method what share of the pair's joint value it credits (Table 3). Leave-one-out credits about half: removing either copy is covered by the survivor, the classic blind spot of one-at-a-time scores (Covert et al., 2020). In the high-correlation cases, cell-pShapley credits the pair approximately its joint value, while efficiency constrains the total attribution across all cells. Once the redundancy is gone (planted correlation 0.20) the two accountings are indistinguishable, so the gap is redundancy-specific. The same construction scored with feature-level Exact Shapley behaves differently again (Section A).
To evaluate deletion faithfulness, we delete cells in each method's importance order and record the performance drop (Section 4, Table 4, Figure 3). Under mean-mask deletion, the signed cell-pShapley ranking beats cell-LOO on every dataset-model case and PAX-TS on 8 of 9; over the 27 paired runs, exact sign tests give and . cell-ShapG and TimeSHAP-c also beat PAX-TS in 24/27 runs each, so within this evaluator the advantage belongs to the Shapley structure rather than to one estimator. Deleting successive batches of ranked cells tests whether a ranking leaves substitutes for deleted cells in place. The sign matters too: the unsigned variant falls back to PAX-TS (14/27). A signed ranking deletes the loss-reducing cells first, so the loss-increasing ones survive and actively mislead the model midway through the curve (Figure 3). Where redundancy is rare, as on ETTh1 with its dominant OT feature, all methods nearly tie. This advantage does not persist under a conditional-imputation evaluator (Section A.5).
Table 3: Share of the redundant pair's joint value credited by each method (synthetic; 10 seeds, mean std, ; cell-pShapley at ). The PAX-TS column is its (non-additive) fraction of total attribution mass.
| corr() | cell-pShapley | LOO | PAX-TS mass |
|---|---|---|---|
| 0.98 | 104 ± 8 | 50 ± 3 | 53 ± 5 |
| 0.80 | 109 ± 10 | 42 ± 8 | 43 ± 5 |
| 0.20 | 72 ± 47 | 84 ± 32 | 46 ± 5 |
Table 4: Weighted slope (mean std over three model-training seeds) of the deletion curve under mean masking; bold = best mean per row, and is the unsigned cell-pShapley ranking. The last two rows count how often each ranking beats a baseline over the 27 (case, seed) runs; exact sign tests give (cell-pShapley vs cell-LOO) and (vs PAX-TS).
| Dataset | Family | cell-pShapley | |φ| | cell-ShapG | TimeSHAP-c | PAX-TS | cell-LOO |
|---|---|---|---|---|---|---|---|
| Jena | LSTM | 1.12 ± 0.19 | 0.68 ± 0.08 | 1.16 ± 0.25 | 1.12 ± 0.19 | 0.55 ± 0.02 | 0.63 ± 0.07 |
| Jena | Transformer | 0.80 ± 0.03 | 0.62 ± 0.03 | 0.80 ± 0.03 | 0.80 ± 0.03 | 0.52 ± 0.02 | 0.60 ± 0.06 |
| Jena | DLinear | 1.95 ± 0.20 | 0.85 ± 0.07 | 1.93 ± 0.20 | 1.95 ± 0.20 | 0.81 ± 0.09 | 0.90 ± 0.06 |
| ETTh1 | LSTM | 0.93 ± 0.01 | 0.92 ± 0.00 | 0.92 ± 0.01 | 0.92 ± 0.01 | 0.91 ± 0.01 | 0.92 ± 0.00 |
| ETTh1 | Transformer | 0.92 ± 0.00 | 0.91 ± 0.01 | 0.92 ± 0.00 | 0.91 ± 0.01 | 0.90 ± 0.01 | 0.90 ± 0.00 |
| ETTh1 | DLinear | 1.00 ± 0.02 | 0.93 ± 0.00 | 0.99 ± 0.02 | 1.00 ± 0.02 | 0.94 ± 0.00 | 0.93 ± 0.00 |
| Exchange-Rate | LSTM | 0.94 ± 0.09 | 0.95 ± 0.04 | 0.99 ± 0.06 | 0.94 ± 0.09 | 0.97 ± 0.05 | 0.83 ± 0.09 |
| Exchange-Rate | Transformer | 0.70 ± 0.03 | 0.71 ± 0.04 | 0.70 ± 0.04 | 0.69 ± 0.04 | 0.67 ± 0.12 | 0.61 ± 0.12 |
| Exchange-Rate | DLinear | 1.82 ± 0.13 | 0.91 ± 0.01 | 1.78 ± 0.12 | 1.82 ± 0.13 | 0.98 ± 0.00 | 0.91 ± 0.02 |
| median S | 0.932 | 0.901 | 0.941 | 0.930 | 0.903 | 0.876 | |
| beats cell-LOO | 26 | 16 | 24 | 26 | 16 | — | |
| beats PAX-TS | 24 | 14 | 24 | 24 | — | 10 |

Figure 3: Cell-level deletion curves for one of the three training seeds averaged in Table 4 (held-out windows; full model, all-masked; legend gives ; cell-pShapley at ). Deleting in cell-pShapley order drives below the all-masked baseline on the redundant Jena panels while PAX-TS and cell-LOO plateau; the methods nearly tie on ETTh1.
5.4 REAL DATA
The profiles resolve the structure on every real forecaster (Table 5; per-feature profiles in Figure 7). A single feature dominates across families on two of the three datasets (OT on ETTh1, AUS on Exchange-Rate).
There is no consistent recency ordering across architectures: the most-recent family changes across datasets (Table 5). Most profiles are near uniform; their departures are dataset- and model-specific, revealing structure that a single centroid cannot resolve.
The rank-settling distinguishes stable from evolving rankings and separates cases that no scalar attribution distinguishes: some rankings are fixed from , others keep reordering well into the horizon (Table 5, Figure 5).
Baseline, payoff and budget sensitivity controls are reported in Section A.4. At the reported sampling budget, the tested profiles show little variation across independent permutation draws in eight of nine dataset–model cases, with the Exchange-Rate Transformer as the exception (Figure 8).
Table 5: Real-data when/horizon-impact across families (, cell-pShapley , mean baseline). when-centroid = mean input lag weighted by (0=oldest); settle = horizon step at which the ranking reaches (single training runs).
| Dataset | Family | test/naive | top feature | when-centroid | settle |
|---|---|---|---|---|---|
| Jena | LSTM | 0.051 | Tpot (K) | 12.5 | 16 |
| Jena | Transformer | 0.051 | Tpot (K) | 11.9 | 17 |
| Jena | DLinear | 0.012 | rho (g/m**3) | 11.4 | 2 |
| ETTh1 | LSTM | 0.048 | OT | 12.6 | 5 |
| ETTh1 | Transformer | 0.046 | OT | 13.0 | 1 |
| ETTh1 | DLinear | 0.019 | OT | 12.2 | 1 |
| Exchange-Rate | LSTM | 0.382 | AUS | 14.3 | 1 |
| Exchange-Rate | Transformer | 0.369 | AUS | 11.5 | 4 |
| Exchange-Rate | DLinear | 0.034 | AUS | 11.5 | 4 |
6 CONCLUSION
TempShap resolves input lag and forecast horizon through a cell-level loss game, validated against planted ground truth and analytic oracles. Permutation sharing makes estimation practical at localized perturbation cost. Its signed Shapley rankings improve held-out deletion faithfulness under mean masking, with gains reproduced across estimators, supporting applications such as pruning and masking.
There are some limitations. TempShap explains error after the fact, not a prediction online. The redundancy mechanism is shown causally only on the synthetic counterexample. Shapley rankings are not generally optimal for greedy deletion; the observed advantage is empirical. We evaluate one model per family rather than multiple tuned instances.
Three directions for future work can be proposed: (a) Explaining this dependence on the deletion protocol and developing rankings suited to conditional deletion remain open problems. (b) Multi-target () extensions must account for each target's own-history contribution. (c) Larger and further architectures (e.g. PatchTST, TFT) would test scalability.
REFERENCES
Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, and Been Kim. Sanity checks for saliency maps. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
João Bento, Pedro Saleiro, André F. Cruz, Mário A. T. Figueiredo, and Pedro Bizarro. TimeSHAP: Explaining recurrent models through sequence perturbations. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), pp. 2565–2573, 2021.
Leo Breiman. Random forests. Machine Learning, 45(1):5–32, 2001.
Javier Castro, Daniel Gómez, and Juan Tejada. Polynomial calculation of the Shapley value based on sampling. Computers & Operations Research, 36(5):1726–1730, 2009.
Hugh Chen, Joseph D Janizek, Scott Lundberg, and Su-In Lee. True to the model or true to the data? arXiv preprint arXiv:2006.16234, 2020.
Ian Covert and Su-In Lee. Improving KernelSHAP: Practical Shapley value estimation using linear regression. In International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 3457–3465, 2021.
Ian Covert, Scott M. Lundberg, and Su-In Lee. Understanding global feature contributions with additive importance measures. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
Jonathan Crabbé and Mihaela van der Schaar. Explaining time series predictions with dynamic masks. In Proceedings of the 38th International Conference on Machine Learning (ICML), pp. 2166–2177, 2021.
Manuel Franco de la Peña, Ángel Luis Perales Gómez, and Lorenzo Fernández Maimó. ShaTS: A Shapley-based explainability method for time series artificial intelligence models. Future Generation Computer Systems, 176:108178, 2025.
Sara Hooker, Dumitru Erhan, Pieter-Jan Kindermans, and Been Kim. A benchmark for interpretability methods in deep neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2019.
Aya Abdelsalam Ismail, Mohamed Gunady, Héctor Corrada Bravo, and Soheil Feizi. Benchmarking deep learning interpretability in time series predictions. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
Neil Jethani, Mukund Sudarshan, Ian C. Covert, Su-In Lee, and Rajesh Ranganath. FastSHAP: Real-time Shapley value estimation. In International Conference on Learning Representations (ICLR), 2022.
Martin Jullum, Lars Henry Berge Olsen, Jon Lachmann, and Annabelle Redelmeier. shapr: Explaining machine learning models with conditional Shapley values in R and Python. arXiv preprint arXiv:2504.01842, 2025.
Jinwoong Kim and Sangjin Park. GroupSegment-SHAP: Shapley value explanations with group-segment players for multivariate time series. arXiv preprint arXiv:2601.06114, 2026.
Tim Kreuzer, Jelena Zdravkovic, and Panagiotis Papapetrou. PAX-TS: Model-agnostic multi-granular explanations for time series forecasting via localized perturbations. arXiv preprint arXiv:2508.18982, 2025.
Guokun Lai, Wei-Cheng Chang, Yiming Yang, and Hanxiao Liu. Modeling long- and short-term temporal patterns with deep neural networks. In Proceedings of the 41st International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR), pp. 95–104, 2018.
Scott M. Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems (NeurIPS), pp. 4765–4774, 2017.
Michael Mayer and Mario V. Wüthrich. Shapley values: Paired-sampling approximations. arXiv preprint arXiv:2508.12947, 2025. doi: 10.48550/arXiv.2508.12947.
Christopher Musco and R. Teal Witter. Provably accurate Shapley value estimation via leverage score sampling. In International Conference on Learning Representations (ICLR), 2025.
Amin Nayebi, Sindhu Tipirneni, Chandan K. Reddy, Brandon Foreman, and Vignesh Subbian. WindowSHAP: An efficient framework for explaining time-series classifiers based on Shapley values. Journal of Biomedical Informatics, 144:104438, 2023.
Chuwen Pang, Bing Mi, and Kongyang Chen. Temporal-decay Shapley: A time-aware data valuation framework for time-series data. arXiv preprint arXiv:2605.08153, 2026.
Leon Petrosjan and Georges Zaccour. Time-consistent Shapley value allocation of pollution cost reduction. Journal of Economic Dynamics and Control, 27(3):381–398, 2003.
Vitali Petsiuk, Abir Das, and Kate Saenko. RISE: Randomized input sampling for explanation of black-box models. In British Machine Vision Conference (BMVC), 2018.
Vikas C. Raykar, Arindam Jati, Sumanta Mukherjee, Nupur Aggarwal, Kanthi Sarpatwar, Giridhar Ganapavarapu, and Roman Vaculin. TsSHAP: Robust model agnostic feature-based explainability for time series forecasting. arXiv preprint arXiv:2303.12316, 2023.
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should I trust you?": Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 1135–1144, 2016.
Avanti Shrikumar, Peyton Greenside, and Anshul Kundaje. Learning important features through propagating activation differences. In Proceedings of the 34th International Conference on Machine Learning (ICML), pp. 3145–3153, 2017.
Erik Štrumbelj and Igor Kononenko. Explaining prediction models and individual predictions with feature contributions. Knowledge and Information Systems, 41(3):647–665, 2014.
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning (ICML), pp. 3319–3328, 2017.
Mattia Villani, Joshua Lockhart, and Daniele Magazzeni. Feature importance for time series data: Improving KernelSHAP. arXiv preprint arXiv:2210.02176, 2022.
Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 11121–11128, 2023. doi: 10.1609/aaai.v37i9.26317.
Yuyi Zhang, Qiushi Sun, Dongfang Qi, Jing Liu, Ruimin Ma, and Ovanes Petrosian. ShapTime: A general XAI approach for explainable time series forecasting. In Kohei Arai (ed.), Intelligent Systems and Applications, volume 822 of Lecture Notes in Networks and Systems, pp. 659–673. Springer Nature Switzerland, 2024. doi: 10.1007/978-3-031-47721-8_45.
Chi Zhao, Jing Liu, and Elena Parilina. Complete-to-sparse: A novel graph construction strategy for efficient shapg. In International Conference on Mathematical Optimization Theory and Operations Research, pp. 180–194. Springer, 2025a.
Chi Zhao, Jing Liu, and Elena Parilina. ShapG: New feature importance method based on the Shapley value. Engineering Applications of Artificial Intelligence, 148:110409, 2025b.
Haoyi Zhou, Shanghang Zhang, Jieqi Peng, Shuai Zhang, Jianxin Li, Hui Xiong, and Wancai Zhang. Informer: Beyond efficient transformer for long sequence time-series forecasting. In Proceedings of the AAAI Conference on Artificial Intelligence, pp. 11106–11115, 2021.
A CONSTRUCTION DETAILS AND ABLATIONS
A.1 SETUP AND SYNTHETIC CONSTRUCTIONS
All timings are measured on one machine: an NVIDIA RTX 4090 (24 GB), a 32-thread Intel Core i9-13900F, and 32 GB of RAM.
The synthetic constructions use , in two correlated blocks (a shared latent per block at each timestep, i.i.d. over so the planted lag is the unique information location), 12 000/2 000/128 train/val/test, one LSTM (32 units, 30 epochs). C1 plants feature 0 at lags [8, 12) and feature 4 at [16, 20); C2 a single feature at [8, 12) with target , ; C3 four features (coefficients 1, 0.7, 0.5, 0.3) at [8, 12) all scaled by . The competitor comparison (Table 2) reuses this construction with narrower bands.
Per-feature WHEN recovery: cell-Shapley vs perturbation vs group-segment

Figure 4: Per-feature when recovery on the planted band (dotted = planted lags 9, 17). The cell estimators peak sharply at both lags; PAX-TS recovers them with a more multi-peaked feat4 profile; GS-SHAP is flat, since its groups cannot separate the features.
Feature-importance convergence across the forecast horizon

Figure 5: Cumulative per-feature importance up to step ; the order in which the curves settle is what measures. Synthetic C3 settles at while its magnitudes decay; on Jena the settling horizon differs by architecture.
A.2 REAL-DATA PROFILES AND LINEAR ORACLE
Table 6: Agreement with the closed-form DLinear oracle: signed Pearson, per-cell and Spearman, and the max-abs centroid difference in lags.
| Dataset | Estimator | signed Pearson | per-cell τ | Spearman | centroid Δ (lags) |
|---|---|---|---|---|---|
| Jena | cell-pShapley | 1.000 | 1.000 | 1.000 | 0.00 |
| cell-ShapG | 0.986 | 0.969 | 0.980 | 0.11 | |
| ETTh1 | cell-pShapley | 1.000 | 1.000 | 1.000 | 0.00 |
| cell-ShapG | 0.916 | 0.904 | 0.954 | 0.50 | |
| Exchange-Rate | cell-pShapley | 1.000 | 1.000 | 1.000 | 0.00 |
| cell-ShapG | 0.871 | 0.841 | 0.872 | 0.05 |

Figure 6: Running-mean importance of the top-4 features against the number of input windows averaged (cell-pShapley, real data, N=256). The top-4 set settles within a few dozen windows, well before the individual magnitudes stop drifting.

Figure 7: Real-data profiles per architecture family, one panel per dataset. (top) when: temporal influence , with solid curves for cell-pShapley, dashed for cell-ShapG, and vertical dotted lines at the centroid of each cell-pShapley profile. (bottom) how much: horizon impact of the top feature, which is not monotone, so a feature's influence fluctuates across the horizon rather than decaying. Both are normalized.
A.3 FEATURE-LEVEL EXACT CONTROL
We repeated the redundancy experiment with a different player set: the whole features rather than the cells, which makes the game small enough to solve exactly ( coalitions). This game gives the redundant pair of its joint value, far more than the cell game does, and splits that credit unevenly between the two copies () from one seed to the next. Two things differ: the coalitions are no longer the same (), and removing a feature's entire history at once pushes the input far off the data manifold when the copies are highly correlated. Efficiency fixes only the grand total, never how it is divided among players, so how much of it a group of players captures depends on which players the game has.
A.4 SENSITIVITY CONTROLS
Table 7: Shift of the when-centroid, in lags, from the deployed setting of each control run; the payoff columns keep the mean reference. marks a variant that also changes which feature ranks first.
| Dataset | Family | reference (vs mean) | payoff (vs error-reduction) | ||
|---|---|---|---|---|---|
| marginal | conditional | prediction | |||
| Jena | LSTM | +1.4 | -0.6 | +0.2 | +1.2 |
| Jena | Transformer | -0.1 | -0.7 | -0.1 | +0.7 |
| Jena | DLinear | +0.6 | +0.0 | -0.0 | -0.0 |
| ETTh1 | LSTM | +0.4 | -1.0 | +0.2 | -0.5 |
| ETTh1 | Transformer | +0.2 | -0.4 | -0.3 | -0.9 |
| ETTh1 | DLinear | +0.3 | +0.2 | -0.0 | +0.4 |
| Exchange-Rate | LSTM | -0.1 | -3.0 | -0.0 | -0.4 |
| Exchange-Rate | Transformer | -0.5 | +0.3 | +0.1 | -0.0 |
| Exchange-Rate | DLinear | -0.0 | +0.7 | +0.3 | |
Reference. Replacing the mean with a Monte-Carlo marginal expectation moves the when-centroid by at most 1.4 lags (median 0.3; Table 7), so the mean plug-in tracks it closely. An observational game (per-feature temporal Gaussian conditional imputer, shapr-style (Jullum et al., 2025; Chen et al., 2020)) agrees within lag on 8/9 cells; the exception, Exchange-Rate LSTM at lags, is the least-predictable dataset.
Payoff. Swapping the error-reduction (equation 1) for the prediction-based moves the centroid by lags, and a global game by lags. Which feature ranks first is unchanged everywhere except in one cell under the prediction-based game (Table 7). The profiles do not hinge on the choice of .
Budget convergence. All reported profiles and rankings are budget-converged at the used. We swept from 1 to 64 on all 9 cases against a reference computed at 128 pairs (Table 8). Cell values need the budget: they are still improving at . The when-centroid does not. On 8/9 cases it is already within a quarter of a lag at . The Exchange-Rate Transformer is the exception, slow on both. Figure 6 shows the same pattern along the sample axis.
Sampling stability of the profiles. For each of the nine cases, we fix the model, explanation windows and baseline, and repeat estimation with eight independent permutation seeds. We assess the feature with the largest attribution mass in an independent reference. At , mean total-variation distance from this reference is below 0.021 for normalised in eight cases, with mean unnormalised mass differing by less than ; mean distance for normalised is at most 0.010 in all nine. The three DLinear cases are exact at every budget, as Corollary 1 requires. The Exchange-Rate Transformer's distance is 0.164, so its fine temporal structure remains uncertain (Figure 8).
Finite-reference error. The paired/unpaired comparison in Table 8 is discussed in Section 3.4. The observed error decrease is consistent with Monte-Carlo convergence, but the reference itself uses finitely many pairs. For a scalar attribution estimate and an independently sampled reference

Figure 8: Normalised top-feature profiles for two of the nine cases: Jena LSTM and the Exchange-Rate Transformer. Coloured bands show the pointwise min–max range across eight permutation seeds at and 32. The black solid and orange dashed lines show two independent references; distances are computed against the black curve.
for the same game,
The expectation includes both independent estimates. Thus error against this reference need not follow a pure rate, particularly as approaches the reference budget.
Table 8: Convergence of cell-pShapley against a high-budget reference of 128 antithetic pairs, averaged over 3 sampling seeds; column groups are the estimation budget . The unpaired group spends the same budget on independent permutations instead of antithetic pairs: DLinear is exact only when paired.
| Dataset | Family | relative RMSE of , paired | relative RMSE of , unpaired | when-centroid error (lags) | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 32 | 64 | 1 | 32 | 64 | 1 | 32 | 64 | ||
| Jena | LSTM | 0.224 | 0.042 | 0.034 | 0.601 | 0.107 | 0.074 | 0.18 | 0.01 | 0.03 |
| Jena | Transformer | 0.194 | 0.035 | 0.025 | 0.566 | 0.094 | 0.071 | 0.09 | 0.00 | 0.01 |
| Jena | DLinear | 0.000 | 0.000 | 0.000 | 0.673 | 0.120 | 0.083 | 0.00 | 0.00 | 0.00 |
| ETTh1 | LSTM | 0.064 | 0.013 | 0.010 | 0.361 | 0.052 | 0.038 | 0.10 | 0.04 | 0.02 |
| ETTh1 | Transformer | 0.132 | 0.026 | 0.022 | 0.387 | 0.054 | 0.043 | 0.14 | 0.02 | 0.02 |
| ETTh1 | DLinear | 0.000 | 0.000 | 0.000 | 0.301 | 0.041 | 0.033 | 0.00 | 0.00 | 0.00 |
| Exchange-Rate | LSTM | 0.238 | 0.049 | 0.037 | 0.600 | 0.096 | 0.078 | 0.08 | 0.04 | 0.02 |
| Exchange-Rate | Transformer | 1.753 | 0.364 | 0.259 | 1.642 | 0.397 | 0.292 | 0.59 | 0.57 | 0.26 |
| Exchange-Rate | DLinear | 0.000 | 0.000 | 0.000 | 0.450 | 0.090 | 0.065 | 0.00 | 0.00 | 0.00 |
A.5 ON-MANIFOLD DELETION
Keeping rankings, windows and the deletion schedule fixed, we replace mean masking with the conditional mean of a joint Gaussian fitted to training windows (Table 9). Under this evaluator, cell-pShapley beats PAX-TS on 3/27 runs and cell-LOO on 11/27; the unsigned ranking achieves the highest median .
Reconstruction checks (seed 2333) give relative to per-cell training means on 22/72 tested deletion sets for ETTh1, versus 0/72 each for Jena and Exchange-Rate. Excluding all nine ETTh1 runs leaves cell-pShapley beating cell-LOO on 5/18 runs and beating PAX-TS on 16/18.
Table 9: Mean-mask versus Gaussian conditional-mean deletion. Entries report median and wins against each baseline over 27 (case, seed) runs; bold marks the highest median within each evaluator.
| Evaluator | cell-pShapley | cell-ShapG | TimeSHAP-c | PAX-TS | cell-LOO | ||
|---|---|---|---|---|---|---|---|
| mean mask | median | 0.931 | 0.901 | 0.941 | 0.929 | 0.902 | 0.892 |
| beats PAX-TS | 24 | 16 | 24 | 24 | — | 10 | |
| beats cell-LOO | 26 | 16 | 24 | 26 | 16 | — | |
| conditional | median | 0.097 | 0.269 | 0.054 | 0.053 | 0.212 | 0.216 |
| beats PAX-TS | 3 | 17 | 3 | 4 | — | 11 | |
| beats cell-LOO | 11 | 21 | 9 | 10 | 16 | — |