Quality estimate 6.3/10

IMRouter: Imbalance-aware Temporal Pattern Routing for LLM-based Time Series Forecasting

Xin Yang, Cai Xu, Haishun Chen, Ying Liu, Jie Zhao, Wei Zhao, Ziyu Guan ยท October 29, 2026

Reviewed paper version: v1.

๐Ÿ“Œ Highlights

IMRouter targets a specific failure mode in LLM-based forecasting: temporal pattern imbalance causes common local dynamics to dominate the shared optimization signal, leaving less frequent dynamics with higher errors. The paper combines sparse expert routing with routing-aware cross-modal alignment and reports improvements on long-term, short-term, few-shot, pattern-wise, and ablation evaluations.

The strongest evidence is internally consistent with the proposed mechanism: the full model reaches 0.171 MSE and 0.263 MAE on ECL and 0.423 MSE and 0.285 MAE on Traffic in the ablation table, while the pattern-wise Traffic analysis reports the lowest MSE across all six clusters and an approximate Cluster 6 MSE of 0.78.

  • Core claim: frequency imbalance in recurring temporal patterns biases both temporal encoders and semantic prototype alignment.
  • Main method: PATR uses gradient-conflict and density-aware routing; RGSA preserves routing information during cross-modal alignment.
  • Reported long-term evaluation covers ETTh1, ETTh2, ETTm1, ETTm2, Weather, ECL, and Traffic.
  • Reported short-term evaluation on M4 gives sMAPE 11.77, MASE 1.568, and OWA 0.844.
  • Key caveat: transfer beyond the GPT-2 backbone and the reported datasets is not established.

๐ŸŽฏ Introduction

The paper frames time-series forecasting as important for website traffic prediction, cloud workload management, online service demand, traffic monitoring, and resource management. LLM-based forecasters commonly use a represent-then-align paradigm: a temporal encoder extracts representations, an alignment module maps them toward text prototypes derived from a frozen LLM vocabulary, and the system is trained with forecasting loss.

The paper argues that existing methods focus mainly on the modality gap between continuous time series and discrete text while overlooking the unequal frequency of local temporal patterns. Using TS2Vec representations and HDBSCAN clustering for analysis, the authors identify skewed cluster sizes and generally higher errors for less frequent clusters. IMRouter therefore aims to reduce frequency-induced bias in temporal representation learning and semantic alignment without manually assigned pattern labels.

๐Ÿ”ฌ Methodology

The forecasting backbone normalizes each channel, divides it into sliding-window patches, and maps the patches into temporal tokens. Temporal tokens are aligned with compressed text prototypes through cross-attention and then processed by a frozen LLM. The paper's key motivation is expressed by Eq. (5): the aggregate loss weights each pattern-specific loss by $\frac{|D_j|}{|D|}$, and Eq. (7) consequently weights its gradient contribution by the same empirical frequency.

PATR replaces a single shared temporal transformation with sparse mixture-of-experts routing. Eq. (8) computes patch-level assignment probabilities and Eq. (9) combines the selected experts. After an initial warm-up, the method penalizes incompatible assignments using the positive negative-cosine conflict score in Eq. (10). It estimates local density from normalized shared-router gradients and applies inverse-density weighting so sparsely represented optimization directions receive greater relative influence.

RGSA applies cross-attention to the PATR representations and transfers routing information to the aligned representation. The paper formulates this as mutual-information maximization and implements it with routing-guided semantic distillation: Eq. (19) minimizes KL divergence between the stop-gradient router distribution and a predictor inferred from the aligned representation. The complete training objective in Eq. (20) combines prediction, load balancing, density-weighted gradient conflict, and semantic distillation; RGSA is activated midway through training to avoid unstable early routing supervision.

equation 5

Formula:
\[\mathcal{L}(\theta) = \sum_{j=1}^{J} \frac{|D_j|}{|D|}L_{j}(\theta)\]

Meaning: Decomposes the overall forecasting objective by temporal pattern and exposes the empirical-frequency weighting that favors frequent patterns.

equation 8

Formula:
\[\mathbf r_{i,c}^{n} =\operatorname{softmax}\!\left(g_{\phi}(\mathbf e_{i,c}^{n})\right)\]

Meaning: Produces the router's expert-assignment distribution for each patch.

equation 9

Formula:
\[\mathbf u_{i,c}^{n} =\sum_{m\in\mathcal S_{i,c}^{n}} \tilde r_{i,c,m}^{n}E_m(\mathbf e_{i,c}^{n})\]

Meaning: Combines the selected top-k expert outputs into the PATR temporal representation.

equation 10

Formula:
\[\mathcal{C}_{q,q'}^{(m)} = \left[ -\operatorname{cos} \left( \mathbf{g}_{q}^{(m)}, \mathbf{g}_{q'}^{(m)} \right) \right]_{+}\]

Meaning: Measures incompatible optimization directions for two patches assigned to the same expert.

๐Ÿ“Š Experiments

For long-term forecasting, the paper evaluates ETTh1, ETTh2, ETTm1, ETTm2, Weather, Electricity (ECL), and Traffic with input length 96 and prediction horizons 96, 192, 336, and 720. It reports MSE and MAE, where lower values are better, against TimeSup, FSCA, CALF, Time-LLM, GPT4TS, PatchTST, iTransformer, and TimesNet. The reported aggregate comparison is provided in tab:long_term_forecasting: IMRouter has 0.171 MSE and 0.263 MAE on ECL, and 0.423 MSE and 0.285 MAE on Traffic.

For short-term forecasting, the M4 benchmark contains 100,000 univariate series across Yearly, Quarterly, Monthly, Weekly, Daily, and Hourly frequencies. The paper reports sMAPE, MASE, and OWA, with lower values better, averaged across the Yearly, Quarterly, Monthly, and Other subsets. IMRouter reports 11.77 sMAPE, 1.568 MASE, and 0.844 OWA, compared with FSCA's 11.828, 1.580, and 0.850.

The few-shot setting trains on 10% of the available samples and averages over horizons 96, 192, 336, and 720 on ETTm1, ETTm2, ETTh1, and ETTh2. IMRouter ranks first or second on six of eight reported metrics and reaches 0.498 MSE and 0.457 MAE on ETTm1 and 0.292 MSE and 0.330 MAE on ETTm2. The ablation table shows progressive gains from Vanilla MoE to PATR, RGSA, density weighting, and full IMRouter; on ECL, full IMRouter improves from 0.177 to 0.171 MSE over PATR w/o Density + RGSA, while on Traffic it improves from 0.430 to 0.423.

The pattern-wise Traffic experiment reports the lowest IMRouter MSE across all six frequency-ranked clusters, with stronger improvements on less frequent clusters; the paper gives an approximate Cluster 6 MSE of 0.78 versus 0.85โ€“0.93 for competing methods. Sensitivity experiments on ECL and Traffic find k=2 best for the number of selected experts and expert dimension 256 best among the tested settings.

tab:long_term_forecasting

Caption: Long-term forecasting results averaged over four prediction horizons on seven benchmarks. The best and second-best results are shown in bold and underlined, respectively.

Content:
DatasetIMRouter MSEIMRouter MAETimeSup MSETimeSup MAEFSCA MSEFSCA MAECALF MSECALF MAETime-LLM MSETime-LLM MAEGPT4TS MSEGPT4TS MAEPatchTST MSEPatchTST MAEiTransformer MSEiTransformer MAETimesNet MSETimesNet MAE
ETTm10.3890.3890.4020.4070.4730.4370.3930.3910.4100.4090.3890.3970.3880.4020.4070.4110.4100.418
ETTm20.2790.3210.2840.3290.2820.3260.2820.3220.2850.3310.2580.3310.2900.3330.2910.3340.2950.332
ETTh10.4420.4370.4640.4500.4290.4360.4110.4390.4600.4490.4470.4360.4480.4470.4640.4550.4600.455
ETTh20.3720.3970.4020.4190.3720.4010.3760.4040.3890.4080.3810.4080.3840.4130.3830.4070.4070.421
Weather0.2500.2690.2590.2790.2600.2800.2460.2710.2740.2900.2640.2840.2580.2800.2600.2810.2590.285
ECL0.1710.2630.1920.2810.1940.2780.1930.2780.2230.3090.2050.2900.2040.2940.1750.2660.1970.297
Traffic0.4230.2850.4420.2880.4570.2930.4590.3030.5410.3580.4880.3170.4820.3080.4280.2850.6250.331

Why It Matters: It reports the main long-term comparison across energy, weather, and transportation benchmarks using MSE and MAE.

tab:m4_results

Caption: Average short-term forecasting performance on the M4 dataset. The results are averaged across the Yearly, Quarterly, Monthly, and Other subsets. The best results are shown in bold, and the second-best results are underlined.

Content:
MetricIMRouterFSCATime-LLMGPT4TSPatchTSTiTransformerTimesNet
SMAPE11.7711.82812.49412.36512.05912.14212.880
MASE1.5681.5801.7311.7671.6231.6321.836
OWA0.8440.8500.9130.9180.8690.8740.955

Why It Matters: It shows that IMRouter reports the lowest sMAPE, MASE, and OWA on the averaged M4 short-term evaluation.

tab:fewshot_results

Caption: Few-shot forecasting performance on four ETT datasets. Results are averaged over the available prediction horizons. Lower MSE and MAE indicate better performance. The best results are highlighted in bold, and the second-best results are underlined.

Content:
DatasetIMRouter MSEIMRouter MAEFSCA MSEFSCA MAECALF MSECALF MAETime-LLM MSETime-LLM MAEGPT4TS MSEGPT4TS MAEPatchTST MSEPatchTST MAEiTransformer MSEiTransformer MAETimesNet MSETimesNet MAEDLinear MSEDLinear MAE
ETTm10.4980.4570.6020.5030.5040.4620.5650.4910.6070.4980.6190.4960.5800.4970.6740.5350.5680.500
ETTm20.2920.3300.3020.3390.3020.3300.3030.3410.3030.3370.3020.3420.3060.3440.3220.3550.3290.383
ETTh10.6430.5410.6950.5530.6440.5410.6160.5300.6880.5540.6230.5320.7480.5870.8640.6250.6470.552
ETTh20.4190.4250.4030.4160.4190.4270.4970.4650.5740.4950.4900.4590.4430.4430.4870.4680.4460.461

Why It Matters: It tests whether the imbalance-aware routing approach remains useful when only 10% of the available training samples are used.

fig:pic1

fig:pic1

Caption: Illustration of temporal pattern diversity in a time series. Frequently recurring peak-shaped patterns coexist with less frequent, smoother local patterns (highlighted by red dashed boxes), demonstrating the heterogeneity of temporal dynamics.

Why It Matters: It motivates the central problem by showing why a single average forecasting objective must handle multiple local temporal regimes.

fig:pic2

fig:pic2

Caption: (a) Frequency distribution of temporal pattern clusters identified from a representative channel in the Traffic dataset, ranked by cluster size in descending order. (b) Cluster-wise forecasting errors (MSE) of three existing methods on the same clusters, showing generally higher errors for less frequent patterns. (c) Dataset-level TPI statistics across Electricity, Weather, and Traffic. Gini measures the inequality of cluster sizes, while Top-20 \% Coverage denotes the proportion of samples covered by the largest 20 \% of clusters.

Why It Matters: It provides the paper's main empirical diagnosis: pattern frequencies are skewed and less frequent clusters generally have higher forecasting error.

fig:pic3

fig:pic3

Caption: Illustration of IMRouter

Why It Matters: It shows how PATR, RGSA, the frozen LLM, and the auxiliary optimization objectives fit together.

fig:patter-wise

fig:patter-wise

Caption: Pattern-wise forecasting performance of IMRouter and three baseline methods on the Traffic dataset.

Why It Matters: It directly evaluates the claimed mechanism by comparing errors across clusters ordered by occurrence frequency.

sensitity

sensitity

Caption: Hyperparameter sensitivity results on the number of top-k experts and the dimension of experts.

Why It Matters: It tests how routing sparsity and expert capacity affect forecasting error on ECL and Traffic.

๐Ÿ”ฎ Conclusion

The paper concludes that temporal pattern imbalance is a meaningful source of bias in LLM-based time-series forecasting. IMRouter addresses it at two linked points in the pipeline: PATR reduces optimization interference through gradient-guided expert routing, and RGSA preserves the resulting pattern-specific information during cross-modal semantic alignment.

Across the reported benchmarks, the method improves average forecasting metrics and shows especially clear benefits for underrepresented Traffic patterns. The evidence supports the value of treating temporal frequency imbalance as distinct from abrupt changes, non-stationarity, and extreme events.

๐Ÿ› ๏ธ Future Research Improvements

The main body does not provide a detailed future-work agenda, so the following are evidence-grounded research questions rather than stated paper claims. The next evaluation should test whether the method remains effective with other frozen LLM backbones, since the reported comparisons standardize LLM-based models on GPT-2.

The pattern-wise conclusions could be strengthened by replacing or complementing TS2Vec-plus-HDBSCAN diagnostics with alternative representations, clustering procedures, or directly measured recurring regimes. Broader few-shot curves, explicit compute and latency accounting, and tests across more operational domains would clarify deployment trade-offs.

๐Ÿญ Potential Industry Use Scenarios

The paper's stated application areas map naturally to workload forecasting for web services and cloud resources, where frequent weekday patterns may coexist with less frequent weekend or special-event cycles. More reliable rare-pattern forecasts could support capacity planning, autoscaling, traffic routing, and service-level protection.

The benchmark coverage also suggests energy-demand forecasting, weather-sensitive operations, transportation-flow prediction, and other multivariate monitoring systems as plausible use cases. A production implementation would need to validate routing stability, memory overhead, latency, and performance under distribution shifts not evaluated in the supplied main body.

๐Ÿ’ฌ Critical Analysis

The strongest aspect of IMRouter is that its mechanism is tied to an explicit optimization diagnosis rather than only adding capacity: Eq. (5) identifies frequency-weighted gradients, the ablation study separates vanilla expert routing from gradient-guided routing and density weighting, and the pattern-wise Traffic experiment directly examines errors by frequency. The complementary PATR and RGSA design also addresses both representation learning and cross-modal alignment.

The main uncertainty is external validity. The experiments use a CALF-based implementation, channel-wise routing, a GPT-2 backbone, selected public benchmarks, and a narrow sensitivity study. The supplied evidence does not establish the computational cost of gradient-based routing, the stability of density estimates under changing batch composition, or the behavior of the method when temporal patterns evolve over time.

Reproducibility is helped by the reported Python 3.10 and PyTorch 2.1.3 environment, Adam optimization, fixed random seed 2021, hyperparameter search spaces, two RTX 4090 GPUs, and early-stopping settings. A builder should nevertheless verify the exact warm-up and RGSA activation schedules, auxiliary-loss coefficients, pair-sampling strategy, and expert capacity constraints before treating the reported numbers as directly reproducible.

Original Abstract

Accurate time series forecasting (TSF) is essential for Web applications, such as traffic monitoring and online resource management. Recent advances in leveraging pre-trained large language models (LLMs) have shown promising performance in TSF. However, existing LLM-based TSF methods largely optimize the overall forecasting objective while overlooking temporal pattern imbalance (TPI), where different temporal patterns occur at highly unequal frequencies. Our empirical analysis reveals that TPI is prevalent across widely used TSF benchmarks, with substantially higher forecasting errors on less frequent patterns. To address this issue, we propose IMRouter (Imbalance-aware Temporal Pattern Routing), a novel framework that mitigates TPI-induced biases in both temporal representation learning and cross-modal alignment. Specifically, IMRouter introduces Pattern-Adaptive Temporal Representation Learning (PATR), which leverages gradient conflict and local gradient density to guide expert specialization. By penalizing incompatible expert assignments with density-aware weighting, PATR reduces the dominance of frequent optimization signals in router training. Furthermore, Routing-Guided Semantic Alignment (RGSA) transfers the pattern-specific knowledge learned by the router to cross-modal alignment through mutual information maximization, preserving distinctive temporal information across different patterns. Extensive experiments on benchmark datasets demonstrate the effectiveness of IMRouter, particularly in improving forecasting performance on less frequent temporal patterns.