TL;DR
Give an LLM a clear prompt, and it writes great code; give it only a handful of input-output examples with zero explanation, and it usually memorizes a brittle lookup table or gets lost in spaghetti logic. DIO-Agent solves this "reverse engineering" problem by pairing LLM-driven evolutionary search with a classic human software engineering discipline: start with the simplest possible code, and only add complexity—like if statements or while loops—when the data forces your hand.
What Problem Does This Paper Address?
Modern code generation (NL2Code) thrives because LLMs learned to map human descriptions to familiar code patterns during pretraining. What happens when there is no description? Whether you are reverse-engineering a black-box API, migrating legacy systems with lost source code, or distilling scientific laws from raw data, you have to deduce the underlying rule strictly from behavior. The authors call this IO2Code.
IO2Code is a treacherous search problem with two classic failure modes:
- The Overfitting Trap: Without natural language nudging the model toward a general algorithm, the easiest way to pass visible tests is to write a giant
if/eliflookup table—which immediately collapses on unseen inputs. - The Blind Mutation Trap: If you use evolutionary search to randomly tweak code, the LLM quickly wanders into syntactically complex, semantically broken dead ends that are nearly impossible to mutate out of.
Methods
DIO-Agent builds on a standard multi-island evolutionary backbone (where an LLM proposes SEARCH/REPLACE code diffs and a sandbox executes them), but tames the search space using three tightly coupled innovations:
- Transformation-Priority Guided Mutation (TPP): Borrowed from Robert Martin’s Test-Driven Development (TDD) practices, TPP enforces a strict structural hierarchy: constants $\rightarrow$ variables $\rightarrow$ conditionals (
if) $\rightarrow$ loops (while) $\rightarrow$ recursion. Prompting biases the LLM to exhaust simple constructs before escalating to complex control flow, acting like Occam’s Razor inside the mutation operator. - Curriculum-wise Evolution: Instead of dumping all I/O pairs on the agent at once, examples are sorted from shortest/simplest to hardest and revealed in nested stages. The winning program from stage $s-1$ seeds stage $s$, allowing the agent to establish a clean core hypothesis early and refine it gradually.
- Error-Grounded Feedback: Scalar accuracy scores hide why a program failed. DIO-Agent passes concrete execution mismatches, runtime errors, and an inherited chain of ancestor bugs directly into the mutation prompt, while explicitly penalizing code bloat and input-copying in its fitness score.
Datasets
Because existing Programming-by-Example (PBE) benchmarks mostly focus on narrow domains like spreadsheet string manipulation, the authors introduce IO2CodeBench. It evaluates true algorithmic induction across four distinct tiers—Base, Algorithm, Geometry, and Multimodal—using strict held-out test sets to catch overfitting. (Note: This is an inference-time discovery framework; no training datasets are used.)
Key Insights and Ideas
- Brute-force sampling hits a wall: Giving an LLM 40 independent tries (Best-of-N) or using Self-Consistency severely trails 40 steps of structured evolution. In discovery tasks, the true underlying rule is rarely sitting at the top of the model's prior distribution waiting to be sampled.
- Shrinking code is the hallmark of a eureka moment: Tracking code length across evolutionary stages revealed a striking pattern: runs that continuously simplified their code succeeded 94.4% of the time, whereas monotonically growing code signaled "patch-work" overfitting. Failed runs averaged 833.9 characters on the final stage (even when scoring 100% on visible tests!), compared to crisp 249.8-character solutions for true discoveries.
- Active exploration unlocks even better discovery: When the authors removed static examples and let DIO-Agent invent its own inputs to query a black-box oracle, performance jumped even higher—proving the agent can strategically probe edge cases to resolve ambiguity.
Key Results
Across IO2CodeBench (using DeepSeek V3.2), DIO-Agent achieves an average pass rate of 58.63%, beating traditional PBE (14.58%) and state-of-the-art evolutionary coding agents like AlphaEvolve (47.29%) and CodeEvolve (49.60%).
- Excels on hard tasks: On Algorithm tasks, DIO-Agent hits 71.43% (vs. 60.00% for AlphaEvolve/CodeEvolve), and nearly doubles AlphaEvolve on noisy Multimodal tasks (40.67% vs. 22.00%).
- Token efficient: It uses 3,738 tokens/iteration, significantly leaner than AlphaEvolve (4,130) and CodeEvolve (5,829).
- Model-agnostic: Swapping the backbone to Qwen-3.6-Plus (55.45% avg) or Claude-Sonnet-4.6 (57.31% avg) yields similarly strong gains over baselines.
- Ablations: Removing the easy-to-hard curriculum hurts most (dropping accuracy to 51.33% while spiking token costs), followed by removing TPP (53.80%) and Error Feedback (54.61%).
Limitations and Future Work
While the main text does not feature a standalone limitations section, the authors' failure analyses highlight clear boundaries: models still fall prey to verbose overfitting in deceptive domains like Arithmetic (where 36 of 42 test failures achieved perfect training accuracy via convoluted logic), and autonomous active exploration significantly extends the search horizon required per task. Looking ahead, the authors position IO2CodeBench and active oracle-querying as stepping stones to push code-generating LLMs beyond pattern reuse toward autonomous scientific and algorithmic discovery.
Summary updated