arXiv ScienceSearch

arXiv · 2603.20456

Neural Hidden Markov Model with Adaptive Granularity Attention for High-Frequency Order Flow Modeling

Abstract

We propose a Neural Hidden Markov Model (HMM) with Adaptive Granularity Attention (AGA) for high-frequency order flow modeling. The model addresses the challenge of capturing multi-scale temporal dynamics in financial markets, where fine-grained microstructure signals and coarse-grained liquidity trends coexist. The proposed framework integrates parallel multi-resolution encoders, including a dilated convolutional network for tick-level patterns and a wavelet-LSTM module for low-frequency dynamics. A gating mechanism conditioned on local volatility and transaction intensity adaptively fuses multi-scale representations, while a multi-head attention layer further enhances temporal dependency modeling. Within this architecture, a Neural HMM with conditional normalizing flow emissions is employed to jointly model latent market regimes and complex observation distributions. Empirical results on high-frequency limit order book data demonstrate that the proposed model outperforms fixed-resolution baselines in predicting short-term price movements and liquidity shocks. The adaptive granularity mechanism enables the model to dynamically adjust its focus across time scales, providing improved performance particularly during volatile market conditions.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Tianzuo Hu. 2026-03-20. Neural Hidden Markov Model with Adaptive Granularity Attention for High-Frequency Order Flow Modeling. https://arxiv.org/abs/2603.20456

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Causal Discovery in Financial Markets: A Framework for Nonstationary Time-Series Data

This paper introduces a new causal structure learning method for nonstationary time series data, a common data type found in fields such as finance, economics, healthcare, and environmental science. Our work builds upon the constraint-based causal discovery from nonstationary data algorithm (CD-NOD). We introduce a refined version (CDNOTS) which is designed specifically to account for lagged dependencies in time series data. We compare the performance of different algorithmic choices, such as the type of conditional independence test and the significance level, to help select the best hyperparameters given various scenarios of sample size, problem dimensionality, and availability of computational resources. Using the results from the simulated data, we apply CDNOTS to a broad range of real-world financial applications in order to identify causal connections among nonstationary time series data, thereby illustrating applications in factor-based investing, portfolio diversification, and comprehension of market dynamics.

q-fin.ST

Extreme Value Analysis for Finite, Multivariate and Correlated Systems with Finance as an Example

Extreme values and the tail behavior of probability distributions are essential for quantifying and mitigating risk in complex systems of all kinds. In multivariate settings, accounting for correlations is crucial. Although extreme value analysis for infinite correlated systems remains an open challenge, we propose a practical framework for handling a large but finite number of correlated time series. We develop our approach for finance as a concrete example but emphasize its generality. We study the extremal behavior of high-frequency stock returns after rotating them into the eigenbasis of the correlation matrix. This separates and extracts various collective effects, including information on the correlated market as a whole and on correlated sectoral behavior from idiosyncratic features, while allowing us to use univariate tools of extreme value analysis. This holds even for high-frequency data where discretization effects normally complicate analysis. We employ a peaks-over-threshold approach and thereby fully avoid the analysis of block maxima. We estimate the tail shape of the rotated returns while explicitly accounting for nonstationarity, a key feature in finance and many other complex systems. Our framework facilitates tail risk estimation relative to larger trends and intraday seasonalities at both market and sectoral levels.

q-fin.ST

Does Crypto Sentiment Extremity Widen Estimated Spreads? Evidence Depends on the Specification

We examine whether extreme values of the Crypto Fear & Greed Index are associated with a daily high-low spread estimate for Bitcoin. The sample contains 2,896 BTC/USDT observations from February 2018 to January 2026. We find an unconditional extreme-minus-neutral gap of 61.99 basis points. After close-to-close realised-volatility-quintile demeaning it is 24.79 basis points, although none of the five separate quintile contrasts survives Holm correction. With quadratic realised-volatility and strictly lagged momentum controls, the HAC estimate is 11.81 basis points (95% CI [-2.31,25.93], p=.101). A fixed non-parametric stratification gives 20.44 basis points (p=.0195 under circular shifts), while separate models for a zero-floored estimate's incidence and positive magnitude are imprecise. The results therefore show only a descriptive, specification-dependent association. We conclude that they do not establish a stable or causal liquidity premium.

q-fin.ST