Abstract
Discovering "alpha factors"—mathematical formulas that predict stock market movements—is a cornerstone of quantitative finance. However, traditional automated methods often produce uninterpretable "black box" formulas that fail to generalize. This paper presents a novel framework that integrates the reasoning capabilities of Large Language Models (LLMs) with the systematic exploration of Monte Carlo Tree Search (MCTS). By utilizing real-world backtesting feedback and a "Frequent Subtree Avoidance" mechanism, the system discovers trading signals that are more accurate, generalizable, and economically logical than those found by genetic programming or reinforcement learning.
Introduction
In the "Alpha Jungle" of quantitative finance, researchers seek predictive signals from raw market data. Traditionally, these factors are either hand-crafted by experts or mined using Genetic Programming (GP). These approaches face two significant hurdles: a lack of interpretability, often resulting in complex formulas devoid of economic logic, and search inefficiency, where algorithms frequently overfit to historical noise. This work addresses these challenges by leveraging LLMs as "financial priors" to guide a systematic search through the infinite space of mathematical formulas.
The Alpha Mining Pipeline
The proposed framework treats formula discovery as an iterative pipeline consisting of three primary components: Alpha Search, Agent Tools, and Strategy Building.
- Alpha Search: Uses MCTS to explore the formula space, with an LLM acting as the expansion and refinement engine.
- Agent Tools: A suite of utilities including market databases and backtesters that provide quantitative feedback to the search process.
- Strategy Building: A final stage where a subset of discovered alphas is selected to train machine learning models for investment simulation.
Systematic Search and Targeted Refinement
At the core of the framework is the LLM-Guided MCTS. Unlike random mutations in GP, this system uses the LLM to suggest logical refinements. Each node in the search tree represents a candidate formula. The system employs the Upper Confidence Bound for Trees (UCT) algorithm to balance the exploitation of promising formulas with the exploration of new mathematical regions.
Evaluation is multi-dimensional, assessing formulas on Effectiveness, Stability, Turnover, Diversity, and Overfitting Risk. If a formula shows high profit but low stability, the LLM is specifically prompted to "improve stability" while maintaining predictive power. To ensure diversity, a Frequent Subtree Avoidance (FSA) mechanism identifies common mathematical "clichés" and instructs the LLM to avoid them, forcing the search into novel territory.
Experimental Results
The framework was evaluated on real-world data from the Chinese A-shares (CSI 300 and CSI 1000) and the U.S. S&P 500 index. Training data covered 2011–2020, with out-of-sample testing from 2021 to late 2024.
- Performance: The framework achieved an Information Ratio (IR) of 1.3577 on the CSI 300, nearly doubling the performance of traditional GP and RL baselines.
- Generalization: The gap between in-sample and out-of-sample performance was significantly reduced, indicating that the system identifies robust signals rather than memorizing noise.
- Interpretability: Mined formulas often aligned with recognized economic principles, such as "anomalous intraday momentum," making them trustworthy for human traders.
- Efficiency: The system is cost-effective; using Gemini 2.0 Flash, a full mining run cost approximately $7.50, compared to over $70 for GPT-4, without sacrificing significant performance.
Conclusion
By combining the systematic rigor of MCTS with the heuristic reasoning of LLMs, this framework transforms alpha mining from a random search into a logical discovery process. While future work will explore multimodal data and even more complex mathematical structures, this approach already demonstrates a superior ability to navigate the complexities of the financial markets while maintaining the interpretability essential for real-world trading.
Summary updated