← Latest papers
💰 quantitative finance

Quantformer: from attention to profit with a quantitative transformer trading strategy

This paper introduces Quantformer, a transformer-based neural network enhanced by transfer learning from sentiment analysis, which effectively captures long-range dependencies and market signals to outperform traditional 100-factor strategies in predicting stock returns within the Chinese capital market.

Original authors: Zhaofeng Zhang, Banghao Chen, Shengxin Zhu, Nicolas Langrené

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

Original authors: Zhaofeng Zhang, Banghao Chen, Shengxin Zhu, Nicolas Langrené

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are trying to predict the weather to decide whether to carry an umbrella. Traditional methods might look at yesterday's rain and guess today will be wet. But the stock market is like a chaotic, stormy ocean where the weather changes every second, influenced by millions of tiny ripples, giant waves, and even the mood of the sailors.

This paper introduces a new tool called Quantformer. Think of it as a super-smart, weather-forecasting AI that doesn't just look at the rain; it understands the entire storm system to predict exactly where the sun will shine next.

Here is the story of how they built it, explained simply:

1. The Problem: The Old Tools Were Too Simple

For decades, investors have used "factors" to pick stocks. Think of a factor as a single clue, like "Is the company making money?" or "Is the stock price going up?"

  • The Old Way: Imagine trying to navigate a maze by only looking at one wall at a time. You might get lucky, but you'll likely hit a dead end. Traditional math models (like the ones used in the 1950s) are too rigid. They can't handle the messy, emotional, and fast-changing nature of the stock market.
  • The Machine Learning Attempt: Recently, people tried using AI (Machine Learning) to fix this. They used models designed for reading text (like translating English to French) to read stock charts. But this was like trying to read a book using a dictionary meant for a different language. The numbers didn't fit the "words" the AI expected.

2. The Solution: Enter "Quantformer"

The authors took a famous AI architecture called the Transformer (the same brain behind tools like ChatGPT) and gave it a makeover specifically for money.

  • The Metaphor: Imagine a translator who usually translates books (text). The authors realized that stock data isn't a book; it's a symphony of numbers.
  • The Makeover:
    • No More "Word Embeddings": In normal AI, words are turned into "word vectors" (like assigning a color to every word). Since stock data is just numbers (prices, volume), the authors replaced the "word dictionary" with a simple linear layer. It's like swapping a complex thesaurus for a straight ruler. It measures the numbers directly.
    • Removing the "Mask": In language AI, the model often has to guess the next word one by one (like filling in a crossword). In trading, you don't need to guess word-by-word; you need to see the whole picture of the next month's return at once. So, they removed the "mask" that forced the AI to guess step-by-step.
    • The "Attention" Superpower: The core of the Transformer is "Attention." Imagine you are at a noisy party. A normal person hears everything equally. A Transformer with "Attention" can instantly tune out the chatter and focus only on the one person shouting the most important news. Quantformer uses this to look at 20 days of past stock data and instantly figure out which days actually matter for the future.

3. How They Tested It: The "Giant Simulation"

They didn't just guess; they ran a massive simulation.

  • The Data: They fed the AI data from 4,601 Chinese stocks over 13 years (2010–2023). That's over 5 million data points. It's like training a chef by having them taste every dish in a massive buffet for a decade.
  • The Training: They taught the AI to look at the past (prices and how many shares were traded) and predict the future (will the stock go up or down?).
  • The Competition: They pitted their new AI against 100 other traditional trading strategies. It was like a race between a Formula 1 car (Quantformer) and 100 bicycles (traditional factors).

4. The Results: The AI Wins the Race

The results were impressive:

  • Higher Profits: The Quantformer strategy made significantly more money than the 100 traditional strategies. While the traditional ones often lost money or broke even, Quantformer delivered strong annual returns (around 17% in their best monthly test).
  • Better Safety: In investing, it's not just about how much you win, but how much you risk losing. Quantformer had a lower "Value at Risk" (VaR). Think of this as the size of the hole you might fall into. Quantformer's hole was smaller and safer than the others.
  • The "Alpha": In finance, "Alpha" is the score for being smarter than the market. Quantformer had a positive Alpha, meaning it genuinely outsmarted the market, not just got lucky.

5. Why This Matters

The paper shows that we don't need to treat stock markets like text to use powerful AI. By tweaking the AI to understand numbers instead of words, we can build a system that:

  1. Sees the big picture: It connects long-term trends with short-term spikes.
  2. Adapts: It learns from the chaos of the market better than old math formulas.
  3. Makes Money: It turns complex data into profitable decisions.

In a nutshell: The authors took a super-intelligent language brain, taught it to speak "Finance," and showed that it can navigate the stock market's stormy seas much better than the old compasses we've been using for decades. It's a bridge from "Attention" (the AI's focus) to "Profit" (the investor's goal).

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →