M3: A State-Event Generative Foundation Model for Market Microstructure Dynamics
Listen
Radio episode about this paper
Transcript
Introduction to the show: ident: Quantitative Finance. The day in quantitative finance: models of markets, risk and prices.
Ruth: We're looking at the paper: "M3: A State-Event Generative Foundation Model for Market Microstructure Dynamics".
Title and authors: Ruth: So we're looking at the paper M3: A State-Event Generative Foundation Model for Market Microstructure Dynamics. It’s about building a model that can simulate how order flow and liquidity actually change together in financial markets.
Warren: Yeah, it moves beyond just looking at orders or just looking at the book separately; it tries to capture the dynamic interaction between them as they evolve.
Iris: I think what's interesting is that existing models often treat order events and limit order book states like they're separate things being conditioned on each other, but this one aims to model both coupled dynamics directly.
Ruth: Exactly. The core idea here is to create a state-event generative foundation model that generates future trajectories for the order flow while accounting for that evolving interaction with the liquidity.
Warren: It suggests a scalable way to do counterfactual simulations at the microstructure level, which is pretty ambitious considering how messy these markets are in real life.
Iris: The architecture involves two main parts: first, a vector quantized order tokenizer that turns continuous order events into discrete tokens and back again, and second, an autoregressive model that uses a limit order book encoder to condition its next-token prediction.
Ruth: That tokenization step is crucial because it takes the raw data—the continuous events and those structured limit order book snapshots—and maps them into a unified representation.
Warren: And then the whole system uses that representation within an autoregressive Transformer setup, where it predicts subsequent order tokens based on the current state of the limit order book.
Iris: The training signal itself is built using a composite objective function that has four parts: continuous reconstruction, categorical reconstruction, quantization constraints, and financial heuristics.
Ruth: That's where you get some realism in there because one of those components enforces micro-structural realism by making sure the reconstructed prices align precisely with valid, discrete market tick intervals.
Warren: So it’s not just about predicting a sequence; it’s about ensuring that the sequences generated actually make sense in terms of how trades happen on an exchange.
Iris: And empirically, they show strong and scalable order-flow modeling ability through their evaluations on large-scale real stock market data.
Ruth: They demonstrate this by reproducing key market properties, showing that generated trajectories recover meaningful impact patterns, like the square-root law.
Warren: That’s a big deal because those specific impact patterns are what traders actually care about when they're looking at execution costs and slippage.
Iris: Furthermore, it supports counterfactual analysis for things like liquidity stress testing and estimating meta-order impact.
Ruth: The validation shows that M3 achieves the smallest Wasserstein distance across all four return horizons compared to models like ZeroIntelligence or Compound Hawkes Process.
Warren: That means when you compare the generated market paths to what actually happened, it’s doing a better job matching the stylized facts of those markets.
Iris: They also found that mid-price prediction improves when you condition on the limit order book, and volatility prediction shows that realized volatility increases monotonically with the predicted quintile.
Ruth: That's informative because it means the model isn't just guessing a number; it’s producing forecasts where higher predicted flow corresponds to higher expected risk.
Warren: And they successfully estimated market impact scaling under closed-loop TWAP interventions, producing what they describe as concave square-root-like impact scaling.
Iris: For what this means for the world, M3 introduces a world model for order-level financial market simulation by treating everything as discrete tokens.
Ruth: It allows the model to generate multiple future market trajectories from a single starting point, which opens up new avenues for simulation-based analysis and risk evaluation.
Warren: It suggests that order-level generative world models can serve as a foundation for strategy development and stress testing in finance.
Iris: To wrap up, M3’s design allows it to generate multiple future market trajectories by representing heterogeneous order events and LOB states as discrete tokens, which is a big step in modeling coupled dynamics.
Ruth: It moves the field toward simulation-based analysis where you can test scenarios that might be too complex or impossible to observe directly in real markets.
Warren: So while it’s a powerful tool for simulation, we still have to watch how it scales and what the real cost is when you try to run these kinds of deep simulations across different market conditions.
Iris: That's definitely something future work will need to address, especially regarding the computational demands of training such a large foundation model.
Ruth: Exactly. We’ll see if this architecture can be adapted for more complex scenarios beyond just order flow dynamics in the coming time.
The paper's summary: Ruth: So, M3 is essentially this big model that learns to generate future order flow by treating every order event and every part of the limit order book as a discrete piece of data, almost like tokens in a language.
Warren: Right, it’s taking these messy continuous events—like trades happening at any time—and those structured snapshots of the limit order book, and turning them into something the AI can actually read and predict from.
Ruth: It’s trying to build this world model for how markets behave at the very granular level, not just looking at big averages or trends.
Warren: And what's cool is that it’s designed to be a foundation model, meaning it can generate many different future market scenarios based on where you start.
Iris: The training process itself is quite clever because they use four different ways of training the model, and one of those is making sure the prices generated by the model actually make sense according to real market rules.
Ruth: That's what keeps it grounded, because it’s not just generating random numbers; it has to adhere to these constraints during training.
Warren: And when they test it, they find that this approach actually manages to reproduce some of those famous market facts we talk about—like the square-root law for impact—when you compare its generated paths against what actually happened in the real stock markets.
Ruth: So, the implication here is that we’re moving towards a way to simulate market dynamics that respects the underlying mechanics of how liquidity and orders interact, which is something traditional models often struggle with.
Warren: It opens up possibilities for serious counterfactual analysis—you could stress-test how much a sudden flood of buy or sell orders would affect the price, or estimate the impact of a big trade before it even happens.
Ruth: That’s what I’m thinking—moving beyond just seeing what happened to actively testing 'what if' scenarios in a more realistic simulation environment.
Warren: And because it works on these large datasets, they claim this isn't just a toy model; it shows scalable order flow modeling ability when you look at the empirical results.
Iris: I’m still looking into how robust this is; we need to see if those specific patterns hold up across different types of assets or market regimes before we call it a solid foundation.
Ruth: Exactly, that's the next step—checking if this model works just as well when you introduce a new type of order flow pressure or look at a totally different stock market.
Warren: So, M3 gives us this powerful simulation tool that captures the complexity of order flow and liquidity interaction with a very structured way to generate those future paths.
Iris: It's definitely a heavy lift computationally, so we’ll need to keep an eye on how much memory and processing power it demands when you try to run these simulations at scale.
The paper's improvements: Tom: So, we’re looking at how they’re trying to fix M3, which is this foundation model for market microstructure dynamics by making some specific tweaks to its training and its structure.
Ruth: Basically, they want to make sure the model isn't just good at generating paths but that it actually understands the underlying financial mechanics better.
Warren: They’re focusing on refining those training objectives, which means adjusting how the AI learns what a "valid" market event or price move looks like.
Iris: I think one big improvement they suggest is making sure the model handles those complex dependencies between order events and limit order book states even more tightly.
Ruth: That’s right; they’re trying to boost that unified representation, the tokenization part, so it captures the interaction between orders and liquidity more accurately.
Warren: And then there are adjustments in how they handle those constraints during training—basically fine-tuning those four parts of their objective function we talked about earlier.
Iris: They're also looking at improving the quantization process, trying to make sure that when the AI translates continuous data into discrete tokens, it’s doing it in a way that preserves more of the true market signal.
Ruth: That’s crucial because if the tokenization isn't good, then all those generated trajectories will be fundamentally flawed from the start.
Warren: And they also seem to be exploring ways to improve how the model predicts things like volatility, trying to make that forecast even more reliable than just using predicted order flow alone.
Iris: They’re also looking at scaling the architecture itself, seeing if this design can handle much larger market data and sequence lengths without completely breaking down its performance.
Ruth: That leads me to think about where this goes next—if we get these improvements, what kind of things could we actually test with them?
Warren: If they nail these refinements, the real payoff is in making those counterfactual simulations much more powerful for risk management and strategy development.
Conclusion: Tom: So we’re wrapping up on M3: A State-Event Generative Foundation Model for Market Microstructure Dynamics, which essentially boils down to this AI learning to simulate future order flow by treating every order event and limit order book state as a discrete token.
Ruth: Right, the big picture is that this allows us to build a world model for market behavior at the level of individual orders and liquidity interactions.
Warren: It gives us a way to run counterfactual simulations, which is huge because we can test scenarios like liquidity stress or see what happens when meta-orders are executed under different pressure.
Iris: From an econometric view, it’s interesting because they’re not just guessing paths; they’re generating sequences that reproduce known market patterns and stylized facts, which is a strong sign of identification.
Ruth: They showed that the generated paths recover impact patterns like the square-root law, which means we are seeing something that looks structurally similar to what happens in real markets.
Warren: And they also provided some solid predictions for things like future volatility, showing how realized variance increases based on the predicted order flow quintile.
Iris: I just want to point out though, the authors did mention that this model’s main limitation is that it stops working when you try to predict very long-term market dynamics outside of those immediate order flow interactions.
Ruth: True, it’s a world model for simulation, not a perfect predictor of the entire stock market trajectory over decades.
Warren: But for tactical trading and risk evaluation right now, having a tool that can generate multiple realistic scenarios based on LOB states is pretty useful.
Iris: It changes how we test strategies because instead of just running one simulation, you can run many different order flow experiments to see which ones survive stress testing.
Ruth: So, M3 gives us this concrete foundation for simulation-based analysis and risk evaluation in finance.
Warren: It’s a powerful tool for strategy development, provided we keep an eye on the computational cost of running these kinds of deep simulations across different market conditions.
Academy of Mathematics and Systems Science, Chinese Academy of Sciences · Zhongguancun Academy · University of Chinese Academy of Sciences · Zhongguancun Institute of Artificial Intelligence
q-fin.CP, cs.LG
Submitted: 2026-07-29
Updated: 2026-11-30
License: http://creativecommons.org/licenses/by/4.0/
Importance score: 88/100
The gist: M3 (Market Microstructure Model), a state-event generative foundation model for market microstructure dynamics…
Key concepts
- Order Events and LOB Snapshots
- These are the raw data inputs: individual trades or orders (order events) and snapshots of the limit order book (LOB). M3 converts these varied, continuous inputs into a unified, discrete token representation. This allows the model to understand how different market actions interact with existing liquidity.
- Token-Based Representation
- The model transforms heterogeneous data—like continuous prices or event types—into a sequence of discrete tokens. A specialized vector-quantized tokenizer handles this mapping. This structure enables the autoregressive Transformer to process and predict the next state in market dynamics by sequentially decoding and generating these tokens.
- Counterfactual Simulation
- This capability allows M3 to test 'what-if' scenarios without real-world execution. For example, it can simulate liquidity stress testing by applying specific order flow pressures (like buy stress) to see how the market reacts, or estimate the impact of a Trade Weighted Average Price (TWAP) intervention.
Terminology
Summary
M3 (Market Microstructure Model), a state-event generative foundation model for market microstructure dynamics, learns to generate future order-flow trajectories while accounting for the evolving interaction between order events and limit order book liquidity. p. 0 We propose the M3
(Market Microstructure Model), a state-event generative foundation model for market microstructure dynamics. M3 learns
to generate future order-flow trajectories, while accounting
for the evolving interaction between order events and limitorder-book liquidity. Trained on large-scale order-level real
stock market data, M3 exhibits predictable scaling behavior, reproduces key market stylized facts, and enables practical simulation-based applications including forecasting, stress
testing, and market-impact analysis. These results suggest a
scalable foundation-model paradigm for counterfactual market simulation at the microstructure level.Where the paper says it
Where the paper says it
Model Architecture and Tokenization
The model transforms heterogeneous order events and structured LOB snapshots into a unified token-based representation and models their dependencies with an autoregressive Transformer.<ref:2608.19227#pg4>. The architecture consists of two main components: a vector-quantized order tokenizer and an auto-regressive model with an LOB encoder. p. 3 main components: a vector-quantized order tokenizer and
an auto-regressive model with an LOB encoder. The tokenizer maps continuous order events into discrete tokens and
decodes generated tokens back into order events. main components: a vector-quantized order tokenizer and
an auto-regressive model with an LOB encoder. The tokenizer maps continuous order events into discrete tokens and
decodes generated tokens back into order events.Where the paper says it
Where the paper says it
How the training signal is built
The model is trained on large-scale real stock market data and empirically studies its scaling behavior.<ref:2608.19227#pg5>. The composite objective function for the tokenizer involves a weighted sum of four components: Continuous Reconstruction (Lrecon cont), Categorical Reconstruction (Lrecon categorical), Quantization Constraints (Lvq), and Financial Heuristics (Lfinancial). p. 9 Tokenizer Training Objective
Composite Objective Function. To ensure both microstructural fidelity and macroscopic statistical consistency in
the reconstructed data, the model is optimized using a composite loss function, Ltotal, defined as a weighted sum of four
components:
Ltotal = Lrecon_cont+Lrecon_categorical+Lvq+λtickLfinancial (5)
• Continuous Reconstruction (Lrecon_cont): A weighted
Mean Squared Error (MSE) applied to continuous features. • Financial Heuristics (Lfinancial): A domain-specific
Open Tick Loss (λtick = 0. 001) designed to enforce
micro-structural realism by ensuring that reconstructed
prices precisely align with valid, discrete market tick intervals.Where the paper says it
Where the paper says it
Where the gains come from
M3 demonstrates strong and scalable order-flow modeling ability through empirical evaluation.<ref:2608.19227#pg5>. The model reproduces key market properties by showing that generated trajectories recover meaningful impact patterns such as the square-root law. p. 1 We validate M3 through a range of market simulation tasks, including stylized-facts reproduction, liquidity stress testing, and market-impact analysis. The results show that
M3 produces realistic market dynamics, recovers meaningful impact patterns such as the square-root law, and
supports counterfactual evaluation under different orderflow interventions. Empirically, M3 demonstrates strong and scalable orderflow modeling ability. Through empirical evaluation, we
show that the generated trajectories reproduce key market
properties, preserve short-horizon predictive information,
and support counterfactual analysis such as liquidity stress
testing and meta-order impact estimation.Where the paper says it
Where the paper says it
Empirical Validation and Prediction
The model's performance is validated through several downstream tasks.<ref:2608.19227#pg5>. Stylized facts are reproduced where M3 achieves the smallest Wasserstein distance at all four return horizons compared to ZeroIntelligence (ZI) and Compound Hawkes Process (Hawkes) models. p. 5 Table 1 compares M3 against two baselines: a ZeroIntelligence agent (ZI) and a Compound Hawkes Process
(Hawkes). Distributional fidelity is evaluated using the
Kolmogorov–Smirnov statistic, Wasserstein distance, and return kurtosis across multiple time scales. For each prompt, we derive an ensemble
return forecast from the generated mid-price paths and rank
prompts into predicted Down, Flat, and Up terciles. Figure 6
shows that the tail predictions are directionally informative
and that conditioning on LOB consistently improves accuracy over both the no-LOB baseline and DeepLOB. For each prompt, we estimate future realized
variance by averaging across Monte Carlo trajectories and
group the prompts into forecast quintiles. As shown in Figure 7, realized volatility increases monotonically with the
predicted quintile, indicating that the model distinguishes Both estimates are close to the square-root benchmark exponent of
1/2, indicating that the simulator produces market-impact
scaling under closed-loop TWAP interventions. Conclusion
We introduced M3 (Market Microstructure Model), a market
microstructure world model for order-level financial market
simulation.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
What-if Analysis
Directional stress testing isolates the mechanical response of the order book to one-sided order-flow pressure.<ref:2608.19227#pg15>. This testing shows that buy stress raises the mid-price relative to the baseline, while sell stress lowers it, with displacement increasing sublinearly over the tested range. p. 6 Figure 8a shows that buy
stress raises the mid-price relative to the baseline, whereas
sell stress lowers it. The displacement increases with intervention strength but is sublinear over the tested range, qualitatively consistent with concave market impact (Bouchaud,
Farmer, and Lillo 2009; Bucci et al. Left: directional buy- and sell-side order-flow pressure
produces economically consistent mid-price responses. Right: TWAP meta-order simulations exhibit concave square-root-like
impact scaling with respect to executed quantity. Left: directional buy- and sell-side order-flow pressure
produces economically consistent mid-price responses. Right: TWAP meta-order simulations exhibit concave square-root-like
impact scaling with respect to executed quantity.Where the paper says it
Where the paper says it
Where the paper says it
Conclusion
M3 introduces a market microstructure world model for order-level financial market simulation by representing heterogeneous order events and LOB states as discrete tokens.<ref:2608.19227#pg15>. This design allows the model to generate multiple future market trajectories. p. 6 M3 represents heterogeneous order events and
LOB states as discrete tokens, explicitly capturing the interaction between order events and market state, and then generated orders are recursively executed through the matching
engine. This design allows the model to generate multiple
future market trajectories. M3 represents heterogeneous order events and
LOB states as discrete tokens, explicitly capturing the interaction between order events and market state, and then generated orders are recursively executed through the matching
engine. This design allows the model to generate multiple
future market trajectories. Through empirical evaluation, we
show that the generated trajectories reproduce key market
properties, preserve short-horizon predictive information,
and support counterfactual analysis such as liquidity stress
testing and meta-order impact estimation. These results suggest that order-level generative world models can provide
a useful foundation for simulation-based market analysis,
risk evaluation, and strategy development. Through empirical evaluation, we
show that the generated trajectories reproduce key market
properties, preserve short-horizon predictive information,
and support counterfactual analysis such as liquidity stress
testing and meta-order impact estimation. These results suggest that order-level generative world models can provide
a useful foundation for simulation-based market analysis,
risk evaluation, and strategy development.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
References
Arthur W B Holland J H LeBaron B Palmer R G and Tayler P 1997 Asset Pricing. Under Endogenous Expectations in an Artificial Stock Market Economic Notes 26(2): 297–330. p. 7 Asset Pricing Under Endogenous Expectations in an Artificial Stock Market. Economic Notes,
26(2): 297–330. ; and Lillo, F. How Markets Slowly Digest Changes in Supply and Demand. , Handbook of Financial
Markets: Dynamics and Evolution, Handbooks in Finance,
57–160. San Diego: North-Holland. Crossover from Linear to Square-Root Market Impact. Physical Review Letters, 122(10): 108302. ABIDES:
Towards High-Fidelity Market Simulation for AI Research. arXiv:1904. Empirical Properties of Asset Returns: Stylized Facts and Statistical Issues. Quantitative Finance, 1(2):
223–236. Market dynamics therefore
arise from a sequence of state transitions in which incoming
orders update the book and the updated book state shapes subsequent order flow (Gould et al. 2013; Cont and de Larrard
2013; Bouchaud, Farmer, and Lillo 2009). Price Dynamics in a
Markovian Limit Order Market. SIAM Journal on Financial
Mathematics, 4(1): 1–25. We replay the
generated orders through the matching engine and compare
the resulting mid-price returns with empirical market paths. We focus on four widely documented stylized facts: heavy
tails, aggregational Gaussianity, weak linear autocorrelation of returns, and volatility clustering (Mandelbrot 1963;
Cont 2001; Ding, Granger, and Engle 1993). A Long
Memory Property of Stock Market Returns and a New Model. Journal of Empirical Finance, 1(1): 83–106. ; and Ommer, B. Taming Transformers for High-Resolution Image Synthesis. Taming Transformers for High-Resolution Image Synthesis. In Proceedings of the IEEE/CVF Conference on Computer Vision and
Pattern Recognition, 12873–12883. These results suggest a
scalable foundation-model paradigm for counterfactual market simulation at the microstructure level. Code: ArthurZhang02/m3-market-microstructure
Model: Arthur210/M3-market-microstructure
Introduction
Financial markets are complex adaptive systems whose dynamics emerge from the interaction of heterogeneous participants, information acquisition, strategic trading, and liquidity
conditions (Grossman and Stiglitz 1980; Kyle 1985; Farmer
and Lo 1999; Lo 2004). Frontiers of Finance:
Evolution and Efficient Markets. Proceedings of the National
Academy of Sciences, 96(18): 9991–9992. At the microstructure
level, order events supply, consume, and redistribute liquidity, while the LOB determines the execution outcome and
price impact of incoming orders. Market dynamics therefore
arise from a sequence of state transitions in which incoming
orders update the book and the updated book state shapes subsequent order flow (Gould et al. Limit Order Books. Quantitative Finance, 13(11): 1709–1742. These results suggest a
scalable foundation-model paradigm for counterfactual market simulation at the microstructure level. Code: ArthurZhang02/m3-market-microstructure
Model: Arthur210/M3-market-microstructure
Introduction
Financial markets are complex adaptive systems whose dynamics emerge from the interaction of heterogeneous participants, information acquisition, strategic trading, and liquidity
conditions (Grossman and Stiglitz 1980; Kyle 1985; Farmer
and Lo 1999; Lo 2004). ; and Stiglitz, J. On the Impossibility of Informationally Efficient Markets. On the Impossibility of Informationally Efficient Markets. The American
Economic Review, 70(3): 393–408. World Models. arXiv
preprint arXiv:1803. ; Borgeaud, S. ; Mensch, A. ; Rutherford, E. ; de Las Casas, D. ; Millican, K. ;
van den Driessche, G. Training Compute-Optimal Large Language Models. arXiv:2203. ; McCandlish, S. ; Henighan, T. Scaling Laws for Neural Language Models. arXiv:2001. Following the “what-if” evaluations in TradeFM and
MarS (Kawawa-Beaudan et al. 2026; Li et al. TradeFM: A Generative Foundation Model for Trade-flow and Market Microstructure. arXiv:2602. Continuous Auctions and Insider Trading. Econometrica, 53(6): 1315–1335. Time
Series Properties of an Artificial Stock Market. Journal of
Economic Dynamics and Control, 23(9–10): 1487–1516. arXiv:2409. The Adaptive Markets Hypothesis: Market
Efficiency from an Evolutionary Perspective. The Adaptive Markets Hypothesis: Market
Efficiency from an Evolutionary Perspective. The Journal of
Portfolio Management, 30(5): 15–29. We replay the
generated orders through the matching engine and compare
the resulting mid-price returns with empirical market paths. We focus on four widely documented stylized facts: heavy
tails, aggregational Gaussianity, weak linear autocorrelation of returns, and volatility clustering (Mandelbrot 1963;
Cont 2001; Ding, Granger, and Engle 1993). Mandelbrot, B. The Variation of Certain Speculative
Prices. The Variation of Certain Speculative
Prices. The Journal of Business, 36(4): 394–419. Agent-centric models
constitute a classical approach to financial market simulation,
ranging from artificial stock markets with heterogeneous
adaptive agents (Arthur et al. 1997; LeBaron, Arthur, and
Palmer 1999) to microstructure models that simulate order
submissions and cancellations through explicit or empirically
calibrated rules (Mike and Farmer 2008). An Empirical Behavioral
Model of Liquidity and Volatility. Journal of Economic
Dynamics and Control, 32(1): 200–234. ; Vicente, J. ; Moyano, L. Market Impact and Trading Profile of Hidden Orders in Stock
Markets. Physical Review E, 80(6): 066102. ; Sapora, S. ; Calinescu, A. ; and Foerster, J. Generative AI for End-to-End Limit
Order Book Modelling: A Token-Level Autoregressive Generative Model of Message Flow Using a Deep State Space
Network. ; and Foerster, J. Generative AI for End-to-End Limit
Order Book Modelling: A Token-Level Autoregressive Generative Model of Message Flow Using a Deep State Space
Network. Generative AI for End-to-End Limit
Order Book Modelling: A Token-Level Autoregressive Generative Model of Message Flow Using a Deep State Space
Network. In Proceedings of the Fourth ACM International
Conference on AI in Finance, 91–99. ;
and Li, Y. MarketSim: Simulating Stock Markets with
Large-Scale Generative Agents. MarketSim: Simulating Stock Markets with
Large-Scale Generative Agents. In Proceedings of the 43rd
International Conference on Machine Learning. ; Pavlov, M. ; Radford, A. ; and Sutskever, I. Zero-Shot Textto-Image Generation. ; and Zhang, T. , Proceedings of the 38th International Conference on Machine
Learning, volume 139 of Proceedings of Machine Learning
Research, 8821–8831. Our model is related to discrete
representation learning in generative modeling. VQ-VAE
converts continuous observations into discrete codebook indices, allowing autoregressive models to learn priors over
compact latent tokens instead of raw high-dimensional inputs (van den Oord, Vinyals, and Kavukcuoglu 2018). ; and Vinyals, O. Generating Diverse High-Fidelity Images with VQ-VAE-2. Generating Diverse High-Fidelity Images with VQ-VAE-2. In
Advances in Neural Information Processing Systems, volume 32. GLU Variants Improve Transformer. arXiv
preprint arXiv:2002. Following Shi et al. (2025), tokenization is
performed by a causal encoder Eθ, a vector quantizerQ, and a
causal decoder Dϕ. Kronos: A Foundation Model for the Language
of Financial Markets. arXiv:2508. arXiv:2508. ; Murtadha, A. RoFormer: Enhanced Transformer with Rotary
Position Embedding. arXiv:2104. ; and Sennrich, R. Root Mean Square Layer
Normalization. Generating Diverse High-Fidelity Images with VQ-VAE-2. In
Advances in Neural Information Processing Systems, volume 32. DeepLOB:
Deep Convolutional Neural Networks for Limit Order Books. IEEE Transactions on Signal Processing, 67(11): 3001–
3012. Limit Order Book Event Stream Prediction with Diffusion
Model. arXiv preprint arXiv:2412.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Data and Preprocessing
The raw dataset consists of order book data for the CSI 500 and CSI 300 constituents, covering January 2024 to November 2025 for training and December 2025 for testing. Input preprocessing involves clipping continuous features at the 0. p. 9 Input Preprocessing
Each input order sequence is denoted as x1:T , where xt ∈ R
5
. To ensure that the continuous feature dimensions—such as
price, log1p(volume), and the time feature ∆τ—maintain
a consistent scale for tokenizer training and to guarantee
model robustness, we clip these features at the 0. To ensure that the continuous feature dimensions—such as
price, log1p(volume), and the time feature ∆τ—maintain
a consistent scale for tokenizer training and to guarantee
model robustness, we clip these features at the 0. 5th and
99. To ensure that the continuous feature dimensions—such as
price, log1p(volume), and the time feature ∆τ—maintain
a consistent scale for tokenizer training and to guarantee
model robustness, we clip these features at the 0. 5th and
99. Following the aforementioned data preprocessing
pipeline, we restrict the sequence length to a maximum of
1,024 tokens. Consequently, a sliding window of length 1,024
is uniformly adopted for both tokenizer training and the subsequent autoregressive modeling tasks.Where the paper says it
Where the paper says it
Where the paper says it
Where the paper says it
Model Hyperparameters and Scaling Law
The scaling law fitted to the validation losses is given by L(N, D) = 5.3697 + 1.5987 N 0.3795 + 1.0027 D 0.3117. The MAPEs for held-out sizes across the models were 9. p. 4 (2) on each four-size subset
predicts the held-out size with a mean absolute relative error
of 0. 66% across folds ; a fit restricted to models up to 366M
predicts the held-out 1. Refitting Eq. (2) on each four-size subset
predicts the held-out size with a mean absolute relative error
of 0.Where the paper says it
Where the paper says it
Stylized Facts Reproduction
The generated order-flow trajectories reproduce key market properties by comparing mid-price returns with empirical market paths. M3 achieves the smallest Wasserstein distance at all four return horizons and the smallest K–S statistic at 10, 30, and 60 seconds compared to baselines. p. 5 Table 1 compares M3 against two baselines: a ZeroIntelligence agent (ZI) and a Compound Hawkes Process
(Hawkes). Distributional fidelity is evaluated using the
Kolmogorov–Smirnov statistic, Wasserstein distance, and return kurtosis across multiple time scales. We validate M3 through a range of market simulation tasks, including stylized-facts reproduction, liquidity stress testing, and market-impact analysis. The results show that
M3 produces realistic market dynamics, recovers meaningful impact patterns such as the square-root law, and
supports counterfactual evaluation under different orderflow interventions.Where the paper says it
Where the paper says it
Prediction Capabilities
The model generates future order trajectories and evaluates the induced future mid-price paths to support multiple downstream predictive diagnostics. It shows that tail predictions are directionally informative and that conditioning on LOB consistently improves accuracy over both the no-LOB baseline and DeepLOB. p. 5 For each prompt, we derive an ensemble
return forecast from the generated mid-price paths and rank
prompts into predicted Down, Flat, and Up terciles. Figure 6
shows that the tail predictions are directionally informative
and that conditioning on LOB consistently improves accuracy over both the no-LOB baseline and DeepLOB. For each prompt, we estimate future realized
variance by averaging across Monte Carlo trajectories and
group the prompts into forecast quintiles. As shown in Figure 7, realized volatility increases monotonically with the
predicted quintile, indicating that the model distinguishes 819, respectively. Both estimates are close to the square-root benchmark exponent of
1/2, indicating that the simulator produces market-impact
scaling under closed-loop TWAP interventions.Where the paper says it
Where the paper says it
Where the paper says it
Directional stress testing evaluates the mechanical response of the order book to controlled order-flow imbalance. The model shows that buy stress raises the mid-price relative to the baseline, whereas sell stress lowers it, with displacement increasing sublinearly over the tested range. p. 6 Figure 8a shows that buy
stress raises the mid-price relative to the baseline, whereas
sell stress lowers it. The displacement increases with intervention strength but is sublinear over the tested range, qualitatively consistent with concave market impact (Bouchaud,
Farmer, and Lillo 2009; Bucci et al.Where the paper says it
M3 introduces a market microstructure world model for order-level financial market simulation by representing heterogeneous order events and LOB states as discrete tokens. This design allows the model to generate multiple future market trajectories. The results suggest that order-level generative world models can provide a useful foundation for simulation-based market analysis, risk evaluation, and strategy development.
Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.
Improvements for AI systems
-
Market Microstructure Model (M3) can generate future order-flow trajectories by representing heterogeneous order events and LOB states as discrete tokens within a unified framework, enabling counterfactual simulation of market dynamics.
-
The system can reproduce key market stylized facts such as heavy tails, aggregational Gaussianity, weak linear autocorrelation of returns, and volatility clustering when comparing generated trajectories to empirical market paths.
-
M3 supports counterfactual analysis by allowing for liquidity stress testing where
buy stress amplifies buyside add events while leaving sell-side events unchanged
and TWAP meta-order simulations that showconcave square-root-like impact scaling with respect to executed quantity.
-
The model can perform mid-price prediction by generating future order trajectories and evaluating the induced mid-price paths, showing that
conditioning on LOB consistently improves accuracy over both the no-LOB baseline and DeepLOB.
-
M3 can forecast future realized volatility by generating multiple Monte Carlo trajectories and reporting
realized variance increases monotonically with the predicted quintile,
allowing for predictions of future risk based on different order flow scenarios. -
The system can quantify market impact using a TWAP meta-order protocol, estimating impact relative to daily volatility and volume, showing that the estimated log-log slopes are
close to the square-root benchmark exponent of 1/2.
Abstract
Market microstructure simulation aims to model how liquidity, prices, and order flow evolve in electronic financial markets. Since market data reveal only one realized trajectory, many important questions are inherently counterfactual and require realistic trajectory-level simulation. Existing financial generative models, however, often model order events and market states, such as the LOB, in isolation, overlooking the dynamic interaction between order flow and liquidity in market microstructure. We propose the M3 (arket icrostructure odel), a state-event generative foundation model for market microstructure dynamics. M3 learns to generate future order-flow trajectories, while accounting for the evolving interaction between order events and limit-order-book liquidity. Trained on large-scale order-level real stock market data, M3 exhibits predictable scaling behavior, reproduces key market stylized facts, and enables practical simulation-based applications including forecasting, stress testing, and market-impact analysis. These results suggest a scalable foundation-model paradigm for counterfactual market simulation at the microstructure level.
Sources
- ABIDES: Towards High-Fidelity Market Simulation for AI Research
- Simulating Financial Market via Large Language Model based Agents
- World Models
- Training Compute-Optimal Large Language Models
- Scaling Laws for Neural Language Models
- TradeFM: A Generative Foundation Model for Trade-flow and Market Microstructure
- MarS: a Financial Market Simulation Engine Powered by Generative Foundation Model
- GLU Variants Improve Transformer
- Kronos: A Foundation Model for the Language of Financial Markets
- RoFormer: Enhanced Transformer with Rotary Position Embedding
- LLaMA: Open and Efficient Foundation Language Models
- Neural Discrete Representation Learning
- VideoGPT: Video Generation using VQ-VAE and Transformers
- Limit Order Book Event Stream Prediction with Diffusion Model
Related papers
- AI Disclosures and Fund Return Comovement: Evidence from Public Filings
- AFNO: Universal Certifiably-Arbitrage-Free Operator Learning Framework for European Call-Price Surfaces
- Marked INAR model and the rough Hawkes--Heston limit
- Diffusion models for dynamic volatility surface generation and data-driven hedging
- Rethinking Synthetic Scenario Realism: Compatibility, Not Fidelity, Drives Hedging Performance
- CosmosAlpha: Multi-Relational Graph Search with Pareto-Guided Exploration for LLM-Driven Alpha Mining