XAlpha: AI Quant Researcher with Memory & Reflection for Alpha Discovery

XAlpha introduces a memory-driven AI quantitative researcher that automates the full hypothesis-to-code alpha discovery loop via a multi-brain architecture, integrating report knowledge, hypothesis planning, factor evolution, empirical validation, and feedback integration, achieving superior performance on CSI300.

Bighead's Algorithm Notes
Bighead's Algorithm Notes
Bighead's Algorithm Notes
XAlpha: AI Quant Researcher with Memory & Reflection for Alpha Discovery

Abstract

Financial markets are noisy, non-stationary, and high-dimensional, making robust predictive trading signals difficult to extract. Alpha discovery has evolved from manual factor design to machine learning, evolutionary search, and recently LLM-based frameworks. However, existing methods only automate isolated steps rather than emulating an end-to-end quantitative researcher who absorbs external knowledge, closes the hypothesis-to-code validation loop, and learns from accumulated findings.

To fill this gap, the paper proposes XAlpha , a memory-driven AI quantitative researcher for continuous hypothesis-to-code alpha discovery. XAlpha maintains a multi-source research memory system that integrates financial knowledge from research reports with discovery feedback from previous generations and research cycles. Guided by this memory: Macro Brain plans research topics and selects appropriate research archetypes; Micro Brain translates the hypothesis pool into executable factor code and performs pre-validation of hypothesis–code–financial rationality tri-alignment; Cross Brain consolidates empirical results into generation-level feedback, cycle-level summaries, and archetype-level research leads for subsequent exploration. Thus XAlpha transforms alpha mining from isolated factor generation into a continuous read→hypothesize→implement→validate→reflect→evolve closed-loop research process. Experiments on CSI300 show XAlpha significantly outperforms representative baselines across all alpha discovery metrics.

Background

The core goal of alpha mining is to discover predictive trading signals—mapping historical market observations to future asset return forecasts. This is the central problem in quantitative investing, complicated by market noise, non-stationarity, and time-varying volatility (Engle, 1982). The difficulty has driven alpha discovery from manual factor design toward increasingly automated, interpretable, knowledge-driven methods (Guo et al., 2024). Yet current automation remains at isolated factor-level operations—search, generation, evaluation—rather than the complete hypothesis-driven workflow of human quants.

The paper organizes existing methods into three lineages:

Manual factor design: Researchers use economic intuition, empirical asset pricing evidence, and market observation to hand-craft factors (Fama & French, 1992, 1993; Kakushadze, 2016). These signals are interpretable and auditable but labor-intensive, hard to scale, and heavily dependent on individual experience.

Machine learning and automated search: Deep neural models learn nonlinear predictive representations from large market panels for cross-sectional return and price trend prediction (Duan et al., 2022; Xu et al., 2021a,b), but learned signals are often black boxes with weak links to explicit financial hypotheses. Genetic programming and evolutionary search discover technical trading rules and formulaic alpha factors (Allen & Karjalainen, 1999; Zhang et al., 2020; Cui et al., 2021); reinforcement learning further optimizes formula generation or alpha portfolios with performance-driven rewards (Yu et al., 2023). These retain explicit expressions and enable large-scale search, but search is driven by statistical fitness rather than financial reasoning, yielding formulas lacking solid economic grounding, poor robustness, and unstable out-of-sample performance.

Recent LLM-based systems: AlphaGPT converts natural language investment theses into alpha candidates but requires human interaction for initial ideas (Wang et al., 2023). FAMA combines neural and symbolic factor mining for interpretability but focuses on factor construction, not the full research loop (Li et al., 2024). AlphaAgent introduces regularization to reduce factor crowding and alpha decay but has limited memory and planning (Tang et al., 2025). AlphaJungle uses LLM-driven MCTS to refine formulaic alpha, keeping search symbol-centric (Shi et al., 2025). RD-Agent(Q) automates factor-model co-optimization for full-stack quant strategy optimization, not report-driven alpha hypothesis discovery (Li et al., 2025). FactorMiner introduces skill and experience memory to reuse successful patterns and failure constraints, but memory comes mainly from prior mining trials (Wang et al., 2026). CogAlpha represents alpha as executable code with LLM-driven evolutionary search and multi-agent quality checks, but lacks explicit integration of report knowledge memory, macro planning, and feedback consolidation (Liu et al., 2026).

These systems each advance the field but remain at the level of automating isolated steps, failing to integrate external knowledge absorption, research memory, hypothesis planning, factor code implementation, empirical validation, and feedback integration into a true closed-loop AI quantitative researcher. XAlpha is designed to fill this void. The "X" represents the unknown latent structure of discoverable predictive alpha signals in financial markets; the core idea adapts the emerging autonomous research agent paradigm (The AI Scientist, AI Co-Scientist, EvoScientist, etc.) to quantitative finance.

Problem Statement

The core problem: how to build an AI system that works continuously like a human quantitative researcher, turning alpha discovery into a hypothesis-to-code closed-loop research process rather than one-off factor generation or isolated backtest-driven search.

A real quant researcher cycles through: absorb market knowledge → form financial hypotheses → translate hypotheses into factor implementations → check financial rationality → empirical evaluation → reuse successes and failures for future exploration. Existing methods lack the ability to connect this entire chain.

The paper formalizes the goal: given daily OHLCV market data and external research reports, the system must continuously—without stepwise human intervention—absorb reusable financial knowledge from reports, plan research topics guided by knowledge memory and discovery feedback, translate hypotheses into executable Python factor code, pre-validate alignment of hypothesis, code, and financial logic, empirically validate using cross-sectional predictivity and out-of-sample robustness signals, attribute findings back to the research taxonomy, and update feedback memory to guide the next exploration round. The prediction target is the 10-day forward adjusted open-to-open return: y_i,t(10) = O_adj_i,t+11 / O_adj_i,t+1 - 1 where O_adj_i,t is the adjusted open price of stock i on trading day t. This convention aligns day-t factor observations with tradable returns starting from the next open.

Method

XAlpha's overall architecture is a closed-loop multi-brain system comprising core modules that form an iterative research cycle: report absorption → memory-guided hypothesis planning → executable factor code evolution → empirical validation → discovery feedback integration.

XAlpha architecture diagram
XAlpha architecture diagram

3.1 Report-to-Memory Absorption Layer (RMA)

Inspired by StructMem (Xu et al., 2026) structured memory construction, the RMA layer writes external research reports into a "report-based knowledge memory" as an upstream memory update for alpha mining. RMA does not stuff raw documents into agent prompts; instead it converts report fragments into structured, retrievable knowledge compatible with daily OHLCV factor workflows.

RMA organizes report-derived knowledge via a three-tier A/B/C taxonomy:

Tier A (OHLCV Eligibility): Input: report fragment or evidence block. Output: KEEP/DROP decision with OHLCV feasibility rationale. Only fragments whose core mechanism can be directly observed, inferred, or stably proxied from daily open, high, low, close, and volume are kept; fragments relying on order-book state or fundamentals are dropped. Example: accounting-ratio fragments based on cash flow, inventory, gross margin are DROPPED because these variables are unavailable from daily OHLCV; return decomposition fragments involving past returns, overnight returns, open-to-close decomposition are KEPT because these quantities are computable from daily open/close prices.

Tier B (Mechanism Family): Input: Tier-A approved research path atoms. Output: coarse-grained mechanism family assignment plus reusable research paths. E.g., retained fragments are grouped into trend & momentum, reversal & mean reversion, or price-volume interaction families.

Tier C (Actionable Archetype Memory): Input: Tier-B research paths. Output: records containing mechanism role and report-based research archetypes. Tier-C archetypes are not factor formulas themselves but structured research leads that guide subsequent hypothesis generation. Example: B1 trend-momentum family further split into C101 initiation momentum, C102 continuation momentum, C103 momentum failure.

By separating OHLCV eligibility screening, mechanism family classification, and actionable archetype construction, RMA enables report-based knowledge to be directly used by downstream planning and hypothesis generation without hard-coding report claims into alpha formulas.

3.2 Macro Brain: Research Planning & Archetype Routing

Macro Brain is XAlpha's cycle-level research planner. It retrieves Tier B/C knowledge, determines the current research direction, selects appropriate research archetypes, and constructs an archetype-guided hypothesis pool for the mining cycle.

At each cycle start, Macro Brain first determines a routing mode from three options: fixed-theme mode (theme pre-specified), coarse-guided mode (user gives high-level direction, Macro Brain refines into concrete themes), memory-driven mode (themes derived from accumulated discovery feedback of previous generations and cycles, using GOOD/BAD summaries, cycle-level results, and archetype coverage records to identify unresolved information gaps and avoid saturated or repeatedly failing directions). Default configuration: XAlpha first runs 5 coarse-guided cycles to initialize feedback on important mechanism families, then switches to memory-driven routing.

Given the cycle theme, Macro Brain performs B/C-level planning: selects 1 primary B-tier as the main mechanism line, 3-4 auxiliary B-tiers as complementary mechanisms or boundary conditions; these B-tiers narrow the candidate C-tier archetype scope, from which report-based research paths are retrieved; selected archetypes and paths are organized into active research agent packages, each assigned a mechanism role and hypothesis generation target.

3.3 Micro Brain: Hypothesis-to-Code Factor Evolution

Micro Brain is XAlpha's inner factor discovery loop, divided into initialization and evolution phases.

Initialization phase: At cycle start, active research agents constructed by Macro Brain convert the archetype-guided hypothesis pool into executable Python factor code, generating initial seed factors.

Evolution phase: After initialization, new factors are mainly produced by code-based evolution from retained parent factors, supplemented by periodic novelty injection to refresh the search space.

Every generated factor must pass a quality pipeline before empirical evaluation:

AST Gating: Static checks rejecting invalid syntax, unsupported imports/fields, static look-ahead leakage (e.g., negative shifts), and excessive code complexity.

Tri-Alignment Judge: Checks consistency among hypothesis rationale, code logic, and financial rationality.

Numerical Validation: Runs candidate factor to materialize factor series; discards factors with invalid values or extreme value ratio >30%, and factors with excessive low-information dates.

Unit Testing: Detects dynamic look-ahead leakage via truncation and future noise perturbation checks that static analysis cannot fully catch.

Recoverable failures are repaired and resubmitted to the same quality pipeline.

Code-based evolution operates at the mechanism level rather than random syntactic edits, with three operators: mutation (creates mechanism-level variants of a parent factor), crossover (recombines mechanisms of two parent factors into a new hypothesis expressed as code), refinement (keeps core mechanism and signal intent while simplifying non-essential implementation components). Generated offspring also pass the quality pipeline before evaluation. Factors passing the normal selection gate enter the parent pool for subsequent generations; stronger candidates enter the elite pool for archive updates and feedback integration.

Novelty injection triggers at configured cycle points. In the main setting, injection occurs when (g+1) is divisible by 4, where g is the zero-based generation index excluding the final cycle step. At injection, XAlpha recomposes active agent packages based on the current cycle theme and short-term feedback memory (recent GOOD/BAD summaries, reusable mechanisms, failure patterns) to generate fresh seed factors that differ from the current pool but remain consistent with the cycle theme. A 0.95 correlation threshold filters redundancy; filtered seeds are injected into the parent pool.

3.4 Factor Evaluation & Selection

The evaluation module assesses each factor using standard cross-sectional predictive metrics: Information Coefficient (IC), IC Information Ratio (ICIR), Rank IC (RankIC), Rank IC Information Ratio (RankICIR). Factor direction is aligned so higher alignment scores indicate stronger predictive quality.

Normal selection maintains the parent pool for subsequent evolution using training-split evidence, with looser criteria than elite selection. Offspring are deduplicated, dependency factors removed, then scored by: s_normal = (0.70 * α_train + 0.30 * r_evo_train,OOS) * d_complexity, where α_train is training alpha score, r_evo_train,OOS is rolling out-of-sample evolution score within training scope, d_complexity is implementation complexity discount. Normal gating uses relative score threshold plus static quality floor (RankIC floor 0.005, RankIC positive ratio floor 0.50); warm-start generations retain top 45% by normal score.

Elite selection retains stronger mechanisms across generations using training-validation evidence and stricter requirements: s_elite = 0.70 * α_train+val + 0.30 * r_elite_train+val,OOS. No extra complexity discount; elite gating uses higher relative threshold, RankIC floor 0.01, RankIC positive ratio floor 0.55; warm-start generations retain only top 15%.

Library admission occurs at cycle end. Admission score: s_library = 0.70 * Norm(RankIC_train+val) + 0.30 * Norm(IC_train+val). Candidate factors are admitted only if library score exceeds admission threshold (default 0.65) and rank in top half. In final reported library backtest, admitted factors are sorted by library score on the training-validation selection window; up to 40 factors with maximum absolute correlation <0.60 to already retained set are kept.

3.5 Cross Brain: Factor Attribution & Feedback Integration

Cross Brain connects empirical factor results back to XAlpha's research taxonomy and feedback memory, with three main functions:

Factor-to-Archetype Attribution (FAA): Attributes elite factors—because after repair, mutation, crossover, or refinement the final mechanism may differ from the source agent. FAA assigns factors to valid B-tier mechanism families and compatible C-tier research archetypes based on factor name, hypothesis rationale, mechanism tags, code logic, and implementation.

Feedback Construction: Converts factor results into compact GOOD/BAD summaries. GOOD feedback records validated mechanisms, positive empirical evidence, reusable principles, and direct replication constraints; BAD feedback records failure types, failed hypotheses, avoidance rules, and possible fix conditions. Summaries are mechanism-level rather than pure score-level, preserving "why it worked or failed" information.

Multi-Level Memory Update: Feedback written to three memory tiers: archetype-level (FAA-classified elite factors write validated hypothesis rationales into corresponding C-tier archetype memory), generation-level (recent GOOD/BAD summaries provide short-term feedback for novelty injection within current cycle), cycle-level (integrated feedback summarizes cycle results, guiding subsequent cycle theme selection and routing decisions).

Experiments

Experimental Setup

Dataset: Main experiments on CSI300 using Qlib daily market data. Stock universe: large-cap Chinese A-shares. Prediction target: 10-day forward adjusted open-to-open return y_i,t(10).

Calendar split: Training 2011/01/01–2020/12/31, validation 2021/01/01–2021/12/31, test 2022/01/01–2025/12/31. All experiments use identical temporal splits.

Model & runtime config: All agents use gpt-oss-120b as default LLM backend. Default Ridge regression (α=10.0) fits XAlpha-generated alphas for portfolio reporting. Each mining cycle starts with 64-factor initial seed target, maintains parent pool up to 80 factors across 10 generations. Novelty injection interval = 4. Normal and elite selection use percentile thresholds 60 and 80. Max NaN ratio = 0.30.

Evaluation metrics: Predictive quality: IC, RankIC (cross-sectional Pearson/Spearman correlation of factor scores with future returns); ICIR, RankICIR (time-series stability of IC/RankIC across evaluation dates). Portfolio evaluation: annualized return (AR), annualized excess return (AER), information ratio (IR).

Comparison with Representative Baselines

Under the same CSI300 10-day setting, XAlpha is compared against two baseline categories:

Predictive modeling baselines: Ridge, Random Forest, LightGBM, XGBoost, CatBoost, AdaBoost, plus neural networks MLP, GRU, LSTM, CNN, Transformer trained directly on the same daily OHLCV feature panel to predict the 10-day target.

Alpha method baselines: Alpha360, AutoAgent, AlphaAgent, R&D-Agent(Q), CogAlpha; each method's 40 admitted factors evaluated under the same Ridge portfolio reporting protocol.

Main results: XAlpha achieves best performance on all 7 metrics: IC=0.0619, RankIC=0.0748, ICIR=0.3703, RankICIR=0.4043, AR=0.1795, AER=0.1443, IR=1.5368. For comparison, stronger baselines: CogAlpha (IC=0.0366, IR=0.5747), AlphaAgent (IC=0.0243, IR=0.9516), MLP (IC=0.0196, IR=0.5965). XAlpha's IR of 1.5368 far exceeds AlphaAgent's 0.9516 and MLP's 0.5965, with especially large portfolio performance advantage. Cumulative return curves show XAlpha leading by a wide margin on the held-out test period.

Main results comparison
Main results comparison
Cumulative return curves
Cumulative return curves

Component Analyses

RMA Analysis

Demonstrates the A/B/C conversion process. Tier A drops accounting-ratio fragments based on cash flow, inventory, gross margin (OHLCV unavailable); keeps return decomposition fragments involving past returns, overnight returns. Tier B routes retained continuation-related fragments to B1 trend-momentum family. Tier C routes different B1 research path atoms to C101 initiation momentum, C102 continuation momentum, C103 momentum failure. This shows RMA is not simple report text retrieval but converts external evidence into structured memory supporting downstream planning.

RMA analysis illustration
RMA analysis illustration

Memory Routing Analysis

Shows how memory-driven routing converts prior feedback into next-cycle research agenda. GOOD memory records "adaptive lag structure based on volatility and liquidity pressure" → effect: retain regime-aware delayed response mechanism. BAD memory records "isolated volume spike markers, rigid lag windows, over-stacked regime adjustments" → effect: exclude these repeatedly failing patterns. Macro Brain abstracts GOOD/BAD memories into mechanism constraints; routing decision outputs theme regime_lagged_directional_pressure_response, selects lagged response as primary B-tier, with directional pressure, liquidity pressure, volatility regime, volume structure as supporting conditions.

Memory routing analysis
Memory routing analysis

Elite Single-Factor Diversity

Tests whether XAlpha discovers truly diverse elite factors rather than redundant variants. Single-theme setting (50 elite factors from vol_regime_breakout_interaction theme): mean absolute pairwise correlation 0.234, median 0.181, 68.0% of factor pairs with absolute correlation <0.3. Cross-theme setting (60 elite factors from 6 themes, 10 per theme): mean absolute correlation drops to 0.142, median 0.099, 87.1% of pairs <0.3. This supports Macro Brain's thematic routing: different themes guide search to distinct factor space regions, creating two-layer diversity—within-theme yields many non-homogeneous elite factors, cross-theme further broadens mechanism coverage.

Elite factor diversity analysis
Elite factor diversity analysis

Interpretability of Generated Factors

Shows a representative elite factor with core idea "regime-dependent reversal after downside overshoot": downside overshoot pressure measured relative to moving average anchor; pressure decays faster in high-volatility regime. Implementation includes 20-day moving average anchor, 20-day return volatility regime, downside overshoot events weighted by absolute return accumulation, regime-dependent exponential moving average smoothing, centering with extended historical benchmark. Factor achieves on train-validation: IC=0.0382, RankIC=0.0564, ICIR=0.2622, RankICIR=0.3593; on test: IC=0.0440, RankIC=0.0634, ICIR=0.2311, RankICIR=0.3188; AST complexity C(f)=14.788. This demonstrates code-based alpha discovery can still produce mechanistically readable signals.

Example elite factor code and performance
Example elite factor code and performance

Computational Cost

Under main CSI300 10-day setting: average ~15 seconds per factor generation; ~16 minutes per generation (including factor generation, validation, evaluation, parent selection, feedback construction); ~3 hours per full mining cycle (all generations, novelty injections, archive updates, feedback integration). Main experiments run on two H100 GPUs; evolution uses locally deployed gpt-oss-120b with no external API cost.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LLM Agentsquantitative financealpha discoveryCSI300AI quantitative researcherfactor evolutionhypothesis-to-codememory-driven AImulti-brain architectureXAlpha
Bighead's Algorithm Notes
Written by

Bighead's Algorithm Notes

Focused on AI applications in the fintech sector

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.