HyperAIHyperAI

Command Palette

Search for a command to run...

MENDEL-GÖDEL-MASCHINE: REKURSIVE, SICH SELBST VERBESSERNDE CODIERAGENTEN DURCH VERGLEICHENDE EVOLUTION

Changzhi Liu Yilun Liu Sikuan Yan Volker Tresp Yunpu Ma

Zusammenfassung

Sich selbst verbessernde Codieragenten, die iterativ ihren eigenen Quellcode umschreiben, haben beeindruckende Leistungen bei Programmieraufgaben gezeigt. Bestehende Lösungen leiten Selbstmodifikationen jedoch in der Regel jeweils aus einer einzelnen Fehlschlag-Trajektorie ab und übersehen dabei die reichhaltigen vergleichenden Signale, die im wachsenden Archiv früherer Versuche des Agenten verfügbar sind. In Anlehnung an die Mendelschen Prinzipien der kontrollierten Vererbung stellen wir die Mendel-Gödel-Maschine (MGM) vor. Zusätzlich zur allgemeinen klonalen Mutation entlang einer Einzeltrajektorie umfasst MGM zwei neue Arten der Selbstmodifikation, die akkumulierte Evidenz besser nutzen: Die Reaktionsnorm-Mutation verändert einen Agenten auf Basis seiner Trajektorien über mehrere Aufgaben gleichzeitig, und die abstammungsübergreifende Hybridisierung verändert einen Agenten anhand der Trajektorie eines Referenzagenten aus einer anderen Abstammungslinie für dieselbe Aufgabe. Unter einem additiven Fitness-Landschafts-Modell beweisen wir theoretisch und demonstrieren durch kontrollierte Surrogatsimulationen, dass die neuen Strategien eine schnellere und bessere Konvergenz gegenüber Einzeltrajektorien-Ansätzen ermöglichen. Experimente auf SWE-bench und Polyglot bestätigen MGM's konsistente Verbesserung in Leistung, Effizienz und Generalisierbarkeit.

One-sentence Summary

Researchers from the University of Electronic Science and Technology of China, LMU Munich, and the Munich Center for Machine Learning present the Mendel Gödel Machine (MGM), a recursive self-improving coding agent that, grounded in Mendelian principles of controlled inheritance, extends single‑trajectory clonal mutation with reaction‑norm mutation (editing an agent based on its trajectories on multiple tasks simultaneously) and cross‑lineage hybridization (editing an agent using the trajectory of a reference agent from another lineage on the same task), thereby leveraging comparative evolution to achieve theoretically proven and empirically validated faster convergence, improved performance, efficiency, and generalizability on SWE‑bench and Polyglot.

Key Contributions

  • The Mendel Gödel Machine (MGM) augments single-trajectory clonal mutation with reaction-norm mutation, which edits an agent from its trajectories on multiple tasks, and cross-lineage hybridization, which edits an agent using a trajectory of a reference agent from another lineage on the same task, both reusing existing evaluations.
  • Under an additive fitness landscape model, theoretical analysis and controlled simulations demonstrate that these comparative evidence strategies raise effective fix probability and accelerate convergence compared to single-trajectory baselines.
  • Experiments on SWE-bench and Polyglot show MGM consistently outperforms the single-trajectory HGM baseline in performance and efficiency under matched budgets, with ablation confirming both operators contribute to gains and held-out evaluations indicating evolved scaffolds transfer across benchmarks and backbone LLMs.

Introduction

The authors build on the idea of self-improving coding agents that recursively edit their own source code, a vision that has recently been realized with large language models. Prior work maintains an archive of agent variants but relies on a single agent’s trajectory (typically a recent failure) for each self-modification step, overlooking the rich comparative evidence already present in the archive. The authors introduce the Mendel Gödel Machine (MGM), which enriches the self-modification process with two new operators: reaction-norm mutation, which conditions edits on the agent’s performance across multiple tasks, and cross-lineage hybridization, which uses another agent’s trajectory on the same task. These operators reuse existing evaluation data without incurring extra task evaluations, yielding faster convergence and consistent performance gains on coding benchmarks.

Method

The Mendel Gödel Machine (MGM) builds upon a tree-search framework comprising selection, evaluation, and expansion policies. Instead of relying on single-trajectory self-modification, MGM partitions the expansion operator Φ\varPhiΦ into three specialized sub-operators based on the type of diagnostic evidence EEE available in the archive. These operators are clonal mutation ΦCM\varPhi_{\mathrm{CM}}ΦCM, reaction-norm mutation ΦRM\varPhi_{\mathrm{RM}}ΦRM, and cross-lineage hybridization ΦCH\varPhi_{\mathrm{CH}}ΦCH.

The authors design these self-modification operators as diagnostic processes that ask the selected agent to make general improvements to its genotype based on different phenotype evidence, analogous to Mendelian genetics.

Clonal Mutation (ΦCM\varPhi_{\mathrm{CM}}ΦCM) serves as the standard single-agent, single-trajectory self-improvement operator. It is utilized when MGM has only one informative failure or cannot construct a reliable comparison. Given a selected node iii and a failed task τFi\tau \in F_iτFi, the evidence is defined as:

ECM(i,τ)={(φ(ai,τ),r(ai,τ))}.E_{\mathrm{CM}}(i, \tau) = \{(\varphi(a_i, \tau), r(a_i, \tau))\}.ECM(i,τ)={(φ(ai,τ),r(ai,τ))}.

The editor diagnoses the failure and modifies aia_iai to avoid similar failures in future tasks:

aΦCM(ai,ECM).a' \leftarrow \varPhi_{\mathrm{CM}}(a_i, E_{\mathrm{CM}}).aΦCM(ai,ECM).

This operator preserves the behavior of standard self-modification and ensures the search can proceed even when the archive is small.

Reaction-norm Mutation (ΦRM\varPhi_{\mathrm{RM}}ΦRM) incorporates the concept of a reaction norm, which describes how one genotype expresses different phenotypes under different environments. By comparing multiple phenotypes of the same genotype across different tasks, MGM identifies recurring or contrastive behavioral patterns. This operator becomes available for agent aia_iai when it has accumulated enough trajectories SimRM|S_i| \geq m_{\mathrm{RM}}SimRM and there exist at least two trajectories with a failed one as the target τtSi\tau_t \in S_iτtSi. The reference τr\tau_rτr may be any other trajectory in SiS_iSi. The evidence is:

ERM(ai,τt,τr)={(φ(ai,τt),r(ai,τt)),(φ(ai,τr),r(ai,τr))}.E_{\mathrm{RM}}(a_i, \tau_t, \tau_r) = \{(\varphi(a_i, \tau_t), r(a_i, \tau_t)), (\varphi(a_i, \tau_r), r(a_i, \tau_r))\}.ERM(ai,τt,τr)={(φ(ai,τt),r(ai,τt)),(φ(ai,τr),r(ai,τr))}.

The agent is asked to identify a shared behavioral pattern and implement a general improvement:

aΦRM(ai,ERM).a' \leftarrow \varPhi_{\mathrm{RM}}(a_i, E_{\mathrm{RM}}).aΦRM(ai,ERM).

Cross-lineage Hybridization (ΦCH\varPhi_{\mathrm{CH}}ΦCH) compares different genotypes under the same task environment. It is available when two nodes have attempted at least one common target task τt\tau_tτt that is not already solved by both. MGM designates one failed agent as the target ata_tat to improve. If the reference agent ara_rar fails likewise, MGM uses the comparison to identify complementary failure modes. If ara_rar solved τt\tau_tτt, differences in their genotypes guide the self-modification. The evidence is:

ECH(at,ar,τt)={(φ(at,τt),r(at,τt)),(φ(ar,τt),r(ar,τt))}.E_{\mathrm{CH}}(a_t, a_r, \tau_t) = \{(\varphi(a_t, \tau_t), r(a_t, \tau_t)), (\varphi(a_r, \tau_t), r(a_r, \tau_t))\}.ECH(at,ar,τt)={(φ(at,τt),r(at,τt)),(φ(ar,τt),r(ar,τt))}.

The child is produced by:

aΦCH(at,ECH).a' \leftarrow \varPhi_{\mathrm{CH}}(a_t, E_{\mathrm{CH}}).aΦCH(at,ECH).

This hybridization operation is a diagnostic process where the target agent extracts a transferable behavioral trait from the reference trajectory and adapts it to its own codebase, encouraging genuine improvement rather than task-specific behaviors.

To control how future evaluation tasks are sampled, MGM maintains a global pool:

Pt=iVtFi,\mathcal{P}_t = \bigcup_{i \in \mathcal{V}_t} F_i,Pt=iVtFi,

which stores tasks that have exposed failures in any previously evaluated agent. When selecting a new task for an agent, MGM samples from tasks not yet attempted by that agent but assigns a predetermined weight to tasks in Pt\mathcal{P}_tPt:

wi(τ)={βfail,τPt,1,τPt,τSi,w_i(\tau) = \begin{cases} \beta_{\text{fail}}, & \tau \in \mathcal{P}_t, \\ 1, & \tau \notin \mathcal{P}_t, \end{cases} \quad \tau \notin S_i,wi(τ)={βfail,1,τPt,τ/Pt,τ/Si,

where βfail\beta_{\text{fail}}βfail is the failed-pool boost. This design concentrates evaluation on tasks known to reveal weaknesses, increasing the diagnostic value of each φ\varphiφ-evaluation and deliberately creating overlap across lineages to facilitate cross-lineage comparisons.

For strategy selection, MGM inherits a Thompson-sampling policy π\piπ, which chooses between initiating a φ\varphiφ-evaluation for an existing node or a Φ\varPhiΦ-expansion of the evolution tree. When π\piπ selects a Φ\varPhiΦ-expansion for parent aia_iai, MGM constructs the set of eligible operators Ωi{ΦCM,ΦRM,ΦCH}\Omega_i \subseteq \{\varPhi_{\mathrm{CM}}, \varPhi_{\mathrm{RM}}, \varPhi_{\mathrm{CH}}\}Ωi{ΦCM,ΦRM,ΦCH} from the archive. MGM then samples among eligible operators with configurable weights λCM\lambda_{\mathrm{CM}}λCM, λRM\lambda_{\mathrm{RM}}λRM, and λCH\lambda_{\mathrm{CH}}λCH:

Pr(σi)=λσσΩiλσ,σΩi.\Pr(\sigma \mid i) = \frac{\lambda_{\sigma}}{\sum_{\sigma' \in \Omega_i} \lambda_{\sigma'}}, \qquad \sigma \in \Omega_i.Pr(σi)=σΩiλσλσ,σΩi.

The selected operator determines the evidence EσE_{\sigma}Eσ, and the child is produced by:

aΦσ(at,Eσ).a' \leftarrow \varPhi_{\sigma}(a_t, E_{\sigma}).aΦσ(at,Eσ).

If Ωi=\Omega_i = \emptysetΩi=, MGM skips the expansion and π\piπ allocates another φ\varphiφ-evaluation instead.

Experiment

The controlled simulations confirm that incorporating comparative evidence reduces diagnostic uncertainty and improves the effective fix probability of self-modification, with MGM outperforming DGM and HGM as the diagnostic advantage increases. On SWE-bench and Polyglot, MGM consistently achieves higher accuracy than HGM under equal computational budgets, and the evolved scaffolds generalize across benchmarks and backbone models, demonstrating the acquisition of reusable workflow-level improvements. Ablation studies reveal that both reaction-norm mutation and cross-lineage hybridization contribute to performance, with cross-lineage hybridization playing a more critical role in preserving and reusing evolutionary information.

MGM consistently outperforms HGM across both SWE-bench Verified and Polyglot benchmarks under the same computational budget and starting from the same initial scaffold. The largest gains appear on Polyglot, where MGM lifts accuracy from 50.8% to 93.2%, a relative improvement of 83.5%, while HGM reaches 77.9%. The performance gap is not explained by wall-clock time or token consumption, suggesting that MGM’s reuse of archived trajectories through reaction‑norm mutation and cross‑lineage hybridization drives more effective self‑improvement. On SWE‑bench Verified, MGM improved accuracy by 10.0 percentage points over the initial agent, twice the 5.0 point improvement of HGM. On Polyglot, MGM gained 42.4 percentage points (83.5% relative improvement), substantially exceeding HGM’s 27.1 point gain (53.3% relative improvement). Both methods used identical numbers of evaluations and expansions, and their wall‑clock times were comparable (within 3–4 hours on SWE‑bench and 4 hours on Polyglot), ruling out extra compute as the source of MGM’s advantage. Across the two benchmarks, MGM achieved an average accuracy of 85.8%, compared with 75.6% for HGM and 59.6% for the shared initial scaffold. The text confirms that average token costs per evolutionary step were similar for HGM and MGM, so the gains are not attributable to higher token expenditure.

When scaffolds evolved on Polyglot are transferred to SWE-bench Pro and SWE-bench Multilingual, MGM consistently improves accuracy, while HGM shows limited or negative transfer. MGM achieves large gains on both benchmarks, demonstrating that its self-modification operators discover reusable workflows that generalize across different repository complexities and programming languages. MGM yields substantial accuracy improvements on both held-out benchmarks, whereas HGM degrades on the more challenging SWE-bench Pro and gains only marginally on Multilingual. The relative improvements for MGM range from 32% on Multilingual to 60% on Pro, indicating robust cross-benchmark transfer of evolved scaffold changes.

Scaffolds evolved with MGM on Qwen3.6-35B-A3B transfer effectively to DeepSeek backbones on SWE-bench Verified-60. MGM achieves 70.8% average accuracy across the two DeepSeek models, substantially outperforming the initial scaffold (47.5%) and HGM (65.0%), while also improving the original Qwen setting by 10.0 points. These results indicate that MGM discovers reusable workflow-level improvements that are not tied to a single foundation model. MGM improves accuracy over the initial scaffold by 10.0 points on the original Qwen backbone and by 23.3 points on average across the transferred DeepSeek backbones. The relative improvement of MGM over the initial scaffold reaches 66.7% on DeepSeek-V4-Pro, compared to 55.6% for HGM. MGM consistently outperforms HGM across all model backbones, with the largest absolute gains on the transferred DeepSeek models.

The full MGM achieves a large accuracy gain over the initial agent, while removing either the reward model or the communication history significantly reduces this improvement. The communication history component proves most critical, as its absence causes the largest drop in performance. Training times are comparable across all variants, confirming that the gains come from the components themselves rather than differences in computational cost. Removing the communication history roughly halved the absolute accuracy gain, indicating it is essential for retaining and reusing useful evolutionary information across iterations. Without the reward model, the improvement declined by about one-third, showing it helps guide the self-improvement search toward more promising agents.

MGM was evaluated on SWE-bench Verified and Polyglot, where it consistently outperformed HGM while using identical computational budgets, and its gains were shown to stem from trajectory reuse rather than extra compute. Transfer experiments demonstrated that scaffold improvements evolved with MGM on one benchmark or model backbone generalize effectively to held-out benchmarks and different foundation models, whereas HGM exhibits limited or negative transfer. Ablations confirmed that the communication history is the most critical component for retaining and reusing evolutionary information, with the reward model providing additional guidance, and that the observed gains come from design choices rather than increased training cost.


KI mit KI entwickeln

Von der Idee bis zum Launch – beschleunigen Sie Ihre KI-Entwicklung mit kostenlosem KI-Co-Coding, sofort einsatzbereiter Umgebung und bestem GPU-Preis.

KI-gestütztes kollaboratives Programmieren
Sofort einsatzbereite GPUs
Die besten Preise

HyperAI Newsletters

Abonnieren Sie unsere neuesten Updates
Wir werden die neuesten Updates der Woche in Ihren Posteingang liefern um neun Uhr jeden Montagmorgen
Unterstützt von MailChimp