Table of Contents
Fetching ...

EXFormer: A Multi-Scale Trend-Aware Transformer with Dynamic Variable Selection for Foreign Exchange Returns Prediction

Dinggao Liu, Robert Ślepaczuk, Zhenpeng Tang

TL;DR

This paper tackles the longstanding difficulty of predicting daily foreign exchange returns by introducing EXFormer, a Transformer-based model that fuses multi-scale trend-aware self-attention, dynamic covariate weighting, and squeeze-and-excitation calibration. The encoder–decoder framework jointly models short-, medium-, and long-horizon patterns while adaptively weighting 28 exogenous covariates, delivering pre-hoc interpretability of drivers. Empirically, EXFormer significantly outperforms randomness benchmarks and a wide set of baselines across EUR/USD, USD/JPY, and GBP/USD, translating predictive gains into economically meaningful trading profits even after realistic frictions. The study also demonstrates regime-robust performance and provides insights into which global factors drive currency dynamics, bridging modern neural architectures with established international finance theories.

Abstract

Accurately forecasting daily exchange rate returns represents a longstanding challenge in international finance, as the exchange rate returns are driven by a multitude of correlated market factors and exhibit high-frequency fluctuations. This paper proposes EXFormer, a novel Transformer-based architecture specifically designed for forecasting the daily exchange rate returns. We introduce a multi-scale trend-aware self-attention mechanism that employs parallel convolutional branches with differing receptive fields to align observations on the basis of local slopes, preserving long-range dependencies while remaining sensitive to regime shifts. A dynamic variable selector assigns time-varying importance weights to 28 exogenous covariates related to exchange rate returns, providing pre-hoc interpretability. An embedded squeeze-and-excitation block recalibrates channel responses to emphasize informative features and depress noise in the forecasting. Using the daily data for EUR/USD, USD/JPY, and GBP/USD, we conduct out-of-sample evaluations across five different sliding windows. EXFormer consistently outperforms the random walk and other baselines, improving directional accuracy by a statistically significant margin of up to 8.5--22.8%. In nearly one year of trading backtests, the model converts these gains into cumulative returns of 18%, 25%, and 18% for the three pairs, with Sharpe ratios exceeding 1.8. When conservative transaction costs and slippage are accounted for, EXFormer retains cumulative returns of 7%, 19%, and 9%, while other baselines achieve negative. The robustness checks further confirm the model's superiority under high-volatility and bear-market regimes. EXFormer furnishes both economically valuable forecasts and transparent, time-varying insights into the drivers of exchange rate dynamics for international investors, corporations, and central bank practitioners.

EXFormer: A Multi-Scale Trend-Aware Transformer with Dynamic Variable Selection for Foreign Exchange Returns Prediction

TL;DR

This paper tackles the longstanding difficulty of predicting daily foreign exchange returns by introducing EXFormer, a Transformer-based model that fuses multi-scale trend-aware self-attention, dynamic covariate weighting, and squeeze-and-excitation calibration. The encoder–decoder framework jointly models short-, medium-, and long-horizon patterns while adaptively weighting 28 exogenous covariates, delivering pre-hoc interpretability of drivers. Empirically, EXFormer significantly outperforms randomness benchmarks and a wide set of baselines across EUR/USD, USD/JPY, and GBP/USD, translating predictive gains into economically meaningful trading profits even after realistic frictions. The study also demonstrates regime-robust performance and provides insights into which global factors drive currency dynamics, bridging modern neural architectures with established international finance theories.

Abstract

Accurately forecasting daily exchange rate returns represents a longstanding challenge in international finance, as the exchange rate returns are driven by a multitude of correlated market factors and exhibit high-frequency fluctuations. This paper proposes EXFormer, a novel Transformer-based architecture specifically designed for forecasting the daily exchange rate returns. We introduce a multi-scale trend-aware self-attention mechanism that employs parallel convolutional branches with differing receptive fields to align observations on the basis of local slopes, preserving long-range dependencies while remaining sensitive to regime shifts. A dynamic variable selector assigns time-varying importance weights to 28 exogenous covariates related to exchange rate returns, providing pre-hoc interpretability. An embedded squeeze-and-excitation block recalibrates channel responses to emphasize informative features and depress noise in the forecasting. Using the daily data for EUR/USD, USD/JPY, and GBP/USD, we conduct out-of-sample evaluations across five different sliding windows. EXFormer consistently outperforms the random walk and other baselines, improving directional accuracy by a statistically significant margin of up to 8.5--22.8%. In nearly one year of trading backtests, the model converts these gains into cumulative returns of 18%, 25%, and 18% for the three pairs, with Sharpe ratios exceeding 1.8. When conservative transaction costs and slippage are accounted for, EXFormer retains cumulative returns of 7%, 19%, and 9%, while other baselines achieve negative. The robustness checks further confirm the model's superiority under high-volatility and bear-market regimes. EXFormer furnishes both economically valuable forecasts and transparent, time-varying insights into the drivers of exchange rate dynamics for international investors, corporations, and central bank practitioners.

Paper Structure

This paper contains 23 sections, 26 equations, 11 figures, 19 tables.

Figures (11)

  • Figure 1: The architecture of EXFormer. The model consists of an Encoder and a Decoder. The Encoder includes a dynamic variable selector, multi-scale convolution and squeeze-and-excitation block, and multi-scale trend-aware self-attention. The Decoder comprises a position-wise feed-forward layer and a GRU followed by a linear output layer.
  • Figure 2: The comparison of the standard self-attention versus our multi-scale trend-aware self-attention in a daily exchange rate forecasting task. The standard self-attention mistakenly aligns observation A with B simply because their instantaneous values coincide. In contrast, our multi-scale trend-aware self-attention incorporates local trend dynamics and correctly associates B with C, the two most relevant time points.
  • Figure 3: The daily returns of EUR/USD, USD/JPY, and GBP/USD from May 7, 2010 to August 29, 2024. The shaded areas indicate the training (first 80%), validation (next 10%), and test (final 10%) periods.
  • Figure 4:
  • Figure 5: The cumulative returns of EXFormer and all benchmarks using a 15-day sliding window ($T = 15$) across EUR/USD, USD/JPY, and GBP/USD. The gold line represents EXFormer, while the black dotted line is the random walk benchmark. Other models are shown in various colors.
  • ...and 6 more figures