acceptodds
Under review as a conference paper at ICLR 2027

ConTex: Reformulating Counterfactual Input Generation For Time Series Forecasting

Abstract

Deep time series forecasting models achieve strong predictive performance, yet their inverse behavior remains opaque: they do not reveal the temporal drivers of desired alternative forecasts or how these inputs must change to reach them. Understanding this target-dependent inverse behavior enables auditing of learned temporal dependencies and, when appropriate feasibility constraints are available, can support decision-making. Existing counterfactual explanation methods address this through instance-wise optimization, which incurs high computational costs, inconsistent solutions across similar inputs, and limited real-time applicability. We address this as a target-conditioned inverse forecasting problem and introduce GenCF as a direct amortized realization of this formulation. Building on this perspective, we further improve transparency into a model's target-conditioned inverse behavior by separating model-level counterfactual explanations into target-relative temporal relevance and modification magnitude. To this end, we introduce ConTex, a forecaster-architecture-agnostic intervention function that maps an input and desired forecast trajectory to model-level counterfactual modifications. We further introduce target-conditioned intervention relevance, identifying which timesteps matter for inducing a desired forecast rather than retrospectively explaining the current prediction. ConTex operationalizes this notion through a learned temporal selection score and a corresponding modification strength, revealing where and how the input must change. Across multiple forecasting architectures and benchmark datasets, ConTex achieves highly competitive target validity while producing substantially sparser input counterfactuals. Additionally, ConTex reduces total computational cost by 12–36× and enables several-thousand-fold faster per-sample inference relative to instance-wise optimization. These results establish ConTex as a promising foundation for extending forecasting models with explanations of their inverse behavior, supporting interpretability, auditing, and model diagnostics.

Primary area:
interpretability and explainable AI
Keywords:
time series forecasting, counterfactual explanations, explainable AI, amortized inference, inverse forecasting

Reviews

Among:
Shape:
1234this paper, Bottom 49%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 2.25 over 4 reviews, above 49% of the others.
Reviewer_d5eBOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper proposes a generator that modifies a time series input to make a forecasting model produce a prediction within a desired range. ConTex separates the changes into a timestep selection mask mm and a modification strength ss, while GenCF directly predicts the changes. Experiments on four forecasting models and four datasets show that both methods achieve higher validity than ForecastCF in most settings, modify fewer timesteps, and run faster. A deletion test suggests that the mask identifies important timesteps.

Critical strengths
  1. Efficiency and validity. The generators achieve higher validity than ForecastCF in most settings while requiring much less computation.
  2. Comprehensive evaluation. The paper evaluates four forecasting models and four datasets using five random seeds, multiple metrics, and sensitivity studies. The authors also released the code.
Critical weaknesses
  1. Unclear benefit of decomposition. GenCF matches or outperforms ConTex in validity in most settings. Although ConTex produces more compact changes, it also uses an additional sparsity penalty. Testing both methods with the same penalty would clarify the benefit of decomposition.
  2. Limited evidence of relevance and realism. The deletion test does not clearly show that the mask identifies important timesteps, and no ground-truth evaluation is provided. ConTex also makes large changes, with proximity values about four times those of FCF-Tuned on NN5 and Electricity using N-HiTS. For realistic targets, NN5 compactness drops to 0.05–0.10, contrary to the Figure 4 caption.
Questions for authors
  1. Is GenCF the same as the “w/o Decomposition” ablation, and does it use a sparsity penalty?
  2. Can ConTex and GenCF be compared across different sparsity weights using validity, compactness, and proximity?
  3. Can the mask mm be tested on a synthetic predictor with known important timesteps and compared with gradient-based methods?
  4. How realistic are the counterfactuals? For example, how close are they to the nearest training sample?
  5. How does IER rank methods when none reach 50% validity, such as PatchTST on NN5 with realistic targets?
3 comments

We thank the reviewer for taking the time to evaluate our paper and for the helpful comments. We have carefully considered the points raised, performed additional experiments, and made corresponding revisions to the manuscript. The updated version has been uploaded. We address the reviewer's questions and concerns below.

Response to Question 1: Is GenCF the same as w/o Decomposition, and does it use a sparsity penalty?

Yes, GenCF corresponds to the w/o Decomposition ablation and uses the same sparsity weight as ConTex. Since GenCF has no explicit mask, it instead employs a difference-based sparsity penalty:

LsparseGenCF=1TF∑t,fσ(50(∣xt,fCF−xt,f∣−τ)),\mathcal{L}_{\mathrm{sparse}}^{\mathrm{GenCF}} = \frac{1}{TF} \sum_{t,f} \sigma\left(50\left(|x_{t,f}^{\mathrm{CF}} - x_{t,f}| - \tau\right)\right),

which penalizes changes exceeding the threshold τ\tau. Thus, both variants are sparsity-regularized with identical weighting, but different formulations (see released repository loss_torch.py, “sparsity_loss_difference_based”).

Response to Question 2: Different Sparsity Weights

Our primary objective is to evaluate the benefit of the mask–strength decomposition under controlled experimental conditions. Accordingly, we compare ConTex and GenCF using the same training settings and sparsity weights. We do not claim that different hyperparameter choices could not yield different validity–compactness–proximity trade-offs. Rather, our conclusions concern the benefits of the decomposition within the evaluated setting, particularly its ability to provide explicit temporal selection scores for interpreting the forecaster, which GenCF cannot provide regardless of the sparsity weight.

Response to Question 3: Comparison with Gradient Based Attribution

Thank you for this valuable suggestion. We have expanded our experiments to include a comparison with gradient-based attribution. However, we would like to clarify an important distinction: A synthetic predictor with known temporal relevance would provide a useful test of attribution accuracy, whereas our study investigates whether meaningful temporal selection patterns can be learned from trained black-box forecasters, where the underlying relevance structure is not directly observable. The challenge is therefore to uncover such patterns rather than recover predefined relevance labels.

We nevertheless recognize that our original experiments did not sufficiently investigate whether the learned selection scores reveal meaningful underlying temporal relevance patterns. In particular, it remained unclear whether they capture recurring, target-dependent patterns across inputs beyond what conventional gradient-based attribution can identify. To address this, we extended our evaluation beyond mask faithfulness with a mask-consistency analysis, comparing the learned selection scores against input gradients of the target-violation loss. Across all 16 dataset–backbone combinations and Top-kk budgets of 5%, 10%, and 20%, the learned masks exhibit greater within-target versus between-target overlap differences than gradient-based attribution (48/48 comparisons; revised manuscript, p. 9, “Selection Patterns and Stability,” Appendix A.14). Our cross-seed analysis further shows substantial agreement in selection rankings across independently trained generators sharing the same forecaster (Appendix A.13.1, Table 31).

These findings provide additional evidence that the learned scores capture recurring, target-dependent temporal patterns in black-box forecasters, beyond the functional relevance established through mask deletion. They do not establish recovery of ground-truth relevance, which remains an important question for future evaluation with synthetic predictors.

AuthorsOpenReview ↗

Response Part 2

Response to Question 4: Counterfactual Plausibility

Thank you for this question. We would like to clarify that our study focuses on model-level counterfactual explanations, including the ability to reveal potentially implausible dependencies learned by the forecaster itself. ConTex, like the evaluated baselines, does not explicitly optimize for data-manifold realism. We therefore did not include a plausibility assessment in our evaluation, as it lies outside our objective. Importantly, enforcing plausibility during generation could conceal precisely the implausible model dependencies that our explanations aim to reveal.

We do not claim that the generated counterfactuals necessarily follow the real data distribution, as their primary purpose is to explain the forecasting model's behavior. We consider incorporating plausibility and actionability requirements an important next step, for which measuring data-manifold proximity would provide a useful complementary assessment. We have clarified this distinction and discussed how practical constraints can be incorporated in the revised manuscript (Appendix, “Actionability Constraints”).

Response to Question 5: IER Ranking Clarification

If no method reaches the 50% validity threshold, all methods receive the same failure rank (1) for that dataset–backbone combination. Thus, no method is rewarded for favorable proximity or compactness despite insufficient target validity. The overall IER is then computed by averaging the ranks across datasets, so differences arise from configurations where methods achieve sufficient validity.

We have revised the IER explanation in Appendix A.4 to clarify this case.

Clarification Regarding Apparent Contradiction in Weakness 2

Regarding the apparent contradiction in Weakness 2, the reported results are correct and do not contradict the claims made in Figure 4. The caption refers to ConTex achieving the highest compactness relative to competing methods, not uniformly high absolute compactness. As specified in Table 24, these comparisons include only methods reaching at least 50% target validity, since high compactness without sufficient target satisfaction does not indicate an effective counterfactual. We acknowledge that absolute compactness can be low across methods, particularly in certain realistic-pattern settings on NN5. We explicitley adress this as limitation in our analysis.

Thank you for the detailed comments. My concerns about ground-truth relevance and plausibility remain, so I will keep my score.

Reviewer_qz7oOpenReview ↗
Rating
2
Confidence
3
Informativeness
2
Presentation
3
Soundness
2
Read review
Paper summary

This paper studies counterfactual input generation for a fixed, differentiable, multi-horizon time-series forecaster. It introduces GenCF as an amortized target-conditioned generator and ConTex as a structured generator that factorizes input modifications into a temporal selection score and a signed modification strength. ConTex combines a temporal encoder, target conditioning, and separate prediction heads, trained using forecast-alignment, proximity, and sparsity objectives.

The evaluation covers four datasets and four forecasting backbones, with five random seeds. It includes controlled trend targets, separately trained models for realistic target trajectories, architectural ablations, deletion-based selection analysis, neighborhood consistency, and runtime measurements. The results support substantial inference-time savings and improved temporal compactness in many settings, although target satisfaction and modification magnitude remain important trade-offs.

Critical strengths

The experiments provide convincing evidence that amortized generation is useful in the evaluated forecasting settings. The comparison uses four forecasting architectures, four datasets, and multiple ForecastCF configurations, including a validity-focused variant and an explicitly documented calibration procedure. Together with the runtime study, this supports a practical contribution beyond a single favorable example.

The decomposition produces a measurable compactness benefit. GenCF provides a useful control for separating amortization from the selection–strength architecture. For example, the NN5/N-HiTS ablation in Table 17 increases compactness from 0.691 without decomposition to 0.848 with ConTex, while retaining high stepwise validity. The deletion experiments also provide evidence that mask rankings identify consequential components of the generated intervention.

Critical weaknesses
  1. The evidence supports relevance within a generated intervention more directly than it supports the broader interpretation of the forecaster’s temporal dependencies. Forecasting counterfactuals and conditional amortized counterfactual generation have established precedents, both acknowledged by the paper. Consequently, the interpretation of the selection–strength decomposition is particularly consequential to its contribution. Appendix A.13 shows that removing high-mask components disrupts ConTex’s own intervention. This is useful evidence, but it does not establish that those locations are necessary across alternative valid interventions, or that the ranking is robust to different generator solutions. Moreover, the product z=m⊙sz=m\odot s does not by itself uniquely determine the two factors; their interpretation depends on the regularization and strength-scaling constraints. The paper should clarify this distinction and provide evidence that the selection ranking reflects more than the particular generator’s preferred solution. This matters because interpretability, rather than amortization alone, is a central claimed contribution.

  2. The evaluation does not fully establish the claimed validity–minimality advantage under comparable successful target attainment. The paper appropriately reports Full Target Satisfaction, but its main compactness comparisons and IER use a threshold on average stepwise validity. Passing that threshold does not ensure comparable success on the trajectory-level constraint defined in Section 3. For example, ConTex’s PatchTST/NN5 stepwise validity is 0.863 in Table 1, whereas its FTS is only 0.238 in Table 11.

Questions for authors

Clarification: What constraints bound the conditioned strength scaler, and how do they prevent a smaller mask from being compensated by a larger strength while preserving the intervention? How stable are mask rankings across independently trained generators for the same input and target?

Assessment-changing evidence: At matched trajectory-level success rates, does ConTex retain its compactness advantage over GenCF and tuned ForecastCF? Can you report proximity and compactness on the common subset of instances for which the compared methods fully satisfy the target?

Clarification: How are realistic target trajectories and tolerance widths constructed, and how are their source windows separated from training and evaluation inputs? What explains the particularly low PatchTST/NN5 validity, and how should this failure qualify the generality claims?

3 comments

We would like to express our gratitude to the reviewer for the thorough review and insightful questions. The feedback has provided valuable opportunities to strengthen both the experimental evaluation and the presentation of our work. We have conducted additional analyses, incorporated the corresponding clarifications into the revised manuscript, and uploaded the updated version. We respond to the individual comments below.

Response to Question 1: Constraints & Ranking Stability

Mask-Stability Experiment:

To assess cross-seed stability, we conducted an additional experiment, as our original benchmark varies both forecaster and generator seeds. We therefore independently trained five ConTex generators per setting with the same frozen forecaster across eight dataset–backbone combinations on NN5 and Tourism. For identical input–target pairs, we measured Spearman rank correlation across the full temporal rankings and Top-10%/20% IoU (see revised manuscript, Appendix A.13.1, Table 31). Overall, we observe substantial agreement, with an average Spearman correlation of 0.728 and average IoU values of 0.636 and 0.676, respectively, despite not explicitly enforcing cross-seed consistency during training. While stability varies across backbones, these results provide evidence of reproducible temporal selection across independent generator training runs.

Mask-Strength Compensation:

The strength scaler consists of a positive, learnable timestep-specific scale and a bounded target-conditioned modulation factor (0.5–1.5). Although the raw strength is tanh-bounded, the final strength has no fixed upper bound. Consequently, mask–strength compensation remains possible, particularly for intermediate mask values, and the decomposition is not uniquely identifiable. Importantly, this potential mixing is deliberately accepted, as it serves the exploratory focus of our study. Since the temporal relevance underlying a forecaster's response to a target is not directly observable, whether it can be meaningfully separated from perturbation magnitude is itself part of our investigation. Rather than imposing a predefined relevance structure through hard gating, we jointly learn continuous, regularized selection scores and modification strengths as part of the counterfactual construction. We then empirically assess whether the learned selection scores capture functional information beyond what can be inferred from the resulting perturbation magnitudes through our mask-deletion experiment.

We have expanded the Conclusion to improve on clarifying the limtations of our design choice and identify clean disentangling selection relevance from modification strength as a direction for future work.

Response to Question 2: Common Subset Comparison

We expanded the experiments with a validity-matched common subset comparison. While we initially omitted validity-matched comparisons due to the small common-success subsets (see Appendix A.5.1 and Table 12), we conducted an additional comparison on M4 using identical input–target pairs for which all four methods achieve full trajectory-level target satisfaction (Table 13). The results confirm the trade-off observed in the main benchmark: ConTex retains the highest or jointly highest compactness across all four backbones, whereas FCF-Tuned achieves the best proximity.

Importantly, FCF-Tuned's full trajectory satisfaction decreases substantially for targets further from the center of the forecast distribution (e.g., from 38.1% at the 0.50 quantile to 10.4% at 0.95 on M4/DLinear), while ConTex consistently maintains over 99% satisfaction. Consequently, the common-success intersection shrinks from 22.0% to 3.4%, disproportionately excluding more extreme targets. Thus, the matched comparison predominantly reflects cases where FCF-Tuned succeeds, yet ConTex retains its compactness advantage.

These findings help explain ConTex's overall intervention-efficiency advantage: it maintains high compactness alongside high validity across the full evaluation set, despite FCF-Tuned's better proximity on the common-success subset. This contrasts with the generally negative validity–compactness association among ForecastCF variants (median r=−0.919r=-0.919; see revised Experiments, Table 15).

AuthorsOpenReview ↗

Response Part 2

Response to Question 3: Realistic Target Construction & PatchTST/NN5 Failure

Since the objective of our realistic-pattern benchmark is to assess how well counterfactual methods can induce specific forecast patterns beyond simple trend matching, it is important that the target trajectories are known to be achievable by the forecaster for at least one input. To prevent data leakage, we split the time series chronologically before window creation and shuffling, separating training, validation, and test inputs. The challenge for each method is therefore to induce the same predefined forecast pattern from previously unseen inputs, while the target trajectories remain fixed across splits.

To obtain realistic targets, we generate forecasts from training inputs and, for each target quantile, randomly select one trajectory from the 5% whose mean forecast values are closest to the corresponding quantile. Pointwise tolerance bounds are then defined as δh,d=max⁡(α∣ch,d∣,10−6)\delta_{h,d}=\max(\alpha|c_{h,d}|,10^{-6}), where cc denotes the selected trajectory and α\alpha (0.05 in the reported experiments) controls the relative tolerance.

NN5/PatchTST: Regarding the particularly low validity on NN5/PatchTST, we note that this difficulty is observed across the evaluated counterfactual methods in the main benchmark, rather than being specific to ConTex. This suggests a possible dataset–forecaster interaction, although the underlying cause remains unclear. We have revised the manuscript to explicitly discuss the observed difficulties on NN5/PatchTST (Appendix A.12, Table 24 caption).

Thank you for the response and the additional analyses. After considering these results and clarifications, reivewer remain unconvinced that my central concerns have been fully addressing. We still find the evidence insufficient to support the broader interpretation of the selection scores. We therefore maintain the current scores.

Reviewer_fewjOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper studies counterfactual input generation for time-series forecasting, aiming to modify historical inputs so that a fixed forecasting model produces a desired future trajectory. The authors propose ConTex, which decomposes each counterfactual modification into a temporal selection score and a modification strength, representing where and how much the input should be changed. ConTex is trained end to end through a frozen forecasting model and does not require labeled counterfactual examples. Experiments across four datasets and four forecasting architectures show that ConTex maintains strong target validity while producing sparser and more localized modifications. It also substantially reduces the computational cost of instance-wise optimization. Deletion experiments further suggest that the learned temporal selection scores identify intervention locations that are important for reaching the target forecast.

Critical strengths
  1. ConTex provides an efficient and clear method for generating counterfactual explanations for time-series forecasting. It separates each intervention into temporal selection scores and modification strengths, showing where the input should be changed and by how much. This design produces sparse counterfactuals that are easier to inspect and understand.

  2. The experiments provide broad evidence for the effectiveness of the method. The paper evaluates ConTex on four datasets and four forecasting architectures using validity, proximity, sparsity, efficiency, and local consistency metrics. The results show that ConTex generates more focused modifications while maintaining strong target validity and greatly reducing the cost of instance-wise optimization.

Critical weaknesses
  1. The experiments do not directly verify the correctness of the counterfactual explanations. Target validity, sparsity, and deletion experiments only show that the selected positions affect the current model’s output. They do not establish that these positions are truly important or causally meaningful.

  2. Both the counterfactual results and their internal representations are non-unique. Multiple valid modifications may produce the same target forecast, while the same intervention may be represented by different combinations of selection scores and modification strengths. Therefore, there is insufficient evidence to directly interpret the learned selection scores as temporal importance.

Questions for authors
  1. My understanding is that the deletion experiment only shows that the temporal selection scores identify positions that affect the current model’s output. It does not establish that these positions have real or causal significance. Please correct me if this understanding is inaccurate. Otherwise, could the authors provide further evidence that the scores capture meaningful temporal relevance rather than positions where the model is simply easier to perturb?

  2. The current proximity and sparsity constraints do not guarantee that the modified series follows the real data distribution, physical rules, or practical intervention constraints. How do the authors assess the real-world feasibility of the generated counterfactuals? Could you provide a plausibility evaluation or discuss how domain constraints could be incorporated in practical applications?

  3. A target forecast may correspond to multiple valid counterfactuals, and the same intervention may have different selection–strength decompositions. How does the method handle this non-uniqueness, and how should the resulting selection scores be interpreted?

  4. Conditional counterfactual generation, amortized inference, and sparse temporal masks have appeared in previous work. Could the authors clarify the central technical novelty of ConTex relative to these methods and explain the unique challenges introduced by multi-horizon forecasting?

3 comments

We appreciate the reviewer's careful evaluation of our work and the constructive feedback provided. The comments have helped us identify aspects of the paper that would benefit from further clarification and empirical investigation. In response, we have conducted additional experiments, revised the manuscript, and uploaded the updated version. We address the individual points below.

Response to Question 1: Temporal Causality and Significance

Thank you for raising this distinction. Our study aims to explain how a forecasting model can be induced to produce a specified alternative target trajectory, rather than its current forecast, given an input. We therefore focus on model-level rather than system-level explanations, as imposing causal or physical constraints would introduce assumptions that alter the explanations and potentially conceal implausible dependencies learned by the model. Investigating real-world causal significance remains important future work, requiring additional causal knowledge or ground truth unavailable in our benchmarks, as well as distinguishing implausibility originating from the forecaster from that introduced by the explanation method.

Further Evidence: Our mask-faithfulness experiment already shows that the learned selection scores identify intervention-critical timesteps beyond what can be inferred from the final perturbation magnitudes. However, we agree that this alone does not establish whether the scores reflect a meaningful underlying temporal relevance structure. In particular, it remains unclear whether they capture recurring, target-dependent patterns across inputs beyond those identifiable through conventional gradient-based attribution.

To investigate this, we added a mask-consistency analysis (revised manuscript, p. 9, “Selection Patterns and Stability,” and Appendix A.14). We measure the difference between within-target and between-target Top-kk IoU and compare the learned selection scores against input gradients of the target-violation loss. Across all 16 dataset–backbone combinations and selection budgets of 5%, 10%, and 20%, ConTex exhibits greater target-specificity than gradient-based attribution (48/48 comparisons). The average overlap differences are 0.146 vs. 0.031 (5%), 0.140 vs. 0.028 (10%), and 0.112 vs. 0.028 (20%) for learned masks and gradients, respectively.

Together, the deletion and consistency analyses provide complementary evidence of functional relevance and recurring target-dependent selection patterns beyond gradient-based attribution. This supports interpreting the scores as proxies for target-conditioned temporal relevance, without implying causal significance or uniquely identifying the forecaster's internal relevance structure.

Response to Question 2: Addtional Constraints

Thank you for raising this point. ConTex and the evaluated baselines do not explicitly optimize for real-world plausibility or actionability. As our benchmark investigates the feasibility of model-level counterfactual explanations, we deliberately avoid imposing external system constraints that could alter the explanations and conceal implausible dependencies learned by the forecasting model itself. Accordingly, we do not claim that the generated counterfactuals represent physically feasible or actionable interventions.

Nevertheless, when domain-specific constraints are available, they can be incorporated into ConTex without changing its underlying architecture. We have added an explanation in the revised manuscript (Appendix A 16, “Actionability Constraints”). Specifically, the intervention can be defined as δt=atmtΔtmax⁡tanh⁡(s^t)\delta_t=a_t m_t\Delta_t^{\max}\tanh(\hat{s}_t), where at∈0,1a_t\in{0,1} excludes immutable timesteps and Δtmax⁡\Delta_t^{\max} specifies the maximum admissible modification magnitude. This guarantees that immutable inputs remain unchanged and ∣δt∣≤Δtmax⁡|\delta_t|\leq\Delta_t^{\max}, while retaining the learned target-conditioned selection mechanism.

These constraints provide a direct way to incorporate known intervention restrictions, although they do not by themselves guarantee causal, physical, or data-manifold plausibility. Such guarantees would require additional domain-specific knowledge and, for reliable actionable interventions, a forecasting model whose behavior adequately reflects the underlying system.

AuthorsOpenReview ↗

Response Part 2

Response to Question 3: Selection Score Interpretation

Thank you for this question. ConTex does not resolve counterfactual non-uniqueness by generating multiple solutions. Instead, amortized learning enables the generator to learn a reusable target-conditioned inverse mapping across inputs, rather than independently optimizing each input–target pair. This provides an opportunity to capture recurring target-dependent temporal selection patterns, as supported by our additional mask-consistency analysis (revised manuscript, p. 9, “Selection Patterns and Stability,” and Appendix A.14). However, the current formulation produces one counterfactual per input–target pair rather than representing multiple valid alternatives, which remains an important direction for future work.

A further question is whether such temporal selection patterns remain stable across independently trained generators despite the underlying non-uniqueness. To investigate this, we conducted an additional cross-seed stability experiment (revised manuscript, Appendix A.13.1, Table 31). We independently trained five ConTex generators per setting with the same frozen forecaster across eight dataset–backbone combinations on NN5 and Tourism, comparing selection rankings for identical input–target pairs. Despite independent training and no explicit cross-seed consistency constraint, we observe an average Spearman rank correlation of 0.728 and Top-10%/20% IoU values of 0.636 and 0.676, respectively. Although agreement varies across backbones, these results provide evidence that recurring temporal selections can emerge consistently across independently trained generators, despite the non-uniquess problem.

The selection scores should therefore be interpreted as proxies for recurring, intervention-relevant temporal patterns rather than unique attributions. Addressing counterfactual non-uniqueness by capturing such patterns while also representing valid alternatives remains an important direction for future work, as now discussed in the revised Conclusion.

Response to Question 4: Novelty Carification

The novelty of ConTex does not lie in individual components but in three distinct contributions:

Problem Formulation. Unlike previous approaches to counterfactual multi-horizon forecasting, such as ForecastCF, which primarily consider input-relative target shifts, we investigate externally specified, continuous multi-horizon forecast trajectories. This problem is challenging, as a continuous multi-horizon target specifies an entire forecast trajectory, requiring input interventions to account for dependencies across multiple future prediction steps. Reaching the same predefined targets from different inputs can also require substantially larger prediction changes, increasing the computational cost of instance-wise optimization (see Appendix, optimization budget (A.2) and runtime analysis (A8)). We demonstrate that a shared target-conditioned inverse mapping can be learned for these targets through amortized counterfactual generation (GenCF), providing the foundation for ConTex's temporal selection mechanism.

Conceptual Novelty. Rather than treating counterfactuals as a single perturbation, ConTex separates temporal selection relevance from modification strength. This is motivated by the assumption that the forecaster relies on an underlying temporal relevance structure that is not directly observable and cannot necessarily be inferred from perturbation magnitudes alone. Although the decomposition is not uniquely identifiable, our deletion analysis provides empirical evidence that the learned selection rankings capture intervention-relevant information beyond the resulting counterfactual perturbations.

Interpretability Contribution. Unlike gradient-based attribution or instance-wise counterfactual optimization, ConTex derives selection scores from a shared target-conditioned inverse mapping rather than independent per-sample optimization, aiming to reveal recurring patterns in which historical timesteps the forecaster relies on to achieve specific targets. Our counterfactual consistency analysis demonstrates recurring intervention patterns across inputs, while the additional mask-consistency analysis (revised manuscript, p. 9, “Selection Patterns and Stability,” and Appendix A.14) shows greater target-specificity than gradient-based attribution, measured by the difference between within-target and between-target temporal overlap.

Thank you for the response. I still have concerns about the correctness, effectiveness, and interpretability of the decomposition. I will maintain my score.

Reviewer_LMc3OpenReview ↗
Rating
3
Confidence
3
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

The paper proposes ConTex, a model-agnostic framework for generating counterfactual explanations in time-series forecasting through amortized intervention learning rather than computationally expensive instance-wise optimization. The proposed architecture combines a Temporal Convolutional Network (TCN), a target-conditioning encoder, Feature-wise Linear Modulation (FiLM), and two prediction heads that separately estimate temporal intervention relevance and modification strength. The resulting counterfactuals are designed to satisfy predefined forecasting constraints while minimizing unnecessary modifications to the original time series.

Critical strengths
  1. A significant strength is the replacement of instance-wise counterfactual optimization with a learned, target-conditioned intervention function. This formulation enables counterfactual generation through a single forward pass and reduces the computational overhead associated with repeated optimization. The reported inference latency of approximately 0.007 seconds and the substantial runtime reduction compared with ForecastCF suggest practical benefits for latency-sensitive forecasting applications. The evaluation across multiple forecasting architectures further supports the usefulness of this approach beyond a single predictive backbone.

  2. The decomposition of interventions into temporal relevance and modification strength provides an intuitive mechanism for identifying where interventions should occur and how strongly the input should be modified. This design improves the interpretability of counterfactual generation and facilitates sparse temporal modifications. The experimental evaluation across four datasets and four forecasting architectures, together with ablation studies and multiple random seeds, offers meaningful evidence of the framework's effectiveness. In particular, the improvements in validity and compactness over ForecastCF demonstrate the potential of amortized counterfactual generation.

Critical weaknesses
  1. The paper primarily evaluates counterfactual quality using validity, proximity, compactness, and stepwise validity metrics. However, satisfying a forecasting model's target constraints does not necessarily imply that the generated modifications are physically feasible, causally meaningful, or actionable in real-world applications. The proposed framework does not explicitly enforce domain-specific constraints, temporal feasibility, causal relationships, or data-manifold consistency. Consequently, the method may generate counterfactual inputs that successfully manipulate model predictions without representing realistic interventions. This is particularly consequential because the manuscript motivates ConTex through practical decision-making applications, including energy systems and healthcare. 2.Although the amortized formulation is promising, the proposed architecture primarily combines established components, including TCN, FiLM conditioning, MLP prediction heads, and sparsity-based regularization. The manuscript does not sufficiently distinguish the proposed intervention-learning formulation from existing amortized optimization, conditional perturbation generation, and learned counterfactual explanation frameworks. A more precise characterization of the methodological novelty is necessary.
Questions for authors

Question 1: Novelty and contribution. How does ConTex differ fundamentally from existing amortized optimization and conditional counterfactual generation approaches? Can the authors clarify which methodological components constitute the principal novelty beyond combining established temporal encoders, FiLM conditioning, and sparsity regularization?

Question 2: Validity versus intervention magnitude. Table 3 indicates that ConTex frequently achieves higher validity but substantially worse proximity than ForecastCF. How should this trade-off be interpreted when evaluating counterfactual quality? Can the authors clarify whether validity-matched comparisons or comparisons restricted to successful counterfactuals support the claimed advantages in intervention efficiency?

Question 3: Plausibility and actionability. Since the framework does not explicitly enforce causal, physical, or data-manifold constraints, what evidence supports the claim that generated counterfactuals represent realistic and actionable interventions rather than adversarial modifications that alter the forecasting model's output? Are any plausibility assessments available in the existing experiments?

Question 4: Generalization beyond predefined targets. To what extent does the learned intervention function generalize to nonlinear target trajectories, previously unseen target distributions, and multivariate time-series forecasting? Can the authors clarify how the qualitative results in Figure 5 were obtained and whether those target patterns were excluded from the training distribution?

Question 5: Role of architectural decomposition. In Table 4, removing the mask–strength decomposition improves both Validity Ratio and S-AUC while reducing compactness. What evidence establishes that the decomposition provides genuinely more meaningful temporal attribution rather than functioning primarily as an additional sparsity-inducing architectural constraint?

Question 6: Baseline fairness and computational comparison. Were ForecastCF and the adapted baselines optimized under comparable target constraints, validity requirements, and hyperparameter-search budgets? Can the authors clarify the treatment of unsuccessful optimization runs and the workload assumptions underlying the reported 12–36× end-to-end computational reduction?

3 comments

We sincerely thank the reviewer for the thoughtful and helpful comments and questions. We have carefully considered the feedback, conducted additional experiments, and revised the manuscript accordingly. The updated version has been uploaded, and we address the individual points below.

Response to Question 1: Novelty and Contribution

Thank you for this question. We do not claim novelty in the individual architectural components. Instead, our contributions lie in three distinct aspects:

Problem Formulation: Unlike previous approaches to counterfactual multi-horizon forecasting, such as ForecastCF, which primarily consider input-relative target shifts, we investigate externally specified, continuous multi-horizon forecast trajectories. Reaching these targets can require substantially larger prediction changes, increasing the computational cost of instance-wise optimization (see Appendix, optimization budget (A2) and runtime results(A8). Importantly, prior work has not systematically demonstrated whether a shared target-conditioned inverse mapping can be learned to generate competitive counterfactuals for such targets. We empirically demonstrate this feasibility through amortized counterfactual generation (GenCF), providing the foundation for the proposed temporal selection mechanism in ConTex.

Conceptual Novelty: Rather than treating counterfactuals as a single perturbation, ConTex explicitly separates temporal selection relevance from modification strength. This is motivated by the assumption that the forecaster relies on an underlying temporal relevance structure that is not directly observable and cannot necessarily be inferred from perturbation magnitudes alone. While the decomposition does not guarantee a unique identification of this relevance, our deletion analysis provides empirical evidence that the learned selection rankings capture intervention-relevant information not fully reflected by the resulting counterfactual perturbations.

Interpretability: Unlike gradient-based attribution methods or instance-wise gradient-based counterfactual optimization, ConTex's selection scores provide relevance indicators derived from a shared target-conditioned inverse mapping rather than independent per-sample optimization. This aims to reveal recurring, generalizable patterns in which historical timesteps the forecaster relies on to achieve specific targets. Our counterfactual consistency analysis supports this perspective by demonstrating recurring intervention patterns across inputs, while our additional mask consistency analysis (see revised manuscript, p. 9, “Selection Patterns and Stability,” and Appendix A.14) shows greater target-specificity of the learned selection scores than gradient-based attribution, measured by the difference between within-target and between-target temporal overlap.

Response to Question 2: Validity-Proximity Trade Off

Thank you for raising this point. We agree that this trade-off was insufficiently explained in the manuscript. Although ConTex generally exhibits higher proximity than FCF-Tuned, its intervention efficiency reflects two distinct properties:

  1. Maintaining compactness under the validity–proximity trade-off. Across methods, validity and proximity are positively correlated, while the ForecastCF variants exhibit a strong negative validity–compactness association (median Pearson r=−0.919r=-0.919; see revised Appendix 5.2, Table 15). In contrast, ConTex maintains high compactness alongside high validity, preserving more original input timesteps despite larger perturbations. Our additional common-success comparison (A 5.2, Table 14) confirms that ConTex retains this compactness advantage across all four M4 backbones when evaluated on identical, fully successful input–target pairs, whereas FCF-Tuned achieves better proximity.
  2. Maintaining validity across more extreme targets. Our new target-wise full trajectory satisfaction (FTS) analysis (A 5.2 Table 13) shows that FCF-Tuned's success rate decreases substantially for targets further from the center of the forecast distribution. On M4/DLinear, its FTS drops from 38.1% at the 0.50 quantile to 10.4% at 0.95, while ConTex consistently exceeds 99%. Consequently, the common-success subset shrinks from 22.0% to 3.4%, disproportionately excluding more extreme targets. ConTex's ability to maintain both high validity and compactness across these conditions helps explain its intervention-efficiency advantage in the full benchmark, despite FCF-Tuned's strength in proximity.

We have incorporated this explanation and the supporting analyses into the revised manuscript (p. 8, “Validity–Compactness–Proximity Trade-off”; Appendix A.5.2, Tables 13–15)

AuthorsOpenReview ↗

Response Part 2

Response to Question 3: Plausibility and Actionability

Thank you for raising this point. Our study distinguishes counterfactual explanations from real-world interventions, treating actionability as a subsequent, system-level task rather than a requirement for model-level explanations. ConTex, like the other evaluated methods, does not explicitly enforce causal, physical, or data-manifold constraints, and we do not claim that its counterfactuals are necessarily actionable.

Importantly, implausible counterfactuals do not necessarily indicate a deficiency of the explanation method, as they may instead reveal implausible dependencies learned by the forecasting model itself. Without additional assumptions, these sources of implausibility cannot readily be distinguished. Enforcing plausibility by default could therefore conceal aspects of the forecasting model's behavior that our explanations aim to reveal. Accordingly, our experiments do not include an explicit plausibility assessment. Nevertheless, actionability constraints can be incorporated when system-level requirements are known. We have clarified this extension in the revised manuscript: The intervention can be expressed as

δt,d=at,dmt,dΔt,dmax⁡tanh⁡(s^t,d),\delta_{t,d} = a_{t,d} m_{t,d} \Delta_{t,d}^{\max} \tanh(\hat{s}_{t,d}),

where at,d∈{0,1}a_{t,d} \in \{0,1\} excludes immutable features or timesteps and Δt,dmax⁡\Delta_{t,d}^{\max} bounds the admissible modification magnitude. This ensures that immutable inputs remain unchanged and modifications respect prescribed magnitude limits, while retaining the target-conditioned selection mechanism. However, such constraints restrict the intervention space and may therefore conceal aspects of the forecasting model's behavior.

Response to Question 4: Generalization & Figure 5

Figure 5 illustrates how counterfactual methods perform for targets in different regions of the forecast distribution, using results already reported in the main benchmark for NN5/N-HiTS. The x-axis represents target quantiles from 0.50 to 0.95, showing how validity, compactness, and proximity change toward more extreme targets. The evaluation inputs are unseen, whereas the target conditions are predefined and were not held out during training. Regarding generalization, our study focuses on establishing the methodological feasibility of our problem reformulation. Unlike previous approaches primarily considering input-relative trend shifts, we investigate whether counterfactual methods can induce fixed target forecast patterns from different inputs, alongside the properties of the proposed selection mechanism. We therefore deliberately evaluate generalization to unseen inputs rather than unseen target distributions, which remains an important direction for future work. Our experiments are also limited to univariate forecasting. While the mask–strength decomposition can conceptually be extended to multivariate time series through time- and feature-dependent masks and strengths, this extension has not yet been empirically validated.

Regarding nonlinear targets, our realistic-pattern benchmark uses complete trajectories previously produced by the forecaster rather than arbitrary, potentially infeasible patterns. This ensures that each target is achievable for at least one input, while requiring methods to reproduce its temporal pattern from unseen inputs within narrow pointwise tolerance bounds. Despite this challenging requirement, ConTex and GenCF achieve substantial target satisfaction across several dataset–backbone combinations and generally achieve higher target satisfaction than the ForecastCF variants. Nevertheless, reliably matching specific forecast patterns remains challenging, with considerable room for improvement.

AuthorsOpenReview ↗

Response Part 3

Response to Question 5: Role of architectural decompostion

In the original manuscript, we evaluated the functional relevance of the learned selection scores through a mask-deletion experiment, since the forecaster's underlying temporal relevance is not directly observable. This analysis showed that mask-based rankings identify intervention-critical timesteps beyond what is reflected by the final counterfactual perturbation magnitudes.

However, we agree that an additional property remained unexplored: Do the learned selection scores capture recurring, target-dependent temporal patterns across different inputs? If so, this would provide further evidence that the decomposition captures recurring temporal dependencies relevant to specific forecast targets, rather than merely enforcing sparsity. To investigate this, we added an experiment measuring the difference between within-target and between-target Top-kk IoU, using input gradients of the target-violation loss as a reference (revised manuscript, p. 9, “Selection Patterns and Stability,” and Appendix A.14). Across all 16 dataset–backbone combinations and selection budgets of 5%, 10%, and 20%, the learned masks exhibit greater target-specificity than gradient-based attribution (48/48 comparisons). Averaged across settings, the differences are 0.158 vs. 0.031 (5%), 0.153 vs. 0.028 (10%), and 0.112 vs. 0.028 (20%) for masks and gradients, respectively. These results support the interpretation that the selection scores capture recurring target-dependent temporal patterns beyond merely enforcing sparsity.

Response to Question 6: Baseline Fairness and Computational Comparison

All methods were evaluated under the same target constraints and validity requirements. However, as ForecastCF performs test-time optimization whereas ConTex learns an amortized counterfactual generator, identical optimization budgets would not be directly comparable. Instead, we systematically calibrated ForecastCF's learning rate and maximum iteration budget for each dataset, increasing the budget until further increases yielded no meaningful improvement in target validity. The optimization protocol, search space, and selected configurations are documented in Appendix A.2 (Figure 6 and Tables 7–8).

Unsuccessful optimization runs are retained in the evaluation, as failure to satisfy the target constraints is itself an informative outcome. All methods are evaluated on the same input–target pairs, and unsuccessful counterfactuals contribute to the reported validity, proximity, and compactness metrics. We do not repeat optimization until a valid counterfactual is found, as this would obscure failure rates and introduce additional computational costs.

The reported computational reduction is based on a conservative end-to-end comparison. We select NN5, where ForecastCF has comparatively low computational costs due to the smaller dataset size and second-lowest optimization budget (Appendix A.2, Table 8), while accounting for the entire ConTex pipeline, including forecaster preparation, bounds calibration, training, validation, test evaluation, and visualization. For NN5/N-HiTS, the twelve ForecastCF-Tuned configurations require 61,771.10 seconds, compared with 4,542.80 seconds for ConTex, yielding a 13.6× reduction (Appendix A.8, Tables 13–14). Thus, substantial savings remain even when including all upfront costs of a single ConTex training run, whereas ForecastCF requires separate optimization for each input–target pair.

We have clarified these workload assumptions and the conservative end-to-end calculation in the revised manuscript (p. 9, “Runtime Study”).

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.