Skip to content
Tim Frenzel

// Insight

TradeFM: a foundation model learns the grammar of order flow

4 min read
synthetic-datamicrostructurefoundation-modelsorder-flow

Last week I argued that synthetic financial data fails the tests that matter. Fairness demands the counterexample. It comes from a bank. TradeFM, out of J.P. Morgan’s AI research group, is a 524M-parameter decoder-only Transformer trained on more than ten billion tokens of tick-level trade events across over nine thousand US equities. The corpus runs February 2024 through September 2025, with the final year held out for testing. It treats order flow as a language. The bet pays: two to three times lower distributional error than the Compound Hawkes processes that have owned this niche for a decade.

Two design choices carry the paper. The first is scale invariance. Raw trade data is hopelessly heterogeneous across assets (a tick means something different on a microcap than on AAPL). TradeFM normalizes everything into scale-free features and a universal token vocabulary before the Transformer ever sees it. One model, no per-asset calibration. The second is humility about information. The model learns from the public event stream, the trades any participant can watch, without the full limit order book that most neural microstructure models demand. A foundation model that needs privileged data is a contradiction in terms.

The numbers hold up under the framing my last piece demanded. The team generates 1,024-event rollouts in a closed loop against a deterministic matching engine, two to five minutes of AAPL-class market time apiece, then grades the synthetic returns on the stylized facts and the synthetic flow on its distributions. Closed-loop evaluation couples model quality with simulator fidelity. The authors call the two only partially disentangled and leave the full separation to future work.

Log-return K-S distance at 60s, lower is better
Zero Intelligence0.429Compound Hawkes0.101TradeFM0.035
Kolmogorov-Smirnov distance between real and generated log returns at a 60-second interval, averaged over 9 assets, 3 liquidity tiers, and 9 held-out months. The 2-3x margin over Hawkes holds from 10-second to 120-second intervals.

Heavy tails, volatility clustering, near-zero return autocorrelation, aggregational Gaussianity: the generated series carry all four. A zero-intelligence control run through the identical simulator carries none. That points the credit at the model. The transfer result is what I would not have predicted. Trained purely on US equities, the model generalizes zero-shot to Japan and China with only moderate perplexity degradation, straight across Itayose batch auctions and ten-percent daily price limits it has never seen. Microstructure apparently has a grammar. It is less regional than the exchange rulebooks suggest.

Now the part that earns trust. The fidelity table contains losses. The authors print them. Bid-ask spreads go to Compound Hawkes on both metrics, the paper’s own exception. TradeFM posts 0.238 against 0.218 on the K-S distance and 0.400 against 0.302 on Wasserstein. Bid volume splits, a loss on K-S and a win on Wasserstein. The spread row has a disarming explanation. Spreads in their pipeline emerge from the simulator’s deterministic matching rather than from the learned flow. The one quantity their model never directly speaks is the one it loses outright. They suggest hybrids with explicit spread models. The distributional scoring borrows its conventions from LOB-Bench, with the caveat that the neural models scored on that benchmark need the full book as input. A direct scoreboard against them does not exist.

The fidelity table, wins and printed losses
Where the model winsInterarrival times 0.281 vs 0.515Price depth 0.169 vs 0.281Book imbalance 0.142 vs 0.155Where it losesSpreads 0.238 vs 0.218Spread forms in the simulatorBid volume 0.386 vs 0.296, K-S
K-S distances, TradeFM vs Compound Hawkes, lower is better. Bid volume flips back to a TradeFM win on Wasserstein, 0.130 against 0.278. Spreads stays lost on both metrics.

Set this next to last week’s ledger. The pattern from the order-book generation literature resolves cleanly. The generators that fail are the ones evaluated on marginals and eyeballed realism. TradeFM wins because the evaluation was built like an adversary: distributions the desk consumes, a control run through the same simulator, out-of-distribution markets, plus the losing rows left in the table. Eighteen years of model reviews taught me to trust a table with a loss in it far more than one without. What a bank wants from this is obvious once you see the eval. It wants stress paths and agent-training environments minted from data it already owns. What the rest of us get is proof that the skeptic’s bar can be cleared, by a model that speaks in trades.

TradeFM clears the bar synthetic market data keeps missing, two to three times closer to real distributions than Hawkes with zero-shot transfer across exchange rulebooks. It earns the trust the usual way: an adversarial evaluation with its losses printed in the table.

Working on AI that needs to ship?

I help funds, fintechs, and data teams take AI from prototype to production.