Memory-constrained forecasting
When a forecasting system can keep only so many bytes in memory, what should those bytes be? Tested on spikes in electricity prices, where the rare worst hours are what matter.
- Python
- Polars
- MLX
- Parquet
Key numbers
- 19%
lower tail-forecast error at equal memory, best budget
- 14×
more raw history beaten, at the same bytes
- 10 GiB → 91 MiB
memory in the heaviest step after one fix
How it works
- Electricity prices329M rows, as published
- Fixed set of nodes499, present every year
- Memory budgetsame bytes either way
- Learned vectorsa few slots, 14 wide
- Raw history14× more slots
- Tail-risk readout99th percentile
- Pre-registered testswritten before scoring
Decisions that matter
Prices as they were known
Real-time electricity prices get revised after the fact. Every version is stored with when it was published, so a model only ever sees what was known at the moment it had to decide.
Learned vectors win every comparison
Across six memory budgets and two ways of choosing what to keep, learned vectors had the lower tail-forecast error in all 12 comparisons. 11 of the 12 are significant on their own (Diebold-Mariano p < 0.05); the smallest-gap case, six vector slots, is not. The project flags its pooled p-value as too optimistic, so the claim rests on these per-budget tests.
Kill gates written down first
Each hypothesis had a pass-or-kill test fixed before any data was scored. Two of the three failed, and they were reported as failures.
Memory problems traced to code
The build kept running out of memory. The cause was three allocations that loaded far more than they needed. After fixing them it peaks at 2.8 GiB with no swap and gives bit-identical results. The raw data is 329M rows of 15-minute prices, stored as first published.
Results
Limits. This is research on one market and one machine. Of the three ideas tested, only the memory result held up; the other two were negative and are reported that way.
