Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

MAS-FactorMiner: LLM-Driven Multi-Agent System for Explainable Alpha Discovery

Python 3.9+ Architecture-MAS AI-Quant

📌 Executive Summary

MAS-FactorMiner is a framework designed to bridge the gap between traditional manual factor research and automated "black-box" mining. By orchestrating a Multi-Agent System (MAS) powered by Large Language Models (LLMs), the system automates the generation, validation, and optimization of alpha factors while preserving economic interpretability.

Unlike traditional Genetic Programming (GP) approaches that often produce "formula soup," MAS-FactorMiner utilizes autonomous agents to hypothesize factors based on financial semantics, implement them as symbolic expressions, and refine them through a closed-loop backtesting environment. This ensures that every discovered factor is backed by a financial rationale and rigorous statistical verification.


🧠 System Architecture: The Agentic Workflow

The system utilizes a specialized agent collective, each handling a distinct stage of the quantitative research lifecycle:

  1. Factor Ideator: Generates factor hypotheses grounded in market logic and economic theories (e.g., liquidity premium, momentum reversal), leveraging tool-enhanced reasoning and rapid self-verification mechanisms. .
  2. Factor Calculator: Parses symbolic expressions, computes factor values across datasets, and repairs invalid formulas using LLM-assisted error correction while adhering to a standardized operator library.
  3. Factor Evaluator: Conducts layered cross-sectional backtests, calculates IC-family metrics (IC, IR), turnover, and group returns, and generates structured diagnostic reports with quantitative insights.
  4. Factor Optimizer: Iteratively refines factors through evaluator feedback, applying mutation, crossover, and refinement strategies to enhance predictive performance and robustness.

framework


🛠️ Core Capabilities & Innovations

1. Explainable Alpha

Every factor generated by the MAS includes an LLM-generated rationale. This allows researchers to understand why a factor works, facilitating the construction of portfolios that are grounded in economic reality rather than statistical coincidences.

2. Closed-Loop Iterative Optimization

The system doesn't just mine; it learns. By utilizing a feedback loop, agents analyze failure cases (e.g., high turnover or low IC decay) and adjust their search space parameters, effectively performing Bayesian-like optimization over the symbolic expression domain.

3. Institutional-Grade Evaluation

  • Cross-Sectional Metrics: Comprehensive calculation of Rank IC, ICIR, and hit rates.
  • Factor Orthogonality: Automated correlation analysis to ensure new factors are not redundant with existing styles (Size, Value, Volatility).
  • Advanced Operator Library: Supports time-series smoothing, cross-sectional ranking, and non-linear conditional operators.

🔬 Methodology & Evaluation

Research Pipeline

  • Generation: Autonomous hypothesis generation via LLM (OpenAI-compatible APIs).
  • Refinement: Symbolic expression repair and syntax self-correction.
  • Backtest: Vectorized evaluation over $T \times N$ panel data.
  • Report: Automated generation of Markdown research reports and visualization dashboards.

Technical Performance

By leveraging structured output modes and function-calling, the system ensures a high Valid Factor Yield, significantly reducing the API costs associated with LLM-based factor mining.

Metric Capability
Model Support OpenAI-compatible APIs
Backtest Speed Optimized vectorized operations for large universes
Deduplication Symbolic canonical form checking
Reporting Integrated layer tests and cumulative IC visualizations

About

Factor Research Series 2: LLM-Driven Multi-Agent System for Explainable Alpha Discovery

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors