Sentiment-Aware Stock Price Prediction with Transformer and LLM-Generated Formulaic Alpha

This paper proposes a novel framework that leverages large language models to automatically generate interpretable, sentiment-aware formulaic alphas, which serve as enhanced features for Transformer-based models to significantly improve stock price prediction accuracy and transparency.

Qizhao Chen, Hiroaki Kawashima

Published 2026-03-05
📖 4 min read☕ Coffee break read

Imagine you are trying to predict the weather for next week.

The Old Way (Traditional Finance):
In the past, financial experts (quantitative analysts) tried to predict stock prices by manually writing complex mathematical recipes. They would look at the data and say, "If the price went up yesterday and the volume was high, maybe it will go up today." They called these recipes "Alpha Formulas."

  • The Problem: This was like trying to write a new weather forecast formula by hand every single day. It was slow, exhausting, and once everyone figured out your formula, it stopped working (a phenomenon called "alpha decay"). Also, these experts often missed the "human element"—like how a rumor about a competitor might make people panic and sell their stocks.

The New Way (This Paper's Solution):
This paper introduces a team-up between a Super-Intelligent Robot (LLM) and a Pattern-Recognizing Brain (Transformer) to predict stock prices.

Here is how it works, step-by-step:

1. The "News Detective" (Sentiment Analysis)

First, the system doesn't just look at the stock chart. It reads thousands of news articles.

  • The Twist: It doesn't just read about the company you are interested in (e.g., Toyota). It also reads about Toyota's friends and enemies (e.g., Honda, Ford, Tesla, and even Apple).
  • Why? If there is bad news about a major supplier or a rival, Toyota's stock might drop even if Toyota itself did nothing wrong. The system calculates a "mood score" (sentiment) for all these related companies.

2. The "Creative Chef" (The LLM)

This is the star of the show. The researchers gave a Large Language Model (like a very smart AI) a list of ingredients:

  • Ingredients: Stock prices, technical math (like moving averages), and the "mood scores" of the related companies.
  • The Task: "Chef AI, please invent 5 new, creative recipes (Alpha Formulas) that mix these ingredients to predict tomorrow's price."

Instead of just giving a number, the AI writes out the recipe in plain English math, like:

"Take Toyota's momentum, add a dash of how happy people are about Tesla, and subtract the fear about Ford."

The AI acts like a creative chef who can taste the market and invent new flavor combinations that humans might never think of.

3. The "Pattern Master" (The Transformer)

Once the AI Chef creates these new recipes, they aren't used to trade directly. Instead, they are fed into a Transformer model.

  • Think of the Transformer as a master detective who is really good at spotting long-term patterns in a messy crime scene.
  • It takes the "recipes" created by the AI Chef and uses them as clues to predict exactly what the stock price will be tomorrow.

The Results: Why is this cool?

The researchers tested this on five big companies (Apple, HSBC, Pepsi, Toyota, Tencent).

  • Better Accuracy: The team-up of the "Creative Chef" (LLM) and the "Pattern Master" (Transformer) predicted prices much better than older methods (like standard computer models or human-written formulas).
  • No More "Black Box": Usually, AI gives you an answer but won't tell you why. Here, because the LLM writes the formulas in readable math, we can actually see the logic. We can say, "Ah, the model predicted the price went up because it noticed positive news about a competitor!" This makes the prediction trustworthy.
  • Beating the Competition: When they compared their AI-generated formulas against:
    1. Standard Computer Tools: The AI Chef was smarter.
    2. Human Experts: The AI Chef was much faster and more creative, avoiding the "old recipe" problem where human formulas stop working over time.

The Big Picture Analogy

Imagine you are trying to guess the winner of a horse race.

  • Old Method: You look at the horse's past speed and weight.
  • This Paper's Method: You ask a super-smart AI to read the newspaper, check the weather, see what the jockey's rival is saying, and then invent a brand-new way to calculate the odds. Then, you give that new calculation to a super-observant detective who spots the winner.

In short: This paper shows that by letting an AI invent its own "trading recipes" based on news and market mood, and then letting a deep-learning model use those recipes, we can predict stock prices more accurately and understand why the prediction was made. It's like giving a financial analyst a superpower to instantly invent new ways to see the future.