TwinFormer: A Dual-Level Transformer for Long-Sequence Time-Series Forecasting
About
TwinFormer is a hierarchical Transformer for long-sequence time-series forecasting. It divides the input into non-overlapping temporal patches and processes them in two stages: (1) a Local Informer with top-$k$ Sparse Attention models intra-patch dynamics, followed by mean pooling; (2) a Global Informer captures long-range inter-patch dependencies using the same top-$k$ attention. A lightweight GRU aggregates the globally contextualized patch tokens for direct multi-horizon prediction. The resulting architecture achieves linear $O(kLd)$ time and memory complexity. On eight real-world benchmarking datasets from six different domains, including weather, stock price, temperature, power consumption, electricity, and disease, and forecasting horizons $96-720$, TwinFormer secures $27$ positions in the top two out of $34$. Out of the $27$, it achieves the best performance on MAE and RMSE at $17$ places and $10$ at the second-best place on MAE and RMSE. This consistently outperforms PatchTST, iTransformer, FEDformer, Informer, and vanilla Transformers. Ablations confirm the superiority of top-$k$ Sparse Attention over ProbSparse and the effectiveness of GRU-based aggregation. Code is available at this repository: https://github.com/Mahimakumavat1205/TwinFormer.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Time Series Forecasting | ETTh1 | -- | 601 | |
| Long-term time-series forecasting | ETTh1 | MAE1.1193 | 351 | |
| Long-term time-series forecasting | ETTm1 | -- | 295 | |
| Time Series Forecasting | ILINet | MAE0.6092 | 30 | |
| Long-term time-series forecasting | Weather | MAE20.4612 | 28 | |
| Long-sequence time-series forecasting | Power | MAE1.52e+3 | 24 | |
| Long-sequence time-series forecasting | IDEA | MAE3.4133 | 24 | |
| Long-sequence time-series forecasting | Temp. | MAE0.5486 | 24 | |
| Long-sequence time-series forecasting | Electricity | MAE20.3264 | 24 | |
| Time Series Forecasting | Weather | MAE14.1749 | 18 |