cs.AIAug 24, 2026
SaveDo LLMs Understand Limit Order Book Dynamics?
Organizations: Columbia Business School
Abstract
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.
Figures & tables
Figure 1: Representation of a limit order book
| Model | Valid | SP | Extra | Compress. |
| Traversal | Rate | Steps | Score | |
| SP | 99.4% | 99.4% (100%) | 0.0 (0.0) | 61.1% |
| RW-S | 98.5% | 90.6% (10.4%) | 0.1 (16.3) | 42.0% |
| RW-L | 95.5% | 83.7% (4.2%) | 0.3 (43.8) | 48.0% |
| Baseline | 0.7% | 0.7% (4.2%) | 0.0 (43.8) | 99.9% |
Table 1: Diagnostic results
| Step | Event | Resulting State |
| 0 | Start | |
| 1 | ask_p3_2 | |
| 2 | bid_p2_1 | |
| 3 | ask_p2_1 | |
| 4 | w_ask_p1_2 | |
| 5 | ask_p3_1 |
Table 2: Prefix used in kernel-level TV
| Action Token | Next State | True Prob. | LLM’s Prob. |
| w_ask_p1_2 | 0.050 | 0.245 | |
| w_ask_p1_1 | 0.050 | 0.241 | |
| ask_p2_2 | 0.050 | 0.190 | |
| ask_p1_1 | 0.050 | 0.132 | |
| ask_p1_2 | 0.050 | 0.106 |
Table 3: Next-event probabilities in kernel-level TV
Figure 2: Illustration of history- and kernel-level TV
| Model | TV Type | |||
| SP | Kernel-level | 0.46 | 0.72 | 0.84 |
| History-level | 0.33 | 0.51 | 0.59 | |
| RW-S | Kernel-level | 0.11 | 0.19 | 0.28 |
| History-level | 0.07 | 0.14 | 0.23 | |
| RW-L | Kernel-level | 0.08 | 0.15 | 0.21 |
| History-level | 0.06 | 0.11 | 0.16 |
Table 4: Multi-step forecast TV distances
| Event Token | Next State | ||
| bid_p2_2 | 0.278 | 0.002 | |
| ask_p3_2 | 0.056 | 0.313 | |
| m_ask_2 | 0.047 | 0.233 | |
| w_bid_p3_2 | 0.028 | 0.199 | |
| ask_p2_2 | 0.053 | 0.208 | |
| ask_p2_1 | 0.128 | 0.002 |
Table 5: Next-event probabilities in history-level TV
Figure 3: Regression results for RW-S
Figure 4: Regression results for RW-L
| LOB Setting | # of States | Model | Valid Traversal | SP Rate | Compress. Score | Kernel-level TV | History-level TV | ||||
| 8281 | SP | 99.4% | 99.4% (100%) | 47.0% | 0.64 | 0.86 | 0.93 | 0.34 | 0.45 | 0.57 | |
| RW-S | 97.8% | 88.6% (11.5%) | 29.0% | 0.14 | 0.22 | 0.35 | 0.10 | 0.13 | 0.26 | ||
| RW-L | 94.1% | 81.2% (4.0%) | 34.0% | 0.13 | 0.19 | 0.32 | 0.08 | 0.14 | 0.18 | ||
| Baseline | 0.3% | 0.3% (4.0%) | 99.8% | 0.00 | 0.02 | 0.01 | 0.01 | 0.00 | 0.01 | ||
| 41553 | SP | 97.1% | 96.8% (100%) | 53.6% | 0.61 | 0.79 | 0.92 | 0.39 | 0.56 | 0.62 | |
Table 6: Diagnostic and multi-step forecast results for larger LOB settings
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Prefix | Start State | Event Sequence |
| ask_p1_2 , w_bid_p3_1 , ask_p2_2 , ask_p1_1 , bid_p3_2 , bid_p2_1 , m_ask_1 , bid_p3_1 , w_bid_p3_2 , ask_p2_1 , ask_p3_2 , bid_p1_1 , bid_p3_2 , m_ask_1 , m_bid_2 , m_bid_1 , m_bid_2 , bid_p1_1 , ask_p1_2 , bid_p3_2 | ||
| bid_p3_2 , bid_p2_1 , bid_p2_2 , m_bid_2 , ask_p1_1 , w_bid_p3_1 , w_bid_p3_1 , ask_p1_2 , w_bid_p3_2 , ask_p3_1 , m_ask_2 , bid_p3_1 , ask_p3_1 , w_ask_p1_1 , ask_p2_2 , ask_p1_1 , m_ask_1 , ask_p1_1 , m_bid_2 , bid_p3_2 |
Table 7: Two prefixes in history-level TV
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.
Probabilistic Limit Order Book Forecasting with Conditional Diffusion Models
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.
Understanding the Inner Workings of a State-Space Foundation Model for Limit Order Books
Autoregressive foundation models offer state-of-the-art capabilities to simulate the market by generating the message flow of limit order books (LOBs). Yet, without understanding their inner workings, research directions are hard to narrow and practical use in real-world trading environments remains uncertain. This study therefore asks what these models actually learn about market microstructure. We find that, similarly to games where sequence models build an internal representation of the board, an 8.2M-parameter Mamba-3 state-space model trained autoregressively on the tokenized message stream of eight large-cap US equities learns an internal representation of the market and its dynamics. In particular, order-flow imbalance, a central driver of short-horizon price moves, is decodable at , far above controls and baselines. This representation extends to unseen stocks, suggesting that these models learn general representations rather than ticker-specific patterns. The model also generalizes across metrics beyond order-flow imbalance: results hold across traded volume and volatility. Additionally, the representation is causally steerable: pushing the state along a feature's axis shifts the model's next-message beliefs as that feature implies, monotonically in dose, consistent with the emergence of a world model.