BSAT: B-Spline Adaptive Tokenizer for Long-Term Time Series Forecasting
Maximilian Reinwardt, Michael Eichelbeck, Matthias Althoff
TL;DR
This work tackles the inefficiency and rigidity of patch-based transformers for long-horizon time-series forecasting by introducing BSAT, a parameter-free B-spline based tokenizer that adaptively allocates tokens to high-curvature regions, reducing self-attention complexity from $O(L^2)$ to $O(n^2)$ while handling irregular sampling. It couples BSAT with a Hybrid Additive Rotary Positional Encoding and a layer-wise learnable RoPE base (L-RoPE) to encode non-uniform tokens and enable multi-resolution attention across layers. Empirical results across ETTh1, Alabama PV, and ECL show BSAT achieving competitive RMSE, especially at low token budgets, and the ablations reveal that hybrid embeddings and diverse RoPE bases improve robustness and performance, though numerical stability can be an issue on highly volatile data. The combination of adaptive tokenization and flexible positional encoding offers practical efficiency gains for memory-constrained forecasting tasks, with avenues for further stability improvements and end-to-end differentiable tokenization.
Abstract
Long-term time series forecasting using transformers is hampered by the quadratic complexity of self-attention and the rigidity of uniform patching, which may be misaligned with the data's semantic structure. In this paper, we introduce the \textit{B-Spline Adaptive Tokenizer (BSAT)}, a novel, parameter-free method that adaptively segments a time series by fitting it with B-splines. BSAT algorithmically places tokens in high-curvature regions and represents each variable-length basis function as a fixed-size token, composed of its coefficient and position. Further, we propose a hybrid positional encoding that combines a additive learnable positional encoding with Rotary Positional Embedding featuring a layer-wise learnable base: L-RoPE. This allows each layer to attend to different temporal dependencies. Our experiments on several public benchmarks show that our model is competitive with strong performance at high compression rates. This makes it particularly well-suited for use cases with strong memory constraints.
