Cognitive Alpha Mining via LLM-Driven Code-Based Evolution

Fengyuan Liu, Huang Yi, Sichun Luo, Yuqi Wang, Yazheng Yang, Xinye Li, Zefa Hu, Junlan Feng, Qi Liu · OpenReview

Abstract

Discovering effective predictive signals, or "alphas," from financial data with high dimensionality and extremely low signal-to-noise ratio remains a difficult open problem. Despite progress in deep learning, genetic programming, and, more recently, large language model (LLM)–based factor generation, existing approaches still explore only a narrow region of the vast alpha search space. Neural models tend to produce opaque and fragile patterns, while symbolic or formula-based methods often yield redundant or economically ungrounded expressions that generalize poorly. Although different in form, these paradigms share a key limitation: none can conduct broad, structured, and human-like exploration that balances logical consistency with creative leaps. To address this gap, we introduce the Cognitive Alpha Mining Framework (CogAlpha), which combines code-level alpha representation with LLM-driven reasoning and evolutionary search. Treating LLMs as adaptive cognitive agents, our framework iteratively refines, mutates, and recombines alpha candidates through multi-stage prompts and financial feedback. This synergistic design enables deeper thinking, richer structural diversity, and economically interpretable alpha discovery, while greatly expanding the effective search space. Experiments on A-share equities demonstrate that CogAlpha consistently discovers alphas with superior predictive accuracy, robustness, and generalization over existing methods. Our results highlight the promise of aligning evolutionary optimization with LLM-based reasoning for automated and explainable alpha discovery. All source code will be released.

Introduction

In the competitive field of quantitative finance, the "Alpha" is the primary objective—a predictive signal capable of consistently forecasting asset returns. However, extracting these signals from the chaotic, high-dimensional, and noise-heavy environment of stock markets is a monumental task. Historically, practitioners have faced a trade-off between the slow, labor-intensive process of manual design and the "black box" complexity of deep learning models.

This paper presents CogAlpha, a framework that transforms Large Language Models (LLMs) into "cognitive agents" capable of broad, structured, and human-like exploration of the financial search space. By representing alphas as Python code rather than simple mathematical formulas, CogAlpha enables the discovery of complex, logically sound, and economically interpretable signals.

The CogAlpha Framework

CogAlpha treats alpha discovery as an integrated software engineering and reasoning problem. The architecture is designed to move beyond simple pattern replication toward genuine structural innovation.

The CogAlpha Working Stream: An iterative pipeline from raw data to a pool of qualified alpha candidates.

Seven-Level Agent Hierarchy

A core pillar of the framework is the use of 21 unique agents organized into a seven-level hierarchy. This structure ensures diversity by forcing the system to explore various types of financial logic, from macro-level market cycles to micro-level candlestick patterns.

The Seven-Level Agent Hierarchy: Organizing cognitive agents from macro-market cycles down to micro-geometric patterns.

Multi-Stage Reasoning and Quality Control

The framework employs a rigorous multi-stage pipeline to ensure the validity and quality of discovered signals:

  • Quality Checker: A dedicated gauntlet where a Judge Agent evaluates economic logic, a Code Quality Agent checks for bugs, and unit tests prevent information leakage (using future data to predict the past).
  • Thinking Evolution: Unlike traditional genetic programming that mutates numerical parameters, CogAlpha uses LLMs to perform crossover and mutation on the logic of the code itself using natural language prompts.
  • Adaptive Generation: The system maintains a feedback loop, learning from failed candidates by summarizing why they were rejected and feeding this "negative knowledge" back into the prompt for subsequent generations.

Experimental Results

CogAlpha was evaluated on the CSI 300 index of the Chinese A-share market, using daily OHLCV (Open, High, Low, Close, Volume) data. The testing period spanned 2021 to 2024, following a training period from 2011 to 2019.

Compared against 19 baselines—including traditional machine learning (XGBoost, LightGBM), deep learning (Transformers, LSTMs), and other LLM-based methods—CogAlpha demonstrated superior performance:

  • Predictive Power: It achieved an Information Coefficient (IC) of 0.0591, significantly outperforming the best non-LLM baseline (0.0358).
  • Risk-Adjusted Returns: The model reached an Information Ratio (IR) of 1.8999, nearly doubling the performance of many traditional machine learning models.
  • Interpretability: By producing Python code, CogAlpha ensures that the discovered signals are not just statistically significant but also economically grounded and auditable by human experts.

Conclusion

CogAlpha represents a significant step forward in automated alpha discovery. By aligning evolutionary optimization with LLM-based reasoning, the framework overcomes the limitations of both "black box" neural networks and "formula soup" genetic programming. The results highlight the potential for LLMs to act as sophisticated cognitive agents in complex, low-signal domains like quantitative finance.

Summary updated

BibTeX
@misc{liu2025cognitive,
  author = {Fengyuan Liu and Huang Yi and Sichun Luo and Yuqi Wang and Yazheng Yang and Xinye Li and Zefa Hu and Junlan Feng and Qi Liu},
  title = {{Cognitive Alpha Mining via LLM-Driven Code-Based Evolution}},
  year = {2025},
  eprint = {2511.18850},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.18850},
}
Figure