Introduction
Traditional time-series forecasting (TSF) models typically rely on Empirical Risk Minimization (ERM), which operates under the assumption that future data will follow the same statistical distribution as the past. However, real-world time series are frequently subject to "Out-of-Distribution" (OOD) shifts caused by policy changes, climate shifts, or global events like the COVID-19 pandemic.
While Invariant Learning (IL) offers a path toward robustness by identifying stable relationships across environments, it faces two critical challenges in the temporal domain: the presence of unobserved "core" variables that break the sufficiency assumption, and the lack of explicit environment labels in most time-series datasets. To address these, the authors introduce FOIL (Forecasting for Out-of-distribution generalization via Invariant Learning), a model-agnostic framework designed to enhance the OOD robustness of existing deep TSF models.
The FOIL Framework
FOIL is designed as a "plugin" that can be wrapped around various deep learning backbones. The framework consists of three primary components that work together to handle unobserved variables and discover latent temporal environments.
- Label Decomposing Component ($C_{LD}$): Recognizing that we cannot observe every variable affecting a target, FOIL utilizes Instance Residual Normalization (IRN). This component uses a surrogate loss to align the mean and variance of residuals, effectively filtering out the influence of unobserved factors and making the target more predictable for invariant learning.
- Time-Series Environment Inference Module ($\mathcal{M}_{TEI}$): This module automatically identifies distinct environments within the data using an EM-based clustering approach. A key innovation is the temporal adjacency constraint, which assumes that data points close in time likely belong to the same environment, preventing the model from overfitting to noise.
- Time-Series Invariant Learning Module ($\mathcal{M}_{TIL}$): The core learner works adversarially with the inference module to identify features that perform consistently across all discovered environments, discarding spurious correlations that would fail during a distribution shift.
Experimental Evaluation
The framework was evaluated using four real-world benchmarks: Exchange (currency rates), ILI (influenza-like illness ratios), and ETTh1/ETTh2 (electricity transformer temperatures). These datasets were tested against three state-of-the-art backbone models: Informer, Crossformer, and PatchTST.
Key Results and Ablation
FOIL demonstrated significant performance improvements across all benchmarks. For the Informer backbone, FOIL reduced Mean Squared Error (MSE) by up to 85% on the Exchange dataset. Even for the highly optimized PatchTST, the framework provided gains of up to 30%.
As shown in the ablation study, the removal of any single component—such as the sufficiency-handling surrogate loss (FOIL\Suf) or the environment inference module (FOIL\TEI)—leads to a marked decrease in performance. This confirms that addressing unobserved variables and accurately inferring temporal environments are both essential for OOD generalization. Furthermore, a case study on the ILI dataset revealed that FOIL could successfully identify real-world environments like "Winter," "Summer," and the "H1N1 pandemic" without any manual labeling.
Conclusion
FOIL represents a significant step forward in making time-series forecasting robust to distribution shifts. By acknowledging the "blind spot" of unobserved variables and leveraging temporal structure for environment discovery, it transforms Invariant Learning into a viable tool for TSF. While the framework currently excels in short-term forecasting and involves higher computational overhead during training, its model-agnostic nature makes it a powerful enhancement for any modern forecasting pipeline.
Summary updated