StochLOB: Heavy-Tailed Score Matching for Robust Limit Order Book Trend Prediction
Authors: Arshia Abolghasemi, Seyed Reza Tavakoli, Parsa Naderi, Nazanin Mirzaei, Behrad Jahani, Saba Yousefzadeh, Tahereh Javaheri, Mohammad Hosein Rohban, Gholamali Aminian, Ali Habibnia
Organizations: Dataism Laboratory for Quantitative Finance · Sharif University of Technology · Amirkabir University of Technology · Boston University · The Alan Turing Institute · Virginia Tech
Score-based diffusion methods usually perturb data with Brownian Gaussian noise, corresponding to a light-tailed forward stochastic differential equation (SDE). For market time series this SDE can be a poor abstraction: limit order book (LOB) order flow is heavy-tailed, bursty, and occasionally jump-like. We study STOCHLOB, a training-only score-matching framework that changes the forward diffusion corruption law while leaving the deployed predictor deterministic. Instead of Brownian-only Gaussian corruption, the noising process uses two non-Gaussian SDE-inspired alternatives: jump-Lévy noise through a compound-Poisson variance mixture, and clipped α-stable noise through a positive-stable Gaussian scale mixture. These corruptions inject finite jumps and heavy-tailed residuals into training without requiring reverse-time diffusion sampling at inference. The resulting score target has a useful interpretation: its radial factor ht(r) is the posterior expected corruption precision, so large residuals are weighted according to the latent corruption scale that most plausibly generated them. On chronologically held-out Coinbase LOB data, the proposed variants remain competitive on uncorrupted BTC and altcoin test horizons and improve several realized tail-window stress diagnostics. An exploratory Feishu A-share transfer study further tests whether the probability outputs remain usable under transaction costs and trading-rule constraints. Code and configuration files are available at https://github.com/ArshiAbolghasemi/Penny.
Figures & tables
Figure 1: Main stress result on chronologically held-out Coinbase BTC windows at horizon k=100 ( 31,842 test windows). Columns sort windows by realized stress, realized variance, and variance-controlled jump residual, all computed from one-step increments of the level-averaged feature stream. Decile 10 is the most turbulent. The top row reports macro-F1 by decile; the bottom row reports paired differences against the same StochLOB trunk trained with cross-entropy only. Shaded bands are 95% circular block-bootstrap confidence intervals.
Figure 2: StochLOB workflow. The classifier pools the unperturbed sequence representation for three trend logits. The training-only score decoder receives the noisy T×F window, timestep embedding, and per-timestep trunk context, and predicts a T×F score field. At inference, the corruption sampler and score decoder are disabled.
k=10
k=20
Model
Acc
F1
Acc
F1
Logistic regression
0.6607 ± 0.0007
0.6591 ± 0.0007
0.6061 ± 0.0049
0.6089 ± 0.0048
Linear VAR
0.6735 ± 0.0009
0.6710 ± 0.0008
0.6205 ± 0.0017
0.6231 ± 0.0015
DeepLOB (CNN-LSTM)
0.6338 ± 0.0167
0.6284 ± 0.0142
0.5591 ± 0.0128
0.5535 ± 0.0079
BiN-CTABL
0.6679 ± 0.0045
0.6659 ± 0.0041
0.6097 ± 0.0027
0.6110 ± 0.0024
TLOB (Transformer)
0.6783 ± 0.0068
0.6754 ± 0.0054
0.6127 ± 0.0076
0.6142 ± 0.0068
Table 1: BTC OFI trend prediction on chronologically held-out windows. Accuracy (Acc) and macro-F1 are reported as mean ± std over five seeds ( 13,21,42,84,168 ). Bold marks the best mean result in each horizon/metric column; underlining marks the second best.
Regime
Best StochLOB
k
StochLOB F1
Gaussian F1
Best supervised
Gain vs. Gaussian
Gain vs. supervised
Stress
alpha-stable
10
0.712
0.703
TLOB 0.708
+0.008
+0.004
Stress
alpha-stable
100
0.647
0.604
LogReg 0.614
+0.043
+0.034
High variance
jump-Poisson
20
0.686
0.680
LinVAR 0.651
+0.006
+0.034
High variance
alpha-stable
50
0.658
0.603
LinVAR 0.645
+0.055
+0.014
High variance
alpha-stable
100
0.659
0.613
LinVAR 0.628
+0.046
+0.030
Jump residual
alpha-stable
100
0.637
0.567
LinVAR 0.597
+0.070
+0.039
Table 2: Compact summary of extreme-window macro-F1 comparisons on held-out BTC regimes. Each row reports the best heavy-tailed StochLOB variant in that regime and horizon, the matched Gaussian StochLOB baseline, and the strongest supervised comparator in the same row. Best F1 in each row is shown in bold. Gains are absolute macro-F1 differences; Appendix Table 9 reports the full regime-by-horizon grid.
Model
CAGR(%)
Sharpe
Max DD(%)
Return(%)
Vol.(%)
Calmar
Win(%)
Avg. Hold.
LogReg
28.03
0.69
− 28.41
28.03
46.28
0.99
47.72
167.3
LinVAR
− 38.66
− 0.71
− 49.75
− 38.66
52.35
− 0.78
43.98
11.3
DeepLOB
31.72
0.68
− 36.49
31.72
82.61
0.87
48.55
50.1
TLOB
17.56
0.55
− 29.04
17.56
46.28
0.60
53.11
961.5
StochLOB (jump-Poisson)
38.78
1.04
− 23.20
38.78
36.64
1.67
54.36
1861.0
Table 3: Feishu out-of-sample constrained portfolio metrics. Bold denotes the best result in each column across the shown active models. Other evaluated models are omitted because they mostly predict the flat class and therefore generate little or no trading activity.
Figure 3: Exploratory Feishu portfolio-management transfer result. Cumulative returns are shown for the constrained portfolio rule using StochLOB variants, supervised baselines, and the passive equal-weight reference.
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
Symbol
Snapshots
Raw start (UTC)
Raw end (UTC)
Test start (UTC)
BNB
213,679
2026-06-18 23:42:10
2026-07-13 23:10:30
2026-07-10 05:24:30
BTC
213,335
2026-06-18 23:42:10
2026-07-13 23:10:40
2026-07-10 05:24:10
ETH
213,593
2026-06-18 23:42:10
2026-07-13 23:10:30
2026-07-10 05:28:10
USDT
213,448
2026-06-18 23:42:10
2026-07-13 23:10:40
2026-07-10 05:27:10
XRP
213,752
2026-06-18 23:42:10
2026-07-13 23:10:30
2026-07-10 05:27:40
Appendix
Table 4: Coinbase crawl coverage and chronological test-start timestamps computed from the normalized local parquet files. Test start denotes the raw snapshot index at the 85% chronological split boundary before applying horizon-specific look-back and future-label validity constraints.
Block
Features
Microstructure
spread/mid; log total bid-depth over total ask-depth; one-step log mid-return
Trade flow
log buy volume; log sell volume; signed trade imbalance; log trade count; VWAP deviation from mid
Table 5: The 11 auxiliary features appended to the 20 OFI levels. Repeated activity proxies are intentional substitutes for unavailable intra-bin quote-update counts in the resampled exchange feed.
k
Real time
αlab
Train
Val.
Test
10
100 s
0.000093
147,218
31,831
31,932
20
200 s
0.000189
147,208
31,821
31,922
50
500 s
0.000362
147,178
31,791
31,892
100
1000 s
0.000543
147,087
31,741
31,842
Appendix
Table 6: BTC split sizes and train-calibrated label thresholds. Other crypto symbols use the same protocol with symbol-specific thresholds.
Symbol
BTC
ETH
BNB
XRP
USDT
α used for α -stable corruption
1.687
1.731
1.900
1.615
1.685
Appendix
Table 7: Coinbase alpha-stable corruption indices from train-only OFI tail calibration.
Figure 4: Heavy-tail distribution-fit diagnostics. The dashed normal reference is not the leading fit: it ranks 11th for BTC increments and 31st for the first principal component of the feature tensor.
Figure 5: Log-log complementary CDF of pooled absolute crypto OFI, normalized by symbol median. The top 5% Hill/Pareto fit gives α^=1.62 , supporting heavy-tailed OFI corruption.
Table 9: Complete BTC extreme-window macro-F1 grid underlying Table 2 . Each row uses the top 10% held-out windows for the named regime and horizon. The table reports the better of the two heavy-tailed StochLOB variants, the matched Gaussian StochLOB baseline, and the best supervised comparator in the same tail subset. Best F1 in each row is shown in bold. Rows with negative gains are retained rather than filtered out.
k=10
k=20
k=50
k=100
Symbol
Model
Acc
F1
Acc
F1
Acc
F1
Acc
F1
ETH
LogReg
0.6669
0.6653
0.6304
0.6334
0.5975
0.5999
0.5573
0.5614
ETH
LinVAR
0.6913
0.6876
0.6518
0.6550
0.6033
0.6074
0.5686
0.5734
ETH
DeepLOB
0.6615
0.6543
0.5752
0.5754
0.5471
0.5464
0.4793
0.4829
ETH
BiN-CTABL
0.6857
0.6820
0.6467
0.6484
0.5771
0.5792
0.5464
0.5501
ETH
TLOB
0.6840
0.6793
0.6389
0.6412
0.5606
0.5624
0.5826
0.5782
Appendix
Table 10: Additional crypto held-out test Accuracy (Acc) and Macro-F1 (F1) under the same model scope as the main table. Bold marks the best value within each symbol and horizon; underlining marks the second-best value.
StochLOB (jump-Poisson)
StochLOB (alpha-stable)
Class ( k=10 )
P
R
F1
P
R
F1
down
0.7023
0.6188
0.6579
0.7516
0.6052
0.6705
stationary
0.6685
0.7389
0.7019
0.6646
0.7655
0.7115
up
0.6805
0.6679
0.6741
0.6805
0.6794
0.6800
Appendix
Table 11: BTC per-class precision (P), recall (R), and F1 at k=10 .
symmetric spectrum
skewed spectrum
CV(λ)
D2
exp(D2)
D2
exp(D2)
exp(D2/2) (sym.)
0.01
0.09
1.1
0.09
1.1
1.05
0.05
2.32
1.0×101
2.37
1.1×101
3.2
0.10
9.26
1.1×104
10.0
2.2×104
1.0×102
0.20
36.6
7.9×1015
47.1
2.9×1020
8.9×107
Appendix
Table 12: Angular penalty at d=1860 and αν=1.62 . The symmetric spectrum places half the coordinates at 1+CV and half at 1−CV ; the skewed spectrum places the excess on 5% of the coordinates. The angular factor multiplies the coverage constant, and its square root multiplies the transfer bound.
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.
Junyu Chen, Franklin Liu, Moshu Xu +1
Department of Statistics and Data Science, Tsinghua University, Beijing, China
Limit order book (LOB) simulators are most useful to practitioners when they combine realistic market dynamics, computationally efficient sampling, controllable scenario generation, and the ability to generalize beyond the instruments seen during training---properties that existing agent-based and deep generative simulators provide only partially. We present FlowLOB, a conditional flow-matching generator of LOB trajectories, trained on multiple Hong Kong Exchange (HKEX) symbols at three sampling frequencies (0.1s, 1s, 10s) in tick-relative representation that transfers to unseen instruments. Because flow and diffusion models admit a common formulation, we train both with identical data, architecture, and budget, and sample both through the same fixed-step ODE solvers, yielding a controlled comparison of sampling efficiency and fidelity. Flow matching attains its best quality with only 10 ODE-solver steps, whereas diffusion needs many more function evaluations to approach the same fidelity. At this efficient operating point, FlowLOB improves realism over baselines, two learned and two agent-based models, in most distributional metrics at the two finer sampling frequencies. We evaluate counterfactual controllability with a distributional test that asks whether changing a scenario condition moves the generated statistic toward the corresponding real tail regime; FlowLOB satisfies this criterion in most tested settings. Both realism and control effects transfer zero-shot on a held-out symbol. We additionally conduct ablation studies on the network architecture and the learning rate.
Zhuohan Wang, Andreea Bacalum, Ollie Olby +2
Joint affiliation with King’s College London · Simudyne United Kingdom · King’s College London United Kingdom
Generative models of limit orderbook (LOB) data have advanced rapidly, but their evaluation often focuses on stylised facts and selected market statistics. These measures provide useful diagnostics but may not capture the joint temporal and cross-level structure of order-book trajectories. We introduce LOB-ID, an embedding-based framework that adapts the Fréchet Inception Distance (FID) and Monge Inception Distance (MIND) to LOB data. To obtain domain-specific embeddings, we train the DeepLOB architecture on four months of Level-2 order-book data for five equities. We show that LOB-ID is stable across time, instruments, and embedding checkpoints, and rises monotonically under controlled distortions. We then construct a moment-matching attack against FID and a deep-book perturbation that evades statistic-based evaluation. MIND remains substantially more sensitive to both distortions. Finally, we score five generative LOB models, spanning stochastic baselines and deep learning approaches, and find that LOB-ID ranks them in line with the joint temporal and cross-level structure each captures by construction.