Hubble: An LLM-Driven Agentic Framework for Safe, Diverse, and Reproducible Alpha Factor Discovery
Abstract
Automated alpha discovery is difficult because the search space of formulaic factors is combinatorial, the signal-to-noise ratio in daily equity data is low, and unconstrained program generation is operationally unsafe. We present Hubble, an agentic factor mining framework that combines large language models (LLMs) with a domain-specific operator language, an abstract syntax tree (AST) execution sandbox, a dual-channel retrieval-augmented generation (RAG) module, and a family-aware selection mechanism. Instead of treating the LLM as an unconstrained code generator, Hubble restricts generation to interpretable operator trees, evaluates every candidate through a deterministic cross-sectional pipeline, and feeds back both top formulas and structured family-level diagnostics to subsequent rounds. The current system additionally introduces positive/negative RAG, formula-similarity penalties, standardized multi-metric scoring, dual reporting of RankIC and Pearson IC, and persistent diagnostics artifacts for post-hoc research analysis. On a U.S. equity universe of roughly 500 stocks, our main run evaluates 104 valid candidates across three rounds with zero runtime crashes and discovers a top set dominated by range, volatility, and trend families rather than crowded volume-only motifs. We then fix the resulting top-5 factors and validate them on a held-out period from 2025-06-01 to 2026-03-13. In this out-of-sample window, the two range factors and two volatility factors remain positive and several achieve HAC-significant Pearson IC and long-short evidence, whereas the weakest in-sample trend factor decays materially. These results suggest that safe LLM-guided search can be upgraded from a syntax-compliant generator into a reproducible alpha-research workflow that jointly optimizes validity, diversity, interpretability, and family-level generalization.
Figures & tables
| Item | Setting |
| Universe | S&P 500 ticker list ( sp500.txt ) |
| Discovery panel | 501 valid stocks |
| Discovery date range | 2022-01-01 to 2025-05-31 |
| Discovery trading days | 840 |
| OOS window | 2025-06-01 to 2026-03-13 |
| OOS trading days | 195 |
| Round | Candidates | Evaluated | OK | Errors | Best Score |
| R1 | 20 | 40 | 40 | 0 | 5.195 |
| R2 | 20 | 34 | 34 | 6 | 5.622 |
| R3 | 20 | 30 | 30 | 10 | 5.436 |
| Total | 60 | 104 | 104 | 16 | 5.622 |
| ID | Family | Structural Summary |
| Range-1 | range | normalized intraday range with temporal smoothing |
| Range-2 | range | normalized intraday range with smoothing and cross-sectional normalization |
| Volatility-1 | volatility | rolling variance of short-horizon log returns |
| Volatility-2 | volatility | rolling standard deviation of short-horizon log returns |
| Trend-1 | price trend | moving-average anchor relative to current price |
| ID | Family | Score | RankIC | RankICIR (ann.) | IC | ICIR (ann.) | LS Ret. | Turnover |
| Range-1 | range | 5.622 | 0.0059 | 0.350 | 0.0127 | 0.687 | 0.000810 | 0.113 |
| Range-2 | range | 5.486 | 0.0057 | 0.342 | 0.0130 | 0.716 | 0.000724 | 0.161 |
| Volatility-1 | volatility | 5.475 | 0.0057 | 0.368 | 0.0133 | 1.028 | 0.000546 | 0.174 |
| Volatility-2 | volatility | 5.272 | 0.0047 | 0.297 | 0.0124 | 0.851 | 0.000587 | 0.137 |
| Trend-1 | price trend | 4.609 | 0.0115 | 0.900 | 0.0110 | 0.968 | 0.000350 | 0.368 |
| ID | Family | RankIC | RankICIR (ann.) | RankIC (HAC) | IC | ICIR (ann.) | IC (HAC) | LS Ret. | LS (HAC) | Turnover |
| Range-1 | range | 0.0242 | 1.804 | 1.75 | 0.0391 | 2.788 | 2.98** | 0.00205 | 2.17* | 0.133 |
| Range-2 | range | 0.0245 | 1.860 | 1.81 | 0.0385 | 2.797 | 3.01** | 0.00209 | 2.31* | 0.182 |
| Volatility-1 | volatility | 0.0275 | 2.305 | 2.25* | 0.0131 | 1.656 | 1.68 | 0.00200 | 2.60** | 0.173 |
| Volatility-2 | volatility | 0.0232 | 1.900 | 1.81 | 0.0204 | 2.251 | 2.47* | 0.00189 | 2.27* | 0.133 |
| Trend-1 | price trend | 0.0083 | 0.794 | 0.81 | 0.0034 | 0.380 | 0.39 | 0.00064 | 0.87 | 0.374 |
| Metric | Main Run | Robustness Run |
| Model | Nemotron-120B-free | Hunter-Alpha |
| Total evaluated | 104 | 107 |
| Total OK | 104 | 105 |
| Total errors | 16 | 15 |
| Best score | 5.622 | 5.460 |
| Top families | range, volatility, trend | range, volatility, trend |