Efficient Linear Attention for Multivariate Time Series Modeling via Entropy Calibration
Organizations: Advanced Institute of Big Data, Beijing · University of Southampton
Abstract
Attention mechanisms are effective for multivariate time series modeling because they adaptively aggregate information across timestamps and variables. Their quadratic cost, however, limits their use in multivariate and spatio-temporal systems. Linear attention reduces this cost by replacing nonlinear attention mappings with forms that support associative computation. Replacing exponential weighting may weaken the amplification of high-score positions and further bias weakly selective distributions toward uniform aggregation. We propose an entropy-calibrated linear attention module and instantiate it as the ELinFormer forecaster. Our operator decomposes aggregation into a uniform component and a query-dependent correction, whose magnitude is calibrated by a query-specific temperature. We derive a second-order KL proxy from centered query-key scores. The Taylor expansion reduces the proxy to the squared-score energy divided by the squared temperature. This score energy can be computed from shared products of the centered keys without forming the full pairwise score matrix, and the same products support the linear attention output. We design a smooth temperature rule to calibrate the KL proxy: it keeps low-energy residuals vanishing, approximately calibrates moderate-energy queries to a shared KL level, and allows the proxy to continue growing for high-energy queries. Experiments on five PEMS benchmarks show competitive forecasting accuracy. Controlled comparisons with vanilla attention and Linformer demonstrate a favorable accuracy--memory trade-off, while analysis on PEMS08 shows that the proposed rational temperature rule and query-specific calibration achieve lower MAE than a linear rule or shared-temperature alternatives. These results support entropy calibration as an effective mechanism for preserving selective deviations in linear attention.
Figures & tables
| Module | Time | Shared matrix state |
|---|---|---|
| Softmax attention | ||
| Proposed ( ) |
| Dataset | #Nodes | #Edges | #Timesteps | Interval |
|---|---|---|---|---|
| PEMS-BAY | 325 | 2369 | 52128 | 5 min |
| PEMS03 | 358 | – | 26208 | 5 min |
| PEMS04 | 307 | 340 | 16992 | 5 min |
| PEMS07 | 883 | 866 | 28224 | 5 min |
| PEMS08 | 170 | 295 | 17856 | 5 min |
| Model | PEMS-BAY | PEMS03 | PEMS04 | PEMS07 | PEMS08 | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | MAE | RMSE | |
| STID [ 23 ] | – | – | 15.37 | 25.10 | 18.68 | 30.61 | 20.07 | 33.39 | 14.55 | 23.85 |
| M3-Net [ 24 ] | – | – | 14.88 | 25.49 | 18.30 | 30.15 | 19.42 | 32.85 | 13.89 | 23.33 |
| TSNN † [ 25 ] | – | – | 15.21 | 24.44 | 19.28 | 31.69 | 20.37 | 34.56 | 14.57 | 24.80 |
| AGCRN [ 14 ] | 1.60 | 3.67 | 15.24 | 26.65 | 19.28 | 31.02 | 20.68 | 34.45 | 15.78 | 24.76 |
| DCRNN [ 5 ] | 1.59 | 3.69 | 15.54 | 27.18 | 19.66 | 31.18 | 21.16 | 34.15 | 15.23 | 24.17 |
| Dataset | Model | MAE | RMSE | MAPE | Memory (MiB) | Time (s/epoch) |
|---|---|---|---|---|---|---|
| PEMS03 | STAEformer | 15.35 | 27.55 | 15.18% | 8336 | 186 |
| Linformer | 15.12 | 26.06 | 15.60% | 5611 | 140 | |
| NaLaFormer | 14.75 | 26.13 | 15.00% | 7155 | 157 | |
| ELinFormer | 14.81 ( 3.5%) | 24.86 ( 9.8%) | 15.21% ( 0.2%) | 5278 ( 36.7%) | 151 ( 18.8%) | |
| PEMS04 | STAEformer | 18.22 | 30.18 | 11.98% | 7096 | 101 |
| Linformer | 18.39 | 30.15 | 12.10% | 5217 | 79 |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Component | Specification |
|---|---|
| Operating system | Linux |
| CPU | 12 vCPU Intel Xeon Platinum 8255C, 2.50 GHz |
| System memory | 40 GB |
| GPU | NVIDIA RTX 3080, 10 GB VRAM |
| Python | 3.8 |
| PyTorch | 1.10.0 |
| Dataset | Nodes | Edges | Time steps | Interval |
|---|---|---|---|---|
| PEMS-BAY | 325 | 2369 | 52128 | 5 min |
| PEMS03 | 358 | – | 26208 | 5 min |
| PEMS04 | 307 | 340 | 16992 | 5 min |
| PEMS07 | 883 | 866 | 28224 | 5 min |
| PEMS08 | 170 | 295 | 17856 | 5 min |
| Setting | Final value or selection procedure |
|---|---|
| Temperature floor | , fixed |
| Global scale | , fixed |
| candidates | |
| Selected | , selected by PEMS08 validation MAE |
| Cross-dataset use | The selected is reused for the remaining PEMS datasets, heads, and queries |
| Backbone settings | Follow the corresponding STAEformer configurations unless explicitly changed |
| Rational | Linear | |
|---|---|---|
| 0.50 | 13.41 | 13.45 |
| 1.00 | 13.35 | 13.41 |
| 1.33 | 13.34 | 13.49 |
| 1.50 | 13.37 | 13.48 |
| 2.00 | 13.38 | 13.47 |
| Variant | MAE |
|---|---|
| Proposed linear operator, rational temperature | 13.34 |
| Softmax attention with the proposed | 13.36 |
| Learnable | 13.44 |
| Shared global | 13.57 |
| Fixed | 13.51 |
| Layer | Floor (%) | Transition (%) | Upper tail (%) | Median |
|---|---|---|---|---|
| Temporal 1 | 79.38 | 20.62 | 0.00 | 0.1064 |
| Temporal 2 | 21.99 | 77.93 | 0.08 | 0.1977 |
| Temporal 3 | 5.47 | 93.45 | 1.08 | 0.3074 |
| Spatial 1 | 55.59 | 44.41 | 0.00 | 0.1364 |
| Spatial 2 | 56.10 | 43.90 | 0.00 | 0.1236 |
| Spatial 3 | 76.08 | 23.92 | 0.00 | 0.1038 |
Linear Attention
Linear attention reduces sequence-length costs by replacing pairwise token interactions with kernel features, recurrent states, or compact memory.
See all 131 papers