Mendel Gödel Machine (MGM) makes a self-editing coding agent learn faster by feeding the editor comparative trajectories from its archive: same agent on multiple tasks, or different agents on the same task. On Polyglot, this lifts a Qwen-backed scaffold from 50.8% to 93.3%.
Imagine you’re running an autonomous coding agent that rewrites its own scaffolding (prompts, tools, control flow) every time a benchmark task fails. Today, most self-improving setups (Darwin Gödel Machine (DGM), Huxley Gödel Machine (HGM)) show the editor exactly one failure log and say “fix yourself.” That’s a noisy signal. One failed test could mean a deep design flaw, or just a weird task. The editor has no way to tell.
MGM sits in the same archive-based evolution loop as those systems but changes what the editor sees before it rewrites code. It keeps the search machinery and adds two new comparison-based edit operators on top.
MGM treats each agent scaffold as a genotype and its pass/fail record across tasks as a phenotype. The archive already stores every agent variant and every trajectory it produced. MGM’s contribution is three edit operators, chosen by weighted sampling when the search decides to expand a node:
•
Clonal mutation: the old baseline. One agent, one failed trajectory, ask the LLM to fix itself.
•
Reaction-norm mutation: show the LLM two or more trajectories from the same agent on different tasks. If it fails the same way twice, that’s a genotype-level defect, not a task fluke. Formally, the candidate set of “loci to fix” shrinks from one task’s requirements to the intersection of two.
•
Cross-lineage hybridization: show the LLM two different agents on the same task. If one solved it and the other didn’t, the successful trajectory acts as a contrastive control. The editor extracts the behavior (not the source code) that made the difference and adapts it into the failing agent.
All three operators reuse trajectories already sitting in the archive, so they cost zero extra task evaluations. A separate failed-task pool biases future evaluations toward tasks that have exposed at least one failure somewhere, which increases the odds that two lineages share a comparable task.
for step in range(budget):
if should_expand(archive):
parent = sample_parent(archive) # Thompson sampling
eligible = which_operators_apply(parent, archive)
op = sample_weighted(eligible, weights=(0.10, 0.45, 0.45))
evidence = build_evidence(op, parent, archive) # 1 traj, N trajs, or cross-agent
child = llm_edit(parent.code, evidence)
archive.add(child)
else:
agent, task = pick_next_eval(archive, failed_pool_boost=1.0)
run_and_record(agent, task, archive)
The prevailing view in self-improving agents (Darwin Gödel Machine (DGM), Huxley Gödel Machine (HGM)) is that the archive is a leaderboard: its job is to tell you which agent to edit next. This paper argues the opposite. The archive is a source of controlled experiments, and the real leverage is in what evidence you hand the editor at each step, not in which node you pick. The clean evidence for this is the Additive fitness landscape analysis, which shows the comparative operators shrink the editor’s candidate defect set. The full-benchmark headline number is a downstream consequence.
The load-bearing result is the ablation on Polyglot-60: removing either reaction-norm mutation or cross-lineage hybridization degrades performance clearly, with hybridization the more critical of the two. That’s what pins the gains to the evidence structure, not to search budget or token spend. The paper reports token consumption per operator is comparable, ruling out “MGM just uses more compute per edit.”
•
On Polyglot-60, same 200-evaluation budget and same starting scaffold, HGM lifts a Qwen3.6-35B-A3B agent from 50.8% → 77.9%, MGM lifts it to 93.2%.
•
Full 225-task Polyglot: 93.3%, matching the subset.
•
Cross-model transfer: freeze the MGM-evolved scaffold, swap the backbone to DeepSeek-V4-Pro, get 96.9% on full Polyglot. The scaffold improvement isn’t tied to the model that discovered it.
•
Cross-benchmark transfer to SWE-bench Pro and Multilingual: MGM’s scaffold generalizes positively (+10.0 and +13.3 pp), while HGM’s actually regresses on SWE-bench Pro (−3.4 pp). This is the sharpest sign that MGM is discovering reusable workflow skills rather than benchmark-specific patches.
•
Counterintuitive backbone result: a larger coding-specialized model (Qwen3-Coder-Next-80B) produces weaker self-improvement than the smaller Qwen3.6-35B, because self-editing rewards diagnostic reasoning over raw coding fluency.
Reach for this when you’re running an offline evolution loop over agent scaffolds and can afford to keep an archive of trajectories. Concretely: you’ve got a coding agent that iterates on a benchmark suite, and today you regenerate a whole new scaffold from one failure. MGM says pool the archive first. Before editing agent A on task T, look for another trajectory from A on a different task (reaction-norm) or from another agent B on task T (cross-lineage). Hand both to the editor as context. The comparison narrows what the LLM tries to fix.
Code and project page are released: GitHub and project page. The evolved agent scaffolds in the appendix are directly readable diffs. One discovered workflow, a “test-contract extraction” two-phase loop that reads test files as strict API contracts before implementing, is language-agnostic and could be lifted into other coding-agent scaffolds without running MGM at all.
In self-improving systems, upgrade the evidence before you upgrade the search. The archive isn’t just a ranking of candidates; it’s a corpus of controlled experiments you’re throwing away when the editor sees only one failure at a time.
•
MGM needs an archive with overlap to work. Early in evolution, or with sparse task coverage, the comparative operators aren’t eligible and MGM collapses to plain single-trajectory editing. The failed-task pool helps but can’t manufacture contrasts out of nothing.
•
Better evidence doesn’t guarantee a better edit. The LLM still has to interpret the comparison, and the paper’s own Qwen3-Coder-Next result shows that a stronger coding model with weaker reasoning gets less mileage from richer evidence than a smaller, better-reasoning model.
•
Primary experiments run on 60-task subsets with limited seeds, and the theoretical justification uses a stylized binary-genotype model. The full-Polyglot and cross-model checks are supporting evidence, not a broad variance study.