Introduction
Transformer-based models have become the cornerstone of Long-Term Time Series Forecasting (LTSF) due to their ability to capture long-range dependencies. However, their standard self-attention mechanism, which aggregates information globally across the entire sequence, faces significant challenges in real-world scenarios. Specifically, it struggles with dynamic lag effects and the presence of noisy anomalies. This paper introduces TimeExpert, a model utilizing a novel Temporal Mix of Experts (TMOE) attention mechanism to address these limitations by treating historical data as specialized "local experts."
The Challenge: Lag Effects and Anomalies
In real-world time series, the relevance of historical data is rarely uniform. Two primary issues degrade standard global attention:
- Inherent Lag Effects: The importance of past timestamps shifts dynamically. For instance, traffic patterns may depend on the immediate past during weekdays but on different historical windows during holidays.
- Anomalous Segments: Data often contains sensor glitches, abrupt outliers, or zero-imputed missing values. Global attention forced to consider every timestamp inadvertently incorporates this noise, leading to inaccurate forecasts.
Methodology: Temporal Mix of Experts (TMOE)
To overcome these issues, the authors propose TMOE, which reimagines the attention mechanism as a routing problem.
Local Experts and Adaptive Routing
Instead of a single global aggregation, TMOE treats each historical Key-Value (K-V) pair as a local expert specialized in its temporal context. For any given query, a learnable gating function calculates scores based on feature similarity and temporal proximity. The model then employs Top-K routing, selecting only the most relevant experts. This sparsity naturally filters out irrelevant lags and noisy anomalies.
Shared Global Expert
To maintain the ability to capture dataset-wide trends like seasonality, a learnable shared global expert is introduced. This expert is always included in the context aggregation, ensuring that long-range dependencies are not lost while focusing on local relevance.
Integration
TMOE is designed as a plug-and-play replacement for vanilla attention. It has been integrated into architectures like PatchTST (forming TimeExpert) and the foundation model Timer (forming TimeExpert-G).
Experimental Results
The models were benchmarked on seven real-world datasets, including ETT, Exchange, Weather, and Solar-Energy.
Quantitative Performance
TimeExpert achieves state-of-the-art (SOTA) results, outperforming strong baselines such as iTransformer and PatchTST by 3.2–7.8% in MAE and 2.9–6.5% in MSE. Furthermore, TimeExpert-G demonstrates exceptional zero-shot capabilities, competing effectively with large-scale foundation models like Chronos and TimesFM.
Robustness and Insights
A key finding is the model's resilience to data artifacts. While baseline models often suffer phase shifts or amplitude errors when encountering outliers, TimeExpert maintains stable forecasts by ignoring the noisy patches. Additionally, ablation studies show that the utility of the shared global expert is data-dependent: it is crucial for periodic data like Solar-Energy but less so for complex, heterogeneous datasets like ETTm2.
Conclusion
TimeExpert introduces a paradigm shift by moving the Mixture-of-Experts concept into the attention layer. By treating historical timestamps as routable experts, it achieves a balance between capturing global trends and ignoring local noise. This architecture provides a robust foundation for future time series models designed to handle the complexities of real-world data.
Summary updated