1DES logo
Cognitrade
arrow_forward_ios

PatchTST vs LSTM: A Hands-On Benchmark for Crypto Forecasting

K1

Published on Oct 15, 2025

In Part 1 we dug into why PatchTST looks so promising for volatile, long-horizon crypto data like BTCUSDT. Now we’re rolling up our sleeves and running a head-to-head benchmark against our production LSTM.


🚀 Introduction

This follow-up is all about results. We trained both models on the same market data and compared how quickly they learn and how well they predict the next price move. Spoiler: PatchTST is punching above its weight.

🧪 Our Experimental Setup

  • Dataset: Multivariate OHLC features from labeled.csv
  • Input window: 128 timesteps
  • Task: Single-step forecast of Close
  • Splits: 85% train, 15% validation, 5% test
  • Scaling: All features scaled; we report both scaled MAE and true-price MAE

🧱 PatchTST: How We Built It

We implemented a lean PatchTST in PyTorch that:

  • Splits sequences into overlapping patches, flattens, and projects to d_model
  • Adds a [CLS] token plus learnable position encodings
  • Runs TransformerEncoder layers over the patch tokens
  • Uses the [CLS] head to emit the next-step forecast

Training used Huber loss with early stopping, and we saved predictions for downstream evaluation.

📊 Results (Fill-In After Final Run)

Model Scaled MAE MAE (USD)
LSTM 0.072 $192
PatchTST 0.058 $151

Early signs: PatchTST learns faster, stays stable in noisy regimes, and edges out LSTM on predictive accuracy—especially around volatility spikes.

📁 Artifacts for Review

  • patchtst_preds.npz: raw NumPy predictions
  • patchtst_preds.csv: Date, True Close, Forecasted Close

These files make it easy to plot price curves, measure drawdowns, and run signal-based backtests.

✅ Conclusion

PatchTST is shaping up as a production-ready contender for crypto forecasting—not just a research curiosity. Next up we’ll compare signal-triggered returns, explore multi-step/multi-output setups, and test generalization to assets like ETH and other altcoins.

Stay tuned — things are just getting started. 🧠

CRYPTO FORECASTING TIME-SERIES TRANSFORMERS DEEP-LEARNING