TL;DR
The Mendel Gödel Machine (MGM) introduces a comparative evolution framework for self-improving coding agents, moving beyond traditional single-failure code edits. By analyzing an agent's performance across multiple tasks simultaneously and contrasting different agent lineages, MGM discovers robust, generalizable workflow improvements that significantly boost coding performance without incurring extra evaluation costs.
What Problem Does This Paper Address?
Recursive self-improving AI agents—systems that autonomously rewrite their own source code to become more capable—typically rely on a single failure trajectory to guide their self-modifications. When an agent fails a task, it inspects that specific failure and tries to fix its code.
However, this approach is noisy and prone to overfitting, often resulting in narrow, task-specific patches rather than general capability upgrades. It completely overlooks the rich comparative data building up in the agent's historical archive of past attempts across various tasks and lineages.
Methods
Inspired by Mendelian genetics, the authors propose the Mendel Gödel Machine (MGM). MGM treats the agent's codebase as its genotype and its evaluation history as its phenotype.
Instead of relying solely on standard Clonal Mutation (editing code based on a single failure), MGM introduces two new comparative operators:
- Reaction-norm Mutation ($\Phi_{RM}$): Compares an agent's trajectories across multiple different tasks to isolate recurring, systemic weaknesses rather than task-specific accidents.
- Cross-lineage Hybridization ($\Phi_{CH}$): Compares two different agent lineages on the same task. If one succeeded and the other failed, the failing agent uses the successful agent's trajectory as a contrastive control to extract and adapt transferable behavioral traits into its own codebase.
MGM also maintains a global pool of failed tasks to deliberately create overlap across lineages, maximizing the opportunities for hybridization without requiring extra task evaluations.
Datasets
The authors evaluated MGM on several challenging software engineering and coding benchmarks:
- Polyglot (both a 60-task subset and the full 225-task benchmark): Tests multi-language standalone coding across C++, Go, Java, JavaScript, Python, and Rust.
- SWE-bench Verified (60-task subset): A human-filtered subset of real-world GitHub issues testing repository-level fault localization and patch construction.
- SWE-bench Pro & SWE-bench Multilingual: Used as held-out benchmarks to test cross-benchmark generalization.
Key Insights and Ideas
- Diagnostic Compression: Comparative evidence acts as a filter, shrinking the search space of potential code defects. By looking at multiple tasks or lineages, the agent can easily separate causal defects from superficial symptoms.
- Self-Evolution is a Reasoning Problem: Surprisingly, a larger, coding-specialized model (Qwen3-Coder-Next-80B) underperformed a smaller model with superior general reasoning (Qwen3.6-35B). Self-improvement requires deep trajectory diagnosis and abstraction before any code is written.
- Workflow-Level Generalization: Because MGM forces agents to learn from broad comparative patterns, the evolved code changes represent reusable software engineering habits (like test-driven verification loops and strict contract planning) rather than brittle hacks.
Key Results
- Massive Performance Gains: Evolving a Qwen3.6-35B base model using MGM boosted its Polyglot performance from 50.8% to 93.3%, outperforming closed-source giants like GPT-5 while using ~117× fewer parameters.
- Seamless Scaffold Transfer: The evolved agent workflows are highly transferable. Freezing the scaffold evolved on the Qwen model and swapping the backbone to DeepSeek-V4-Pro pushed Polyglot performance to an incredible 96.9%.
- SWE-bench Improvements: On SWE-bench Verified, MGM improved the initial agent scaffold from 68.3% to 78.3%, outperforming the single-trajectory baseline (HGM) at 73.3%.
Limitations and Future Work
- High Computational Cost: Running offline evolution loops on repository-level tasks remains extremely expensive in terms of GPU hours and wall-clock time.
- History Dependency: MGM relies on an accumulated archive of failures to find meaningful comparative signals. Early in the evolution process, when the archive is small, it collapses back to standard single-trajectory baselines.
- LLM Editor Bottleneck: While MGM provides better diagnostic evidence, the actual code modification is still performed by an LLM. If the underlying model fails to write clean, maintainable code based on that evidence, the budget is wasted.
- Scope Limitations: The framework has only been validated on coding agent scaffolds; its applicability to non-coding agents or open-ended real-world software maintenance remains unproven.
Summary updated