ALFFLLM·FINANCE

The List / Agents and Multi-Agent Systems / paper

TradeFM: A Generative Foundation Model for Trade-flow and Market Microstructure

Maxime Kawawa-Beaudan; Srijan Sood; Kassiani Papasotiriou; Daniel Borrajo; Manuela Veloso

Abstract

Foundation models have transformed domains from language to genomics by learning general-purpose representations from large-scale, heterogeneous data. We introduce TradeFM, a 524M-parameter generative Transformer that brings this paradigm to market microstructure, learning directly from billions of trade events across>9K equities. To enable cross-asset generalization, we develop scale-invariant features and a universal tokenization scheme that map the heterogeneous, multi-modal event stream of order flow into a unified discrete sequence -- eliminating asset-specific calibration. Integrated with a deterministic market simulator, TradeFM-generated rollouts reproduce key stylized facts of financial returns, including heavy tails, volatility clustering, and absence of return autocorrelation. Quantitatively, TradeFM achieves 2-3x lower distributional error than Compound Hawkes baselines and generalizes zero-shot to geographically out-of-distribution APAC markets with moderate perplexity degradation. Together, these results suggest that scale-invariant trade representations capture transferable structure in market microstructure, opening a path toward synthetic data generation, stress testing, and learning-based trading agents.

In one sentence

TradeFM is a 524M-parameter generative Transformer that learns universal market microstructure dynamics from billions of trade events across >9K equities, achieving 2-3x lower distributional error than Hawkes baselines and zero-shot generalization to APAC markets.

Summary

TradeFM addresses the challenge of modeling heterogeneous, high-frequency market microstructure by introducing a generative foundation model that learns directly from raw, partially observed trade event streams rather than full limit order book snapshots. The research problem centers on whether a single model can capture universal principles of price formation across diverse assets and liquidity regimes without asset-specific calibration, leveraging the hypothesis that scale-invariant representations exist in order flow. The authors propose a decoder-only Transformer architecture trained on over 10 billion tokens from US equities, utilizing a novel universal tokenization scheme and scale-invariant feature engineering to map multi-modal event data into a unified discrete sequence. This approach eliminates the need for privileged full-LOB access, aligning the model with the information available to typical market participants. The experimental design integrates the pre-trained model with a deterministic market simulator to create a closed-loop evaluation environment. Key experiments assess the model's ability to reproduce stylized facts of financial returns, such as heavy tails, volatility clustering, and lack of return autocorrelation, while also measuring distributional fidelity against baselines like Zero-Intelligence agents and Compound Hawkes processes. The study further evaluates out-of-distribution generalization by testing the model on held-out temporal periods and geographically distinct APAC markets (China and Japan) without fine-tuning. Metrics include Kolmogorov-Smirnov and Wasserstein distances for return distributions and order flow statistics, alongside perplexity measures for cross-market transfer. Findings indicate that TradeFM significantly outperforms traditional stochastic baselines, achieving 2-3x lower distributional error in reproducing stylized facts and superior fidelity in order volume and interarrival time distributions. The model demonstrates robust zero-shot generalization to APAC markets with only moderate perplexity degradation, confirming the transferability of scale-invariant trade representations. Limitations include the model's inability to perfectly replicate bid-ask spreads compared to Hawkes processes and the reliance on a deterministic simulator that may not capture all real-world execution frictions. Use cases include synthetic data generation for illiquid assets, stress testing via counterfactual scenario injection, and providing a realistic environment for training reinforcement learning agents for optimal execution.

Research problem

The paper addresses the difficulty of modeling complex, non-stationary market microstructure dynamics using a unified approach. It investigates whether a single foundation model can learn universal representations of order flow from heterogeneous, multi-asset data without asset-specific calibration. A key challenge is achieving this using only partially observed trade event streams, mimicking the limited information available to real market participants, rather than relying on full limit order book snapshots.

Core contributions

  • Introduction of TradeFM, a 524M-parameter generative Transformer for market microstructure.
  • Development of scale-invariant features and a universal tokenization scheme for cross-asset generalization.
  • Demonstration of learning from partial observations (event streams) rather than full limit order books.
  • Integration with a deterministic market simulator for closed-loop evaluation and synthetic data generation.
  • Empirical validation of zero-shot geographic generalization to APAC markets from US-trained data.

Method

  • Decoder-only Transformer architecture with grouped-query-attention and RoPE.
  • Scale-invariant feature construction using log-transformed volume and normalized price depth.
  • Universal tokenization via mixed-base number system combining discrete bin indices of multi-feature tuples.
  • Exponentially-Weighted VWAP for mid-price estimation from partial observations.
  • Closed-loop rollout: model predicts trade, simulator executes it, state updates, and feeds back to model.
  • Multinomial sampling with repetition penalty for decoding generated trade events.
  • Evaluation using Kolmogorov-Smirnov and Wasserstein distances against real market data.

Results & findings

  • TradeFM achieves 2-3x lower distributional error than Compound Hawkes baselines.
  • Successfully reproduces heavy tails, volatility clustering, and lack of return autocorrelation.
  • Zero-shot generalization to APAC markets shows moderate perplexity degradation.
  • Superior fidelity in order volume and interarrival time distributions compared to baselines.
  • Bid-ask spread replication is weaker than Hawkes, suggesting hybrid approaches may help.
  • Controllability experiments show model responds intuitively to liquidity and observation-level indicators.
  • Scaling analysis confirms power-law relationships between compute, dataset size, and test loss.

Data & experiments

  • Pre-training on 10.7 billion tokens from >9K US equities (Feb 2024 - Sep 2025).
  • Evaluation on held-out US assets and geographically out-of-distribution APAC markets (China, Japan).
  • Comparison against Zero-Intelligence agents and Compound Hawkes process baselines.
  • Metrics include Kolmogorov-Smirnov and Wasserstein distances for return distributions and order flow.
  • Closed-loop simulation experiments to test stylized fact reproduction and market impact.

Limitations & caveats

  • Model struggles to replicate bid-ask spreads as accurately as Hawkes processes.
  • Relies on a deterministic simulator that may not capture all real-world execution frictions.
  • Training data is limited to US equities, though generalization to APAC is tested.
  • Full disentanglement of model quality vs. simulator fidelity is noted as future work.
  • Synthetic data realism depends on the accuracy of the underlying simulator mechanics.
  • Model does not explicitly model order book depth, only trade events.

Curator notes

Discovery status: institutional_trading_round3_promoted. Source links: ABIDES: Towards High-Fidelity Multi-Agent Market Simulation