LEAP: Library-driven Evolutionary Abstraction Paradigm for Large Language Models

Fanbin Lu, Chi-Wing Fu, Jiaya JiaNeurIPS 2026

TL;DR

When humans solve hard puzzles, we don't reinvent basic logic from scratch every time—we build mental toolkits of reusable concepts. Current evolutionary LLM code-generators lack this memory, treating every problem in isolation. LEAP fixes this by letting LLMs build, prune, and share a global Python library of helper functions across tasks, dramatically boosting abstract reasoning accuracy while cutting token costs.

What Problem Does This Paper Address?

Pair an LLM with an evolutionary algorithm—where the model mutates parent programs into child programs and keeps the fittest—and you can discover remarkable algorithms (think FunSearch or AlphaEvolve). Yet, throw these systems at benchmarks requiring deep, multi-step abstract reasoning like ARC-AGI (visual grid puzzles where rules must be inferred from just a few examples), and they hit a wall.

Why? Because standard LLM evolution suffers from amnesia. It treats a 100-puzzle benchmark as 100 isolated islands, relying on random, low-level code tweaks to inch toward a solution. If the LLM figures out how to "flood-fill a connected region" on Puzzle 1, it has no way to remember and reuse that tool on Puzzle 12. Without consolidating low-level code into high-level building blocks, lineages quickly stagnate in local optima.

Methods

The authors introduce LEAP (Library-driven Evolutionary Abstraction Paradigm), shifting evolutionary search from isolated tasks to a concurrent batch of tasks sharing a dynamic "genetic memory"—a global library of Python helper functions.

Figure 1: Overview of the LEAP framework. The system operates through four synchronized stages: (1) Task Unification establishes a joint search space by sampling a batch of tasks. (2) Cross-Task Mutation utilizes an LLM to generate offspring programs in parallel, conditioned dynamically on the global library interface. (3) Dual-Level Optimization combines task-specific evaluation of offspring with a batch MDL criterion for library admission. (4) Library Consolidation extracts reusable subroutines from top-performing programs to update the global library. The central Global Library L acts as a shared repository of helper functions, facilitating cross-task knowledge transfer, accelerating exploitation, and enabling semantic exploration.

While standard evolutionary loops select, mutate, and evaluate individual programs, LEAP adds three novel macro-level mechanisms:

  • Global Interface Injection: Stuffing dozens of raw helper functions into a prompt wastes context and confuses the LLM. Instead, LEAP decouples interface from implementation: the prompt only receives compact function signatures and one-line docstrings, while the actual code is pre-loaded silently into the evaluation sandbox.
  • MDL-Based Admission: Whenever a program makes a fitness breakthrough, an "Abstraction Engine" analyzes its Abstract Syntax Tree (AST) to extract candidate subroutines (lifting hard-coded variables into parameters). To prevent library bloat, a function is only admitted if it passes a Minimum Description Length (MDL) gate—meaning the total tokens it saves by compressing solutions across the task batch must outweigh the length of the new function itself.
  • UCB Routing & Strict Pruning: Which functions get shown to the LLM, and which get deleted? LEAP treats prompt injection like a Multi-Armed Bandit problem, using an Upper Confidence Bound (UCB) score to balance proven winners with under-explored newcomers (showing up to 30 functions per prompt). Meanwhile, a separate Survival Score tracks fitness contribution, usage, and age—permanently evicting deadweight functions at the end of every generation.
Dynamic library management: MDL admission, survival scoring, and strict pruning

Datasets

LEAP is evaluated across two distinct domains (no new benchmarks are introduced):

  • ARC-AGI-2: An updated, harder version of the classic visual program synthesis benchmark, consisting of 120 evaluation tasks with $1 \times 1$ to $30 \times 30$ colored grids.
  • Mathematical Optimization Benchmarks: Six deceptive, continuous-to-discrete combinatorial geometry and signal problems, including Circle Packing (Square and Rectangle), Heilbronn Triangle and Convex problems, MinMax Distance, and Signal Processing.

Key Insights and Ideas

  • Smaller models get the biggest lift: By handing the LLM compact, high-level semantic Lego bricks, LEAP offloads the burden of low-level syntax juggling. This disproportionately rescues smaller models whose limited reasoning capacity normally collapses on long-horizon code synthesis.
  • Step-function breakthroughs: Standard evolutionary baselines plateau early on ARC-AGI-2. LEAP exhibits a "staircase" learning curve—periods of search punctuated by sudden upward jumps as newly consolidated library primitives unlock solutions across multiple stagnant tasks at once.
Figure 3: ARC-AGI-2
  • Abstraction saves money: Sharing compressed interfaces doesn't just make search smarter; it makes prompts shorter and convergence faster, turning cross-task library learning into a major token-saver.

Key Results

  • ARC-AGI-2: LEAP outperforms all evaluated evolutionary baselines across every LLM backbone. It hits 68.80% solved tasks on Gemini-3-Pro (vs. 45.00% no-evolution and 65.83% for EvoX) and 67.00% on GPT-5.4. Most strikingly, on the lightweight Gemini-3-Flash, it nearly doubles baseline accuracy from 20.00% to 39.20%.
  • Math Optimization: Using GPT-5 and Gemini-3-Pro backbones, LEAP achieves best or tied-for-best scores across all six benchmarks (largely matching AdaEvolve's final peaks while converging faster) and surpasses human SOTA references on tasks like Circle Packing and MinMax Distance.
  • Cost & Efficiency: LEAP is the cheapest evolutionary method tested on ARC-AGI-2, averaging **0.82M tokens ($14.76) per task**, beating AdaEvolve ($16.38), GEPA ($18.18), and EvoX ($20.34).

Limitations and Future Work

The authors note two main bottlenecks:

  1. Context Window Ceilings: Even with interface-only injection and aggressive pruning, the library is capped (e.g., 20,000 tokens total, top-30 functions per prompt). On massively heterogeneous task batches requiring hundreds of distinct tools, this ceiling could limit scalability.
  2. Base Model Dependency: LEAP amplifies an LLM's coding ability, it doesn't replace it—smaller models still struggle to orchestrate deeply complex algorithms compared to frontier backbones.

For future work, the team plans to extend LEAP beyond grid puzzles and math into multimodal reasoning and broader software engineering workflows.

Summary updated

Abstract

Despite the remarkable progress of evolutionary LLM frameworks like AlphaEvolve in program and algorithm discovery, they consistently struggle with tasks requiring deep algorithmic reasoning and long-horizon planning, such as the Abstraction and Reasoning Corpus (ARC-AGI). A fundamental limitation of current evolutionary code generation is its reliance on unguided stochasticity to derive child programs from parents, lacking a systematic mechanism for knowledge accumulation, whereas human problem-solving thrives on the continuous consolidation and reuse of high-level conceptual abstractions. To bridge this gap, we propose the \textbf{Library-driven Evolutionary Abstraction Paradigm (LEAP)}, a cognitive-inspired framework that enables LLMs to autonomously construct and evolve a globally shared library of reusable algorithmic primitives. The evolution of this library is governed by two rigorous theoretical principles: First, the generation of new primitives is driven by a Minimum Description Length (MDL) objective, ensuring the system only assimilates concepts that genuinely compress the problem space. Second, the evolutionary survival and selection of these primitives are governed by a principled exploration-exploitation mechanism, dynamically regulating the library's life-cycle to strike an optimal balance between exploiting proven cognitive operators and exploring novel hypotheses while strictly bounding context entropy. Extensive experiments demonstrate that LEAP significantly outperforms existing LLM evolutionary baselines on the ARC-AGI benchmark and math optimizations problems, exhibiting robust cross-task generalization, highly efficient context utilization, and autonomous concept discovery capabilities.
BibTeX
@inproceedings{lu2026leap,
  author = {Fanbin Lu and Chi-Wing Fu and Jiaya Jia},
  title = {{LEAP: Library-driven Evolutionary Abstraction Paradigm for Large Language Models}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=CDbFRtl25r},
}
Figure