What Happens When an AI Agent Can Learn From Its Own Trading Experiments?
AQuA lets AI agents discover trading strategies, learn, and try again.
Last updated on
AI Summary
AQuA enables AI agents to iteratively discover trading strategies, learn from prior experiments, and improve subsequent research without retraining the underlying language model.
Developed by researchers at Princeton University, Ant Group, and Stanford University, AQuA stores hypotheses, outcomes, and evidence in persistent research memory. Its two independent systems handle factor discovery and machine-learning model development. Across 20 autonomous rounds, its combined crypto factor signal reached a Spearman Information Coefficient of about 0.190; individual factors achieved roughly 0.026 to 0.037. For US equities, agents use validation data while an untouched 2021–2025 period is reserved for final testing.
AQuA’s key safeguard is a sealed sandbox with human-fixed data splits, labels, features, and evaluation infrastructure. Agents use an approved domain-specific language whose operations only look backward, preventing errors such as an earlier leaked feature that normalized intraday volume using the full day’s volume. The design shows why architectural constraints may protect autonomous trading research better than reviewer prompts alone.
Most AI trading experiments are pretty straightforward. You give an AI some market data, ask it to come up with a strategy, run a backtest, and see what happens.
Instead of stopping after one experiment, it lets AI agents continue doing research on their own. They can test an idea, check the results, remember what happened, and use that knowledge when deciding what to try next.
This is closer to how a human quant researcher actually works. A researcher might spend weeks testing different ideas, throwing away the ones that fail, making small changes to the promising ones, and slowly building a better understanding of the market.
We are already seeing similar ideas outside finance. The AI Scientist, for example, explored whether AI agents could generate research ideas, write code, run experiments, and use the results to continue the scientific process.
AQuA applies a similar idea to quantitative trading, where a bad experiment can have much more subtle consequences.
The paper, titled “AQuA: Recursively Self-Improving Quantitative Trading Research Agents,” comes from researchers at Princeton University, Ant Group, and Stanford University.
They describe it as recursive self-improvement, although the AI model itself is not retraining its own weights.
Results from previous experiments are stored in memory. Later agents can read those results and use them when deciding what to investigate next. A failed experiment can still be useful because the system learns not to waste another run testing the same weak idea.
After going through the paper, I was deeply interested in how this kind of algorithm could play out in real-world applications and what developers and researchers can take away from it.
The Basic Idea Is Easier Than It Sounds
Traditional quantitative research is already an iterative process. Someone starts with a theory about the market, turns it into code, runs an experiment, checks whether the numbers make sense, and then changes the idea based on what happened.
AQuA replaces much of this manual cycle with AI agents.
The system keeps something similar to a research journal. The paper calls this persistent research state, but I find it easier to think of it as a lab notebook.
When an experiment finishes, AQuA does not just save the final score. It can also save what the original hypothesis was, what market behavior it was trying to capture, whether the idea survived testing, and which parts might be useful in another experiment. The next research run can then read that history instead of beginning with a blank slate.
This is what the researchers mean by recursive self-improvement. The LLM itself remains the same, but the research process becomes more informed over time.
There is already a growing body of work around this idea in quantitative finance. Systems such as QuantaAlpha also use previous experiments to guide later alpha-mining attempts. AQuA goes further by studying this feedback loop across two separate parts of quant research while putting strict limits around what those agents can change.
AQuA stores evidence from previous experiments and uses it when planning the next research run.
This is useful until we run into a problem that has haunted quantitative research for years: what happens when the AI learns from a bad experiment?
The “Spy in the Code” Problem
There is a surprisingly good example near the end of the paper.
An earlier version of AQuA gave the agent much more freedom. The AI could directly write feature code, while another LLM reviewed the code before it was used in an experiment.
One AI writes the feature and another checks it for mistakes. The researchers still ended up with data leakage.
The Spy in the Code Problem.
The agent created a feature based on intraday trading volume. It wanted to measure how much volume had traded since the market opened and compare that number across stocks.
There was nothing obviously suspicious about the idea. The bug appeared in how the value was normalized. The agent divided the volume traded so far by the total volume for the entire trading day.
Imagine running the calculation at 10:00 AM. The numerator contains volume from the market open until 10:00 AM, which is fine. But the denominator contains everything traded from the opening bell all the way to the close.
That information does not exist at 10:00 AM.
The model had accidentally been given a small glimpse into the future.
This is known as look-ahead bias or data leakage. It can make a trading model look incredibly good during a backtest because it is using information that would never have been available at the time of the trade.
This problem is not unique to AI agents. Researchers have been warning about backtest overfitting for years, especially when researchers repeatedly test strategies against the same historical data. Campbell Harvey, Yan Liu, and Heqing Zhu also showed how the huge number of factors tested in finance makes seemingly significant discoveries much easier to find by chance, which is why they argued for much stricter statistical hurdles.
In AQuA’s case, the reviewer AI failed to catch the problem.
According to the researchers, the reviewer understood the intention of the feature and treated it as backward-looking, but it missed what the actual implementation was reading. The unusually high performance eventually raised suspicion, and a manual audit traced the problem back to the full-day volume calculation.
This failure is probably one of the most useful parts of the whole paper. The researchers did not respond by writing a longer prompt telling the reviewer to “carefully check for future data.”
They changed the system.
AQuA’s Solution Was to Lock Things Down
The current AQuA system places the agent inside what the paper calls a sealed sandbox.
AQuA’s sealed sandbox flow.
The easiest way to understand it is that the AI can experiment, but it cannot change some of the important infrastructure around the experiment. The data splits, feature and label definitions, and evaluator are fixed by humans before autonomous research begins.
It also cannot freely write whatever data-processing code it wants.
Instead, AQuA gives the agent a limited set of approved mathematical operations. The paper calls this a Domain-Specific Language, or DSL, but the basic idea is simple: give the agent a toolbox containing operations that are known to be safe.
It can calculate things such as past price changes, rolling volatility, correlations, rankings, and other market statistics, but those tools are designed so that historical calculations only look backward.
The dangerous full-day volume calculation from the earlier experiment is therefore no longer something the agent can create through the available operations. The researchers effectively moved the protection away from the AI’s judgment and into the software architecture.
I like this approach because it feels much more practical than relying on prompts. We already see the same problem with coding agents. We can tell an agent not to touch a production database or not to modify certain files, but a stronger protection is simply not giving it those permissions.
AQuA applies the same thinking to AI research.
There is another problem the researchers also had to deal with. Even if the AI cannot see future market data, it can still overfit if it repeatedly sees the final test score.
If an agent tries enough strategies and checks the same test set every time, eventually it may find something that looks good mostly because of luck. This is another version of the same multiple-testing problem quantitative researchers have dealt with for decades.
AQuA therefore separates the scores used during experimentation from the final evaluation. In the US equity experiment, the agent searches using validation data, while the untouched 2021 to 2025 period is reserved for the final test.
AQuA Uses Two Independent “Brains”
Another interesting decision is that AQuA does not use one giant AI agent for the whole research process.
It splits the work into two separate systems.
Part I discovers trading factors
Part II develops the machine-learning model.
You can roughly think of Part I as the researcher looking for market ideas and Part II as the engineer trying to build a better prediction model.
The two systems are deliberately independent. They do not share agents, research memory, candidate spaces, or internal research state.
Part I Looks for Trading Signals
The factor-discovery side uses several specialist agents coordinated by an AI Manager.
Instead of asking an LLM to randomly invent trading formulas, the system begins with an economic idea.
For example, one experiment in the paper studies what happens after a large drop in open interest, which can happen when leveraged traders are forced out of their positions.
The system notices that some price rebounds are supported by strong buying afterward, while others bounce briefly without much buying pressure.
From there, it proposes a theory: if the market rebounds after forced selling but buyers do not strongly support that rebound, the price may be more likely to fall again.
AQuA then converts that idea into a mathematical factor and tests it against historical market data.
The strongest individual factors from this group produced Information Coefficients of roughly 0.026 to 0.037. AQuA then combines multiple useful factors rather than expecting one formula to predict everything.
The other important part is memory. When a hypothesis works or fails, that information is recorded so later runs can use it. The paper says later experiments can avoid repeatedly testing mechanisms that have already failed and spend more time exploring ideas that have stronger evidence behind them.
Part II architecture. A config-driven loop, from a hypothesis (config diff) through the training framework and the evaluation engine to a knowledge update, iterates over model variants
Across 20 autonomous research rounds, the combined factor signal eventually reached a Spearman IC of about 0.190 on the crypto dataset.
The upward trend in Figure 3 is a nice visual example of what recursive research looks like. AQuA keeps carrying useful evidence forward rather than resetting after every experiment.
Part II Tries to Build a Better Trading Model
The second half of AQuA focuses on US stocks. The task is to predict each stock’s return over the next 30 minutes.
Here the AI is no longer trying to discover a simple trading factor. It is testing different versions of a deep-learning model.
The technical architecture can get complicated quickly, but the basic idea does not need to be.
AQuA combines convolutional neural networks, which can detect short-term patterns in the data, with sequence models that can learn how those patterns change over time.
Instead of allowing the AI to rewrite the training program for every experiment, it changes a controlled configuration. It might change part of the model architecture, the loss function, or another approved training setting while the rest of the experiment stays fixed.
This again reduces the chance that an unrelated code change makes two experiments impossible to compare.
The researchers trained on data from 2010 through 2019, left 2020 as a gap, and used 2021 through 2025 as the final held-out test period.
The results were pretty interesting:
The crypto factor-discovery system reached a combined Spearman IC of about 0.190.
AQuA’s US equity model reached a raw per-stock IC of +0.0843, compared with +0.0613 for the strongest GRU baseline, a relative improvement of 37.5%.
When converted into a dollar-neutral long/short strategy, the model reached a held-out Sharpe ratio of +2.50 after transaction costs and volatility targeting.
A stricter walk-forward test, where parameters could only use past information, still produced a Sharpe of about +2.0.
AQuA combines short-term pattern detection with sequence modeling to predict 30-minute stock returns.
For anyone unfamiliar with Sharpe ratios, the number is basically a way of comparing investment returns with how much risk was taken to earn them. Higher is generally better, although backtested Sharpe ratios should always be treated carefully.
And these results are still simulations, not live trading.
The 2022 Result Caught My Attention
The paper also breaks the strategy down year by year.
It recorded a positive Sharpe in every year from 2021 through 2025, but 2022 was actually its strongest year, with a Sharpe of +3.5.
The other years came in at:
+1.7 in 2021
+1.9 in 2023
+1.8 in 2024
+2.7 in 2025
That is interesting because 2022 was a brutal year for technology stocks. According to Nasdaq’s own year-end review, the Nasdaq-100 lost 33% during 2022, its worst year since 2008.
AQuA’s strategy did not depend on the overall market going up. It was built as a dollar-neutral long/short strategy, meaning it could hold some stocks long while shorting others.
The paper’s equity curve shows the strategy moving upward through the 2022 selloff while QQQ dropped heavily.
Part II strategy equity curve.
Still, this is not a direct apples-to-apples comparison. QQQ is a long-only index product, while AQuA’s portfolio is market neutral and takes a very different type of risk. The researchers themselves point this out in the chart.
What Developers and Researchers Can Take Away From AQuA
AQuA is obviously built for quantitative finance, but I think some of its engineering ideas apply to autonomous agents in general.
The clearest lesson is that software restrictions can be much more reliable than prompt instructions.
If an AI agent should never modify a dataset, do not simply tell it not to. Make the dataset read-only. If an evaluation score should not influence experimentation, keep that score outside the agent’s environment. If some operations can introduce invalid results, give the agent a smaller set of approved tools instead of unrestricted code execution.
This becomes more important as agents become capable of running longer experiments without someone watching every action.
The whole point of autonomous research is to let the AI explore. But more autonomy also means a small mistake can survive for longer and influence more decisions. In AQuA’s case, a leaked feature could have been written into research memory as a successful discovery and then affected future experiments.
So for developers building research agents, the environment around the model may be just as important as the model itself.
What’s Next?
The next logical step for AQuA is to connect its two systems.
Right now, the factor-discovery system and model-development system operate independently. Eventually, factors discovered by Part I could become inputs for the deep-learning models in Part II.
The researchers already discuss this possibility, but there is a catch.
If both systems search the same historical data at the same time, they could start overfitting together. Part I might discover a factor because it happens to look unusually good on that data, and Part II could then build a model around the same lucky pattern.
The paper suggests a safer approach: finish the factor search first, freeze the selected factors, and only then give them to the model-development system. Part II would treat them as fixed inputs instead of being able to influence the factor search.
There are other limitations too. The crypto system was tested on one five-minute market setup, while the equity system predicts at a 30-minute horizon. A human still defines the research goal and controls the sandbox, and none of the reported strategies have been validated with live trading capital.
So I would not look at AQuA as an autonomous hedge fund that is ready to start trading tomorrow. It is much closer to an experiment in how AI could automate parts of the quant research process without completely losing control of the experiment.
Final Thoughts
I had a lot of fun reading this paper. It shows a more realistic version of what self-improving AI agents may look like.
The AI does not suddenly rewrite itself or become a better model after every experiment. It improves because it remembers what happened before, uses those results to plan another experiment, and slowly builds a more useful research history.
But the paper also shows why giving an agent unlimited freedom can backfire. The early feature-leakage failure passed through both an author AI and a reviewer AI before humans eventually found the mistake.
The fix was surprisingly simple and practical: give the agent less access.
Let it explore ideas, but lock down the data pipeline. Let it try new models, but hide the final test results. Let it learn from its experiments, but make sure a bad experiment cannot quietly change the rules for everything that comes after it.
Developers will also need to build environments where the AI can make mistakes without those mistakes corrupting everything it learns next.
I recommend giving it a read if you’re into trading and building more reliable AI agents.