LLM-Generated Formulaic Alphas
- LLM-generated formulaic alphas are mathematically defined trading signals derived from historical market data and technical indicators, enabling automated factor discovery.
- They leverage prompt engineering and iterative human–AI interaction to navigate combinatorial factor spaces while ensuring interpretability, diversity, and robustness.
- Empirical studies reveal that integrating these alphas with machine learning models improves predictive accuracy and portfolio performance through controlled generation and regularization.
Searching arXiv for papers on LLM-generated formulaic alphas and related frameworks. LLM-generated formulaic alphas are mathematically expressed trading signals or predictive factors whose construction is delegated, wholly or partially, to LLMs. In the cited literature, these alphas are generated from structured financial inputs such as OHLCV data, technical indicators, sentiment, index levels, or researcher-specified hypotheses, and are then used either as direct factors in cross-sectional backtesting, as high-level features for price prediction, or as inputs to portfolio-weighting systems (Chen et al., 7 Aug 2025, Shi et al., 16 May 2025, Wang et al., 2023, Tang et al., 24 Feb 2025, Shi et al., 9 Mar 2026). The topic sits at the intersection of formulaic alpha mining, symbolic search, prompt engineering, program synthesis, and agentic evaluation. Across recent work, the central technical problem is not merely generation of syntactically valid expressions, but controlled exploration of a combinatorial factor space under constraints of interpretability, originality, robustness, and alpha decay (Shi et al., 16 May 2025, Tang et al., 24 Feb 2025, Liu et al., 24 Nov 2025, Shi et al., 9 Mar 2026).
1. Definitions and problem setting
A formulaic alpha is treated in multiple papers as an explicit function over historical market data. In the stock-prediction setting of Chen and Kawashima, each alpha is written as , where is a -dimensional input vector spanning past price, volume, technical indicators, and sentiment (Chen et al., 7 Aug 2025). In cross-sectional alpha mining, the object is instead a function , producing a score for each stock in the universe at time (Shi et al., 16 May 2025). Other work makes the representation even more concrete by encoding each alpha as an abstract syntax tree (AST) or as a self-contained Python function that maps a time-series DataFrame to a factor series (Tang et al., 24 Feb 2025, Liu et al., 24 Nov 2025, Shi et al., 9 Mar 2026).
The motivating context is the long-standing difficulty of manual alpha construction. Chen and Kawashima frame the conventional workflow as manual crafting through domain expertise and trial-and-error, a process that is time-consuming and difficult to scale (Chen et al., 7 Aug 2025). Related papers widen the diagnosis: traditional genetic programming can be search-inefficient or overfit, LLM-based generation can become homogeneous or overly dependent on prior knowledge, and unconstrained program generation can be operationally unsafe (Shi et al., 16 May 2025, Tang et al., 24 Feb 2025, Shi et al., 9 Mar 2026).
A recurrent distinction in this literature is between alphas used as signals and alphas used as features. In the prediction framework of Chen and Kawashima, the generated alphas are explicitly “not used directly for trading” but are instead treated as high-level features for models such as Transformer, LSTM, TCN, SVR, and Random Forest (Chen et al., 7 Aug 2025). By contrast, frameworks such as AlphaAgent, the LLM-powered MCTS system, CogAlpha, and Hubble evaluate candidate formulas through cross-sectional IC-, RankIC-, return-, or long-short-based backtesting and store high-performing factors in repositories or archives for subsequent use (Shi et al., 16 May 2025, Tang et al., 24 Feb 2025, Liu et al., 24 Nov 2025, Shi et al., 9 Mar 2026).
2. Prompting and generation paradigms
Prompt design is the primary interface between human financial priors and machine-generated symbolic expressions. Chen and Kawashima use a single structured task prompt per company. It requests five formulaic alphas for a target stock using stock features, technical indicators, and VADER-derived sentiment for the target company and related firms, with a worked example and requirements to normalize inputs via Z-scores and handle missing data. Their model is deepseek-r1-distill-llama-70b, used in zero-shot mode with an embedded example (Chen et al., 7 Aug 2025). The same work shows that the model produces not only formulas but also natural-language reasoning transcripts.
Alpha-GPT organizes prompting as a human–AI interaction loop. A quant researcher first expresses an intuition in free-form text, after which a Knowledge Compiler augments the request with a system prompt, a glossary of allowed operators, and few-shot examples retrieved from a repository of 101 published alphas via Faiss. The LLM, gpt-3.5-turbo-16k-0613, returns batches of candidates with identifiers, expressions, and one-paragraph explanations, and the resulting formulas are parsed and validated before genetic-programming enhancement (Wang et al., 2023). This places prompt engineering inside an iterative dialog rather than a single-shot generation step.
Other systems convert prompting into a structured search policy. The MCTS framework first asks the LLM for an “alpha portrait” in JSON, then prompts it to instantiate up to three parameter sets, with the best set selected by backtest; later refinements target one of several dimensions—Effectiveness, Stability, Diversity, Turnover, or Overfitting Risk—using few-shot exemplars from an “Alpha Zoo” repository and a correction loop until the output is parseable (Shi et al., 16 May 2025). AlphaAgent separates natural-language hypothesis generation from factor construction: an Idea Agent proposes five-part hypotheses, a Factor Agent translates them into ASTs and descriptions, and an Eval Agent scores the results and feeds failure modes back into the loop (Tang et al., 24 Feb 2025). CogAlpha moves further toward program synthesis by using dedicated mutation and crossover prompts over code blocks delimited by <<function>>...<</function>>, while Hubble constrains the LLM to a small operator language and feeds both positive and negative retrieval signals into later rounds (Liu et al., 24 Nov 2025, Shi et al., 9 Mar 2026).
A parallel line of work uses LLMs to populate broader strategy pipelines rather than only factor libraries. The “Alpha Grail” system first summarizes multimodal documents into categories such as Momentum, Mean Reversion, Volatility, and Fundamental, then prompts the model to produce category-specific formulaic alpha expressions together with one-sentence rationales (Kou et al., 2024). In a different architecture, prompt-based generation yields fifty alphas per stock, after which reinforcement learning is used to adaptively weight them in real time rather than continuing symbolic refinement (Chen et al., 1 Sep 2025).
3. Representations, search spaces, and regularization
The core representational question is how an LLM-generated alpha is encoded so that it remains executable, comparable, and auditable. One common approach is the symbolic expression tree. In the MCTS framework, leaf nodes are operands such as close_{i,t}, volume_{i,t}, or constants, while internal nodes are unary or binary operators drawn from a fixed library; a simple moving-average spread such as is explicitly described as a binary tree with root − and two MA children (Shi et al., 16 May 2025). AlphaAgent likewise parses every formula into an AST and then computes a similarity measure based on the largest structurally isomorphic subtrees shared with an existing alpha library (Tang et al., 24 Feb 2025).
A second representational line uses executable code rather than operator-only expressions. CogAlpha defines each alpha as a self-contained Python function over a single-stock DataFrame with MultiIndex (date, ticker) and columns [day_open, day_high, day_low, day_close, day_volume]. The output is a pd.Series named identically to the function, and nested loops are disallowed in favor of vectorized pandas, numpy, and talib operations (Liu et al., 24 Nov 2025). This representation supports direct code-level mutation and crossover, with docstrings carrying both economic intuition and LaTeX formulas.
A third approach narrows the search space by means of a domain-specific language (DSL). Hubble’s grammar builds formulas from the six raw fields OPEN, HIGH, LOW, CLOSE, VOLUME, and VWAP, together with a small registry of time-series, cross-sectional, logical, and arithmetic operators. Every candidate is parsed into a Python AST and subjected to structural security, complexity control, and semantic-validity checks before evaluation in a deterministic cross-sectional pipeline (Shi et al., 9 Mar 2026). This addresses the operational-safety concern stated explicitly in that work.
The regularization mechanisms used to keep generated alphas diverse and decay-resistant vary by framework but are highly structured. AlphaAgent combines originality enforcement, hypothesis–factor alignment, and complexity control. Originality is measured by AST overlap against an existing alpha library; the paper reports a hard threshold such as , alignment threshold , maximum AST depth , maximum node count , and regularization weights 0, 1, 2 chosen on a 2020 validation split (Tang et al., 24 Feb 2025). The MCTS framework introduces frequent subtree avoidance (FSA), mining top-3 closed subtrees with highest support and explicitly prompting the LLM to avoid those motifs; in its reported ablations, FSA improves efficiency and final performance by 10–20% (Shi et al., 16 May 2025). Hubble adds formula-similarity penalties, family-concentration penalties, and a family cap of two selected factors per family, while also using dual-channel retrieval to encourage under-covered motifs and suppress crowded ones (Shi et al., 9 Mar 2026). This suggests that recent systems increasingly treat alpha discovery as constrained exploration rather than unconstrained text-to-formula generation.
4. Integration into prediction, backtesting, and allocation systems
The most detailed feature-integration pipeline appears in the stock-prediction framework of Chen and Kawashima. After generation, each 4 is computed day by day and standardized as a Z-score over the training period. A sliding window of 5 days is then formed, so that for each day 6 the model receives 7 for 8, producing 9 features in total. In the Transformer variant, the encoder consumes a 0 tensor of alpha sequences, applies a 1D-conv embedding together with temporal-cycle embeddings and positional encodings, and passes the result to a standard multi-head Transformer encoder; the decoder processes 1 days of past Close prices as a 2 tensor and predicts next-day Close through cross-attention to the encoder output (Chen et al., 7 Aug 2025). Sequence models such as LSTM and TCN operate on reshaped 3 inputs, while SVR and Random Forest use flattened vectors; no additional feature selection is applied.
Several other frameworks couple generation tightly to backtesting. In the MCTS approach, each node expansion invokes the LLM to refine a formula along a selected evaluation dimension, immediately backtests the new expression, aggregates the resulting dimension scores into a reward, and backpropagates that reward through the search tree via UCT. No separate rollout is used: “the LLM proposal + immediate backtest serves as simulation” (Shi et al., 16 May 2025). Alpha-GPT instead inserts genetic programming after seed-alpha generation. Validated LLM outputs are mutated and crossed under IC-based fitness, out-of-sample IC checks, complexity regularization, and early stopping, after which top performers are backtested with transaction costs via order-book simulation in ABIDES-Gym (Wang et al., 2023).
Portfolio-level integration appears in two different forms. The risk-aware multi-agent system for automated strategy finding evaluates candidate alphas across market regimes and risk preferences using IC, Sharpe, and MDD thresholds, then enforces category diversity before passing the selected factor set into a dynamic weight-fitting network and a gating layer conditioned on market status (Kou et al., 2024). The PPO-based system takes fifty LLM-generated alphas as a fixed library, standardizes each to 4, constructs a state 5, lets the policy output a raw 6-dimensional weight vector that is clipped and 7-normalized, forms a composite alpha 8, and converts that composite signal into a position with volatility scaling and adaptive thresholds (Chen et al., 1 Sep 2025). Here the learning problem is no longer discovery of new formulas but online allocation across an LLM-generated alpha basis.
5. Empirical findings across frameworks
The prediction-oriented study of Chen and Kawashima reports next-day Close MSE as the primary metric and Information Coefficient as a secondary metric for individual alphas. On Apple, HSBC, Pepsi, Tencent, and Toyota over 2016-05-01 to 2024-05-08, Transformer models fed with LLM-generated alphas achieve MSEs of 0.0003, 0.0003, 0.0002, 0.0003, and 0.0001 respectively; Random Forest is usually the next-best baseline, with MSE often around 0.0004–0.0019, while LSTM, TCN, and SVR are worse. With sentiment included, the Transformer’s mean MSE over ten runs is 0.00029 for Apple, 0.00040 for HSBC, 0.00038 for Pepsi, 0.00050 for Tencent, and 0.00014 for Toyota; the corresponding “without sentiment” values are 0.00034, 0.00044, 0.00041, 0.00052, and 0.00019. The paper states that adding sentiment reduces MSE by 5–25% and lowers run-to-run variance. It also reports that Featuretools-generated features yield Transformer MSEs around 0.0012–0.0019, approximately 4× worse than the LLM setup, while 101 manually crafted alphas from Kakushadze give MSEs above 0.08 (Chen et al., 7 Aug 2025).
Search-oriented factor-mining studies report gains in both search efficiency and downstream predictive quality. The LLM-powered MCTS framework, evaluated on A-shares, reports that across CSI300/CSI1000 pools and 10-day/30-day targets it consistently outperforms baselines with IC improvements of 10–30%, RankIC improvements of 10–25%, annualized return gains of 5–50 bps, and Information Ratio gains of 0.1–0.5, under equalized search counts of 1k–3k LLM calls versus up to 600k GP/DSO calls. On CSI300 10-day with LightGBM, Alpha158 records IC = 0.0386 and RankIC = 0.0377, Alpha360 records IC = 0.0061 and RankIC = −0.0096, and the proposed method records IC = 0.0420 and RankIC = 0.0395; paired 9-tests over rolling monthly ICs give 0 against the best baseline (Shi et al., 16 May 2025). Alpha-GPT reports that its GP-based search enhancement roughly doubles average top-20 IC across several alpha types, with Trend Discrepancy improving from 0.0115 to 0.0226, Momentum from 0.0095 to 0.0276, and RSI from 0.0111 to 0.0253 (Wang et al., 2023).
AlphaAgent focuses explicitly on alpha decay. On the CSI 500 test period 2021–2024, it reports IC = 0.0212, ICIR = 0.1938, AR = 11.00%, IR = 1.488, and MDD = −9.36%, compared with lower values for LSTM, Transformer, LightGBM, AlphaForge, RD-Agent, DeepSeek-R1, and OpenAI-o1. On the S&P 500 over the same test period, AlphaAgent reports IC = 0.0056, ICIR = 0.0552, AR = 8.74%, IR = 1.0545, and MDD = −9.10%; the strongest baseline in that table on IC and ICIR is DeepSeek-R1 at 0.0048 and 0.0369 respectively. The paper’s yearly CSI 500 decay curves show traditional factors such as Alpha158, GP, and RSI decaying toward zero by 2024, while the 15 alphas mined by AlphaAgent remain around IC ≈ 0.02. Its ablation study further reports hit-ratio / dev-success rate / token-efficiency of 0.29 / 0.83 / 1.00 for the full system, versus 0.16 / 0.82 / 0.95 without originality, 0.21 / 0.83 / 0.97 without alignment, and 0.18 / 0.75 / 0.81 without complexity (Tang et al., 24 Feb 2025).
Portfolio-construction systems emphasize risk-adjusted returns rather than factor IC alone. The multi-agent strategy-finding framework reports a 53.17% cumulative return on SSE50 from Jan 2023 to Jan 2024, with 16.2% annual volatility, Sharpe ratio 2.86, and max drawdown −10.4%, compared with −11.73% cumulative return for the SSE50 Index, −9.17% for the EFund benchmark, and −8.81% for the Boshi Fund benchmark (Kou et al., 2024). The PPO-based alpha-weighting system reports mean cumulative returns over ten runs of 1.6817 for Apple, 0.4657 for HSBC, 0.6272 for Pepsi, 0.6245 for Tencent, and 0.0299 for Toyota, with corresponding Sharpe ratios of 1.9998, 0.8131, 1.4319, 1.1440, and 0.1011. The equal-weighted alpha portfolio yields negative cumulative returns for most stocks, and the paper states that low-correlation alpha subsets, high-contribution subsets, and 30 random-alpha subsets all still outperform their market benchmarks (Chen et al., 1 Sep 2025).
Later agentic systems emphasize breadth, robustness, and out-of-sample persistence. CogAlpha benchmarks against 19 methods on CSI300 and reports test-period performance of IC = 0.0591, RankIC = 0.0814, ICIR = 0.3410, RankICIR = 0.4350, AER = 0.1639, and IR = 1.8999, exceeding LightGBM, Alpha-158, and GPT-OSS-120B in the table provided (Liu et al., 24 Nov 2025). Hubble’s main run evaluates 104 valid candidates across three rounds on roughly 500 U.S. stocks, with zero runtime crashes among valid evaluations and a final top-5 set consisting of two range factors, two volatility factors, and one trend factor. In its held-out period from 2025-06-01 to 2026-03-13, Range-1 and Range-2 achieve Pearson IC values of 0.0391 and 0.0385 with HAC 1-statistics of 2.98 and 3.01, both marked significant at 2; Volatility-2 reaches IC = 0.0204 with IC 3; by contrast, the weakest in-sample trend factor decays materially out of sample, with IC = −0.0034 and long-short return = −0.00064 (Shi et al., 9 Mar 2026).
6. Interpretability, diversity, and open issues
Interpretability is a central claim of this literature, but it is operationalized in several different ways. Chen and Kawashima explicitly expose the model’s natural-language reasoning, including statements such as “Recall α factors capture patterns such as momentum, mean-reversion,” and concrete descriptions of how cross-company sentiment enters a factor definition; they argue that such explanations support transparency, risk assessment, and creativity in factor discovery (Chen et al., 7 Aug 2025). Alpha-GPT requires each candidate to include a one-paragraph natural-language explanation, while CogAlpha embeds economic intuition and LaTeX formulas in function docstrings (Wang et al., 2023, Liu et al., 24 Nov 2025). The MCTS framework retains pseudo-code, refinement summaries, and LLM-ranked interpretability, reporting that its formulas rank second only to pure CoT and ahead of GP/DSO by a wide margin on that qualitative criterion (Shi et al., 16 May 2025).
A common misconception is that LLM-generated alphas are necessarily opaque or unconstrained. Several systems are designed specifically to counter that. AlphaAgent forces correspondence between hypothesis, description, and AST through alignment scoring (Tang et al., 24 Feb 2025). Hubble refuses unconstrained code generation entirely by restricting all candidates to a small operator language, a whitelist-based AST sandbox, and deterministic evaluation (Shi et al., 9 Mar 2026). The multi-agent selection framework enforces category diversity, and Hubble applies a hard cap of two factors per family, indicating that diversity is treated as a formal design objective rather than an incidental property of prompt variation (Kou et al., 2024, Shi et al., 9 Mar 2026).
At the same time, the literature also documents limitations. Alpha-GPT notes that output quality depends on LLM domain alignment, token-limit constraints can reduce context in multi-round sessions, and the combined cost of LLM calls, GP search, and backtest simulation can be resource-intensive (Wang et al., 2023). AlphaAgent highlights the risk that LLMs generate homogeneous factors and worsen crowding unless originality is enforced (Tang et al., 24 Feb 2025). The PPO-based weighting paper notes overfitting risk, computational cost, and latency constraints for real-time deployment (Chen et al., 1 Sep 2025). CogAlpha states that prompt sensitivity remains a challenge and that deeper economic validity still requires expert oversight (Liu et al., 24 Nov 2025). Hubble’s out-of-sample trend-factor decay provides a concrete reminder that strong in-sample composite scores do not guarantee generalization across families (Shi et al., 9 Mar 2026).
Taken together, these results indicate a transition from prompt-only formula generation toward fully instrumented alpha-research workflows. Recent systems increasingly combine LLM reasoning with ASTs, DSLs, retrieval, multi-objective scoring, regularized search, and explicit safety checks. A plausible implication is that the distinctive contribution of LLMs in this domain is not merely faster expression synthesis, but their ability to mediate between natural-language financial hypotheses and executable symbolic structures while leaving a human-auditable trail of formulas, rationales, and diagnostics (Shi et al., 16 May 2025, Tang et al., 24 Feb 2025, Shi et al., 9 Mar 2026).