Spiral Time: A Geometric Reframing of Temporal Structure and Its Applications in Machine Learning
Description
Archimedean spiral in 2D space rather than a scalar on a number line. Under this framework, called Spiral Time, every moment carries both a radial coordinate encoding cumulative progression (trend) and an angular coordinate encoding phase within a recurring cycle (seasonality). This decomposition is geometric and a priori — it is a property of the time coordinate itself, not a learned or analytical transformation of the target variable.
We derive the mathematical structure, demonstrate a controlled 10-experiment LSTM ablation on US Monthly Retail Sales (RSXFS), and show how spiral time embeddings replace standard positional encodings in Transformer architectures with no other architectural changes.
Key results: The optimal multi-period spiral time embedding achieves 1.69% MAPE — outperforming scalar time (9.76%) by 83% and hand-engineered sinusoidal features (4.62%) by 63%. The performance hierarchy is perfectly monotone across all 10 experiments: every geometric addition improves performance with no exceptions.
Key finding on normalisation: the radial term contributes only when linear in θ and z-score normalised. Incorrect normalisation produces results worse than omitting the trend term entirely — a practically important result for any practitioner adding trend proxies to oscillatory features.
The paper covers the single-period and multi-period embedding, connections to Transformer positional encodings, Hawking–Hartle imaginary time, and Kaluza–Klein theory, and surveys applications in forecasting, anomaly detection, battery health modeling, drug dosing, financial cycle modeling, climate science, and neuroscience.
Code is open-source and available at: github.com/frankajieh-ship-it/spiral-time
Files
Files
(459.0 kB)
| Name | Size | Download all |
|---|---|---|
|
md5:06b65774b1eb8dc5d53b8737e81b8859
|
459.0 kB | Download |
Additional details
Identifiers
Related works
- Cites
- Preprint: arXiv:1907.05321 (arXiv)
- Preprint: arXiv:1706.03762 (arXiv)
Dates
- Created
-
2026-06-10
Software
- Repository URL
- https://github.com/frankajieh-ship-it/spiral-time
- Programming language
- Python
- Development Status
- Active
References
- 1. Hartle, J.B. & Hawking, S.W. (1983). Wave function of the universe. Physical Review D, 28(12), 2960–2975.
- 2. Vaswani, A., Shazeer, N., Parmar, N., et al. (2017). Attention is all you need. Advances in Neural Information Processing Systems, 30.
- 3. Nie, Y., Nguyen, N.H., Sinthong, P., & Kalagnanam, J. (2023). A time series is worth 64 words: Long-term forecasting with Transformers. ICLR 2023.
- 5. Zhou, H., Zhang, S., Peng, J., et al. (2021). Informer: Beyond efficient Transformer for long sequence time-series forecasting. AAAI 2021.
- 6. Wu, H., Xu, J., Wang, J., & Long, M. (2021). Autoformer: Decomposition Transformers with Auto-Correlation for long-term series forecasting. NeurIPS 2021.
- 15. US Census Bureau / Federal Reserve Bank of St. Louis. RSXFS: Advance Retail Sales. FRED Economic Data.