Manuscript Offprint
arXiv:2610.29663Lineage-Aware Search Control for LLM-Based Evolutionary Factor Mining
Abstract
Formulaic alpha factor mining searches for symbolic expressions that transform market data into predictive signals. Recent LLM-based evolutionary factor mining methods use large language models as semantic variation operators. Under the conventional LLM-EA paradigm, stochastic variation and fitness-based selection can leave the search weakly directed and concentrated around a narrow set of structurally similar factors. We argue that these limitations arise because current methods mainly organize search at the individual and population levels, leaving lineage-level control underused. A lineage connects successive factor variants through evolutionary descent. We propose LINEAGEEvo, which uses lineage in two coupled forms of search control: (1) lineage-conditioned LLM variation, which distills Lineage-Scoped Search Experience into operator-specific priors and fuses them with global operator priors, providing persistent, lineage-relevant guidance for LLM generation; and (2) lineage-stratified search allocation, which balances factor quality against lineage concentration by distributing the search budget across lineages during evolutionary search. Together, these mechanisms make semantic variation more direction aware and prevent branches from dominating the evolution, thereby promoting the discovery of predictive and diverse factors. We evaluate LINEAGEEvo on CSI 500 and S&P 500 in terms of factor predictiveness, portfolio performance, search efficiency, and lineage- and expression-level diversity. LINEAGEEvo achieves the strongest predictive performance on both markets, while LSPS produces a more balanced lineage distribution and a structurally broader factor pool. The results support lineage as a useful intermediate unit for controlling LLM-based evolutionary factor search.
Introduction
Formulaic alpha factor mining aims to discover mathematical expressions that transform raw market data into predictive signals for future asset returns (Kakushadze 2016). Such factors support portfolio construction and trading, yet the vast expression space and noisy, non-stationary data make predictive and stable factors difficult to discover.
Early factor discovery largely relied on human experts who designed signals based on financial intuition and empirical experience. To reduce such manual effort, automated factor mining methods have been developed, including genetic programming (GP), reinforcement learning (RL), and other machine learning approaches (Zhang et al. 2020; Yu et al. 2023; Chen et al. 2025). These methods expand the searchable factor space and enable systematic exploration beyond hand-crafted factors. However, they still rely mainly on fixed grammars, handcrafted operators, or scalar rewards, limiting semantic reasoning and adaptive reuse of search experience.
More recently, LLM-based factor mining has emerged as a promising paradigm, using pretrained models to generate and refine symbolic formulas through agent-based generation, tree search, and graph-aware evolution (Wang et al. 2023; Tang et al. 2025; Shi, Duan, and Li 2025; Guo et al. 2026; Luo et al. 2026a). Large-scale pretraining provides semantic priors over financial concepts, mathematical expressions, and programming patterns, supporting factor hypothesis generation and formula refinement. Among these approaches, LLM-based evolutionary algorithm (LLM-EA) factor mining is particularly appealing because it replaces purely syntactic genetic operators with LLM-based semantic mutation and recombination (Liu et al. 2023; Luo et al. 2026b; Ren et al. 2025; Han et al. 2026). However, two search-control challenges remain. First, LLM-based operators are flexible but weakly controllable, as the mapping from prompt context to offspring is implicit and difficult to steer persistently (Liu et al. 2023; Yin et al. 2024). Second, under limited budgets, fitness-based selection can lead to takeover, where currently strong individuals or branches receive disproportionate search opportunities, reducing diversity and risking premature convergence (Sudholt 2018; Gabor, Belzner, and Linnhoff-Popien 2018).
These challenges persist because current LLM-EA factor mining methods mainly organize search at the individual and population levels, while making limited use of lineage-level state. At the individual level, LLM operators modify selected parent factors; at the population level, evolutionary selection favors high-scoring candidates. Between them, a lineage is a descent-defined factor family whose membership follows primary evolutionary inheritance. Unlike an isolated individual or an unstructured population, a lineage preserves the continuity of local search across successive variation events, making it a natural stateful unit for both persistent operator guidance and search allocation. Conventional evolutionary algorithms have used genealogy and lineage information for diversity preservation, selection, and inheritance analysis (Burke et al. 2003; Gabor, Belzner, and Linnhoff-Popien
Corresponding author.
2018; Burlacu et al. 2013). However, using lineage as a shared scope for operator priors and search allocation remains underexplored in LLM-EA factor mining.
To address these issues, we propose LINEAGEEvo, a lineage-aware LLM-EA framework for formulaic factor mining. LINEAGEEvo represents evolutionary descent in a lineage DAG and uses lineage in two coupled forms of search control. First, it organizes Lineage-Scoped Search Experience (LSSE) into operator-specific lineage priors and fuses them with global operator priors to condition LLM-based mutation and crossover. Second, Lineage-Stratified Parent Selection (LSPS) allocates search opportunities at the lineage level before selecting parent factor(s), while a separate elite archive preserves high-quality discoveries. This design gives LLM variation a persistent local context and distributes subsequent search more evenly across evolutionary branches.
Experiments on CSI 500 and S&P 500 demonstrate the effectiveness of LINEAGEEvo across markets. Compared with the strongest baseline for each metric, LINEAGEEvo improves IC by 28.3% and 12.6%, and ICIR by 9.9% and 35.8% on CSI 500 and S&P 500, respectively, while achieving the strongest portfolio performance on both markets. Ablation results confirm the complementary roles of lineage-specific and global priors, while LSPS increases lineage entropy from 0.405 to 2.154 and average AST distance from 0.509 to 0.747, preserving a broader and less concentrated factor pool. The search curve further shows that LINEAGEEvo reaches a strong factor set rapidly, indicating efficient evolutionary search.
Our contributions are summarized as follows:
• We identify lineage-level search control as underexplored in LLM-EA factor mining and use it to connect individual-level semantic variation with population-level selection.
• We propose LINEAGEEvo, which represents descent-defined factor families in an evolutionary DAG and organizes Lineage-Scoped Search Experience into operator-specific lineage priors for LLM variation.
• We introduce lineage-stratified search allocation through LSPS, which balances lineage quality against lineage concentration, and decouple search allocation from solution preservation through a separate elite archive.
• Experiments on CSI 500 and S&P 500 show that LINEAGEEvo outperforms eight representative baselines in factor performance, while preserving greater lineage and structural diversity.
Traditional Automated Factor Mining
Traditional automated factor mining mainly formulates alpha discovery as symbolic search. AutoAlpha applies GP-style variation and quality-diversity search, AlphaGen uses reinforcement learning, and AlphaSAGE improves structure-aware exploration (Zhang et al. 2020; Yu et al. 2023; Chen et al. 2025). These methods broaden automated search, but still largely depend on predefined grammars, handcrafted operators, or scalar rewards, making it difficult to incorporate domain semantics or adaptively reuse search experience beyond predefined operators.
LLM-Based Factor Mining
Recent work introduces LLMs into factor mining as semantic generators, refiners, and search assistants. Alpha-GPT explores human–AI interactive alpha generation by translating investment ideas into candidate formulas (Wang et al. 2023), while AlphaAgent develops an autonomous agent framework with originality, hypothesis-factor alignment, and complexity control (Tang et al. 2025). Search-oriented methods further combine LLM generation with Monte Carlo Tree Search or graph-based retrieval to guide formula refinement (Shi, Duan, and Li 2025; Guo et al. 2026). These methods make factor mining more semantic by leveraging LLMs' pretraining-induced knowledge of financial concepts, mathematical expressions, and programming patterns to generate factors with richer rationales and more flexible structures. However, as suggested by AlphaBench, existing LLM-based factor mining methods may still under-exploit the exploration capacity of LLMs, motivating evolutionary frameworks that embed LLMs into iterative population-based search (Luo et al. 2026a).
LLM-EA Factor Mining
LLM-EA search combines the semantic generation ability of LLMs with the population-based optimization mechanism of evolutionary algorithms. General LLM-EA studies use LLMs as evolutionary optimizers or hyper-heuristics, where LLMs generate, mutate, recombine, or reflect on candidate solutions within an iterative search loop (Liu et al. 2023, 2024; Ye et al. 2024). In factor mining, EvoAlpha adapts this paradigm to evolutionary alpha discovery with LLM-generated factors (Luo et al. 2026b); TreEvo evolves tree-structured thoughts to capture the hierarchical nature of alpha formulas (Ren et al. 2025); and QuantaAlpha explores trajectory-level mutation and crossover to reuse effective mining experience (Han et al. 2026). These methods move beyond isolated LLM generation by introducing evolutionary variation and selection into factor search. However, they still face two fundamental search-control challenges: LLM-driven variation can be flexible but weakly controllable, while fitness-based selection can cause dominant branches to monopolize the search process.
Genealogy and Lineage in Evolutionary Algorithms
Evolutionary computation has previously used genealogy and lineage information for diversity preservation, inheritance analysis, and selection (Burke et al. 2003; Gabor, Belzner, and Linnhoff-Popien 2018; Burlacu et al. 2013). These studies establish lineage as an evolutionary abstraction. Building on this foundation, LINEAGEEvo uses each lineage as the shared scope for accumulating operator-specific priors and allocating subsequent search opportunities in LLM-EA factor mining.
Method
We propose LINEAGEEvo, a lineage-aware evolutionary framework for formulaic alpha factor mining with LLM-based semantic variation. Its central idea is to associate accumulated search experience and future search opportunities

Figure 1: Overview of LINEAGEEvo. LSPS first selects a lineage and then selects parent factor(s); lineage-specific and global operator priors are subsequently retrieved and fused to condition LLM-based variation. Valid offspring are evaluated, and the feedback path updates the lineage DAG, prior states, active population, and elite archive.
with each lineage. LINEAGEEvo uses lineage as a stateful intermediate search unit between individual-level LLM variation and population-level evolutionary selection. Specifically, lineage serves two complementary roles: (1) it defines a local scope for accumulating operator-specific search experience, and (2) it provides a unit for allocating a limited evaluation budget.
Figure 1 summarizes one iteration of LINEAGEEvo. Starting from an evolutionary state organized by lineage, Lineage-Stratified Parent Selection (LSPS) first allocates a search opportunity to a lineage and then selects parent factor(s) from the active population. The corresponding lineage-specific and global operator experience is retrieved and fused into soft guidance for LLM-based mutation or crossover. A deterministically validated offspring is subsequently evaluated, after which the lineage graph, prior states, active population, and elite archive are updated. This division of responsibilities keeps the LLM focused on semantic variation, while deterministic components govern validation, evaluation, inheritance, and search-state transitions.
Problem Setup and Lineage Representation
Let denote the market feature space and the symbolic expression space induced by a factor grammar. A formulaic alpha factor maps the historical observations of stock to a cross-sectional signal:
where is the factor value at date t. Rather than seeking a single best expression, the goal is to discover a collection of factors that exhibit strong predictive performance and temporal stability while maintaining sufficient structural diversity during search. The resulting factor pool supports downstream factor selection and combination.
LINEAGEEvo ties lineage identity to the structural inheritance induced by its variation operators. Mutation applies a local modification to a leaf node or a small subtree of one parent while preserving the remaining expression structure. Crossover is asymmetric: the parent sampled from the first selected lineage is fixed as the primary parent and provides the recipient expression backbone. A subtree from the secondary parent replaces a selected primary subtree, while the remaining primary structure is preserved.
We record these inheritance relations using a directed acyclic graph
where contains all valid factors evaluated by iteration t. The set records the inheritance of the expression backbone. A mutation offspring has one primary edge from its parent, whereas a crossover offspring has one primary edge from the backbone parent. The set records the donor ancestry of crossover, preserving the contribution of the parent that provides the replacement subtree.
Let denote the set of root factors. Since each non-root node has exactly one incoming primary inheritance edge, its lineage root is recursively defined as
The lineage associated with root is consequently
A lineage is therefore a descent-defined local search family induced by structure-preserving variation. Lineage membership follows the inherited expression backbone through primary edges, while secondary edges retain cross-lineage donor ancestry. Because mutation modifies only a local component and crossover preserves the primary backbone, nearby descendants are expected to retain greater structural and DSL-level financial-semantic continuity than factors from unrelated lineages, as verified in Appendix. This continuity provides the basis for using lineage as a scope for search experience and resource allocation.
Lineage-Stratified Search Allocation
Modules 1–2 in Figure 1 implement lineage-level search allocation. Standard individual-level fitness selection may repeatedly favor factors from already dominant branches, causing early lineage takeover and reducing exploration (Sudholt 2018; Gabor, Belzner, and Linnhoff-Popien 2018). To mitigate this effect, LINEAGEEVO organizes its active population by lineage:
where contains the active factors belonging to lineage , and is the number of active lineages.
LSPS uses a two-stage sampling procedure. It first selects a lineage and then selects a parent factor within that lineage. Both stages use a common robust quality score. Let denote the optimization metric, either IC or ICIR, and define and . For factors satisfying , the quality score is
where and . This guarantees while penalizing both strength disagreement and directional reversals.
For each lineage, we define a quality score and a lineage-balance weight:
The first term reflects the strongest active factor within the lineage, while the second assigns greater weight to less represented lineages. Their normalized mixture defines the lineage-selection distribution:
where controls the trade-off between favoring high-quality lineages and maintaining exploration across lineages.
After selecting lineage , LSPS samples a parent in proportion to its robust quality:
This two-stage probabilistic selection exploits stronger factors while preserving alternatives at both the lineage and parent levels.
For mutation, one parent is sampled from the selected lineage. For crossover, this first parent is fixed as the primary parent, while a secondary donor is drawn from another lineage whenever possible under the same sampling rule. The allocated and inherited lineages therefore coincide:
The secondary parent contributes the donor subtree and is retained through a secondary ancestry edge.
Search allocation and solution preservation are handled separately. The lineage-bucketed active population governs future parent selection, while an independent elite archive retains high-quality factors for final selection.
Lineage-Conditioned LLM Variation
Modules 3–5 in Figure 1 use evolutionary experience associated with each lineage to condition LLM-based semantic variation. Each valid offspring produces an evolutionary event that records the parent and offspring structures, their expression difference, the applied operator, and train/validation evidence. A mutation event is associated with its parent lineage, whereas a crossover event is associated with the primary lineage while retaining the secondary donor relation. We refer to the experience accumulated within a lineage as Lineage-Scoped Search Experience (LSSE).
Mutation and crossover require different forms of experience. Mutation priors summarize beneficial and harmful local modifications within one lineage, whereas crossover priors capture transferability, complementarity, and incompatibility between recipient and donor structures. Accordingly, each lineage maintains separate priors for , while stores the corresponding cross-lineage experience. Mutation uses the prior of its parent lineage, whereas crossover uses both parent-lineage priors, with the primary prior describing the recipient backbone and the secondary prior providing donor-side guidance.
The priors are updated incrementally by an event-triggered LLM rewriter:
(11)
Here, k denotes the mutation-parent lineage or the crossover primary lineage. For crossover, only the primary-lineage prior and global crossover prior are updated because the offspring inherits the primary backbone; the secondary prior remains read-only. When an improvement or degradation trigger is activated, the rewriter uses its financial and mathematical knowledge to interpret how the parent-offspring structural change alters the factor's signal construction and whether the performance metric change supports or contradicts the existing guidance. It then revises the structured prior by strengthening supported hypotheses, weakening contradicted ones, and recording reusable transformation principles or failure warnings. Mutation updates summarize beneficial and harmful local edits, while crossover updates describe transferable donor structures and their compatibility with the primary backbone. A lightweight deterministic manager validates the structured output and retains the previous state if rewriting fails.
We use the term prior to denote a structured pre-generation inductive bias rather than a normalized Bayesian distribution. Distilled from previous evolutionary evidence and provided before the next variation step, it biases the LLM toward historically promising transformations.
Let denote the lineage-prior input for the current variation. The conditioning context is constructed as
where is a deterministic fusion and prompt-rendering policy. The emphasis parameter is regulated from the recent evolutionary state of lineage , including its performance trend and stagnation status. When the lineage continues to improve, the policy places greater emphasis on its lineage-specific prior to exploit locally effective variation. Under stagnation or degradation, it increases the emphasis on the global prior to introduce transferable cross-lineage experience and reduce local search bias. The policy then fuses the two prior sources and renders the resulting context as concise natural-language guidance for the candidate LLM.
Let contain either one mutation parent or an ordered primary–secondary crossover pair, and let denote the factor grammar and generation constraints. The LLM induces
The conditioning context acts as soft semantic guidance rather than a hard search constraint. Consequently, the LLM retains the flexibility to construct new factor structures while receiving persistent lineage-relevant context unavailable from the current parents alone.
Feedback and Search-State Update
Module 6 and the feedback path in Figure 1 complete each search iteration. We summarize the search state at iteration t as
A generated expression first undergoes deterministic checks for grammar, syntax, duplicate expressions, constraints, and executability. Invalid candidates do not enter the evolutionary DAG or consume the valid-evaluation budget. A valid candidate is evaluated on the training and validation periods, producing an event that records its performance, operator, parent relations, expression change, and generalization evidence. The search state then evolves according to
where U updates the lineage DAG, active population, and elite archive, and invokes the primary-lineage and global prior updates in Equation 11 when the deterministic trigger is satisfied.
The updated lineage state carries operator experience across generations while determining how subsequent search opportunities are allocated. It therefore connects persistent LLM guidance with lineage-level population control within a single evolutionary loop.
Experiments
We evaluate LINEAGEEvo on formulaic alpha factor mining to answer the following questions: (1) whether lineage-aware search finds more predictive and stable factors; (2) whether lineage and global priors provide useful guidance for LLM-based variation; (3) whether Lineage-Stratified Parent Selection (LSPS) improves factor diversity and reduces search concentration; and (4) whether LINEAGEEvo generates higher-quality factors efficiently in the search.
Experimental Setup
Evaluation metrics. We report IC and ICIR to measure factor predictiveness, where IC denotes the average cross-sectional correlation between factor values and future returns, and ICIR reflects the temporal stability of IC. We also report portfolio-level metrics, including annualized return (AR), information ratio (IR), and maximum drawdown (MDD). AR and IR measure profitability and risk-adjusted performance, while MDD captures downside risk. Detailed metric definitions are provided in the supplementary material.
Dataset. We conduct experiments on two market universes: CSI 500 in the Chinese A-share market and S&P 500 in the U.S. stock market. Both markets use the same fixed temporal split: data from 2015-01-01 to 2020-12-31 for training, 2021-01-01 to 2022-04-30 for validation, and 2022-05-01 to 2026-04-30 for testing.
Baselines. We compare LINEAGEEvo with representative baselines from three categories: (1) traditional factor mining methods, including Alpha158 (Yang et al. 2020), GP (Koza 1992), AlphaGen (Yu et al. 2023), and AlphaSAGE (Chen et al. 2025); (2) LLM-based factor mining methods, including RD-Agent (Li et al. 2025) and AlphaPROBE (Guo et al. 2026); and (3) LLM-EA methods, including EoH (Liu et al. 2024) and ReEvo (Ye et al. 2024). Detailed descriptions of the baselines are provided in the supplementary material.
Implementation details. For all LLM-based methods, we use deepseek-v4-flash. LINEAGEEvo initializes each run with 10 LLM-generated seed roots and targets three mutation and two crossover offspring per generation until reaching valid evaluated factors. LINEAGEEvo uses an active pool of 50 factors and an elite archive of 20, with , and . We use IC as the optimization metric in the reported experiments. The prior improvement/degradation thresholds are on CSI 500 and on S&P 500, where each
| Method | CSI 500 | S&P 500 | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| IC ↑ | ICIR ↑ | AR ↑ | IR ↑ | MDD ↓ | IC ↑ | ICIR ↑ | AR ↑ | IR ↑ | MDD ↓ | |
| Alpha158 | 0.0076 | 0.0787 | 15.50% | 0.6866 | 31.62% | 0.0081 | 0.0426 | 17.58% | 0.7715 | 21.03% |
| GP | 0.0074 | 0.0774 | 15.28% | 0.6861 | 33.08% | 0.0055 | 0.0575 | 21.38% | 1.0958 | 20.55% |
| AlphaGen | 0.0345 | 0.2215 | 15.04% | 0.7176 | 36.31% | 0.0099 | 0.0587 | 20.38% | 0.9709 | 23.87% |
| AlphaSAGE | 0.0230 | 0.1855 | 13.71% | 0.7654 | 21.31% | 0.0118 | 0.0668 | 18.32% | 0.8539 | 21.62% |
| RD-Agent | 0.0395 | 0.2253 | 14.14% | 0.7199 | 29.48% | 0.0094 | 0.0464 | 11.05% | 0.7642 | 20.61% |
| AlphaPROBE | 0.0385 | 0.2298 | 11.87% | 0.7587 | 20.48% | 0.0119 | 0.0622 | 5.86% | 0.4597 | 25.55% |
| EoH | 0.0399 | 0.2493 | 9.51% | 0.5715 | 21.50% | 0.0072 | 0.0404 | 23.13% | 0.9682 | 21.83% |
| ReEvo | 0.0303 | 0.1950 | 13.66% | 0.6030 | 42.98% | 0.0047 | 0.0267 | 16.10% | 0.7397 | 18.94% |
| LineageEvo | 0.0512 | 0.2740 | 15.55% | 0.9856 | 19.39% | 0.0134 | 0.0907 | 27.00% | 1.1693 | 17.05% |
Table 1: Main results on CSI 500 and S&P 500. Bold and underlined values denote the best and second-best results.
pair gives the absolute and relative thresholds. All methods use the same Qlib TopK-Dropout backtest with top-K = 50, , daily rebalancing, and matched risk and transaction-cost settings (Yang et al. 2020). Complete prompt templates, DSL definitions, prior schemas, and validation rules are provided in the supplementary material.
Main Results
Table 1 compares LINEAGEEvo with representative traditional, LLM-based, and LLM-EA factor mining methods on both factor-level and portfolio-level metrics. For each method, we select the top 20 factors from its final factor pool according to the method-specific selection criterion when applicable, combine them into a factor set, and evaluate the resulting combined signal under the same evaluation pipeline.
LINEAGEEvo achieves the best result on all five metrics in both markets. On CSI 500, it obtains an IC of 0.0512 and an ICIR of 0.2740, together with the highest AR (15.55%) and IR (0.9856) and the lowest MDD (19.39%). On S&P 500, it similarly achieves the highest IC (0.0134), ICIR (0.0907), AR (27.00%), and IR (1.1693), while reducing MDD to 17.05%. The consistent improvements in IC and ICIR indicate that the discovered factors provide both stronger out-of-sample predictiveness and greater temporal stability. Meanwhile, the gains in AR and IR together with lower drawdown show that these predictive improvements can translate into more profitable and risk-controlled portfolios across both markets. Overall, the results support the effectiveness of combining lineage-conditioned variation with lineage-level search allocation.
Figure 2 shows that while achieving high predictive power, LINEAGEEvo maintains competitive cumulative returns throughout the test period and becomes one of the strongest-performing methods in the later stage, ultimately finishing with the highest cumulative return among the compared approaches.
Ablation on Search Priors
We isolate the contribution of each component in the prior system. LINEAGEEvo uses lineage priors to capture lineage-scoped experience and global priors to provide cross-lineage regularization. Since mutation and crossover require different forms of evolutionary experience, we also examine the contributions of their corresponding operator-specific priors.
We consider the following variants:
-
Full: the complete LINEAGEEvo framework.
-
w/o all priors: removes both lineage and global priors.
-
w/o lineage priors: removes lineage mutation and crossover priors while retaining global priors.
-
w/o global priors: removes global mutation and crossover priors while retaining lineage priors.
-
w/o mutation priors: removes both lineage and global mutation priors while retaining crossover priors.
-
w/o crossover priors: removes both lineage and global crossover priors while retaining mutation priors.
The ablation results confirm the effectiveness of the prior system. Removing all priors reduces IC from 0.0512 to 0.0384 and ICIR from 0.2740 to 0.1994, showing that prior-guided variation substantially improves factor quality. Removing lineage priors produces a similarly large degradation,

Figure 2: Cumulative return curves of different factor mining methods on CSI 500 during the test period.
| Variant | IC ↑ | ICIR ↑ |
|---|---|---|
| w/o all priors | 0.0384 | 0.1994 |
| w/o lineage priors | 0.0390 | 0.2041 |
| w/o global priors | 0.0495 | 0.2579 |
| w/o mutation priors | 0.0438 | 0.2673 |
| w/o crossover priors | 0.0445 | 0.2362 |
| Full LINEAGEEvo | 0.0512 | 0.2740 |
Table 2: Ablation study of the search-prior components on CSI 500.
indicating that lineage-scoped experience is the main source of useful guidance, while global priors alone cannot fully capture the transformation patterns specific to each lineage. The operator-specific ablations further reveal the important roles of mutation and crossover priors.
Factor Diversity and Search Concentration
We evaluate how LSPS affects predictive performance, lineage concentration, and expression diversity in the active factor pool. We compare LINEAGEEvo with a variant that removes LSPS and samples parents directly from the active pool without lineage stratification. Lineage entropy measures how evenly factors are distributed across lineages, average pairwise AST distance measures expression-level structural diversity, and the effective number of structures estimates the number of non-redundant structural families in the pool.
| Method | IC ↑ | ICIR ↑ | Lineage Entropy ↑ | AST Dist. ↑ | Eff. Struct. ↑ |
|---|---|---|---|---|---|
| w/o LSPS | 0.0381 | 0.2415 | 0.405 | 0.509 | 37.89 |
| LINEAGEEvo | 0.0512 | 0.2740 | 2.154 | 0.747 | 41.90 |
Table 3: Effect of LSPS on predictive performance and diversity on CSI 500. Higher values are better.
As shown in Table 3, LSPS improves IC from 0.0381 to 0.0512 and ICIR from 0.2415 to 0.2740, while substantially increasing all three diversity measures. This joint improvement reflects the quality-exploration trade-off built into LSPS. The quality component continues to allocate search opportunities to lineages containing strong factors, allowing promising structures to be refined across successive generations. Meanwhile, the lineage-balance component prevents these branches from monopolizing the search and preserves opportunities for underrepresented lineages that may contain distinct but still promising directions. Consequently, the final factor pool retains high-performing descendants while covering a broader and less redundant set of structures. Such a pool is more likely to provide complementary candidates for factor combination, which is consistent with the higher IC and ICIR achieved by the full method (Sudholt 2018; Gabor, Belzner, and Linnhoff-Popien 2018; Yu et al. 2023; Shi et al. 2024).
Search Efficiency
We analyze whether LINEAGEEvo can discover high-quality factors more efficiently under the same budget. For each method, we track the top-5 mean-so-far absolute IC during the search process. Specifically, at each evaluation checkpoint, we collect all valid factors generated so far, select the five factors with the highest absolute IC, and report their average IC.

Figure 3: Search efficiency comparison on CSI 500. The x-axis denotes the number of valid evaluated factors, and the y-axis reports the top-5 mean-so-far absolute IC.
Figure 3 shows different search behaviors among the three methods. RD-Agent improves quickly in the early stage but soon saturates at a relatively low top-5 mean-so-far IC, suggesting that it can rapidly identify some usable factors but lacks a mechanism to continuously exploit promising search directions. AlphaPROBE improves more gradually and eventually reaches a stronger factor set than RD-Agent, but its improvement requires more evaluations. In contrast, LINEAGEEvo maintains a consistently higher top-5 mean-so-far IC throughout most of the search process and reaches a strong plateau within about 75 valid evaluations. This pattern is consistent with the intended role of lineage-conditioned priors in preserving useful search guidance across generations.
Conclusion
In this paper, we proposed LINEAGEEvo, an LLM-EA framework that uses lineage as an intermediate organizational unit for evolutionary factor mining. LINEAGEEvo combines lineage-conditioned priors for guiding LLM variation with Lineage-Stratified Parent Selection for distributing search opportunities across lineages. The resulting framework discovers highly predictive and stable factors, achieves strong investment returns, and preserves a more diverse factor pool. Future work may compare lineage with other intermediate organizational units, such as clusters, niches, and retrieval neighborhoods, to study their respective advantages in experience reuse and search control.
References
Burke, E. K.; Gustafson, S. M.; Kendall, G.; and Krasnogor, N. 2003. Is Increased Diversity in Genetic Programming
Beneficial? An Analysis of Lineage Selection. In Proceedings of the 2003 Congress on Evolutionary Computation, volume 2, 1398–1405. IEEE.
Burlacu, B.; Affenzeller, M.; Kommenda, M.; Winkler, S.; and Kronberger, G. 2013. Visualization of Genetic Lineages and Inheritance Information in Genetic Programming. In Proceedings of the 15th Annual Conference Companion on Genetic and Evolutionary Computation, 1351–1358. ACM.
Chen, B.; Ding, H.; Shen, N.; Huang, J.; Guo, T.; Liu, L.; and Zhang, M. 2025. AlphaSAGE: Structure-Aware Alpha Mining via GFlowNets for Robust Exploration. arXiv:2509.25055.
Gabor, T.; Belzner, L.; and Linnhoff-Popien, C. 2018. Inheritance-Based Diversity Measures for Explicit Convergence Control in Evolutionary Algorithms. arXiv:1810.12470.
Guo, T.; Shen, H.; Luo, J.; Chen, B.; Ding, H.; Huang, J.; Liu, L.; Ma, Y.; and Zhang, M. 2026. AlphaPROBE: Alpha Mining via Principled Retrieval and On-graph Biased Evolution. arXiv:2602.11917.
Han, J.; Zhang, S.; Li, W.; Yang, Z.; Dong, Y.; Hu, T.; Yuan, J.; Yu, X.; Zhu, Y.; Lou, F.; Guo, X.; Liu, Z.; Jiang, T.; An, R.; Liu, J.; Wu, B.; Chen, R.; Wang, K.; Wang, Y.; Hu, S.; Kong, X.; Zhang, L.; Chen, R.; and Wang, H. 2026. QuantaAlpha: An Evolutionary Framework for LLM-Driven Alpha Mining. arXiv:2602.07085.
Kakushadze, Z. 2016. 101 Formulaic Alphas. Wilmott, 2016(84): 72–81.
Koza, J. R. 1992. Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press.
Li, Y.; Yang, X.; Yang, X.; Xu, M.; Wang, X.; Liu, W.; and Bian, J. 2025. R&D-Agent-Quant: A Multi-Agent Framework for Data-Centric Factors and Model Joint Optimization. arXiv:2505.15155.
Liu, F.; Tong, X.; Yuan, M.; Lin, X.; Luo, F.; Wang, Z.; Lu, Z.; and Zhang, Q. 2024. Evolution of Heuristics: Towards Efficient Automatic Algorithm Design Using Large Language Model. arXiv:2401.02051.
Liu, S.; Chen, C.; Qu, X.; Tang, K.; and Ong, Y.-S. 2023. Large Language Models as Evolutionary Optimizers. arXiv:2310.19046.
Luo, H.; Ko, H. T.; Chen, J.; Sun, D.; Zhang, Y.; and Liu, C. 2026a. AlphaBench: Benchmarking Large Language Models in Formulaic Alpha Factor Mining. In Proceedings of the International Conference on Learning Representations.
Luo, H.; Ko, H. T.; Sun, D.; Zhang, Y.; and Liu, C. 2026b. EvoAlpha: Evolutionary Alpha Factor Discovery with Large Language Models. In NeurIPS 2025 Workshop: Generative AI in Finance.
Ren, J.; Zhao, J.; Liu, S.; and Yang, P. 2025. From Linear to Hierarchical: Evolving Tree-structured Thoughts for Efficient Alpha Mining. arXiv:2508.16334.
Shi, H.; Song, W.; Zhang, X.; Shi, J.; Luo, C.; Ao, X.; Arian, H.; and Seco, L. 2024. AlphaForge: A Framework to Mine and Dynamically Combine Formulaic Alpha Factors. arXiv:2406.18394.
Shi, Y.; Duan, Y.; and Li, J. 2025. Navigating the Alpha Jungle: An LLM-Powered MCTS Framework for Formulaic Factor Mining. arXiv:2505.11122.
Sudholt, D. 2018. The Benefits of Population Diversity in Evolutionary Algorithms: A Survey of Rigorous Runtime Analyses. arXiv:1801.10087.
Tang, Z.; Chen, Z.; Yang, J.; Mai, J.; Zheng, Y.; Wang, K.; Chen, J.; and Lin, L. 2025. AlphaAgent: LLM-Driven Alpha Mining with Regularized Exploration to Counteract Alpha Decay. arXiv:2502.16789.
Wang, S.; Yuan, H.; Zhou, L.; Ni, L. M.; Shum, H.-Y.; and Guo, J. 2023. Alpha-GPT: Human-AI Interactive Alpha Mining for Quantitative Investment. arXiv:2308.00016.
Yang, X.; Liu, W.; Zhou, D.; Bian, J.; and Liu, T.-Y. 2020. Qlib: An AI-oriented Quantitative Investment Platform. arXiv:2009.11189.
Ye, H.; Wang, J.; Cao, Z.; Berto, F.; Hua, C.; Kim, H.; Park, J.; and Song, G. 2024. ReEvo: Large Language Models as Hyper-Heuristics with Reflective Evolution. arXiv:2402.01145.
Yin, H.; Kononova, A. V.; Bäck, T.; and van Stein, N. 2024. Controlling the Mutation in Large Language Models for the Efficient Evolution of Algorithms. arXiv:2412.03250.
Yu, S.; Xue, H.; Ao, X.; Pan, F.; He, J.; Tu, D.; and He, Q. 2023. Generating Synergistic Formulaic Alpha Collections via Reinforcement Learning. arXiv:2306.12964.
Zhang, T.; Li, Y.; Jin, Y.; and Li, J. 2020. AutoAlpha: An Efficient Hierarchical Evolutionary Algorithm for Mining Alpha Factors in Quantitative Investment. arXiv:2002.08245.
A Case Study
Illustrative trace. Figure 4 shows two sequential mutation events on sibling branches of the same lineage in a CSI500 run. At generation 30, Event 1 replaces TsSkew with TsCov between close and high returns, increasing validation from 0.0209 to 0.0369. This event triggers both lineage and global prior rewriting. Event 2 then receives the updated priors before generating a related mutation on another branch of the same lineage. All reported values are absolute IC strengths.
Rendered prior guidance. Before Event 2, Event 1 had already triggered lineage and global prior rewriting. The following excerpt shows the actual prior-related guidance rendered into the mutation prompt.
Prompt A.1: Actual Prior Guidance Before Event 2
1 Mutation experience for this lineage: 2 - Effective pattern: 3 Replacing TsSkew with TsCov between close returns and a second 4 price series, while preserving the 20-day rolling window, 5 produced a strong validation IC improvement. 6 7 - Failed patterns:
Same-lineage prior transfer across sibling branches
CSI500 | Generation 30 | Lineage f_e31f9b51a9d7

Dashed link: prior transfer across sibling branches, not a DAG ancestry edge
Figure 4: A same-lineage prior-reuse case. Event 1 replaces TsSkew with a close/high-return TsCov, triggering a structured prior rewrite. Event 2 receives this prior on a sibling branch, applies the same replacement while preserving its denominator, and strengthens the pattern from medium to high confidence. The dashed connector denotes prior transfer.
8 Avoid replacing TsSkew with TsCorr or TsIr. 9 Avoid introducing raw volume terms or EMA smoothing. 10 Preserve the close-return distributional backbone. 11 - Hint: 13 TsCov with a second price-return series may be useful, while correlation, smoothing, and volume-based modifications have repeatedly degraded this lineage. 15 - Bias warning: medium 18 19 20 Global mutation experience: 21 - Percentage-change inputs have repeatedly strengthened covariance and correlation structures across lineages. 23 - TsCov/TsCorr structures should operate on transformed return-like inputs rather than raw price or volume levels. 26 - Avoid TsIr substitutions, unnecessary smoothing, and volume-delta multipliers. 28 29 - Last updated generation: 30
31 32 33 Prior fusion decision: 34 - Lineage prior weight: 0.45 35 - Global prior weight: 0.55 36 - Balance lineage-specific evidence with global operator guidance.
The example illustrates the complementary roles of the two prior levels. The lineage prior provides factor-family-specific evidence about successful and failed transformations, whereas the global prior contributes patterns observed across lineages. Their relative emphasis is determined by the fusion policy before the guidance is inserted into the candidate-generation prompt.
B Metric Definitions
Let denote a formulaic factor, its value for stock at date , and the future return used as the prediction target. Let be the tradable stock universe at date . The factor-level and portfolio-level metrics follow standard formulaic-alpha and Qlib evaluation practice (Kakushadze 2016; Yang et al. 2020).
Information Coefficient (IC). We compute the daily cross-sectional Spearman correlation between factor values and future returns:
The reported IC is the temporal mean of daily cross-sectional IC:
Under this implementation, IC is equivalent to RankIC.
Information Coefficient Information Ratio (ICIR). ICIR measures the temporal stability of daily IC:
where is used only to avoid division by zero.
Annualized Return (AR). Let denote the daily return series passed to Qlib's risk-analysis routine and let N denote its daily annualization scaler. Following Qlib's default arithmetic accumulation, we report
Information Ratio (IR). Risk-adjusted return is measured as
Maximum Drawdown (MDD). Under arithmetic return accumulation, let . Qlib's signed drawdown statistic is
When a table reports MDD with a downward arrow and non-negative entries, we use the magnitude ; when signed values are shown, values closer to zero are better.
Validation-Oriented Test Metrics. The factor direction is fixed using validation information before test evaluation. For a metric M, the oriented test IC is
No test statistic is used for factor orientation, parent selection, prior updating, or final factor selection.
Top-5 Mean-so-Far IC. Let denote the valid factors discovered within the first valid evaluations. Search efficiency is summarized using validation IC:
where Top5( ) contains the five factors with the largest absolute validation IC discovered so far. Invalid and duplicate attempts do not advance the horizontal-axis evaluation count.
Lineage Entropy. Let be the fraction of factors in the evaluated population state that belong to lineage L. We compute
Higher entropy indicates a more balanced allocation across lineages (Sudholt 2018; Gabor, Belzner, and Linnhoff-Popien 2018).
Average Pairwise AST Distance. We measure expression-level diversity with normalized tree-edit distance between factor abstract syntax trees (ASTs). For a factor set S,
A larger value indicates greater structural dissimilarity.
Effective Number of Structures. For each factor f, let denote the complete structural signature of its normalized AST. We apply the same canonical normalization used for expression deduplication and retain all nodes and ordered parent–child relations in the resulting tree. Two factors belong to the same structural group if and only if
Thus, the groups correspond to exact normalized AST structures rather than distance-based clusters or partial motifs. Let be the empirical frequency of structural signature c in the factor set. We report
which gives the number of equally represented structures with the same structural entropy.
C Baseline Descriptions
We compare LINEAGEEvo with representative baselines from traditional factor mining, LLM-based factor mining, and LLM-EA factor mining.
Alpha158. Alpha158 is a standard hand-crafted factor set provided in Qlib and serves as a non-search reference (Yang et al. 2020).
Genetic Programming (GP). GP provides a classical non-LLM evolutionary baseline based on symbolic mutation, crossover, and fitness selection (Koza 1992).
AlphaGen. AlphaGen generates synergistic formulaic alpha collections through reinforcement learning (Yu et al. 2023).
AlphaSAGE. AlphaSAGE performs structure-aware factor mining with GFlowNet-based exploration (Chen et al. 2025).
RD-Agent. R&D-Agent-Quant is an LLM-based multi-agent framework for data-centric factor and model optimization (Li et al. 2025).
AlphaPROBE. AlphaPROBE combines principled retrieval with on-graph biased evolution for alpha mining (Guo et al. 2026).
EoH. Evolution of Heuristics uses LLMs to iteratively generate, evaluate, and evolve heuristic programs (Liu et al. 2024).
ReEvo. ReEvo uses reflective evolution to guide LLM-based heuristic search (Ye et al. 2024).
| Component | Parameter | Setting |
| LLM | Backend | deepseek-v4-flash through an OpenAI-compatible client |
| LLM | Temperature / maximum tokens | 0.7 / 8000 |
| LLM | Timeout / retries / retry wait | 120 s / 5 / 5 s |
| Search | Valid-evaluation budget | |
| Search | Initial lineage roots | 10 LLM-generated seed factors |
| Search | Valid mutation / crossover slots per generation | 3 / 2 |
| Search | Maximum attempts per slot | 5 |
| Population | Population capacity / elite archive capacity | 50 / 20 |
| Population | Maximum share of one lineage | 0.40 |
| Expression | Prompt / deterministic length limits | 40 / 50 |
| Robust score | (0.2, 0.8, 0.1) | |
| LSPS | Quality / diversity mixture weights | (0.8, 0.2) |
| Backtest | Top- / / risk degree | 50 / 5 / 0.95 |
| Backtest | Rebalancing frequency | Daily |
| Backtest | Buy / sell cost | open_cost = 0.0015 / close_cost = 0.0025 |
| Backtest | Minimum transaction cost | min_cost = 5 |
| Finalization | Number of selected factors | 1, 5, or 20, as specified |
Table 4: Main implementation and evaluation parameters.
D Experimental Protocol and Implementation Details
Markets, target, and temporal splits. We evaluate on CSI500 and S&P 500 using daily data and a common Qlib-compatible pipeline (Yang et al. 2020). The prediction target is the next-period return implemented as
For both markets, 2015-01-01 to 2020-12-31 is used for training, 2021-01-01 to 2022-04-30 for validation, and 2022-05-01 to 2026-04-30 for testing. Training and validation data may be used during search; the test period is accessed only after the final selection rule and factor set are fixed.
Core experimental parameters. Table 4 summarizes the shared configuration. Values associated with final Top-K selection vary only when the corresponding Top-1, Top-5, or Top-20 result is explicitly reported.
Candidate generation schedule. Each LLM call returns exactly one candidate expression. A generation targets three valid mutation offspring and two valid crossover offspring. Each slot permits at most five generation attempts. Invalid, duplicate, and failed-evaluation candidates are logged but do not count toward the valid-evaluation budget.
Expression grammar and deterministic validation. Candidates may use only the configured market variables, constants, and DSL operators. Validation checks JSON/expression parsing, permitted variables and operators, constants and window arguments, normalized-expression duplication, expression length, Qlib executability, empty or constant outputs, and NaN/Inf values. Only valid evaluated candidates are inserted into the lineage DAG.
Optimization metric and robust quality score. The configured optimization metric is IC or ICIR. For factors satisfying , let
Parent, lineage-quality, and final-selection decisions use
The validation term receives the largest weight, while the signed discrepancy penalizes both strength disagreement and directional reversals between training and validation.
Lineage-stratified sampling. For lineage , let and . The lineage distribution is
After sampling lineage , a parent is sampled according to
The population updater additionally limits the fraction of active factors belonging to any one lineage to 0.40.
Mutation, crossover, and lineage inheritance. Mutation selects one lineage and one parent. Crossover selects an anchor lineage and parent, then preferentially samples the partner from another lineage using the same quality–diversity policy over the remaining lineages. The parent sampled from the first selected lineage becomes the primary parent. The child inherits the primary parent's lineage, while the other parent is retained through a secondary crossover edge. Operationally, crossover replaces or enriches a subtree of the primary parent with a subtree-level structure from the secondary parent.
Operator-specific priors and fusion. Each lineage maintains separate mutation and crossover priors, and the search maintains corresponding global operator priors. Structured prior states are rendered into concise natural-language guidance before candidate generation. A deterministic fusion policy determines the relative emphasis on lineage-specific and global experience; the resulting context is soft guidance rather than a hard expression constraint. All compared variants share the same fusion and prompt infrastructure unless a prior source is explicitly removed.
Event-triggered prior rewriting. Prior rewriting is considered only after a valid candidate has been evaluated. We take IC as an example. Let and denote the IC values of the reference parent and its offspring, respectively. For crossover, the primary parent serves as the reference parent. All comparisons use absolute IC strength, consistent with the search objective.
On CSI500, an improvement trigger is activated when
whereas a degradation trigger is activated when
S&P 500 uses more sensitive thresholds. Its improvement and degradation thresholds are and , respectively.
When either trigger is activated, the rewriter receives the previous structured prior together with a structured summary of the evolutionary event and returns a complete updated state rather than a partial patch. A deterministic manager checks the output schema, merges redundant entries, removes low-value content, and retains the previous prior if rewriting fails. If neither trigger is activated, the prior remains unchanged. This event-triggered mechanism differs from unrestricted free-form reflection (Ye et al. 2024).
Population and elite archive. The population is used for future search allocation and is organized by lineage. The elite archive is updated independently and preserves the strongest evaluated factors.
Final factor selection and orientation. Final factors are selected primarily from the elite archive using the same robust score defined above. Expressions are deduplicated after normalization. The sign of each selected factor is fixed using the corresponding validation metric, and no test statistic participates in selection or orientation. For Top-K evaluation, the K highest-scoring distinct factors are selected directly. When K > 1, oriented factor values are normalized cross-sectionally each day and combined with equal weights.
Backtesting protocol. Portfolio evaluation uses Qlib's TopkDropoutStrategy with topk = 50, n_drop = 5, risk_degree = 0.95, and daily execution (Yang et al. 2020). The transaction-cost configuration uses the Qlib default values: open_cost = 0.0015 for purchases, close_cost = 0.0025 for sales, and min_cost = 5 per transaction. The same backtesting and cost configuration is applied consistently across methods within each market. AR, IR, and MDD are computed from the cost-adjusted return series produced by the shared backtesting pipeline.
Ablation configurations. The prior ablations preserve the search budget, LLM backend, LSPS policy, validation protocol, and all non-ablated components. w/o all priors removes lineage and global prior context; w/o lineage priors retains only global operator priors; w/o global priors retains only lineage-specific priors; w/o mutation priors removes both lineage and global mutation guidance; and w/o crossover priors analogously removes crossover guidance. The LSPS ablation replaces lineage-first allocation with score-weighted sampling over the complete population while leaving candidate generation and evaluation unchanged.
E Prompt Templates
LINEAGEEvo uses four principal prompt families for seed generation, mutation, crossover, and prior rewriting. Each LLM request contains one system message and one user message. Candidate-generation prompts share the same factor DSL, look-ahead prevention rules, expression-length constraints, and JSON-format requirements. For readability, the templates below retain the operator-specific instructions, runtime fields, and output schemas while abbreviating repeated DSL definitions, validation constraints, and long examples with bracketed placeholders.
Shared candidate-generation instructions. Seed, mutation, and crossover prompts instruct the LLM to use only the permitted market variables and DSL operators, avoid future information, and generate exactly one executable factor. The performance statistics provided to the LLM are absolute IC or ICIR strengths; the sign used for final factor orientation is not included in candidate-generation prompts.
Seed-generation prompt. The seed prompt encourages diversity across initial lineages and asks for a financial hypothesis together with the expression.
Prompt E.1: Seed-Generation Prompt (Compressed)
1 SYSTEM 2 3 You are an expert quantitative researcher. Generate exactly one diverse and economically plausible seed factor using only the permitted DSL. Avoid look-ahead leakage, invalid expressions, and unnecessary complexity. Return strict JSON only. 7 8 USER 9 10 Market: <MARKET> 11 Stock universe: <UNIVERSE> 12 Allowed factor language: 13 [Shared DSL and operator definitions omitted.] 14 15 Maximum expression length: <LENGTH_TARGET> 16 Existing or previously rejected factors to avoid:
| Prompt | Trigger | Main runtime inputs | Required output |
|---|---|---|---|
| Seed generation | Population initialization | Market, stock universe, factor DSL, expression-length target, and existing or rejected seed expressions | One factor with hypothesis and metadata in JSON |
| Mutation | After selecting one parent | Parent expression and metrics, lineage and global mutation priors, search-control state, fusion decision, and retry feedback | {"factor": "..."} |
| Crossover | After selecting two parents | Primary and secondary expressions and metrics, their lineage priors, global crossover prior, fusion decision, and duplicate feedback | {"factor": "..."} |
| Prior rewriting | After an informative valid evolutionary event | Previous prior, parent and child evidence, expression difference, update trigger, and target JSON schema | A complete updated prior in JSON |
Table 5: Summary of the principal prompts used by LINEAGEEvo.
<EXISTING_OR_REJECTED_EXPRESSIONS> Generate one seed based on a distinct financial hypothesis. Return: { "factor_name": "<NAME>", "hypothesis": "<FINANCIAL_HYPOTHESIS>", "factor": "<FACTOR_EXPRESSION>", "expected_signal_type": "<SIGNAL_TYPE>", "rationale": "<BRIEF_RATIONALE>", "risk_notes": "<RISKS>" }
Mutation prompt. The mutation prompt conditions the LLM on one parent, the experience accumulated within its lineage, and the corresponding global mutation prior. Program-computed control variables specify whether the current search state calls for conservative or broader variation.
Prompt E.2: Mutation Prompt (Compressed)
SYSTEM <CANDIDATE_SYSTEM_MESSAGE> Generate exactly one mutation candidate and return strict JSON only. USER Parent factor: <PARENT_EXPRESSION> Parent predictive strengths: <ABSOLUTE_PARENT_METRICS> Lineage mutation prior: <RENDERED_LINEAGE_MUTATION_PRIOR> Global mutation prior: <RENDERED_GLOBAL_MUTATION_PRIOR> Search-control state: quality_trend = <QUALITY_TREND> stagnation_state = <STAGNATION_STATE>
mutation_strength = <MUTATION_STRENGTH> Prior-fusion decision: local_weight = <LOCAL_WEIGHT> global_weight = <GLOBAL_WEIGHT> instruction = <FUSION_INSTRUCTION> Recent invalid reasons: <FAILURE_FEEDBACK> Previous duplicate to avoid: <DUPLICATE_EXPRESSION> Perform one coherent targeted mutation. Preserve useful parent structure unless broader exploration is requested. Treat the priors as soft guidance and do not override the program-computed mutation strength. [Shared DSL and validation constraints omitted.] Return only: { "factor": "<NEW_MUTATED_EXPRESSION>" }
Crossover prompt. Crossover is implemented asymmetrically. The primary parent provides the expression backbone, whereas the secondary parent provides a local donor subtree. The prompt includes lineage experience from both parents, but the fusion decision is centered on the primary lineage.
Prompt E.3: Crossover Prompt (Compressed)
SYSTEM <CANDIDATE_SYSTEM_MESSAGE> Generate exactly one crossover candidate and return strict JSON only. USER Primary parent: <PRIMARY_PARENT> Primary predictive strengths: <PRIMARY_METRICS>
10 Secondary parent: <SECONDARY_PARENT> 11 Secondary predictive strengths: < SECONDARY_METRICS> 12 13 Primary-lineage crossover prior: 14 <PRIMARY_LINEAGE_PRIOR> 15 16 Secondary-lineage crossover prior: 17 <SECONDARY_LINEAGE_PRIOR> 18 19 Global crossover prior: 20 <GLOBAL_CROSSOVER_PRIOR> 21 22 Prior-fusion decision: < FUSION_DECISION> 23 Previous duplicate to avoid: < DUPLICATE_EXPRESSION> 24 25 Use the primary parent as the main expression tree. Import only a proper non-root subtree or transformed structural motif from the secondary parent. Do not copy the complete secondary expression. 28 Keep the imported material comparable in size and complexity to 29 the replaced primary subtree, and preserve the useful primary 30 backbone. 31 32 [Shared DSL and validation constraints omitted.] 33 34 Return only: 35 {"factor": "<NEW_CROSSOVER_EXPRESSION
"}
Prior-rewriting prompt. Prior rewriting is triggered only after a valid candidate yields informative evolutionary evidence. Rather than producing a free-form reflection or a partial patch, the LLM rewrites the complete structured prior, which is subsequently checked against a deterministic schema.
Prompt E.4: Prior-Rewriting Prompt (Compressed)
1 SYSTEM 2 3 Rewrite a persistent structured prior, not a free-form reflection 4 or patch. Merge the previous knowledge with the new evidence, 5 preserve supported patterns, weaken contradicted patterns, merge 6 redundant entries, and keep the state compact. The reported 7 metrics are absolute predictive- strength values. Do not modify 8 deterministic validation, evaluation, or search control. Return 9 one complete JSON object matching the supplied schema, with no 10 Markdown.
11 12 USER 13 14 Target prior: <PRIOR_TARGET> 15 Previous structured prior: 16 <OLD_PRIOR_JSON> 17 18 New evolutionary evidence: 19 <EVALUATION_EVIDENCE_JSON> 20 21 Expression difference: < EXPRESSION_DIFF> 22 Update trigger: <TRIGGER> 23 Required JSON schema: < TARGET_JSON_SCHEMA> 24 25 Rewrite the complete prior according to the target-specific rules.
The four rewriting targets use different schemas. A lineage mutation prior records successful and failed mutation patterns, a concise hint, and potential bias risks. A lineage crossover prior records transferable and harmful patterns, complementarity, heritable structures, and crossover risks. Global mutation and crossover priors retain only patterns that are considered transferable across lineages.
• Lineage mutation prior: successful_mutation_patterns, failed_mutation_patterns, hint, and bias_risk.
• Lineage crossover prior: transferable_patterns, harmful_patterns, complementarity_profile, heritable_structures, hint, and crossover_risk.
• Global mutation prior: global_successful_mutation_patterns, global_failed_mutation_patterns, common_invalid_patterns, hint, and last_updated_generation.
• Global crossover prior: global_transferable_patterns, global_harmful_patterns, global_complementarity_patterns, hint, and last_updated_generation.
Duplicate retries reuse the original generation context and append the previous duplicate expression. Mutation retries may also include recent deterministic validation failures. Expression validity, DSL compliance, executability, and prior-schema validation are handled deterministically rather than through a separate LLM repair prompt.