← Latest papers
💻 computer science

Retrieval-Augmented Large-Language-Model-Based Time-Series Forecasting for Cross-Market Equity Analysis

This study introduces the Cross-Market Retrieval-Augmented Lag-Llama (CM-RAF-Lag-Llama) framework, demonstrating that integrating historical retrieval with a pre-trained Lag-Llama model significantly reduces forecasting errors across diverse equity markets by leveraging analogous historical windows to correct predictions, particularly for volatility and volume-related targets.

Original authors: Novanto Yudistira, Yanuar Putra Kharisma Adhiyasa

Published 2026-07-10
📖 5 min read🧠 Deep dive

Original authors: Novanto Yudistira, Yanuar Putra Kharisma Adhiyasa

Original paper licensed under CC BY 4.0 (https://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 guess the weather for the next few weeks. You have a super-smart, pre-trained weather robot (let's call it Lag-Llama) that has read every weather report in history. It's great, but sometimes it gets stuck in a loop, guessing based only on the last few days it saw, even if a massive storm pattern is about to hit that it hasn't seen in a while.

Now, imagine you give this robot a magical Time-Travel Library. This library doesn't just hold data; it holds "memory cards" of past weather windows that look exactly like the weather happening right now. When the robot is about to make a guess, it can peek into the library, find a past week that looks just like today, and say, "Hey, last time this happened, the storm came three days later!"

This paper is about testing that exact idea for stock markets. The researchers asked: "If we give our super-smart stock-forecasting robot a Time-Travel Library to peek at similar past market days, does it make better guesses?"

The Big Discovery: The Library Helps, But Only Sometimes

The answer is a resounding "Yes, but..."

The researchers tested this on three different stock markets: Indonesia (IDX7), the US (US7), and Japan (JP7). They found that when they let the robot use its library, it made significantly fewer mistakes. In fact, across all the different scenarios they tested:

  • In Indonesia, the mistakes dropped by 28.85%.
  • In the US, they dropped by 27.27%.
  • In Japan, they dropped by 33.60%.

The robot didn't just get lucky once; it improved in every single one of the 48 different test setups they tried. It's like giving a chess player a cheat sheet of past games that look exactly like the current board; they suddenly start making better moves.

The "Don't Do This" List: What the Paper Rules Out

However, the paper is very careful to tell us what this magic library does not do.

  1. It doesn't fix short-term chaos. If you ask the robot to guess what happens in just 30 days, the library sometimes actually makes things worse. The paper suggests that for very short guesses, the robot is better off just looking at the immediate past (the last few days) rather than digging through the library. The "Time-Travel" info was too noisy for the short term.
  2. It doesn't work for everything the robot predicts. The robot got really good at guessing things like volatility (how wild the market swings) and volume (how much trading happens). But when the task was to guess the actual price of a stock (like log-price), the library didn't help much. The paper notes that for simple price guessing, just assuming "tomorrow will look like today" (a method called persistence) is often just as good as the fancy robot.
  3. It's not a "retrain" button. The researchers didn't re-teach the robot how to think. They kept the robot exactly the same and just added the library as a helper. This is important because it means you don't have to rebuild the whole system to get these benefits.

How Sure Are We? (The "Proof" Level)

The authors are very confident in their numbers, but they are also honest about the limits.

  • They measured it: They didn't just simulate this on a computer; they used real historical stock data from Yahoo Finance spanning from July 29, 2019, to March 27, 2025. They tested this on real assets like Apple, Microsoft, and major Indonesian and Japanese companies.
  • They tested the "Why": They ran special experiments to see when the library works best. They found that the library is most helpful when the robot has to guess 60 to 120 days into the future. It's like saying, "I can't guess the weather for tomorrow, but if you ask me about next month, my library of past storms helps a lot."
  • They checked the "How": They found that the library works best when the robot looks at a "window" of 32 to 64 days of history before making a guess. If the window was too long (256 days), the library got confused because the history was too messy.

The "Secret Sauce": Choosing the Right Card

One of the coolest parts of the study is how they used the library. They didn't just grab the first similar card they saw. They had a "smart selector" that looked at the library and picked the best card to use for the specific situation.

When they used this smart selector, the robot became even more accurate. For example, in the US market, when guessing things like volume or volatility, the smart-selected library helped the robot beat almost every other method they compared it to, including other fancy AI models.

The Bottom Line

The paper suggests that for stock markets, a pre-trained AI robot is already pretty good, but it gets significantly better if you give it a way to look up similar moments from the past. It's like giving a student a textbook and a tutor who says, "Remember that time you solved a problem just like this last year? Do it that way."

But, the paper warns us: this isn't a magic wand that predicts the stock market perfectly. It works best for medium-to-long-term guesses (2 to 4 months), it works best on "wildness" and "activity" rather than just the price tag, and it works best if you don't try to use it for very short-term guesses.

The authors conclude that this "Retrieval-Augmented" approach is a promising, lightweight way to fix forecasting errors without having to rebuild the entire AI from scratch. It's a smart upgrade, not a total replacement.

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 →