TL;DR
PatchMoE introduces a novel, task-aware Mixture-of-Experts (MoE) framework designed to serve as a universal backbone for diverse time series analysis tasks. By incorporating a Recurrent Noisy Gating mechanism that leverages hierarchical layer representations and a dual-dimension load balancing loss, it achieves state-of-the-art performance across forecasting, anomaly detection, imputation, and classification.
What Problem Does This Paper Address?
Unlike Natural Language Processing (NLP) or Computer Vision (CV), which enjoy unified backbones like GPT or ResNet, time series analysis remains fragmented. Different tasks—such as forecasting, anomaly detection, imputation, and classification—frequently rely on distinct, meticulously designed backbones to capture task-specific inductive biases.
While Mixture-of-Experts (MoE) architectures excel at handling diverse data distributions in NLP and CV by activating specialized sub-networks ("experts"), adapting them to time series introduces two major hurdles:
- Task-Agnostic Routing: Standard MoE routers treat all layers independently and fail to account for the fact that different time series tasks rely on different levels of hierarchical features (e.g., forecasting favors shallow representations, while classification requires deeper semantics).
- Neglected Channel Correlations: Many modern time series models adopt a Channel-Independent (CI) strategy to handle varying channel counts. However, standard MoE routing cannot easily perform channel-wise routing, preventing the model from capturing intricate cross-channel correlations.
Methods
The authors propose PatchMoE, which replaces the standard FeedForward network layers in Transformer backbones with a specialized MoE block. Its architecture consists of three core innovations:
- Recurrent Noisy Gating (RNG-Router): Instead of routing tokens independently at each layer, the RNG-Router uses a Gated Recurrent Unit (GRU) cell shared across all layers. It tracks the hidden states across the network hierarchy, allowing the routing strategy to dynamically adapt based on whether the task requires shallow or deep representational knowledge.
- Shared & Routed Experts: Inspired by architectures like DeepSeek, PatchMoE splits its experts into two groups: Shared Experts, which capture general, common temporal patterns across all tokens, and Routed Experts, which are dynamically assigned to model specific temporal and channel variations.
- Temporal & Channel Load Balancing Loss: To prevent tokens from clustering into the same few experts (causing routing imbalance), the authors introduce a dual-dimension balancing loss ($\mathcal{L}_{bal}$). This loss encourages sparse, balanced routing across both the temporal dimensions and channel dimensions, finding an optimal middle ground between Channel-Independence and Channel-Dependence.
Datasets
PatchMoE was comprehensively evaluated across five downstream tasks using several extensive benchmarks:
- Univariate Forecasting: Evaluated on all 8,068 univariate time series in the Time Series Forecasting Benchmark (TFB).
- Multivariate Forecasting & Imputation: Tested on 8 popular datasets: ETT (ETTh1, ETTh2, ETTm1, ETTm2), Weather, Electricity, Solar, and Traffic.
- Anomaly Detection: Evaluated using 8 real-world datasets from the Time Series Anomaly Detection Benchmark (TAB), including CalIt2, Credit, GECCO, Genesis, MSL, NYC, PSM, and SMD.
- Classification: Evaluated on 10 diverse subsets from the UEA Time Series Classification Archive (e.g., PEMS-SF, JapaneseVowels, Heartbeat).
Key Insights and Ideas
- The Hierarchical Variance of Tasks: Using Centered Kernel Alignment (CKA) similarities, the authors demonstrate that well-performing models exhibit distinct layer-wise behaviors depending on the task. Forecasting and anomaly detection show high similarity between early and deep layers, meaning they rely heavily on low-level features. Imputation and classification show low similarity, meaning they require high-level semantic transformations.
- Routing as a Sequence: By treating the routing decision as a recurrent sequence across layers (via the RNG-Router), the model can gracefully transition from clustering tokens based on shallow patterns in early layers to mining deep cross-channel correlations in later layers.
Key Results
PatchMoE achieved consistent state-of-the-art results across all five evaluated tasks:
- Univariate Forecasting: PatchMoE achieved an average msMAPE of 19.95 across 8,068 datasets, outperforming recent strong baselines like Amplifier (21.05) and TimeKAN (20.77).
- Multivariate Forecasting: It consistently outperformed Channel-Independent models (like PatchTST) and Channel-Dependent models (like iTransformer), particularly on large datasets with heavy channel correlations like Solar and Traffic.
- Anomaly Detection: PatchMoE achieved the highest Affiliated-F1 and AUC-ROC scores on the majority of the TAB datasets, demonstrating robust performance under varying anomaly thresholds.
- Ablation Performance: Removing the RNG-Router led to a 4.2% performance drop (MSE), confirming that task-aware hierarchical routing is vital for a unified time series backbone.
Limitations and Future Work
The authors note a clear trade-off regarding model capacity: while increasing the number of hidden layers ($L$) and routed experts ($N_r$) significantly boosts performance on large datasets (like Solar and Traffic), it can lead to overfitting on smaller datasets (like ETTh1 and ETTm2). Future work will likely focus on adaptive scaling mechanisms to automatically tune expert capacity based on dataset scale.
Summary updated