Skip to main content
QUICK REVIEW

[Paper Review] Trading with the Momentum Transformer: An Intelligent and Interpretable Architecture

Kieran Wood, Sven Giegerich|arXiv (Cornell University)|Dec 16, 2021
Stock Market Forecasting MethodsDecision Sciences11 citations
TL;DR

The paper proposes the Momentum Transformer, an attention-based deep learning architecture that outperforms LSTM-based models in time-series momentum trading by capturing long-term dependencies and adapting to market regime shifts. It combines self-attention with an LSTM component, enabling superior performance net of transaction costs and enhanced interpretability through attention head analysis.

ABSTRACT

We introduce the Momentum Transformer, an attention-based deep-learning architecture, which outperforms benchmark time-series momentum and mean-reversion trading strategies. Unlike state-of-the-art Long Short-Term Memory (LSTM) architectures, which are sequential in nature and tailored to local processing, an attention mechanism provides our architecture with a direct connection to all previous time-steps. Our architecture, an attention-LSTM hybrid, enables us to learn longer-term dependencies, improves performance when considering returns net of transaction costs and naturally adapts to new market regimes, such as during the SARS-CoV-2 crisis. Via the introduction of multiple attention heads, we can capture concurrent regimes, or temporal dynamics, which are occurring at different timescales. The Momentum Transformer is inherently interpretable, providing us with greater insights into our deep-learning momentum trading strategy, including the importance of different factors over time and the past time-steps which are of the greatest significance to the model.

Motivation & Objective

  • To develop a deep learning architecture that improves upon LSTM-based Deep Momentum Networks (DMNs) in capturing long-term price trends and adapting to market regime changes.
  • To enhance model interpretability by enabling insight into which past time-steps and market factors are most influential for trading decisions.
  • To evaluate performance across diverse asset classes—especially commodities, FX, equities, and fixed income—under varying transaction cost regimes.
  • To investigate the synergy between attention mechanisms and online changepoint detection (CPD) for robustness during market crises such as the SARS-CoV-2 crash.
  • To demonstrate that attention-based models can outperform LSTMs in net-of-cost performance, particularly in commodities and long-horizon momentum strategies.

Proposed method

  • The Momentum Transformer uses a hybrid architecture combining a Transformer encoder with an LSTM decoder to leverage both global attention and sequential processing.
  • It employs multiple scaled-dot-attention heads to capture concurrent dynamics at different timescales, such as fast mean-reversion and slow momentum.
  • The model is trained end-to-end to optimize the Sharpe ratio of the trading signal, using only historical price series as input.
  • An online changepoint detection (CPD) module based on Bayesian Gaussian processes is integrated to detect regime shifts and improve responsiveness to market breaks.
  • Interpretability is achieved through attention weight analysis, which reveals the importance of specific past time-steps and market regimes.
  • The architecture is evaluated using a backtest from 1995 to 2020 across multiple asset classes, with performance measured under varying transaction costs (C = 0–3 bps).

Experimental results

Research questions

  • RQ1Can an attention-based architecture like the Momentum Transformer outperform LSTM-based DMNs in momentum and mean-reversion trading strategies, especially under transaction costs?
  • RQ2How does the integration of multiple attention heads enable the model to capture concurrent dynamics at different timescales?
  • RQ3To what extent does the inclusion of a CPD module enhance robustness during market regime shifts, such as during the SARS-CoV-2 crisis?
  • RQ4How does the model’s interpretability—via attention weights—shed light on the importance of specific historical time-steps and market events?
  • RQ5Does the hybrid attention-LSTM architecture (e.g., Decoder-Only TFT) achieve better overall performance than pure Transformer or Informer models across diverse asset classes?

Key findings

  • The Momentum Transformer significantly outperforms LSTM-based DMNs across all risk-adjusted performance metrics, including Sharpe ratio and net-of-cost returns.
  • The Decoder-Only Temporal Fusion Transformer (TFT) with an LSTM and attention components achieved the highest Sharpe ratio of 1.22 at 1 bps transaction costs, outperforming pure Transformers from 2 bps onward.
  • The model achieved a portfolio Sharpe ratio of 1.23 at 3 bps transaction costs when trading only 25 commodity futures from 2015–2020, demonstrating strong net-of-cost performance.
  • The Transformer and Informer models outperformed the TFT during the SARS-CoV-2 market crash, indicating strong resilience to sudden regime changes.
  • The CPD module had the largest performance impact on commodities, where timing precision is critical, improving model responsiveness to regime shifts.
  • The model’s interpretability revealed that attention heads segment time-series into distinct regimes and assign high importance to significant historical events, such as market crashes.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.