K1
Published on Sep 29, 2025
At 1DES, time-series forecasting is a critical component of how we build intelligence into our trading automation systems — especially for fast-moving markets like BTCUSDT. Our current models are primarily based on LSTM (Long Short-Term Memory) networks, and they’ve delivered stable results over time.
However, recent advancements in deep learning — particularly Transformer architectures — have opened the door to new possibilities. In this two-part series, we’ll explore what makes Transformers powerful for time-series tasks and why we’re planning to experiment with a specific variant: PatchTST.
This first part is all about theory: what Transformers are, how attention works, and why PatchTST stands out among the crowd. In the second part, we’ll build, benchmark, and compare PatchTST to our existing LSTM setup.
Transformers are deep learning architectures originally developed for Natural Language Processing (NLP). Introduced in the 2017 paper “Attention Is All You Need”, Transformers replaced the need for recurrent neural networks (like LSTM) by introducing a new mechanism: self-attention.
Unlike RNNs that process data step-by-step, Transformers take in an entire sequence at once. Each time step in the input can attend (or “look at”) all others in the sequence. This massively parallel structure allows Transformers to:
Transformers have revolutionized NLP, powering models like BERT and GPT. More recently, the same ideas have been adapted for time-series forecasting.
The core idea behind attention is contextual weighting. In self-attention, every point in the sequence decides how much attention to pay to every other point.
Example: If you're forecasting BTCUSDT and see a price spike, a self-attention model can learn that a similar spike a few hours ago may be relevant. It doesn’t have to wait step-by-step to reach that point — it connects the dots directly.
Attention helps the model:
This mechanism is the backbone of all Transformer-based models.
A direct adaptation from NLP. Useful as a baseline but inefficient for longer sequences.
Introduces ProbSparse attention, improving efficiency by focusing on the most relevant time steps.
Decomposes input into trend and seasonal components — useful for long-term, periodic data.
Inspired by Vision Transformers, it divides a time-series into patches (small blocks of time), processes them in parallel, and applies self-attention over patch representations.
PatchTST has shown state-of-the-art performance across several public time-series forecasting benchmarks. It offers:
Given its success in research and practical relevance to financial data, we’re going to put it to the test.
In the next post, we’ll implement PatchTST using TensorFlow/Keras, run benchmarks against our current LSTM-based models, and share performance insights.
Stay tuned!