Modeling limit order book (LOB) dynamics is central to market forecasting and execution-strategy evaluation. While diffusion models achieve strong empirical performance, existing LOB snapshot models typically lack a learned recurrent encoder and formal statistical guarantees. We introduce LOBGrad, a conditional DDPM framework for probabilistic LOB forecasting that combines an autoregressive RNN encoder with a diffusion-based generator. In particular, we establish an excess-risk oracle inequality for the one-step DDPM noise-prediction objective under exponential mixing and regularity assumptions. We further show that, under contractive dynamics, the dependence on the conditioning-window length can be reduced to a dependence on the latent-state dimension. Experiments on BTC/USDT, GOOGL, and META show that LOBGrad improves on its encoder-free diffusion ablation across all reported queue metrics and obtains competitive results against other baselines. It also reproduces the key stylized facts of LOB microstructure, and yields reasonably calibrated queue-based predictive intervals. A stylized downstream task illustrates the potential value of the generated forecasts.
Figures & tables
Figure 1. Illustration of the raw Level-2 LOB, the centered representation used in our model, and the forecasting target. Bid and ask volumes are arranged around a price center, with negative values for bids and positive values for asks. The model uses past snapshots to predict the next price return and signed-log queue volumes.
Metric
LOBGrad
LG-NE
LG-Q
LG-R
CGAN
PTM
TransLOB
DeepLOB
Hawkes
Poisson
BTC/USDT
Queue
L1 volume Wasserstein
0.100
0.104
0.135
—
0.197
0.126
0.201
0.176
0.266
0.330
OB imbalance Wasserstein
0.095
0.107
0.096
—
0.196
0.107
0.203
0.172
0.219
0.280
Queue profile MAE
0.037
0.109
0.049
—
0.044
0.140
0.068
0.082
0.098
0.100
Queue ACF MAE
0.026
0.081
0.024
—
0.034
0.039
0.075
0.072
0.225
0.219
Table 1. Distributional metrics over a 20 -step forecast horizon across 500 held-out windows. Lower values are better. Bold marks the best value per row. ne = no encoder; q = queue only; r = return only. Dashes indicate metrics that are not applicable.
Figure 2. Sample best-bid queue (top) and mid-price (bottom) trajectories from LOBGrad with 50% and 90% predictive intervals on a held-out test window. A dashed vertical line marks the forecast origin. The subsequent realized paths are compared with the forecast medians and shaded predictive intervals.
Figure 3. Marginal distributions of generated and real queue sizes at the top two book levels: bid (left) and ask (right), level 1 (top row) and level 2 (bottom row). Four density plots compare LOBGrad and baseline models with held-out data. LOBGrad closely follows the main peaks and overall shapes of the empirical densities.
Target
50% coverage
90% coverage
Mean 90% width
Returns
0.630
0.844
8.684
Queues ( 2d=10 )
0.442
0.876
6.213
Best-level volume
0.483
0.892
11.034
OB imbalance
0.479
0.900
1.243
Table 2. Calibration summary on BTC/USDT test windows using M=500 rollouts per window and a 20 -step forecast horizon. We report empirical coverages for nominal 50% and 90% central intervals, and the mean width of the 90% interval.
Figure 4. Stylized facts of 5-second BTC/USDT returns: real held-out data (black) versus LOBGrad samples (blue). Return distribution (left), the ACF of returns (middle), and the ACF of absolute returns (right). Both return distributions peak sharply at zero. Return autocorrelation is positive at the first lag and negative at later displayed lags. Absolute-return autocorrelation is negative across the displayed lags.
Strategy
Mean IS
CVaR95(IS)
j=−1 (Market)
5.89
8.45
j=0
1.75
38.90
j=1
0.75
43.42
j=2
0.56
47.86
j=3
2.93
51.51
CGAN-optimized
0.19
47.35
Table 3. Limit-order execution benchmark across 500 test windows, averaged over 5 seeds. IS per share in USDT (lower is better). Bold marks the best non-oracle value in each column.
A large language model (LLM) trained on synthetic limit order book (LOB) data achieves near perfect scores in generating valid sequences of LOB events. However, the LLM's implicit world model fails to learn the state of the LOB. This deficiency leads to biased estimates and spurious predictability in using the LLM to forecast future LOB events. Our analysis uses novel tests of an LLM's world model, extending prior work from deterministic settings to the stochastic dynamics needed for the LOB.
Modeling the dynamics of financial Limit Order Books (LOB) at the message level is challenging due to irregular event timing, rapid regime shifts, and the reactions of high-frequency traders to visible order flow. Previous LOB models require cumbersome data representations and lack adaptability outside their original tasks, leading us to introduce LOBERT, a general-purpose encoder-only foundation model for LOB data suitable for downstream fine-tuning. LOBERT adapts the original BERT architecture for LOB data by using a novel tokenization scheme that treats complete multi-dimensional messages as single tokens while retaining continuous representations of price, volume, and time. With these methods, LOBERT achieves leading performance in tasks such as predicting mid-price movements and next messages, while reducing the required context length compared to previous methods.
Eljas Linna, Kestutis Baltakys, Alexandros Iosifidis +1
Forecasting short-horizon mid-price movements from limit order book (LOB) data is central to algorithmic trading, yet most deep LOB forecasters are point predictors: they output a direction or a displacement, but never indicate which of their forecasts can be trusted. We introduce UQ-LOB, a lightweight, encoder-agnostic uncertainty quantification module that attaches to any pretrained LOB encoder and, in the spirit of attentive neural processes, conditions each forecast on a context set of recently completed windows whose outcomes are already realised. The UQ-regression variant outputs a calibrated Gaussian over the future tick displacement, while the UQ-classification variant outputs a categorical distribution over down/up/stationary. Both expose a scalar confidence (predicted signal-to-noise ratio or class probability) that supports selective prediction. On 5.2 billion LOB events across seven cryptocurrency assets and horizons of 5, 10 and 15 seconds, UQ-regression attains near-nominal 68% interval coverage, and restricting to the most confident 10% of predictions raises directional macro F1 by 0.11-0.15 for UQ-regression and 0.05-0.11 for UQ-classification, at every horizon. On large, economically meaningful moves, the tightest confidence tier reaches a directional F1 of 0.88 (down) and 0.83 (up) at the 5-second horizon.
Derrick Gilchrist Edward Manoharan, Eljas Linna, Kestutis Baltakys +2
Data Science Research Centre Tampere University Tampere, Finland