Trending
Regime Shift
t
Research·12 min read

Regime Detection with Transformer Architectures: A New Approach to Market State Classification

DSP
Dr. Seonghyeon ParkHead of AI Research · March 12, 2026

Market regime detection has traditionally relied on Hidden Markov Models (HMMs) or threshold-based systems that classify markets into discrete states — trending, mean-reverting, high-volatility, low-volatility. These models work, but they're reactive. By the time an HMM identifies a regime shift, the transition is often well underway.

We asked a different question: can we detect the preconditions of a regime shift before it happens?

The Architecture

Our approach uses a modified transformer architecture that processes multi-scale temporal features. Unlike standard financial transformers that operate on price returns, we feed the model a rich feature set across three time horizons:

  • Micro (1-5 days): Order flow imbalances, intraday volatility patterns, bid-ask spread dynamics
  • Meso (5-30 days): Cross-asset correlation shifts, volatility term structure slope, sector rotation velocity
  • Macro (30-90 days): Credit spread regimes, yield curve shape, central bank policy stance indicators

The key insight is that regime transitions are not instantaneous — they develop over days or weeks as microstructure features begin diverging from macro conditions. A trending market doesn't suddenly become mean-reverting. The preconditions accumulate.

Self-Attention Across Time Scales

The transformer's self-attention mechanism naturally captures dependencies between these time scales. When micro-level features (e.g., order flow becoming increasingly one-directional) diverge from macro-level features (e.g., mean-reversion indicators still dominant), the attention weights shift to highlight this divergence.

We found that the model learns to weight certain cross-scale feature combinations heavily:

  1. 1.Volatility compression + correlation breakdown → Precursor to regime shift (identified 2.4 days early on average)
  2. 2.Spread widening + order flow reversal → Precursor to mean-reversion onset (identified 1.8 days early)
  3. 3.Term structure inversion + sector rotation acceleration → Precursor to trending regime (identified 3.1 days early)

Results

Backtested across 15 years of US equity and FX data:

  • Regime identification accuracy: 78% (vs. 71% for HMM baseline)
  • Average early detection: 2.4 days before traditional models
  • Signal timing improvement: Sharpe ratio of regime-timed signals improved by 0.3 on average
  • False positive rate: 12% (vs. 18% for HMM)

The early detection capability is particularly valuable for the ARKRAFT platform. When our agents detect a regime shift precondition, they can preemptively adjust signal weights rather than reacting after the fact. This is the difference between a 40% weight reduction (preserving optionality) and a full exit (losing re-entry timing).

Integration with ARKRAFT

The regime detector runs as a continuous background process, feeding probability estimates to all signal-generation and portfolio-management agents. When regime shift probability exceeds configurable thresholds, agents receive alerts and can factor the probability into their decision-making.

This is not a black box. Every regime classification comes with a full provenance chain — which features drove the classification, what the attention weights focused on, and how the probability evolved over the preceding days. This is visible through ARKRAFT's Decision Trace interface.

Open Questions

We're actively researching several extensions:

  • Cross-asset regime coupling: Do regime shifts in FX predict equity regime shifts? Early results suggest a 1-2 day lead from FX vol to equity vol regimes.
  • Regime-specific signal weighting: Can we learn optimal signal weights for each regime automatically? This would replace our current Kelly-criterion approach with a learned mapping.
  • Regime transition speed: Not all transitions are equal. Some regimes shift overnight (event-driven), others over weeks (macro-driven). Can we classify transition speed and adjust response accordingly?

We'll share results as we progress. Questions and feedback welcome at research@quantit.com.

© 2026 Quantit