Harness-Aware Self-Evolving: Co-Evolving Model Weights, Harness, and Task Solutions
Summary
HASE is a reinforcement-learning framework that co-evolves model weights, task solutions, and harness components (guidance and evaluation) in a unified agentic process, enabling a single 8B-parameter model to match the performance of much larger systems on text classification and alpha factor mining tasks.
View Cached Full Text
Cached at: 07/07/26, 04:35 AM
# Co-Evolving Model Weights, Harness, and Task Solutions
Source: [https://arxiv.org/html/2607.03935](https://arxiv.org/html/2607.03935)
Haochen Luo1,3, Yi Huang2, Sichun Luo1,3, Fengyuan Liu1,3, Lei Li1,3, Zefa Hu2, Junlan Feng2, Qi Liu1,3
1School of Computing and Data Science, The University of Hong Kong 2Jiutian Research, China Mobile 3Grace Investment Machine haochen\.luo@outlook\.com,huangyi@cmjt\.chinamobile\.com,liuqi@cs\.hku\.hk
###### Abstract
Self\-evolving frameworks usually optimize task solutions while treating the surrounding harness as fixed\. We introduce Harness\-Aware Self\-Evolving \(HASE\), an agentic reinforcement\-learning framework in which a single model can generate task solutions or edit selected harness components in a multi\-turn action space\. HASE enables a single Qwen3\-8B model to match the text\-classification performance of a GPT\-OSS\-120B model that uses Claude Code as the harness proposer\. In alpha factor mining, HASE outperforms the reported GPT\-OSS\-120B baseline\. HASE also repairs imperfect evaluation components and converges to state\-of\-the\-art performance in circle\-packing algorithm discovery\. These results show that HASE improves the harness and the solution through one unified agentic process\.
Harness\-Aware Self\-Evolving: Co\-Evolving Model Weights, Harness, and Task Solutions
Haochen Luo1,3, Yi Huang2, Sichun Luo1,3, Fengyuan Liu1,3,Lei Li1,3, Zefa Hu2, Junlan Feng2, Qi Liu1,31School of Computing and Data Science, The University of Hong Kong2Jiutian Research, China Mobile3Grace Investment Machinehaochen\.luo@outlook\.com,huangyi@cmjt\.chinamobile\.com,liuqi@cs\.hku\.hk
## 1Introduction
LLMs have enabled a growing class of self\-evolving systems that iteratively generate, evaluate, and improve code or other structured artifacts\. Most such systemsNovikovet al\.\([2025](https://arxiv.org/html/2607.03935#bib.bib27)\); Wanget al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib32)\); Yuksekgonulet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib22)\)focus on the object\-level solution while assuming that the surrounding harness is fixed\.Harnessrefers to the components that mediate the model’s interaction with the task, including prompts, memory, context retrieval, tool interfaces, state management, and evaluatorsLeeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib12)\)\. This harness is often as important as the model itself: it determines what the model observes, which actions are available, and how candidate solutions are scored\.
The fixed\-harness assumption has two limitations\. First, human\-written evaluators can be incomplete or misaligned with the external environment\. Under score\-driven optimization, a model may exploit these gaps rather than solve the intended task\. Second, even when the evaluator is correct, the guidance harness may provide poor search priors: prompts may omit useful structure, memories may be too verbose or irrelevant, and retrieval policies may hide the examples needed for reasoning\. In both cases, treating the harness as immutable prevents the agent from improving the computational environment in which it operates\.
We propose Harness\-Aware Self\-Evolving \(HASE\), a framework that gives a single model one action space for both solution generation and selected harness edits\. HASE distinguishes two types of harness components\.Guidancecomponents, such as prompts, memory formatting, and context retrieval, improve search\.Evaluationcomponents, such as validators and scorers, define solution validity and task metrics\. HASE can improve guidance components freely, while evaluator edits remain anchored by real\-world feedback\.
Our contributions are threefold\. First, we introduce a unified harness\-aware self\-evolution framework\. The same model co\-evolves its policy, task solutions, and selected harness components without a separate powerful coding proposer\. Second, we evaluate HASE on online text classification, alpha factor mining, and geometric algorithm discovery\. A Qwen3\-8BYanget al\.\([2025](https://arxiv.org/html/2607.03935#bib.bib1)\)model reaches performance comparable to much larger model\-based systems\. Third, we study algorithm discovery under broken evaluators\. HASE repairs the evaluator and reaches state\-of\-the\-art performance\. These results establish HASE as an effective self\-evolving framework that jointly improves the harness, the solution, and the model\.
## 2Related Work
### 2\.1Self\-Evolving Algorithms
Self\-evolving algorithms improve object\-level artifacts through repeated proposal and evaluation\. These artifacts include code, mathematical constructions, heuristics, and task solutions\. Much of this literature keeps the model frozen and changes only the search pipeline\. Systems such as FunSearch, AlphaEvolve\-style program search, OpenEvolve, ShinkaEvolve, and related heuristic\-evolution methods use LLMs as mutation or proposal engines\. They rely on an external evaluator to select better artifactsRomera\-Paredeset al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib26)\); Novikovet al\.\([2025](https://arxiv.org/html/2607.03935#bib.bib27)\); Sharma \([2025](https://arxiv.org/html/2607.03935#bib.bib28)\); Langeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib29)\); Liuet al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib30)\)\. Recent baseline studies show that random or simple code sampling can match sophisticated evolution on some deterministic\-evaluator tasks\. This result highlights the importance of the search space and evaluator designGideoniet al\.\([2025](https://arxiv.org/html/2607.03935#bib.bib31)\)\.
A second line adapts the model distribution or search process during discovery\. These works use test\-time RL to shift an open model toward high\-scoring samples under a fixed task harnessWanget al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib32)\); Yuksekgonulet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib22)\)\. They are closer to HASE because the model changes during search\. However, they still optimize object\-level artifacts under a given harness\. A third line, including self\-modifying coding agents and coding\-environment agents, allows an agent to modify scaffolding or interact with a workspace\. Yet the improvement remains bounded by the surrounding evaluator and task harnessZhanget al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib33)\); Yanget al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib16)\); Yaoet al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib13)\); Shinnet al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib14)\); Wanget al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib15)\)\.
HASE is motivated by a gap shared by these settings\. Random sampling, evolutionary selection, and test\-time RL usually treat the harness as fixed\. The prompt, context\-management policy, tool interface, evaluator, and validation logic are assumed to be correct and immutable\. HASE instead makes selected harness components part of the agentic action space\. It also preserves a strict separation between guidance\-harness optimization and oracle\-gated evaluator repair\.
### 2\.2Harness Engineering
Model performance depends not only on model weights but also on the harness\. The harness controls what information is stored, retrieved, presented, and validated\. This view connects to tool\-use, API\-use, memory, agent\-environment, multi\-agent, and prompt\-programming systemsSchicket al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib23)\); Qinet al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib19)\); Patilet al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib20)\); Packeret al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib25)\); Parket al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib24)\); Yaoet al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib13)\); Shinnet al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib14)\); Wanget al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib15)\); Wuet al\.\([2023](https://arxiv.org/html/2607.03935#bib.bib21)\); Khattabet al\.\([2024](https://arxiv.org/html/2607.03935#bib.bib17)\)\. Meta\-Harness is the closest prior work to ours\. It optimizes harness code with an outer\-loop coding\-agent proposer that inspects source code, scores, and execution traces from prior candidates through a filesystemLeeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib12)\)\. In online text classification, Meta\-Harness discovers a harness that improves average accuracy over zero\-shot, few\-shot, ACEZhanget al\.\([2025](https://arxiv.org/html/2607.03935#bib.bib3)\), and MCEYeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib2)\)baselines while using fewer context tokens\.
HASE differs from Meta\-Harness in two key ways\. First, Meta\-Harness focuses on guidance\-harness components such as memory and context construction\. HASE also studies evaluation\-harness repair\. Second, Meta\-Harness uses an external frontier LLM, such as Claude CodeAnthropic \([2025](https://arxiv.org/html/2607.03935#bib.bib34)\), to search for a harness used by another model\. HASE instead places harness editing and task solving inside a single unified action space\. It does not rely on an external proposer\. We also evaluate HASE on the online text\-classification task studied by Meta\-Harness\. The 8B model trained with HASE achieves comparable performance on this task; detailed results are in Section[4](https://arxiv.org/html/2607.03935#S4)\.
## 3HASE Methodology
Figure 1:The overall pipeline of the HASE method and comparison with other methods\. HASE differs from pipeline\-style harness search: there is no external powerful coding proposer\. The same Qwen3\-8B policy proposes task solutions and harness edits; a deterministic phase\-level controller only validates, reviews, and commits patches emitted by that policy\.As shown in[Figure 1](https://arxiv.org/html/2607.03935#S3.F1),HASE co\-evolves the model weights, harness, and task solution\.The model can generate a solution or edit the harness within the same agentic action space\. HASE uses phase\-level review to select useful harness edits and prevent reward hacking\. We next define the editable harness components, describe the unified action space, and present the training loop\.
### 3\.1Two Types of Harness
In this paper, we separate harness evolution into two types based on component purpose:
- •Evaluation componentsare local evaluators that the system is allowed to edit\. We uselocal evaluatorfor the modifiable evaluator inside the harness\. It provides dense training\-time feedback and produces theproxy score, which can be inaccurate\. In contrast, thereal\-world evaluatoris not editable and is not part of the modifiable harness\. It is an immutable part of the external environment that defines task validity, such as a leaderboard\. Its feedback is theoracle score, which is guaranteed accurate\.
- •Guidance componentsinclude prompts, memory formatting, retrieval scripts, and context selection\. These components provide useful instructions and context for the model, improving search without changing task correctness\.
Not every task requires evaluation\-harness evolution\.Some evaluators are already trivial and reliable, such as exact\-label matching in text classification\. Others, such as financial backtesting pipelines, are too complex or risky to repair automatically\. In these cases, HASE edits only guidance components such as prompts, retrieval, memory, and context formatting\.
Real\-world evaluators are the anchors of editable local evaluator evolution\.Real\-world feedback is used only when HASE is allowed to modify a local evaluator\. It isoptional at the task level, because some tasks keep their evaluators fixed\. It isnecessary once the local evaluator is editable\. Without this anchor, a model could increase reward by weakening the local evaluator instead of producing better solutions\. HASE uses the local evaluator as the dense reward during training and queries the real\-world evaluator only at phase boundaries\. When the proxy score diverges from the oracle score, HASE adds the submitted solution to the mismatch setℳ\\mathcal\{M\}as a new test case for future evaluator repairs\.
### 3\.2Unified Action Space
HASE exposes solution generation and harness modification through a multi\-turn action space\. At each step, the model can either submit an object\-level solution or use sandbox tools to inspect and modify the editable harness\. The sandbox commands include minimal read and write actions, includingls,cat,grep,replace, andoverwrite\. Thedonecommand lets the model indicate the end of the interaction\.
The model does not receive a separate hard\-coded planner for deciding whether to solve the task or edit the harness\. Instead, the current context determines the useful action\. In alpha mining, for example, the model is asked to definecompute\_alpha\(data\), while the mutable workspace exposesprompt\.txtas a strategy guide andpool\_viewer\.pyas a context\-engineering artifact\. The model may directly submit an alpha factor, or it may inspect and overwrite these files to improve future context before submitting\. Similarly, in text classification, the model may predict a label or modify memory and retrieval tools when the current context is insufficient\.
### 3\.3HASE Algorithm: an Agentic Reinforcement\-Learning View
As described in[Algorithm 1](https://arxiv.org/html/2607.03935#alg1), HASE maintains a persistent harnesshh, a model policyπθ\\pi\_\{\\theta\}, a phase\-local candidate pool𝒞p\\mathcal\{C\}\_\{p\}, and, only when evaluation\-harness evolution is enabled, a mismatch setℳ\\mathcal\{M\}\. Each phase contains multiple GRPO epochs\. Within an epoch, the model rolls out multi\-turn trajectories that may inspect files, temporarily edit the harness, and eventually submit a solution\. Rollout\-local harness edits affect only the trajectory that produced them\. The persistent harness is updated only after phase\-level review\.
Reward design:HASE does not reward harness\-related actions by themselves\. Inspect\-only exploration and random modification receive no direct bonus or penalty\. This avoids rewarding superficial file access while preserving useful exploration\. A trajectory must ultimately submit a solution, and its reward depends on solution quality\. For guidance\-harness edits, credit isproof\-of\-concept \(PoC\)based\. If the model edits the harness, it must then generate a solution using the edited harness\. The whole trajectory receives the improved task reward, and the edit becomes a candidate for phase review\. For evaluation\-harness edits, reward is given only when the proxy score disagrees with the oracle score\. The reward is proportional to the increase in mismatch\-set agreement\. If no mismatch is detected, evaluator modifications are not rewarded\.
Algorithm 1HASE Algorithm1:Initial policy
πθ\\pi\_\{\\theta\}, initial harness
h0h\_\{0\}, local evaluator
ElocE\_\{\\mathrm\{loc\}\}, optional real\-world evaluator
ErealE\_\{\\mathrm\{real\}\}, phase count
PP, GRPO epochs
NepochN\_\{\\mathrm\{epoch\}\}
2:Initialize persistent harness
h←h0h\\leftarrow h\_\{0\}
3:ifthe task allows evaluation\-harness evolutionthen
4:Initialize mismatch set
ℳ←∅\\mathcal\{M\}\\leftarrow\\emptyset
5:endif
6:forphase
p=1,…,Pp=1,\\ldots,Pdo
7:Initialize phase candidate pool
𝒞p←∅\\mathcal\{C\}\_\{p\}\\leftarrow\\emptyset
8:forGRPO epoch
e=1,…,Nepoche=1,\\ldots,N\_\{\\mathrm\{epoch\}\}do
9:Roll out trajectories
τ∼πθ\(⋅∣x,h\)\\tau\\sim\\pi\_\{\\theta\}\(\\cdot\\mid x,h\)over solution and harness\-edit actions
10:Score submitted solutions with the local evaluator:
rtask←Eloc\(τ,h\)r\_\{\\mathrm\{task\}\}\\leftarrow E\_\{\\mathrm\{loc\}\}\(\\tau,h\)
11:Assign trajectory reward
r\(τ\)r\(\\tau\)
12:Add parseable positive\-PoC guidance edits from
τ\\tauto
𝒞p\\mathcal\{C\}\_\{p\}
13:Update
πθ\\pi\_\{\\theta\}with GRPO using
r\(τ\)r\(\\tau\)
14:endfor
15:ifthe task allows evaluation\-harness evolutionthen
16:Query
ErealE\_\{\\mathrm\{real\}\}on selected submissions and add mismatched cases to
ℳ\\mathcal\{M\}
17:Review evaluator edits against
ℳ\\mathcal\{M\}and non\-regression cases
18:endif
19:Review guidance edits in
𝒞p\\mathcal\{C\}\_\{p\}by filtering, shortlisting, and validation scoring
20:Commit the best stable harness update
h←hp\+1h\\leftarrow h\_\{p\+1\}
21:endfor
Figure 2:Circle\-packing evaluator repair\.\(a\)Co\-evolution alignment dynamics \(log scale\): the evaluator is exploited twice \(proxy score high while the oracle returns0, red markers\); HASE detects each divergence and repairs the evaluator twice, and the eventual score improves to2\.6359832\.635983, matching the AlphaEvolve state of the art\.\(b\)The staged validator code that causes those two dips: the initial evaluator omits the boundary and overlap guards \(exploit at Phases 0–1\); the first patch adds both guards but leaves the overlap tolerance at10−810^\{\-8\}\. The second patch updates the tolerance to the task\-specified10−1210^\{\-12\}and keeps proxy and oracle aligned thereafter\.Harness selection:At the phase boundary, HASE turns the best candidate into a persistent harness update\. Guidance candidates in𝒞p\\mathcal\{C\}\_\{p\}are reviewed by validation performance, while evaluator patches are reviewed only when the task permits evaluation\-harness evolution and mismatch evidence exists inℳ\\mathcal\{M\}\. The selected stable update is merged intohhand becomes visible to all rollouts in the next phase\. Sections[3\.4](https://arxiv.org/html/2607.03935#S3.SS4)and[3\.5](https://arxiv.org/html/2607.03935#S3.SS5)describe the two review rules\.
### 3\.4Guidance Harness Evolution
HASE evolves guidance harnesses by reviewing rollout\-local edits at the phase boundary\. During a rollout, the model may edit guidance components, but the edited harness is used only within that trajectory\. Parseable candidate edits are stored in the phase candidate pool𝒞p\\mathcal\{C\}\_\{p\}\. At the phase boundary, HASE filters invalid edits, ranks the candidates, and commits the stable guidance harness that yields the best reviewed task score\. The committed harness is then written to disk and becomes visible to all rollouts in the next phase\.
For guidance edits, HASE uses a lightweight proof\-of\-concept score to shortlist promising candidates\. If a trajectory edits a harness and then obtains a better task score than the current persistent harness, the edit is added to𝒞p\\mathcal\{C\}\_\{p\}\. The final commit decision is still made by phase\-level review, not by the proof\-of\-concept score alone\. This keeps the main optimization loop cheap while avoiding immediate commitment to lucky patches\. Appendix[A\.3](https://arxiv.org/html/2607.03935#A1.SS3)gives the shortlisting details\.
### 3\.5Evaluation Harness Evolution
Evaluator edits are handled differently because they define the reward itself\. Real\-world feedback is therefore used only when the local evaluator is allowed to evolve\.
HASE uses the local evaluator as the dense training\-time reward and queries the real\-world evaluator only at phase boundaries\. Evaluator patches are reviewed against the mismatch setℳ\\mathcal\{M\}: a patch is accepted only if it fixes more mismatches inℳ\\mathcal\{M\}while preserving the required evaluator interface and non\-regression cases\. Importantly, HASE does not require all evaluator errors to be fixed at once\. Agreement on the current mismatch set only means that the local evaluator matches the real\-world evaluator on the cases observed so far; it does not guarantee that the evaluator is permanently correct on all future solutions\.
This design mirrors real\-world debugging scenarios: issues are discovered and fixed iteratively as new counterexamples appear\. In the circle\-packing experiment, for example, the model first improves the evaluator by adding more checks, but still uses an incorrect tolerance\. This tolerance bug is not exposed immediately\. Later, when new solutions exploit the loose tolerance, another mismatch is detected and added toℳ\\mathcal\{M\}to guide a further evaluator repair\. Thus, evaluation\-harness evolution is a continuous self\-improvement process rather than a one\-shot repair\. The circle\-packing details are discussed in Section[4](https://arxiv.org/html/2607.03935#S4)\.
## 4Experiments
Table 1:Overview of experiments: editable harness components by domain\.Figure 3:Heilbronn Triangles evaluator alignment trajectory for co\-evolved vs\. frozen policy runs\. The exploit gap \(shaded red\) is closed rapidly once the evaluator is hardened\. Under frozen weights, performance plateaus, whereas co\-evolution allows the policy to internalize constraints and improve\.We evaluate HASE on both guidance\-harness and evaluation\-harness evolution as shown in Table[1](https://arxiv.org/html/2607.03935#S4.T1)\. For guidance harnesses, we use the Symptom2Disease text\-classification task\(Leeet al\.,[2026](https://arxiv.org/html/2607.03935#bib.bib12)\)and alpha mining following CogAlpha\(Liuet al\.,[2026](https://arxiv.org/html/2607.03935#bib.bib11)\)\. For evaluation harnesses, we use circle packing and Heilbronn triangles to test whether HASE can self\-evolve correctly from an initially incomplete harness under minimal real\-world evaluator feedback\.
### 4\.1Self\-Evolution of Evaluation Harnesses
#### 4\.1\.1Circle packing
In circle packing, the agent must place circles in a unit square while satisfying boundary and non\-overlap constraints\. HASE reaches a best packing score of2\.6359832\.635983, matching the AlphaEvolve state of the art, while starting from an incomplete local evaluator\. The key mechanism is divergence\-driven repair: when the local proxy assigns a high score but the external oracle rejects the candidate, HASE treats the proxy–oracle mismatch as a concrete signal that the evaluator harness is missing a validity check\.
Figure[2](https://arxiv.org/html/2607.03935#S3.F2)shows two repair cycles and their validator edits\. The initial validator checks only basic numeric validity and radii\. It omits boundary and overlap constraints\. Phases 0–1 exploit this evaluator, obtaining proxy score35\.45964335\.459643while the oracle returns0\. This mismatch enters the mismatch set described in §[3\.5](https://arxiv.org/html/2607.03935#S3.SS5)\. The first accepted repair adds boundary and overlap checks, realigning proxy and oracle at score2\.6070722\.607072\. A later candidate exposes a second defect: the overlap tolerance is still too loose at10−810^\{\-8\}\. This again produces a positive proxy score while the oracle returns0\. The final repair tightens verification to the task\-specified10−1210^\{\-12\}\. After this patch, proxy and oracle remain aligned, and the same policy continues object\-level search to the state\-of\-the\-art score\. Evaluator repair is therefore not unconstrained reward rewriting\. Each edit is triggered by an observed oracle disagreement and accepted only when it restores agreement on the mismatch set\.
#### 4\.1\.2Heilbronn Triangles
##### Setup
The Heilbronn triangle problem represents a continuous geometric optimization challenge: placingN=11N=11points within a unit equilateral triangle such that the minimum area of the triangles formed by any triple of these points is maximized\. The final performance score is normalized by the area of the containing equilateral triangle\. This continuous search space is susceptible to reward hacking, making it another example of co\-evolutionary evaluator repair under HASE\.
We use the Qwen3\-8B base model on a cluster of8×8\\timesNVIDIA H20 nodes\. The self\-evolution pipeline runs on the VeRL reinforcement\-learning framework\. In each phase, the orchestrator generatesNprompts=32N\_\{\\text\{prompts\}\}=32prompts for dataset creation\. The rollout engine generates3232trajectories per prompt, for1,0241,024trajectories in total\. We use a global training batch size of3232, a PPO mini\-batch size of3232, and11policy\-optimization epoch per phase\.
##### Evaluator Repair
To evaluate the self\-healing capability, HASE starts from an intentionally vulnerable weak local evaluator\. This initial evaluator validates coordinates only by confirming the absence of NaN/infinite values and verifying the point count, while completely omitting boundary checking:
```
def validate_placement(points):
n = points.shape[0]
if np.isnan(points).any() or np.isinf(points).any():
return False
if n != 11:
return False
return True
```
This omission creates an exploit opportunity\. As visualized in Appendix Figure[5](https://arxiv.org/html/2607.03935#A1.F5)A, the model in Phase 0 exploits this weak evaluator by writing a differential evolution solver that places points far outside the boundary of the containing triangle\. Since the local evaluator lacks edge checks, this cheat yields a high proxy score of0\.0270760\.027076, whereas the oracle score is0\.00\.0\. Once the divergence check detects this discrepancy, HASE synthesizes and commits a barycentric coordinate sign check into the local validator, closing the exploit gap \(Appendix Figure[5](https://arxiv.org/html/2607.03935#A1.F5)B\)\.
##### Weight Co\-Evolution Necessity Ablation
To demonstrate the necessity of parameter co\-evolution, we compare the co\-evolved run with a frozen\-policy baseline\. In the FREEZE baseline \(Figure[3](https://arxiv.org/html/2607.03935#S4.F3)B\), the evaluator is repaired and the exploit gap closes, but the model weights remain fixed\. The final valid score plateaus at0\.0218800\.021880\. In the FULL co\-evolution run \(Figure[3](https://arxiv.org/html/2607.03935#S4.F3)A\), RL updates let the policy internalize the repaired constraints and continue optimizing\. The run reaches a fully valid score of0\.0360820\.036082by Phase 8\.
### 4\.2Self\-Evolution of Guidance Harnesses
#### 4\.2\.1Experiment: Text Classification
Setup: Alignment with Meta\-Harness\.HASE uses the Symptom2Disease train/validation/test split aligned with Meta\-HarnessLeeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib12)\)\. The training split is the only retrieval pool\. The validation split is used only for phase\-boundary harness review\. Final accuracy is reported on the untouched test set\. At test time, the committedclassification\_tools\.pyandprompt\.txtare frozen\. Decoding uses single\-attempt greedy vLLM inference\. No test\-time editing, fine\-tuning, retry, or retrieval over test examples is allowed\. This makes the comparison algorithm\-level: Meta\-Harness uses GPT\-OSS\-120B plus a separate strong coding\-agent harness proposer, whereas HASE uses Qwen3\-8B as both the classifier and the source of candidate harness edits\. Full protocol controls are in Appendix[A\.4](https://arxiv.org/html/2607.03935#A1.SS4)\.
The S2D harness exposes two editable guidance components: retrieval over the training pool and memory formatting for label\-disambiguating diagnostic clues\. A deterministic phase\-level reviewer filters invalid or duplicate patches, checks the required tool interface, evaluates shortlisted harnesses on validation examples, and commits only validation\-improving patches\. It never proposes code edits; every candidate edit is emitted by the same 8B policy used for classification\.
During training, the environment permits up to three discounted attempts with sandbox error feedback\. This encourages tool debugging\. Final test evaluation remains single\-attempt\.
Table 2:S2D accuracy on the Meta\-Harness split\. The HASE system uses temperature\-0greedy vLLM decoding, and its result is reported as mean±\\pmstd over55seeds\. MCEYeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib2)\), ACEZhanget al\.\([2025](https://arxiv.org/html/2607.03935#bib.bib3)\), and Meta\-Harness baselines are from Meta\-HarnessLeeet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib12)\)\.The standalone Qwen3\-8B few\-shot baseline is weaker than GPT\-OSS\-120B on this split, but the discovered HASE harness brings the same 8B model to the Meta\-Harness operating point\. We therefore treat S2D primarily as a guidance\-harness stress test: the final single\-attempt test measures harness\-mediated classification, while Appendix[A\.2](https://arxiv.org/html/2607.03935#A1.SS2)and Appendix[A\.1](https://arxiv.org/html/2607.03935#A1.SS1)report the multi\-turn training behavior and concrete self\-correction trajectories\. Appendix[C](https://arxiv.org/html/2607.03935#A3)gives the statistical reporting details\.
#### 4\.2\.2Experiment: Alpha Factor Mining
Alpha mining is naturally a code\-evolution problem\. Each candidate alpha is a small program that transforms historical market data \(e\.g\., daily OHLCV\) into a predictive signal for future returns\.
Recent LLM\-driven frameworks like CogAlphaLiuet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib11)\)report strong performance by leveraging GPT\-OSS\-120B and human\-engineered orchestration, including a 21\-agent hierarchy, quality checkers, cognitive prompting, and dynamic paraphrasing\. While highly effective, this paradigm requires complex, statically coded human priors\. We deploy HASE to test whether a much smaller 8B model can evolve both object\-level alpha code and its own code\-search harness from a minimal state\.
##### Protocol and Editable Surface\.
Following CogAlphaLiuet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib11)\), our alpha\-mining experiments use the same CSI300 benchmark, 10\-day forward\-return target, and chronological split: training \(2011–2019\), validation \(2020\), and out\-of\-sample testing \(2021–2024\)\. Harness search and phase\-boundary review use only the training and validation periods\. The HASE loop trains a single Qwen3\-8B model across 4 GPUs for 3 phases, with 3 epochs per phase\. The editable surface is restricted toprompt\.txtandpool\_viewer\.py\. The prompt file specifies search priors over factor families\. The pool viewer formats historical discoveries into the context window\. Both files are initialized minimally, and the financial evaluator is fixed throughout\.
Seed harnessinitial
prompt\.txt
minimal task instruction; weak priorspool\_viewer\.py
for f in factors\[\-3:\]:
show\(IC, desc\)
Effect:recency\-only context\.Early harnessearly evolution
prompt\.txt
adds IC goals and momentum/volatility priorspool\_viewer\.py
for f in factors:
show\(IC, desc\)
Effect:removes arbitrary cap, but context grows with the pool\.Final harnessfinal evolution
prompt\.txt
injects best IC, pool range, AER, and hybrid search priorspool\_viewer\.py
top = topIC\(factors, 10\)
for f in top: show\(f\)
Effect:quality\-ranked retrieval under context budget\.Figure 4:Alpha\-mining guidance\-harness evolution in pseudo\-code\. HASE evolves the prompt priors and factor\-pool view from recency\-only context to IC\-ranked retrieval\.Table 3:Performance comparison between HASE \(8B\) and baseline methods on the CSI300 \(10\-day horizon\)\. Baseline values are referenced from CogAlphaLiuet al\.\([2026](https://arxiv.org/html/2607.03935#bib.bib11)\)\.
##### Evaluation Controls\.
To ensure result validity, we apply the controls and audits in Appendix[B](https://arxiv.org/html/2607.03935#A2)\. These include data preprocessing for the CogAlpha\-curated 754\-instrument CSI300 universe \(§[B\.1](https://arxiv.org/html/2607.03935#A2.SS1)\), an automated future\-information leakage screen \(§[B\.2](https://arxiv.org/html/2607.03935#A2.SS2)\), and a cross\-LLM audit \(§[B\.3](https://arxiv.org/html/2607.03935#A2.SS3)\)\. In the audit, four independent LLM judges gave 120/120 unanimous CLEAN verdicts for the 30 factors used in Table[3](https://arxiv.org/html/2607.03935#S4.T3)\. To approximate real\-world trading, all table metrics are computed by a Qlib simulator following CogAlpha\(Liuet al\.,[2026](https://arxiv.org/html/2607.03935#bib.bib11)\)\. The simulator includes transaction costs, minimum\-cost constraints, and 9\.5% limit\-up/limit\-down constraints \(open\_cost=0\.0005,close\_cost=0\.0015,min\_cost=5\)\. We report IC, RankIC, ICIR, RankICIR, AER, and IR\. Appendix[D](https://arxiv.org/html/2607.03935#A4)summarizes the compute setup\.
##### Evolution of the Guidance Harness
During training, the 8B model adapted the guidance harness to context\-window pressure, as summarized in[Figure 4](https://arxiv.org/html/2607.03935#S4.F4)\. Starting from a recency\-only factor view, it first expanded access to the factor pool and later replaced unbounded context growth with IC\-ranked retrieval under a fixed context budget\. This edit changes only the search context seen by the model; the financial evaluator remains immutable\.
##### Performance
Under the CogAlpha\-aligned protocol and the controls above, HASE Qwen3\-8B achieves RankIC0\.03020\.0302, AER14\.35%14\.35\\%, and IR1\.701\.70in the Qlib cost\- and limit\-aware simulation\. As shown in Table[3](https://arxiv.org/html/2607.03935#S4.T3), this outperforms GPT\-OSS\-120B on portfolio profitability \(AER14\.35%14\.35\\%vs\.7\.89%7\.89\\%, IR1\.701\.70vs\.0\.800\.80\) while matching its predictive correlation closely \(RankIC0\.03020\.0302vs\.0\.03180\.0318\), and it exceeds every other baseline in the table\. These results show that harness\-aware self\-evolution lets a smaller model match or exceed larger baselines when task performance depends on careful harness design\.
## 5Conclusion
We introduced HASE, an agentic reinforcement\-learning framework that enables a single model to improve both task solutions and selected components of its own harness\. HASE places solution generation and harness editing in the same multi\-turn action space\. It supports two forms of harness evolution\. Guidance components, such as prompts, memory, retrieval, and context presentation, improve solution search quality\. Evaluation components provide solution scores for the system\. They are repaired only when the local evaluator’s proxy score diverges from the real\-world evaluator’s oracle score\. This divergence identifies an evaluator defect\. This design lets the model improve its working environment without turning evaluator editing into unconstrained reward hacking\.
Across online text classification, alpha factor mining, circle packing, and Heilbronn triangles, HASE demonstrates that harness\-aware self\-evolution is an effective way to increase the capability of an 8B model\-based system\. In text classification, HASE matches the performance of a GPT\-OSS\-120B system that relies on Claude Code as an external harness proposer\. In alpha factor mining, HASE outperforms the reported GPT\-OSS\-120B baseline\. In geometric algorithm discovery, HASE repairs imperfect evaluation components and then converges to state\-of\-the\-art performance\. These results establish HASE as a practical framework for co\-evolving the model policy, the harness, and the task solution within one unified agentic system\.
## 6Limitations
Our experiments establish harness\-aware self\-evolution across four task settings, but they are not an exhaustive scaling study\. Each domain still leaves room for harder follow\-up settings\.
HASE also makes conservative engineering choices that trade generality for safety\. Editable harness components are whitelisted\. Evaluator edits require divergence between the local evaluator and the real\-world evaluator\. Phase\-boundary review commits only interface\-valid patches\. These constraints can reject useful but more invasive modifications\. Future systems can expand the editable surface, add stronger static and dynamic tests, and use more informative mismatch sets while preserving the same safety principle: guidance edits and correctness\-defining evaluator edits must be governed differently\.
## References
- Claude code\.Note:[https://docs\.anthropic\.com/en/docs/claude\-code/overview](https://docs.anthropic.com/en/docs/claude-code/overview)Accessed: 2026\-07\-02Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p2.1)\.
- Y\. Gideoni, Y\. Tang, S\. Risi, and Y\. Gal \(2025\)Random baselines for simple code problems are competitive with code evolution\.InNeurIPS 2025 Fourth Workshop on Deep Learning for Code,External Links:[Link](https://openreview.net/forum?id=rbVIpbmbTc)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p1.1)\.
- O\. Khattab, A\. Singhvi, P\. Maheshwari, Z\. Zhang, K\. Santhanam, S\. V\. A, S\. Haq, A\. Sharma, T\. T\. Joshi, H\. Moazam, H\. Miller, M\. Zaharia, and C\. Potts \(2024\)DSPy: compiling declarative language model calls into state\-of\-the\-art pipelines\.InThe Twelfth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=sY5N0zY5Od)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- R\. T\. Lange, Y\. Imajuku, and E\. Cetin \(2026\)ShinkaEvolve: towards open\-ended and sample\-efficient program evolution\.InThe Fourteenth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=lKEdGCoDNC)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p1.1)\.
- Y\. Lee, R\. Nair, Q\. Zhang, K\. Lee, O\. Khattab, and C\. Finn \(2026\)Meta\-harness: end\-to\-end optimization of model harnesses, 2026\.URL https://arxiv\. org/abs/2603\.28052\.Cited by:[§1](https://arxiv.org/html/2607.03935#S1.p1.1),[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1),[§4\.2\.1](https://arxiv.org/html/2607.03935#S4.SS2.SSS1.p1.1),[Table 2](https://arxiv.org/html/2607.03935#S4.T2),[§4](https://arxiv.org/html/2607.03935#S4.p1.1)\.
- F\. Liu, X\. Tong, M\. Yuan, X\. Lin, F\. Luo, Z\. Wang, Z\. Lu, and Q\. Zhang \(2024\)Evolution of heuristics: towards efficient automatic algorithm design using large language model\.arXiv preprint arXiv:2401\.02051\.Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p1.1)\.
- F\. Liu, H\. Yi, S\. Luo, Y\. Wang, Y\. Yang, X\. Li, Z\. Hu, J\. Feng, and Q\. Liu \(2026\)Cognitive alpha mining via LLM\-driven code\-based evolution\.OpenReview\.External Links:[Link](https://openreview.net/forum?id=jfgdjMhdVo)Cited by:[§4\.2\.2](https://arxiv.org/html/2607.03935#S4.SS2.SSS2.Px1.p1.1),[§4\.2\.2](https://arxiv.org/html/2607.03935#S4.SS2.SSS2.Px2.p1.1),[§4\.2\.2](https://arxiv.org/html/2607.03935#S4.SS2.SSS2.p2.1),[Table 3](https://arxiv.org/html/2607.03935#S4.T3),[§4](https://arxiv.org/html/2607.03935#S4.p1.1)\.
- A\. Novikov, N\. Vũ, M\. Eisenberger, E\. Dupont, P\. Huang, A\. Z\. Wagner, S\. Shirobokov, B\. Kozlovskii, F\. J\. Ruiz, A\. Mehrabian,et al\.\(2025\)Alphaevolve: a coding agent for scientific and algorithmic discovery\.arXiv preprint arXiv:2506\.13131\.Cited by:[§1](https://arxiv.org/html/2607.03935#S1.p1.1),[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p1.1)\.
- C\. Packer, S\. Wooders, K\. Lin, V\. Fang, S\. G\. Patil, I\. Stoica, and J\. E\. Gonzalez \(2024\)MemGPT: towards llms as operating systems\.External Links:2310\.08560,[Link](https://arxiv.org/abs/2310.08560)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- J\. S\. Park, J\. O’Brien, C\. J\. Cai, M\. R\. Morris, P\. Liang, and M\. S\. Bernstein \(2023\)Generative agents: interactive simulacra of human behavior\.InProceedings of the 36th annual acm symposium on user interface software and technology,pp\. 1–22\.Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- S\. G\. Patil, T\. Zhang, X\. Wang, and J\. E\. Gonzalez \(2024\)Gorilla: large language model connected with massive apis\.InAdvances in Neural Information Processing Systems,External Links:[Link](https://arxiv.org/abs/2305.15334)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- Y\. Qin, S\. Liang, Y\. Ye, K\. Zhu, L\. Yan, Y\. Lu, Y\. Lin, X\. Cong, X\. Tang, B\. Qian, S\. Zhao, R\. Tian, R\. Xie, J\. Zhou, M\. Gerstein, D\. Li, Z\. Liu, and M\. Sun \(2024\)ToolLLM: facilitating large language models to master 16000\+ real\-world apis\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=dHng2O0Jjr)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- B\. Romera\-Paredes, M\. Barekatain, A\. Novikov, M\. Balog, M\. P\. Kumar, E\. Dupont, F\. J\. R\. Ruiz, J\. S\. Ellenberg, P\. Wang, O\. Fawzi, P\. Kohli, and A\. Fawzi \(2024\)Mathematical discoveries from program search with large language models\.Nature\.External Links:[Link](https://www.nature.com/articles/s41586-023-06924-6)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p1.1)\.
- T\. Schick, J\. Dwivedi\-Yu, R\. Dessì, R\. Raileanu, M\. Lomeli, E\. Hambro, L\. Zettlemoyer, N\. Cancedda, and T\. Scialom \(2023\)Toolformer: language models can teach themselves to use tools\.InAdvances in Neural Information Processing Systems,External Links:[Link](https://openreview.net/forum?id=Yacmpz84TH)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- A\. Sharma \(2025\)OpenEvolve: an open\-source evolutionary coding agentExternal Links:[Link](https://github.com/algorithmicsuperintelligence/openevolve)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p1.1)\.
- N\. Shinn, F\. Cassano, A\. Gopinath, K\. R\. Narasimhan, and S\. Yao \(2023\)Reflexion: language agents with verbal reinforcement learning\.InThirty\-seventh Conference on Neural Information Processing Systems,External Links:[Link](https://openreview.net/forum?id=vAElhFcKW6)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1),[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- G\. Wang, Y\. Xie, Y\. Jiang, A\. Mandlekar, C\. Xiao, Y\. Zhu, L\. Fan, and A\. Anandkumar \(2023\)Voyager: an open\-ended embodied agent with large language models\.arXiv preprint arXiv:2305\.16291\.External Links:[Link](https://arxiv.org/abs/2305.16291)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1),[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- Y\. Wang, S\. Su, Z\. Zeng, E\. Xu, L\. Ren, X\. Yang, Z\. Huang, X\. He, L\. Ma, B\. Peng, H\. Cheng, P\. He, W\. Chen, S\. Wang, S\. S\. Du, and yelong shen \(2026\)ThetaEvolve: test\-time learning on open problems\.InForty\-third International Conference on Machine Learning,External Links:[Link](https://openreview.net/forum?id=XHP568OuIl)Cited by:[§1](https://arxiv.org/html/2607.03935#S1.p1.1),[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1)\.
- Q\. Wu, G\. Bansal, J\. Zhang, Y\. Wu, B\. Li, E\. Zhu, L\. Jiang, X\. Zhang, S\. Zhang, J\. Liu, A\. H\. Awadallah, A\. White, D\. Burger, and C\. Wang \(2023\)AutoGen: enabling next\-gen llm applications via multi\-agent conversation\.arXiv preprint arXiv:2308\.08155\.External Links:[Link](https://arxiv.org/abs/2308.08155)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- A\. Yang, A\. Li, B\. Yang, B\. Zhang, B\. Hui, B\. Zheng, B\. Yu, C\. Gao, C\. Huang, C\. Lv,et al\.\(2025\)Qwen3 technical report\.arXiv preprint arXiv:2505\.09388\.Cited by:[§1](https://arxiv.org/html/2607.03935#S1.p4.1)\.
- J\. Yang, C\. E\. Jimenez, A\. Wettig, K\. Lieret, S\. Yao, K\. R\. Narasimhan, and O\. Press \(2024\)SWE\-agent: agent\-computer interfaces enable automated software engineering\.InThe Thirty\-eighth Annual Conference on Neural Information Processing Systems,External Links:[Link](https://openreview.net/forum?id=mXpq6ut8J3)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1)\.
- S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. Narasimhan, and Y\. Cao \(2023\)ReAct: synergizing reasoning and acting in language models\.InInternational Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=WE_vluYUL-X)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1),[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1)\.
- H\. Ye, X\. He, V\. Arak, H\. Dong, and G\. Song \(2026\)Meta context engineering via agentic skill evolution\.InForty\-third International Conference on Machine Learning,External Links:[Link](https://openreview.net/forum?id=P1jHroBS5E)Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1),[Table 2](https://arxiv.org/html/2607.03935#S4.T2)\.
- M\. Yuksekgonul, D\. Koceja, X\. Li, F\. Bianchi, J\. McCaleb, X\. Wang, J\. Kautz, Y\. Choi, J\. Zou, C\. Guestrin, and Y\. Sun \(2026\)Learning to discover at test time\.arXiv preprint arXiv:2601\.16175\.External Links:[Link](https://arxiv.org/abs/2601.16175)Cited by:[§1](https://arxiv.org/html/2607.03935#S1.p1.1),[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1)\.
- J\. Zhang, S\. Hu, C\. Lu, R\. T\. Lange, and J\. Clune \(2026\)Darwin gödel machine: open\-ended evolution of self\-improving agents\.InThe Fourteenth International Conference on Learning Representations,External Links:[Link](https://openreview.net/forum?id=pUpzQZTvGY)Cited by:[§2\.1](https://arxiv.org/html/2607.03935#S2.SS1.p2.1)\.
- Q\. Zhang, C\. Hu, S\. Upasani, B\. Ma, F\. Hong, V\. Kamanuru, J\. Rainton, C\. Wu, M\. Ji, H\. Li,et al\.\(2025\)Agentic context engineering: evolving contexts for self\-improving language models\.arXiv preprint arXiv:2510\.04618\.Cited by:[§2\.2](https://arxiv.org/html/2607.03935#S2.SS2.p1.1),[Table 2](https://arxiv.org/html/2607.03935#S4.T2)\.
## Appendix AAdditional Detailed Tables
### A\.1S2D Qualitative Tool\-Evolution Examples
##### Emergent Tool Co\-Evolution and Self\-Correction
The initial retrieval tool is a recency\-based few\-shot harness and often retrieves misleading cases\. During training, HASE learns to modify the sandboxed tool file to improve retrieval and memory construction\. We observe two recurring patterns:
1. 1\.Keyword\-Targeted Overlapping: Given the query“I have been experiencing a high fever… weak and my muscles pain,”the default toolset retrieved irrelevant cases \(e\.g\.,pneumonia,UTI\), prompting an initial incorrect prediction ofpneumonia\. The agent subsequently entered the tool\-evolution mode, overwritingclassification\_tools\.pyto implement a customized symptom\-overlap scoring function targeting the specific symptoms\. The sandboxed execution of this updated tool successfully retrieveddengueandtyphoidexamples, allowing the agent to self\-correct and predictdenguesuccessfully on its second attempt \(R=0\.5R=0\.5\)\.
2. 2\.Similarity\-Based Retrieval Injection: For a patient describing“peeling of skin… joint pain and skin rashes,”the default retrieval was dominated by generic skin infections, leading to an incorrect guess offungal infection\. The agent bypassed this by overwriting the retrieve method with a stronger lexical\-similarity computation\. Upon execution, the updated tool exposed diagnostic links to joint pain, guiding the model to classify the case aspsoriasison its second attempt\.
Sandbox runtime exceptions in the multi\-turn context \(e\.g\., type mismatch errors\) provide useful debugging feedback: the agent often repairs these errors and compiles working implementations\. Across phases, the harness evolves from recency\-only examples and empty memory toward stronger similarity search, symptom extraction, label\-grouped summaries, and diagnostic\-indicator memory\.
### A\.2S2D Training\-Time Agentic Behaviour
Table 4:Training\-time agentic behavior on S2D\. After Phase 0, the model consistently performs multi\-turn inspection and harness\-editing actions\. Tool edits countoverwrite/replace; read ops countcat/ls/grep\.
### A\.3PoC\-Guided Candidate Shortlisting
For guidance\-harness edits, HASE uses a lightweight proof\-of\-concept \(PoC\) signal to decide which candidate patches are worth reviewing at the phase boundary\. Suppose a trajectory edits a guidance harness fromhhtoh′h^\{\\prime\}and then submits a candidate solution with task rewardRtask\(τ;h′\)R\_\{\\mathrm\{task\}\}\(\\tau;h^\{\\prime\}\)\. We assign the trajectory a PoC score
RPoC\(τ\)=max\{0,Rtask\(τ;h′\)−Rbase\(x,h\)\},R\_\{\\mathrm\{PoC\}\}\(\\tau\)=\\max\\\{0,R\_\{\\mathrm\{task\}\}\(\\tau;h^\{\\prime\}\)\-R\_\{\\mathrm\{base\}\}\(x,h\)\\\},whereRbase\(x,h\)R\_\{\\mathrm\{base\}\}\(x,h\)is the reward obtained by the current persistent harness on the same input\. This score is not a commit rule: it only records that the edit produced at least one downstream improvement when used by the same trajectory\.
Parseable guidance edits with positive PoC score are stored in the phase candidate pool𝒞p\\mathcal\{C\}\_\{p\}together with lightweight metadata such as touched files, diff size, and execution status\. At the phase boundary, HASE filters invalid or duplicate edits, shortlists promising candidates, and evaluates the shortlisted harnesses under the task protocol\. The committed guidance harness is the interface\-valid candidate with the best reviewed validation score, not necessarily the candidate with the highest single\-trajectory PoC score\. This keeps candidate collection cheap while preventing one lucky rollout from directly changing the persistent harness\.
### A\.4S2D Protocol Controls
For the Symptom2Disease comparison, we use thes2d\_mhsplit from Meta\-Harness:200200training instances,5050validation instances,212212test instances, and all2222disease classes\. The training set is the only retrieval pool available toclassification\_tools\.py; no external corpus and no test examples are exposed during training or review\. Phase\-boundary review evaluates candidate harnesses on the validation set using greedy base\-Qwen3\-8B decoding and commits only interface\-valid patches that improve validation accuracy\. The final test run uses the committedclassification\_tools\.pyandprompt\.txtwithout test\-time edits, fine\-tuning, retries, or retrieval over the test set\. Training episodes permit up to three attempts with reward1/attempt1/\\text\{attempt\}for the first correct classification and sandbox error feedback after failed tool calls; this retry mechanism is disabled for final reporting\. Test inference is served by vLLM with temperature0, chat\-template formatting,max\_tokens=16384, andmax\_model\_len=32768; outputs are parsed from a single<classification\>tag\.
### A\.5Heilbronn Exploit Visualization
As shown in[Figure 5](https://arxiv.org/html/2607.03935#A1.F5), the left panel shows an invalid solution accepted by the weak evaluator, while the right panel shows the repaired valid solution\.
Figure 5:Point configuration visualizer in the containing equilateral triangle\. \(A\) Phase 0 exploit placement: out\-of\-bounds points \(red crosses\) cheat the weak evaluator to get a proxy score of 0\.02708 \(oracle score 0\.0000\)\. \(B\) Phase 8 valid placement: all points \(green dots\) are strictly inside, with bottleneck minimum area highlighted in yellow\.
## Appendix BRigor of the Alpha\-Mining Evaluation Pipeline
This appendix documents the evaluation infrastructure underlying the alpha\-mining results in Section[4](https://arxiv.org/html/2607.03935#S4)\(Experiment 3\)\. We describe the controls applied at each stage so the reported numbers can be interpreted as alpha rather than as pipeline noise\.
### B\.1Universe Construction and Data Preprocessing
CSI300 constituent lists distributed alongside common Chinese\-equity OHLCV dumps frequently include the index codes themselves \(SH000300,SH000852,SH000905,SH000906,SH000985,SZ399300\) as if they were tradable instruments\. Because index aggregate volume is one to two orders of magnitude larger than any individual constituent, any top\-kk\-by\-volume universe selection trivially places these index codes in the active universe, where they then dominate cross\-sectional rank statistics and corrupt IC measurements\.
We use the CogAlpha\-curatedqlib\_CSI300\.csv\(754 pure CSI300 constituents, 2011–2025\), reformat ticker symbols \(sh\.600000→\\toSH600000\), and use the full 300\-stock universe per window \(typically 150–260 instruments survive per slice after NaN filtering\) rather than a top\-50 volume slice\.
### B\.2Future\-Information Leakage Detection
An alpha factor should be*causal*: the value reported for dayttmay depend on OHLCV observations up to daytt, but not on any rowt′\>tt^\{\\prime\}\>t\. Future\-information leakage occurs when a factor accidentally reads later rows while computing earlier factor values\. Such leakage can produce strong IC and portfolio returns even when the signal would be unavailable at trading time\.
Two simple examples illustrate the failure mode\. First, a factor may directly use a shifted future return, such asclose\[t\+1\] / close\[t\] \- 1, which is predictive only because it reads tomorrow’s price\. Second, array\-indexing mistakes can introduce less obvious leakage: for example, a negative index such asclose\[t\-200\]whent<200t<200wraps around in NumPy and reads a row near the end of the array, which is in the future relative tott\. LLM\-generated factor code is particularly prone to such boundary and axis errors\.
Our detector treats leakage as an invariance violation\. It first creates seeded, per\-stock random\-walk OHLCV data with independent price paths, high/low spreads, and volume noise\. For each test dateTT, it computes the factor on the original data and on a perturbed copy in which every row afterTTis modified by asymmetric per\-stock multipliers and shifts, while maintaining basic OHLC consistency\. A causal factor must produce identical outputs on all rows up toTT, because the past data are unchanged\. If any finite past output changes beyond a tolerance of10−1010^\{\-10\}, the factor is rejected\.
We add a second truncation check to catch factors whose behavior depends on the physical length of the input array\. The detector recomputes the factor after cutting the data at several endpoints and compares the overlapping prefix with the full\-array result\. A valid causal factor should give the same values on the shared prefix whether or not future rows are physically present\. This two\-layer test guards against both explicit future reads and subtler indexing bugs such as negative\-index wraparound or axis\-slicing mistakes\. All factors reported in the main\-text alpha\-mining table pass this detector before entering the factor pool\.
### B\.3Cross\-LLM Independent Leakage Audit
In addition to the leakage detector \(§[B\.2](https://arxiv.org/html/2607.03935#A2.SS2)\), the 30 factors used to produce the main\-text alpha\-mining table were independently audited by four LLM judges: Gemini, ChatGPT, DeepSeek, and Claude Sonnet\. Each judge was given the full factor source code and the following instruction template:
> The following Python function computes a per\-day, per\-stock factor value from historical OHLCV data\. Determine whether the function uses any information from timet′\>tt^\{\\prime\}\>twhen computing the factor value at timett\. Report one of\{LEAK, CLEAN\}, followed by a brief justification\.
All four judges returnedCLEANon all reported factors \(120/120 unanimous verdicts\)\. We also manually inspected the reported factor implementations for future\-information use\.
## Appendix CS2D Statistical Reporting
The S2D test split contains 212 instances\. The headline HASE number in Table[2](https://arxiv.org/html/2607.03935#S4.T2)is reported as mean±\\pmstd over55independent evaluation runs with the same final policy and committed harness\. This report measures the stability of the deployed HASE system under the final inference protocol, where the harness is frozen and no test\-time editing, fine\-tuning, retry, or retrieval over test examples is allowed\.
## Appendix DCompute and Reproducibility
All experiments use Qwen3\-8B served via vLLM with greedy decoding \(temperature 0\) at evaluation time\. RL training uses VeRL with GRPO and an entropic adaptive\-β\\betaadvantage estimator\. Each S2D and alpha\-mining training run uses 4 GPUs for 3 RL phases \(3 epochs per phase\), with per\-rollout multi\-turn budget capped at 15 user turns and a hard 22,000\-token conversation cap to prevent vLLM KV\-cache exhaustion under FSDP\-vLLM sleep/wake cycling\.
## Appendix ERaw Evolved Harness Artifacts
This appendix intentionally preserves raw evolved artifacts\. The main text summarizes the same behavior with pseudocode and figures, while this section records representative evolved harness code in its original form\. It is typeset in one column to avoid overlap from long Python lines\.
The full Python code of the evolved evaluator for circle packing is shown below\.
Phase 3:
```
import numpy as np
from scipy.optimize import minimize
from scipy.optimize import Bounds
from scipy.optimize import NonlinearConstraint
def validate_packing(centers, radii):
n = len(centers)
# Check boundary constraints
for i in range(n):
x, y = centers[i]
r = radii[i]
if not (x - r >= 0 and x + r <= 1 and y - r >= 0 and y + r <= 1):
return False
# Check pairwise distance constraints
for i in range(n):
for j in range(i+1, n):
dx = centers[i][0] - centers[j][0]
dy = centers[i][1] - centers[j][1]
dist = np.sqrt(dx*dx + dy*dy)
if dist < radii[i] + radii[j] - 1e-8: # tolerance for numerical errors
return False
return True
```
Phase 6:
```
import numpy as np
from scipy.optimize import minimize
import math
def validate_packing(centers, radii):
# Check if centers are within [0,1]^2
if not (np.all(centers >= 0) and np.all(centers <= 1)):
return False
# Check if radii are non-negative
if np.any(radii < 0):
return False
# Check distance between every pair of circles
n = len(radii)
for i in range(n):
for j in range(i+1, n):
dx = centers[i, 0] - centers[j, 0]
dy = centers[i, 1] - centers[j, 1]
dist = np.sqrt(dx**2 + dy**2)
if dist < radii[i] + radii[j] - 1e-12: # Tolerance for floating point errors
return False
# Check if any circle exceeds square boundary
for i in range(n):
if centers[i, 0] - radii[i] < 0 or centers[i, 0] + radii[i] > 1:
return False
if centers[i, 1] - radii[i] < 0 or centers[i, 1] + radii[i] > 1:
return False
return True
```
## Appendix FEvolution Details of Alpha Mining
#### pool\_viewer\_phase0\.py
```
"""
Pool Viewer Context Engineering Artifact
This file controls HOW factor pool information is presented to you.
The system calls format_pool_context() to generate pool context for your prompt.
You may modify this file to change what information you see about the factor pool.
Modifying this file = optimizing your own information retrieval strategy.
After modification, call ‘query_pool‘ to see the updated output immediately.
"""
import numpy as np
def format_pool_context(factors: list) -> str:
"""Format factor pool into context string.
Args:
factors: list of dicts with keys: code, ic, aer, daily_ics, phase, description
Returns:
Formatted string injected into your prompt as pool context.
Modify this function to change what you see.
"""
if not factors:
return "Factor pool is empty."
lines = [f"Total factors in pool: {len(factors)}", ""]
for i, f in enumerate(factors[-3:]):
ic = f.get(’ic’, 0.0)
desc = f.get(’description’, ’’)
lines.append(f"[{i}] IC={ic:.4f} | {desc}")
return "Showing last 3 factors in the pool:"+
".join(lines)"
```
#### pool\_viewer\_phase2\.py
```
"""
Pool Viewer Context Engineering Artifact
This file controls HOW factor pool information is presented to you.
The system calls format_pool_context() to generate pool context for your prompt.
You may modify this file to change what information you see about the factor pool.
Modifying this file = optimizing your own information retrieval strategy.
After modification, call ‘query_pool‘ to see the updated output immediately.
"""
import numpy as np
def format_pool_context(factors: list) -> str:
"""Format factor pool into context string.
Args:
factors: list of dicts with keys: code, ic, aer, daily_ics, phase, description
Returns:
Formatted string injected into your prompt as pool context.
Modify this function to change what you see.
"""
if not factors:
return "Factor pool is empty."
lines = [f"Total factors in pool: {len(factors)}", ""]
for i, f in enumerate(factors):
ic = f.get(’ic’, 0.0)
desc = f.get(’description’, ’’)
lines.append(f"[{i}] IC={ic:.4f} | {desc}")
return "\n".join(lines)
```
#### pool\_viewer\_phase4\.py
```
import numpy as np
def format_pool_context(factors: list) -> str:
"""Format factor pool into context string.
Args:
factors: list of dicts with keys: code, ic, aer, daily_ics, phase, description
Returns:
Formatted string injected into your prompt as pool context.
Modify this function to change what you see.
"""
if not factors:
return "Factor pool is empty."
lines = [f"Total factors in pool: {len(factors)}", ""]
# Show top 10 factors (highest IC first)
top_factors = sorted(factors, key=lambda x: x.get(’ic’, 0.0), reverse=True)[:10]
for i, f in enumerate(top_factors):
ic = f.get(’ic’, 0.0)
desc = f.get(’description’, ’’)
lines.append(f"[{i}] IC={ic:.4f} | {desc}")
return "\n".join(lines)
```
#### pool\_viewer\_phase5\.py
```
"""
Pool Viewer Context Engineering Artifact
This file controls HOW factor pool information is presented to you.
The system calls format_pool_context() to generate pool context for your prompt.
You may modify this file to change what information you see about the factor pool.
Modifying this file = optimizing your own information retrieval strategy.
After modification, call ‘query_pool‘ to see the updated output immediately.
"""
import numpy as np
def format_pool_context(factors: list) -> str:
"""Format factor pool into context string.
Args:
factors: list of dicts with keys: code, ic, aer, daily_ics, phase, description
Returns:
Formatted string injected into your prompt as pool context.
Modify this function to change what you see.
"""
if not factors:
return "Factor pool is empty."
lines = [f"Total factors in pool: {len(factors)}", ""]
top_factors = sorted(factors, key=lambda x: x[’ic’], reverse=True)[:3]
for i, f in enumerate(top_factors):
ic = f.get(’ic’, 0.0)
desc = f.get(’description’, ’’)
lines.append(f"[{i+1}] IC={ic:.4f} | {desc}")
return "\n".join(lines)
```
#### prompt\_phase0\.txt
```
Try to produce high quality factors you know.
```
#### prompt\_phase2\.txt
```
# Strategy Guide for Alpha Factor Development in China A-share Market
#
# Core Principles:
# 1. Prioritize factors with high Information Coefficient (IC) and robustness across market regimes
# 2. Focus on market-specific characteristics of Chinese A-shares (e.g., liquidity, volatility, policy impacts)
# 3. Use known financial taxonomies: Momentum, Value, Quality, Volatility, Liquidity, Size, and Sentiment
#
# Taxonomy-Specific Ideas:
# - Momentum: Test 5/10/20-day returns, price acceleration, trend strength
# - Volatility: ATR, earnings volatility, volume dispersion
# - Liquidity: Turnover ratio, order book depth, market impact cost
# - Sentiment: News sentiment, social media volume, broker recommendations
# - Policy: Regulatory changes, sector-specific policy impacts
# - Hybrid: Combine 2-3 factors with cross-validation
#
# Implementation Notes:
# - Use 10-day forward returns as the target variable
# - Prioritize factors where higher values predict higher future returns
# - Validate with both in-sample and out-of-sample data
# - Monitor for overfitting and regime shifts
#
# Recent Insights:
# - Best factor from previous phase had real-world IC of 0.0327
# - Current pool IC range [0.0110, 0.0467]
# - Portfolio of 10 factors achieved 6.79% annual return
#
# Your Task:
# Define compute_alpha(data) function to produce high-quality factor values
# Target: Maximize rank correlation with 10-day forward returns
```
#### prompt\_phase3\.txt
```
# Strategy Guide for Alpha Factor Development in China A-share Market
#
# Core Principles:
# 1. Prioritize factors with high Information Coefficient (IC) and robustness across market regimes
# 2. Focus on market-specific characteristics of Chinese A-shares (e.g., liquidity, volatility, policy impacts)
# 3. Use known financial taxonomies: Momentum, Value, Quality, Volatility, Liquidity, Size, and Sentiment
#
# Taxonomy-Specific Ideas:
# - Momentum: Test 5/10/20-day returns, price acceleration, trend strength
# - Volatility: ATR, earnings volatility, volume dispersion
# - Liquidity: Turnover ratio, order book depth, market impact cost
# - Sentiment: News sentiment, social media volume, broker recommendations
# - Policy: Regulatory changes, sector-specific policy impacts
# - Hybrid: Combine 2-3 factors with cross-validation
#
# Implementation Notes:
# - Use 10-day forward returns as the target variable
# - Prioritize factors where higher values predict higher future returns
# - Validate with both in-sample and out-of-sample data
# - Monitor for overfitting and regime shifts
#
# Recent Insights:
# - Best factor from previous phase had real-world IC of 0.0327
# - Current pool IC range [0.0110, 0.0467]
# - Portfolio of 10 factors achieved 6.79% annual return
#
# Your Task:
# Define compute_alpha(data) function to produce high-quality factor values
# Target: Maximize rank correlation with 10-day forward returns
#
# Additional Strategy:
# - Focus on hybrid factors combining momentum and inverse volatility
# - Leverage existing high-IC factors (e.g., factor 12) as building blocks
# - Test novel combinations of 20-day return ranked (factor 18) with inverse volatility
# - Ensure robust handling of rolling windows and edge cases
# - Monitor for regime shifts and market-specific anomalies
#
# Workspace Optimization:
# - Use query_pool to analyze factor performance
# - Regularly update prompt.txt with new insights
# - Validate factors with both in-sample and out-of-sample data
# - Track real-world performance metrics
# - Maintain a balance between innovation and robustness
```
#### prompt\_phase4\.txt
```
# Strategy Guide for Alpha Factor Development in China A-share Market
#
# Core Principles:
# 1. Prioritize factors with high Information Coefficient (IC) and robustness across market regimes
# 2. Focus on market-specific characteristics of Chinese A-shares (e.g., liquidity, volatility, policy impacts)
# 3. Use known financial taxonomies: Momentum, Value, Quality, Volatility, Liquidity, Size, and Sentiment
#
# Taxonomy-Specific Ideas:
# - Momentum: Test 5/10/20-day returns, price acceleration, trend strength
# - Volatility: ATR, earnings volatility, volume dispersion
# - Liquidity: Turnover ratio, order book depth, market impact cost
# - Sentiment: News sentiment, social media volume, broker recommendations
# - Policy: Regulatory changes, sector-specific policy impacts
# - Hybrid: Combine 2-3 factors with cross-validation
#
# Implementation Notes:
# - Use 10-day forward returns as the target variable
# - Prioritize factors where higher values predict higher future returns
# - Validate with both in-sample and out-of-sample data
# - Monitor for overfitting and regime shifts
#
# Recent Insights:
# - Best factor from previous phase had real-world IC of 0.0309
# - Current pool IC range [0.0110, 0.0488]
# - Portfolio of 10 factors achieved 8.59% annual return
#
# Your Task:
# Define compute_alpha(data) function to produce high-quality factor values
# Target: Maximize rank correlation with 10-day forward returns
#
# Additional Strategy:
# - Focus on hybrid factors combining momentum and inverse volatility
# - Leverage existing high-IC factors (e.g., factor 18) as building blocks
# - Test novel combinations of 20-day return ranked (factor 18) with inverse volatility
# - Ensure robust handling of rolling windows and edge cases
# - Monitor for regime shifts and market-specific anomalies
#
# Workspace Optimization:
# - Use query_pool to analyze factor performance
# - Regularly update prompt.txt with new insights
# - Validate factors with both in-sample and out-of-sample data
# - Track real-world performance metrics
# - Maintain a balance between innovation and robustness
```
#### prompt\_phase5\.txt
```
# Strategy Guide for Alpha Factor Development in China A-share Market
#
# Core Principles:
# 1. Prioritize factors with high Information Coefficient (IC) and robustness across market regimes
# 2. Focus on market-specific characteristics of Chinese A-shares (e.g., liquidity, volatility, policy impacts)
# 3. Use known financial taxonomies: Momentum, Value, Quality, Volatility, Liquidity, Size, and Sentiment
#
# Taxonomy-Specific Ideas:
# - Momentum: Test 5/10/20-day returns, price acceleration, trend strength
# - Volatility: ATR, earnings volatility, volume dispersion
# - Liquidity: Turnover ratio, order book depth, market impact cost
# - Sentiment: News sentiment, social media volume, broker recommendations
# - Policy: Regulatory changes, sector-specific policy impacts
# - Hybrid: Combine 2-3 factors with cross-validation
#
# Implementation Notes:
# - Use 10-day forward returns as the target variable
# - Prioritize factors where higher values predict higher future returns
# - Validate with both in-sample and out-of-sample data
# - Monitor for overfitting and regime shifts
#
# Recent Insights:
# - Best factor from previous phase had real-world IC of 0.0336
# - Current pool IC range [0.0110, 0.0488]
# - Portfolio of 10 factors achieved 8.59% annual return
#
# Your Task:
# Define compute_alpha(data) function to produce high-quality factor values
# Target: Maximize rank correlation with 10-day forward returns
#
# Additional Strategy:
# - Focus on hybrid factors combining momentum and inverse daily price volatility
# - Leverage exiting high-IC factors (e.g., factor 0 for daily price volatility)
# - Test novel combinations of 20-day return rank (momentum) with inverse of (high - low)/low
# - Ensure robust handling of rolling windows and edge cases
# - Monitor for regime shifts and market-specific anomalies
#
# Workspace Optimization:
# - Use query_pool to analyze factor performance
# - Regularly update prompt.txt with new insights
# - Validate factors with both in-sample and out-of-sample data
# - Track real-world performance metrics
# - Maintain a balance between innovation and robustness
```
#### prompt\_phase6\.txt
```
# Strategy Guide for Alpha Factor Development in China A-share Market
#
# Core Principles:
# 1. Prioritize factors with high Information Coefficient (IC) and robustness across market regimes
# 2. Focus on market-specific characteristics of Chinese A-shares (e.g., liquidity, volatility, policy impacts)
# 3. Use known financial taxonomies: Momentum, Value, Quality, Volatility, Liquidity, Size, and Sentiment
#
# Taxonomy-Specific Ideas:
# - Momentum: Test 5/10/20-day returns, price acceleration, trend strength
# - Volatility: ATR, earnings volatility, intraday price range
# - Liquidity: Daily turnover, relative volume, market impact cost
# - Sentiment: Macro news sentiment, social media volume, policy implications
# - Policy: Regulatory changes, sector-specific policy impacts, liquidity regulations
# - Hybrid: Combine 2-3 factors with cross-validation (e.g., momentum + inverse volatility + volume)
#
# Implementation Notes:
# - Use 10-day forward returns as the target variable
# - Prioritize factors where higher values predict higher future returns
# - Validate with both in-sample and out-of-sample data
# - Monitor for overfitting and regime shifts
#
# Recent Insights:
# - Best factor from previous phase had real-world IC of 0.0336
# - Current pool IC range [0.0110, 0.0488]
# - Portfolio of 10 factors achieved 8.59% annual return
#
# Your Task:
# Define compute_alpha(data) function to produce high-quality factor values
# Target: Maximize rank correlation with 10-day forward returns
#
# Additional Strategy:
# - Focus on hybrid factors combining momentum and inverse volatility
# - Leverage exiting high-IC factors (factor 0: price volatility, factor 2: return/volatility ratio)
# - Test novel combinations of inverse daily price volatility with volume-based liquidity signals
# - Apply multi-timescale volatility measures (e.g., 10-day, 20-day, 60-day volatility)
# - Use velocity of price changes, volume dispersion, and policy impact timing
# - Monitor for new market regimes and anomalies
#
# Workspace Optimization:
# - Use query_pool to analyze factor performance
# - Regularly update prompt.txt with new insights
# - Validate factors with both in-sample and out-of-sample data
# - Track real-world performance metrics
# - Maintain a balance between innovation and robustness
# - Introduce cross-sectional patterns (e.g., relative performance vs. market/industry)
# - Consider new signal families: size, earnings, and trading behavior
```
#### prompt\_phase8\.txt
```
# Strategy Guide for Alpha Factor Development in China A-share Market
#
# Core Principles:
# 1. Prioritize factors with high Information Coefficient (IC) and robustness across market regimes
# 2. Focus on market-specific characteristics of Chinese A-shares (e.g., liquidity, volatility, policy impacts)
# 3. Use known financial taxonomies: Momentum, Value, Quality, Volatility, Liquidity, Size, and Sentiment
#
# Taxonomy-Specific Ideas:
# - Momentum: Test 5/10/20-day returns, price acceleration, trend strength
# - Volatility: ATR, earnings volatility, intraday price range
# - Liquidity: Daily turnover, relative volume, market impact cost
# - Sentiment: Macro news sentiment, social media volume, policy implications
# - Policy: Regulatory changes, sector-specific policy impacts, liquidity regulations
# - Hybrid: Combine 2-3 factors with cross-validation (e.g., momentum + inverse volatility + volume)
#
# Implementation Notes:
# - Use 10-day forward returns as the target variable
# - Prioritize factors where higher values predict higher future returns
# - Validate with both in-sample and out-of-sample data
# - Monitor for overfitting and regime shifts
#
# Recent Insights:
# - Best factor from previous phase had real-world IC of 0.0336
# - Current pool IC range [0.0110, 0.0488]
# - Portfolio of 10 factors achieved 8.59% annual return
#
# Your Task:
# Define compute_alpha(data) function to produce high-quality factor values
# Target: Maximize rank correlation with 10-day forward returns
#
# Additional Strategy:
# - Focus on hybrid factors combining momentum and inverse volatility
# - Leverage exiting high-IC factors (factor 0: price volatility, factor 2: return/volatility ratio)
# - Test novel combinations of inverse daily price volatility with volume-based liquidity signals
# - Apply multi-timescale volatility measures (e.g., 10-day, 20-day, 60-day volatility)
# - Use velocity of price changes, volume dispersion, and policy impact timing
# - Monitor for new market regimes and anomalies
#
# Workspace Optimization:
# - Use query_pool to analyze factor performance
# - Regularly update prompt.txt with new insights
# - Validate factors with both in-sample and out-of-sample data
# - Track real-world performance metrics
# - Maintain a balance between innovation and robustness
# - Introduce cross-sectional patterns (e.g., relative performance vs. market/industry)
# - Consider new signal families: size, earnings, and trading behavior
#
# New Insight:
# - A promising hybrid approach is to apply an inverse of 20-day average price range as a volatility proxy and combine it with the ratio of daily volume to its 20-day average. This captures stocks with both low price volatility and high liquidity indicators.
#
# Enterprise Strategy:
# 1. Expand multi-timescale volatility-drivers through variations of day-based volatility measures
# 2. Augment liquidity components with dynamic volume-normalization
# 3. Monitor for early signals of rising market regimes and regime shifts
# 4. Test combinations across 10-day, 20-day, and 30-day timeframes to detect non-stationarity
#
```
## Appendix GEvolution Details of the Text Classification
```
Naive Classification
"""Classification Tools your toolkit for text classification tasks."""
class ClassificationTools:
def __init__(self):
# ---------------------------------------------------------
# THE KNOWLEDGE BASE (dynamically injected real content by the environment)
# Format: [{"text": "patient has stiff neck...", "label": "meningitis"}, ...]
# ---------------------------------------------------------
self.knowledge_base: list[dict] = []
def retrieve(self, query_text: str, n: int = 5) -> list[dict]:
return self.knowledge_base[-n:]
def present_memory(self, query_text: str, label_set: list[str]) -> str:
return ""
```
#### classification\_tools\_phase1\.py
```
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
class ClassificationTools:
def __init__(self):
self.knowledge_base = []
def retrieve(self, query_text, n=5):
if not self.knowledge_base:
return []
# Extract symptoms from query
query_features = self._extract_symptoms(query_text)
# Vectorize all texts
vectorizer = TfidfVectorizer()
texts = [item["text"] for item in self.knowledge_base]
vectors = vectorizer.fit_transform(texts)
# Vectorize query
query_vector = vectorizer.transform([query_text])
# Calculate cosine similarity
similarities = cosine_similarity(query_vector, vectors).flatten()
# Get top n most similar examples
top_indices = similarities.argsort()[::-1][:n]
return [self.knowledge_base[i] for i in top_indices]
def present_memory(self, query_text, label_set):
if not self.knowledge_base:
return ""
# Extract features from query
query_features = self._extract_symptoms(query_text)
# Find matching examples
matching_examples = []
for example in self.knowledge_base:
example_features = self._extract_symptoms(example["text"])
if self._symptoms_overlap(query_features, example_features) > 0.5:
matching_examples.append((example["text"], example["label"]))
# Create memory summary
if not matching_examples:
return "No matching examples found"
# Group by label
label_groups = {}
for text, label in matching_examples:
if label not in label_groups:
label_groups[label] = []
label_groups[label].append(text)
# Create final memory summary
memory = ""
for label, examples in label_groups.items():
memory += f"Key indicators for {label}:\n"
for example in examples:
memory += f"- {example}\n"
return memory
def _extract_symptoms(self, text):
# Enhanced symptom extraction with weighted importance
symptoms = []
keywords = {
"fever": ["fever", "heat", "hot", "temperature"],
"muscle pain": ["muscle", "pain", "aches", "tenderness"],
"weakness": ["weak", "tired", "fatigue", "exhausted"],
"cough": ["cough", "sputum", "phlegm"],
"respiratory": ["breathing", "shortness", "chest", "lungs"],
"urinary": ["urine", "pee", "bladder", "urinary"],
"stomach": ["stomach", "abdomen", "digestive"],
"skin": ["skin", "rash", "itch", "patch", "lesion"],
"allergy": ["allergy", "sneeze", "sore throat", "runny nose"],
"dengue": ["dengue", "fever", "muscle pain", "weakness"],
"malaria": ["malaria", "fever", "chills", "sweating", "fatigue"]
}
# Prioritize fever and muscle pain for infectious diseases
fever_keywords = ["fever", "heat", "hot", "temperature"]
muscle_pain_keywords = ["muscle", "pain", "aches", "tenderness"]
for symptom, words in keywords.items():
if any(word in text.lower() for word in words):
symptoms.append(symptom)
# Check for dengue/malaria patterns
if any(word in text.lower() for word in fever_keywords) and \
any(word in text.lower() for word in muscle_pain_keywords):
symptoms.append("infectious disease")
return symptoms
def _symptoms_overlap(self, query_features, example_features):
# Calculate Jaccard similarity between symptom sets
query_set = set(query_features)
example_set = set(example_features)
union = len(query_set | example_set)
if union == 0:
return 0.0
return len(query_set & example_set) / union
```
#### classification\_tools\_phase2\.py
```
"""Classification Tools your toolkit for text classification tasks."""
class ClassificationTools:
def __init__(self):
# ---------------------------------------------------------
# THE KNOWLEDGE BASE (dynamically injected real content by the environment)
# Format: [{"text": "patient has stiff neck...", "label": "meningitis"}, ...]
# ---------------------------------------------------------
self.knowledge_base: list[dict] = []
def retrieve(self, query_text: str, n: int = 5) -> list[dict]:
"""Find top n most relevant examples based on symptom overlap."""
if not self.knowledge_base:
return []
# Calculate similarity between query and each example
similarities = []
for example in self.knowledge_base:
# Simple keyword matching for demonstration
common_terms = set(query_text.lower().split()) & set(example["text"].lower().split())
similarity_score = len(common_terms) / max(len(query_text.split()), len(example["text"].split()))
similarities.append((example, similarity_score))
# Sort by similarity score and return top n
similarities.sort(key=lambda x: x[1], reverse=True)
return [example for example, _ in similarities[:n]]
def present_memory(self, query_text: str, label_set: list[str]) -> str:
"""Generate diagnostic indicators by comparing with all labels."""
if not self.knowledge_base:
return "No examples in knowledge base for analysis."
# Build a symptom map for each label
label_symptoms = {}
for example in self.knowledge_base:
label = example["label"]
if label not in label_symptoms:
label_symptoms[label] = set()
label_symptoms[label].update(example["text"].lower().split())
# Analyze query symptoms
query_symptoms = set(query_text.lower().split())
# Build key indicators for each label in label_set
memory = ""
for label in label_set:
if label not in label_symptoms:
continue
common = query_symptoms & label_symptoms[label]
if common:
memory += f"Key indicators for {label}:\n"
memory += "- " + "\n- ".join(common) + "\n"
memory += "\n"
return memory
```Similar Articles
Self-Harness: Harnesses That Improve Themselves
Self-Harness introduces a new paradigm where LLM-based agents iteratively improve their own operating harness by mining model-specific weaknesses, proposing harness modifications, and validating them through regression testing, achieving substantial performance gains on Terminal-Bench-2.0 across multiple base models.
HarnessX: A Composable, Adaptive, and Evolvable Agent Harness Foundry
HarnessX is a foundry for composable, adaptive, and evolvable AI agent harnesses that uses compositional primitives and trace-driven evolution to improve agent performance. Across five benchmarks, it achieves an average gain of +14.5% (up to +44.0%), demonstrating that runtime interface evolution is a complementary lever to model scaling.
RewardHarness: Self-Evolving Agentic Post-Training
RewardHarness is a self-evolving agentic framework for post-training that replaces large-scale preference annotation with iterative tool and skill evolution, achieving superior performance in image editing evaluation benchmarks compared to GPT-5.
Adaptive Auto-Harness: Sustained Self-Improvement for Agentic System Deployment on Open-Ended Task Streams
Adaptive Auto-Harness is a framework for sustained self-improvement of agentic systems deployed on open-ended task streams, outperforming baselines via a stateful multi-agent evolver, harness tree, and human-steering hooks.
@AlphaSignalAI: https://x.com/AlphaSignalAI/status/2074130508833845396
Self-improving harnesses enable AI agents to autonomously rewrite their operating rules by analyzing execution traces, leading to a 60% performance boost. Research from Shanghai AI Lab introduces the Self-Harness framework, allowing lightweight models to outperform larger ones without manual engineering.