Organizations: University of the Chinese Academy of Sciences · Baidu · Tsinghua University · Institute of Automation, Chinese Academy of Sciences · Shanghai University
Given a task and an evaluator, a language model can rewrite a candidate program while a search loop decides which rewrites survive, offering a practical route to algorithm discovery. But that loop is governed by five constants set by hand: which parent to select, how hard to mutate, how to keep diversity, what to remember, and a scalar score that never says which part of the program earned it. Reinforcement learning already has an estimator for each. The obstacle is that program evolution is not usually written down as a decision process. We formalize it as a Markov decision process whose action is the modular prefix the model is conditioned on, rather than the program it emits. Credit assignment, value estimation, adaptive exploration, and experience memory can then attach to distinct components. AGAR (Algorithm Generation As RL) provides the resulting substrate: any estimator can be replaced or switched off without changing the controller, making the transfer auditable one mechanism at a time, with no gradient training of the backend model. Across 19 tasks, two backends, and three seeds under one harness, AGAR improves on the stronger of two published baselines on most tasks, with gains concentrated in the competitive-programming family. The formalization also yields a checkable reading of prior work: these systems are implicitly zero-discount, not by choice, but because fitness is exogenous to an individual rather than a return over successors, leaving a discount factor nothing to act on.
Figures & tables
Figure 1: The transfer as a whole. Left to right: the mixed-granularity state st ; the policy π , whose action at is the modular text prefix M1 – M3 produce, with M4 supplying retrieved context rather than an action factor; the environment, in which the frozen black-box LLM sees only that prefix plus the task description and parent code, and a pluggable selection operator folds the result back into the population; and the reward terms of Eq. equation 2 . The outer arrows are the two loops that make this RL rather than a re-labelling: the TextGrad update over the module guidelines θi (top), and the st→st+1 transition the search itself performs (bottom).
Figure 2: The substrate. Top: the streaming loop — fill W slots, wait for any completion, dispatch a replacement immediately — with the controller as sole writer of the population and the W in-flight rollouts reading a dispatch-time snapshot and writing only their own trajectory. The four pipeline stages ( select , generate , evaluate , judge ) are the substrate’s; the replaceable modules sit in the select slot. Shared resource pools are acquired per use and returned. Bottom: the same loop in the three moments used throughout this paper, with τ defined as the population-version difference between dispatch and landing.
Backend
OE
SE
AGAR Base
AGAR Combo
DeepSeek-V4-Flash
0.855±0.193
0.919±0.138
0.949±0.107
0.990±0.024⋄
GLM-5.2
0.897±0.131
0.929±0.093
0.979±0.045
0.972±0.052
Table 1: Best-at-budget, normalized mean ± std across all 19 tasks (3 seeds per system). Each task score is divided by the per-task maximum over all four systems before averaging, so the best system on each task scores 1.0 and the number is comparable across tasks. Per-task raw scores are in Appendix D.10 . ⋄ two of the 19 tasks have fewer than 3 seeds completed for AGAR ( ahc015 , ahc027 ).
Task
L0
L1
L2
L3
L0→L3
ahc008
0.5441
0.7380
0.5452
0.9041
+66.2%
ahc015
0.9687
0.9835
0.9336
0.8284
−14.5%
ahc016
0.6670
0.7316
0.9160
1.0188
+52.7%
ahc024
0.8659
0.8819
0.8774
0.8636
−0.3%
ahc039
0.8797
0.8978
0.9404
0.8843
+0.5%
Mean
0.7851
0.8465
0.8425
0.8998
+14.6%
Table 2: Substrate ladder (raw task score, mean over 3 seeds, every cell run to the full 100 fitness evaluations). Backend: DeepSeek-V4-Flash.
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
Task
W
n
Mean
Median
p95
Max
>W−1
ahc011 (C++)
1
60
0.00
0
0
0
0.0%
ahc011 (C++)
2
330
0.90
1
2
5
13.0%
ahc011 (C++)
4
322
2.74
3
5
10
20.8%
ahc011 (C++)
8
333
6.05
6
12
22
18.6%
eplb (Python)
1
250
0.00
0
0
0
0.0%
eplb (Python)
2
306
0.97
1
2
3
15.4%
Appendix
Table 3: Distribution of τ (number of population updates between dispatch and landing), pooled over 3 seeds per configuration. The last column is the fraction of rollouts that exceed the naive bound W−1 .
System
What it does
Difference in AGAR
AlphaEvolve ( Novikov et al., 2025 )
Fixed prompt template + evolutionary search
Prefix is learnable
ShinkaEvolve ( Lange et al., 2025 )
Bandit over LLMs + novelty sampling
Full tool transfer, not only a bandit
EvoX ( Liu et al., 2026 )
Co-evolves solutions and search strategy
Strategy improved by a critic against explicit J , not by selection
SMC-Evolve ( Jiang et al., 2026 )
Principled sampling, fixed rules
Rules are learned, not fixed
TextGrad ( Yuksekgonul et al., 2024 )
General-purpose text optimization
Coupled to an RL objective in an evolutionary loop
RLHF / GRPO ( Ouyang et al., 2022 ; Shao et al., 2024 )
RL to train LLM parameters
No parameter training; text-space optimization
Appendix
Table 4: AGAR relative to the closest prior systems. The pattern is the same in each row: prior work fixes a rule that our formalization turns into a component optimized against J .
RL tool
Rule replaced
Module
What changed
Credit assignment
Success never attributed
M1
Textual attribution along genealogy, not numerical backup along chain
Value estimation
Must evaluate to rank
M2
Pre-evaluation ranking ; scalar V estimated, not learned
Adaptive exploration
Fixed temperature
M3
Discrete explore/exploit decision + parent choice
Entropy regularization
Island diversity
M3 (floor)
Explicit λH(π) in Eq. equation 2
Experience replay
Population is memory
M4
Two tiers: durable abstract rules; per-direction path detail
Policy improvement
Hand-tuned hyperparams
Meta: TextGrad
Text-space improvement operator (§ 4 )
Appendix
Table 5: The transfer. Each RL tool keeps its function but changes its form to work without an empirical backup (column 4 is the honest column).
LLMs can generate programs for ARC-AGI-2 tasks, but the provided compute only allows a small number of attempts to generate, debug and validate solutions. Genetic algorithms can search and test many more programs, but random search rarely starts in a useful neighborhood of the solution space. We combine the two methods through a compact domain specific language (DSL). First, a quantized Qwen3.5-4B LLM generates an initial set of programs for each ARCAGI-2 task. Then, we use those programs to seed an initial population of starting programs, and use genetic algorithms to evolve these programs towards a solution to the given task. The DSL is designed such that every mutated program remains valid and can be executed. The initial programs proposed by the LLM solve 2 (3.3%) of the first 60 tasks of the ARC-2 public evaluation set. The genetic algorithm solves an additional 4, giving 6 correct test outputs in total (10.0%). If we try using evolving solutions without this LLM seeding, we do not arrive at any solutions at all. The results show that genetic search can improve programs generated by LLMs and produce additional correct solutions.
LLM-guided program evolution has enabled discoveries in mathematics and computational optimization, raising the prospect of reinforcement learning (RL) algorithms that self-evolve to improve how agents learn. However, realizing this prospect faces two obstacles. Joint search over coupled algorithmic components is difficult to scale: simultaneous changes can disrupt learning, while isolated changes overlook their dependencies. Evaluating candidate algorithms also requires costly training, with fitness remaining uncertain across random seeds. We introduce RLDiscover, a framework for the self-evolution of model-free deep RL algorithms. Progressive Co-Evolution advances from targeted component edits to joint evolution, while Progressive Probabilistic Evaluation balances search breadth and evaluation fidelity through staged training and repeated evaluation. Experiments across SAC, PPO, and DQN on four benchmark suites show substantial improvements in mean return, with per-family median gains of 32%-84% and a peak return ratio of approximately 363x over a near-zero baseline. These gains include transitions from failed learning to successful task completion, and improvements persist when evolution starts from stronger open-source implementations. On measured SAC locomotion runs, evaluation uses approximately one-fifteenth the estimated compute required to fully evaluate the same candidate pool. Remarkably, independent searches repeatedly discover interpretable combinations of adaptive robust losses, progress-dependent value targets, and running statistics, with selected programs transferring to unseen tasks. These findings point toward a broader role for self-evolution in AI: discovering interpretable algorithms that improve how agents learn.
Haoran Li, Zengle Ge, Xiaomin Yuan +14
University of the Chinese Academy of Sciences · Baidu · Tsinghua University +4
Autonomous LLM training is often framed as recipe search, which leaves the training harness largely static. This limitation sharpens in agentic RL, where shifting bottlenecks and scalar rewards mask diverse failure modes. We introduce EvoTrainer, an autonomous training framework that co-evolves LLM policies and training-side harnesses through empirical feedback: it diagnoses rollout-level evidence, revises diagnostics, backtests interventions, and accumulates reusable skills. Evaluated on mathematical reasoning, competitive-programming code generation, and repository-level software engineering, EvoTrainer matches or exceeds the human-engineered RL references under the same data, codebase, and evaluation protocol, with the largest gain on long-horizon agentic SWE. Trajectory analyses show that retained strategies diverge across domains, evolving diagnostics prevent invalid high-scoring branches from being promoted, and reusable skills shape later search. Autonomous LLM RL should move beyond recipe search toward joint evolution of policies and the training harnesses that interpret them.
Guhong Chen, Yingcheng Shi, Yongbin Li +6
1Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences · 2Tongyi Lab , Alibaba Group · 3Alibaba Group +1