HiPPO Functional Memory: Coordinate-Queryable Attention for Irregular Time Series
Organizations: Imperial College London
Abstract
Irregular time series are recorded at nonuniform times and are often queried at other times: between observations, after the last one, or on a regular grid. Continuous-time models answer such queries by integrating latent dynamics, and time-aware attention models answer them by revisiting the observation tokens. We introduce HiPPO Functional Memory (HiPPO-FM), an attention operator that writes an irregular history into a rank-M function space with explicit time coordinates. Masked self-attention first exchanges content among the observations; the updated values are then contracted against kernel-smoothed HiPPO-Legendre features and solved through a regularized Gram matrix, so the retained coefficients define a function that is read at any time through the same features. The write and read have the form of an interdomain sparse Gaussian-process mean: every readout lies in an M-dimensional reproducing-kernel subspace, and a pointwise bound separates the approximation error of this subspace from the error of the learned memory. Removing the functional memory from the encoder raises Spiral reconstruction RMSE 18-fold. The full model has the lowest error in 11 of 12 Spiral settings, the highest overall accuracy and best average rank on 20 irregular UEA datasets, the highest event-type accuracy on all five multi-type event benchmarks, and a 21% lower extrapolation MSE than CRU on PhysioNet. Because the memory has fixed rank, the state retained after encoding keeps a fixed size as the history grows and is 102 times smaller than a token cache at 1,024 observations.
Figures & tables
| Model | Encoding | Query set | Seq. steps | State | ms/it |
|---|---|---|---|---|---|
| Transformer | 1.6 | ||||
| Neural ODE | 132 | ||||
| Latent ODE | 167 | ||||
| Neural CDE | 349 | ||||
| ContiFormer | – | 3584 | |||
| HiPPO-FM (ours) | 4.6 |
| Model | ||||||
|---|---|---|---|---|---|---|
| RMSE | MAE | RMSE | MAE | RMSE | MAE | |
| Interpolation ( ) | ||||||
| Transformer | 0.95 0.21 | 0.95 0.17 | 2.09 0.72 | 1.74 0.29 | 2.49 0.41 | 2.32 0.25 |
| Neural ODE | 1.03 0.19 | 1.01 0.14 | 1.89 0.25 | 1.65 0.10 | 2.18 0.14 | 2.10 0.18 |
| Latent ODE | 1.16 0.25 | 1.14 0.20 | 2.50 0.94 | 2.04 0.47 | 2.32 0.39 | 2.14 0.25 |
| Neural CDE | 1.32 0.95 | 1.31 0.91 | 2.29 1.59 | 1.89 1.17 | 2.24 0.94 | 1.83 0.40 |
| Model | 30% dropped | 50% dropped | 70% dropped | Overall | ||||
|---|---|---|---|---|---|---|---|---|
| ACC | Rank | ACC | Rank | ACC | Rank | ACC | Rank | |
| GRU-D | 0.7140 | 5.50 | 0.7080 | 5.88 | 0.6793 | 6.14 | 0.7004 | 9.00 |
| GRU- | 0.7255 | 5.35 | 0.7124 | 5.68 | 0.6876 | 5.10 | 0.7085 | 7.00 |
| ODE-RNN | 0.7211 | 5.75 | 0.7150 | 5.23 | 0.6949 | 5.20 | 0.7104 | 6.00 |
| Neural CDE | 0.5156 | 9.18 | 0.5174 | 9.00 | 0.5028 | 8.90 | 0.5119 | 11.00 |
| mTAN | 0.5587 | 8.58 | 0.5447 | 9.23 | 0.5219 | 8.80 | 0.5418 | 10.00 |
| Model | Metric | Synthetic | Neonate | Traffic | MIMIC | StackOverflow | BookOrder |
|---|---|---|---|---|---|---|---|
| HP | LL ( ) | ||||||
| ACC ( ) | – | ||||||
| RMSE ( ) | |||||||
| RMTPP | LL ( ) | ||||||
| ACC ( ) | – | ||||||
| RMSE ( ) |
| Variant | Overall | Extrap. | |
|---|---|---|---|
| Full | – | ||
| w/o encoder FM | 5/5 | ||
| Cosine basis | 4/5 | ||
| No Gram solve | 4/5 |
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Code | # Train | # Test | Length | # Classes | # Variables |
|---|---|---|---|---|---|---|
| ArticularyWordRecognition | AWR | 275 | 300 | 144 | 25 | 9 |
| BasicMotions | BM | 40 | 40 | 100 | 4 | 6 |
| CharacterTrajectories | CT | 1422 | 1436 | 182 | 20 | 3 |
| DuckDuckGeese | DDG | 60 | 40 | 270 | 5 | 1345 |
| Epilepsy | EP | 137 | 138 | 207 | 4 | 3 |
| ERing | ER | 30 | 270 | 65 | 6 | 4 |
| Dataset | GRU-D | GRU- | ODE-RNN | CADN | N. CDE | S5 | mTAN | TST | ContiFormer | t-PatchGNN | HiPPO-FM |
|---|---|---|---|---|---|---|---|---|---|---|---|
| AWR | 0.8467 | 0.8878 | 0.8878 | 0.9378 | 0.7056 | 0.8933 | 0.7322 | 0.9244 | 0.9322 | 0.7789 | 0.9500 |
| BM | 0.8417 | 0.8917 | 0.8417 | 0.8500 | 0.3500 | 0.8167 | 0.7500 | 0.9583 | 0.9250 | 0.9500 | 0.9000 |
| CT | 0.9740 | 0.9705 | 0.9817 | 0.9612 | 0.8572 | 0.9749 | 0.4053 | 0.9640 | 0.9687 | 0.9615 | 0.9626 |
| DDG | 0.5067 | 0.5600 | 0.5600 | 0.5267 | 0.1933 | 0.5733 | 0.6067 | 0.6600 | 0.6600 | – | 0.6667 |
| EP | 0.9203 | 0.9251 | 0.9155 | 0.9010 | 0.4662 | 0.8696 | 0.5894 | 0.9469 | 0.9058 | 0.9251 | 0.9565 |
| ER | 0.7679 | 0.7568 | 0.7309 | 0.8259 | 0.7259 | 0.8173 | 0.7136 | 0.8321 | 0.8358 | 0.7889 | 0.7469 |
| Dataset | GRU-D | GRU- | ODE-RNN | CADN | N. CDE | S5 | mTAN | TST | ContiFormer | t-PatchGNN | HiPPO-FM |
|---|---|---|---|---|---|---|---|---|---|---|---|
| AWR | 0.8611 | 0.8844 | 0.8900 | 0.9367 | 0.6933 | 0.8911 | 0.7189 | 0.9233 | 0.9367 | 0.7756 | 0.9544 |
| BM | 0.9000 | 0.9333 | 0.9250 | 0.9083 | 0.3083 | 0.7750 | 0.8500 | 0.9417 | 0.9417 | 0.9750 | 0.9667 |
| CT | 0.9656 | 0.9754 | 0.9779 | 0.9181 | 0.8647 | 0.9659 | 0.3942 | 0.9582 | 0.9663 | 0.9568 | 0.9582 |
| DDG | 0.5667 | 0.5533 | 0.5600 | 0.5467 | 0.2267 | 0.5467 | 0.5867 | 0.6200 | 0.6600 | – | 0.6467 |
| EP | 0.9348 | 0.9493 | 0.9275 | 0.9251 | 0.4541 | 0.8575 | 0.5628 | 0.9517 | 0.9130 | 0.9155 | 0.9614 |
| ER | 0.7827 | 0.7728 | 0.7469 | 0.8284 | 0.7346 | 0.7988 | 0.7123 | 0.8321 | 0.8420 | 0.7556 | 0.7247 |
| Dataset | GRU-D | GRU- | ODE-RNN | CADN | N. CDE | S5 | mTAN | TST | ContiFormer | t-PatchGNN | HiPPO-FM |
|---|---|---|---|---|---|---|---|---|---|---|---|
| AWR | 0.8611 | 0.8944 | 0.9067 | 0.9356 | 0.7778 | 0.8956 | 0.7600 | 0.9133 | 0.9144 | 0.7600 | 0.9322 |
| BM | 0.8833 | 0.8833 | 0.9333 | 0.8750 | 0.2667 | 0.7917 | 0.8250 | 0.9333 | 0.9333 | 0.9917 | 0.9500 |
| CT | 0.9615 | 0.9731 | 0.9659 | 0.8728 | 0.8635 | 0.9547 | 0.3679 | 0.9420 | 0.9633 | 0.9422 | 0.9325 |
| DDG | 0.5933 | 0.5467 | 0.5200 | 0.5400 | 0.2467 | 0.5667 | 0.5733 | 0.5800 | 0.5733 | – | 0.6867 |
| EP | 0.9058 | 0.9348 | 0.9251 | 0.8865 | 0.5531 | 0.8623 | 0.5362 | 0.9275 | 0.9082 | 0.9034 | 0.9565 |
| ER | 0.7556 | 0.7457 | 0.7111 | 0.7691 | 0.7765 | 0.7654 | 0.6543 | 0.7741 | 0.8333 | 0.7395 | 0.6210 |
| Drop | Baseline | ACC (pp) | W/T/L | ||
|---|---|---|---|---|---|
| 30% | S5 | 11/0/9 | 0.869 | 1.00 | |
| 30% | ContiFormer | 12/0/8 | 0.216 | 1.00 | |
| 50% | S5 | 11/0/9 | 0.812 | 1.00 | |
| 50% | ContiFormer | 9/0/11 | 0.455 | 1.00 | |
| 70% | S5 | 12/0/8 | 0.756 | 1.00 | |
| 70% | ContiFormer | 9/0/11 | 0.970 | 1.00 |
| Dataset | Model | MSE | s/epoch | GiB | Parameters |
|---|---|---|---|---|---|
| PhysioNet | CRU | 4.121 | 28,654 | ||
| HiPPO-FM | 0.196 | 55,978 |
| Variant | Overall RMSE | Extrap. RMSE | -test | Wilcoxon | Params | |
|---|---|---|---|---|---|---|
| Full | – | – | – | 4037 | ||
| w/o encoder FM (MHA only) | 5/5 | 0.0625 | 3363 | |||
| Cosine basis | 4/5 | 0.3125 | 4037 | |||
| No Gram solve | 4/5 | 0.125 | 4037 | |||
| Point features (no kernel) | 3/5 | 1 | 4037 |
| Model | Test RMSE | Test MAE | Iterations | Time (s) | Reached | Time to quality (s) | Peak MB | Params |
|---|---|---|---|---|---|---|---|---|
| HiPPO-FM | 5/5 | 116 | 4037 | |||||
| Transformer | 5/5 | 59 | 4530 | |||||
| Neural ODE | 0/5 | not reached | 31 | 1186 | ||||
| Latent ODE | 0/5 | not reached | 32 | 1322 | ||||
| Neural CDE | 0/5 | not reached | 22 | 4306 | ||||
| ContiFormer | 0/5 | not reached | 3961 | 3938 |
| Persistent state | Encoding | Readout | Peak alloc. | ||||||
|---|---|---|---|---|---|---|---|---|---|
| FM | Token | Ratio | FM | Token | FM | Token | FM | Token | |
| 32 | 82.7 | 328.5 | 4.0 | 8.75 | 5.83 | 1.60 | 0.65 | 22 | 23 |
| 64 | 83.4 | 656.8 | 7.9 | 8.79 | 5.82 | 1.62 | 0.66 | 24 | 26 |
| 128 | 84.6 | 1313.4 | 15.5 | 8.86 | 5.85 | 1.62 | 0.66 | 33 | 34 |
| 256 | 87.2 | 2626.7 | 30.1 | 8.82 | 5.86 | 1.61 | 0.66 | 68 | 69 |
| 512 | 92.3 | 5253.3 | 56.9 | 8.85 | 5.89 | 1.62 | 0.66 | 199 | 202 |
Irregular Time-Series Modeling
Irregular time-series modeling learns from observations that arrive at uneven times, across variables, or with missing values.
See all 113 papers