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

The paper introduces TradeFM, a 524M-parameter generative Transformer that leverages scale-invariant features and universal tokenization to learn general-purpose representations from billions of trade events, enabling zero-shot cross-asset generalization and the realistic simulation of market microstructure dynamics.

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

Published 2026-03-02
📖 5 min read🧠 Deep dive

Imagine the stock market not as a boardroom of serious people in suits, but as a massive, chaotic, 24/7 digital bazaar. In this bazaar, millions of people are shouting out prices, buying and selling apples, oranges, and rare collectibles every second.

For a long time, trying to predict what happens next in this bazaar was like trying to guess the weather by looking at a single raindrop. It was messy, different for every item, and required a different rulebook for every single stock.

Enter TradeFM. Think of it as a super-smart, all-knowing "Market Oracle" built by J.P. Morgan's AI team. Here is how it works, explained simply:

1. The Problem: Too Many Rulebooks

Imagine you are trying to teach a robot to play soccer. If you give it a rulebook for only one specific field with one specific grass type, it will get confused when you move it to a different field with different grass.

In finance, this was the old way. Models were built for just one stock (like Apple) or one type of market. They couldn't handle the fact that a penny stock behaves differently than a billion-dollar tech giant. They needed a "universal translator" to understand the language of all markets at once.

2. The Solution: The "Universal Translator"

TradeFM is a Generative Foundation Model. That's a fancy way of saying it's a giant AI brain that learned the "grammar" of the entire stock market.

  • The Training Data: Instead of reading a few books, this AI read 10 billion pages of trading history. It watched billions of trades happen across more than 9,000 different US stocks.
  • The Magic Trick (Scale-Invariance): This is the secret sauce. The AI learned to ignore the size of the numbers and focus on the shape of the behavior.
    • Analogy: Imagine you are learning to drive. A Ferrari and a Mini Cooper are very different cars. But the rules of driving (stop at red lights, turn when you see a curve) are the same. TradeFM learned the "rules of driving" for the market, regardless of whether the "car" (the stock) was a Ferrari or a Mini. It doesn't care if a stock costs $1 or $1,000; it cares about the pattern of how people are buying and selling.

3. How It Sees the World: The "Blindfolded" Observer

Most previous AI models were like a referee who could see the entire stadium, the players, and the ball at the exact same time. They had access to the "full order book" (every single pending order).

TradeFM is different. It is trained like a single trader standing on the floor.

  • It only sees the stream of trades as they happen (the "order flow").
  • It doesn't know what the other traders are thinking or what orders are waiting in the wings.
  • Why this matters: This makes it much more realistic. In the real world, no one sees everything. TradeFM learns to predict the future based only on what a normal person can see, making it a much better tool for real-world applications.

4. The "Time Machine" Simulator

Once the AI learned the rules, the researchers built a digital sandbox (a simulator) to test it.

  • They let the AI "play" the market. It predicts the next trade, the simulator executes it, and then the AI sees the result and predicts the next one.
  • The Result: The AI created a fake market that looked and felt exactly like a real one.
    • It had heavy tails (rare, crazy price jumps happened just as often as in real life).
    • It had volatility clustering (when the market got scary, it stayed scary for a while, just like real panic).
    • It had no predictable patterns (you couldn't easily guess the next move, just like in a real efficient market).

5. The "Zero-Shot" Superpower

The most impressive part? The AI was trained only on US stocks.

  • The researchers then asked it to predict what would happen in Japan and China, markets it had never seen before.
  • The Analogy: Imagine teaching a child to speak English using only American movies. Then, you take them to London and they can still understand the locals, even though they've never been there.
  • TradeFM did this. It generalized its knowledge to Asian markets with very little drop in performance. This proves it learned the fundamental physics of how markets work, not just memorized US history.

Why Should You Care?

This isn't just about making money; it's about safety and understanding.

  • Stress Testing: Imagine a bank wants to know, "What happens if everyone tries to sell their stocks at once?" They can use TradeFM to run a "simulation" of that disaster without actually crashing the real market.
  • Privacy: Banks can generate fake, realistic data to share with researchers without revealing their customers' actual secrets.
  • Better Agents: It helps build better AI trading bots that understand the market's "mood" rather than just crunching numbers.

In a nutshell: TradeFM is the first AI that learned the "universal language" of the stock market. It doesn't just memorize history; it understands the underlying rhythm of how humans buy and sell, allowing it to simulate, predict, and test market scenarios with incredible accuracy.

Get papers like this in your inbox

Personalized daily or weekly digests matching your interests. Gists or technical summaries, in your language.

Try Digest →