CliffSearch: Structured Agentic Co-Evolution over Theory and Code for Scientific Algorithm Discovery

Youssef Mroueh, Carlos Fonseca, Brian Belgodere, David CoxarXiv 2026

TL;DR

CliffSearch is a new agentic evolutionary framework that co-evolves scientific theory and executable code to discover novel algorithms. By introducing strict LLM-based reviewer gates for correctness and originality, and splitting mutation into distinct exploration and correction pathways, it prioritizes scientifically interpretable and trustworthy discoveries over raw candidate throughput.

What Problem Does This Paper Address?

While Large Language Models (LLMs) have accelerated automated algorithm discovery, existing evolutionary frameworks suffer from a few major flaws when applied to scientific domains. Most current systems optimize code-only artifacts, focusing purely on maximizing a benchmark score. This approach often results in a "blind code search" that produces fragile implementations, lacks conceptual traceability, and frequently surfaces unoriginal, plagiarized, or trivial variations of existing algorithms. Furthermore, standard mutation policies conflate two entirely different goals: broad, creative exploration and targeted, evidence-guided debugging.

CliffSearch addresses these gaps by structuring the search space around complete scientific artifacts (coupling rationale with code), enforcing strict multi-dimensional review gates, and decoupling exploration from repair.

Methods

CliffSearch implements a population-based evolutionary loop where the core operators are driven by specialized LLM agents: a pair selector, a crossover agent, an exploration mutation agent, a correction mutation agent, and a reviewer agent.

The framework is built around three core architectural pillars:

  1. Structured Node Representation: Instead of searching over raw code snippets, the unit of evolution is a structured JSON node containing three fields: summary_md (a natural-language synopsis of design principles), theory_content (formal mathematical/scientific rationale), and code_content (the executable implementation). It can run in theory+code mode or a streamlined code_only mode where formal theory files are suppressed but the conceptual scaffold (summary_md) is preserved.
Figure 1: Structured node artifact evolved across generations. In code_only, theory_content is present but empty, while summary_md still carries the node’s explanatory prose.
  1. Two-Path Mutation Routing: Mutation is explicitly split based on reviewer feedback. If a candidate is correct but lacks originality, it goes down the Exploration Mutation pathway to import novel mechanisms from adjacent scientific domains (e.g., control theory, information geometry). If a candidate is incorrect or yields a weak score, it is routed to the Correction Mutation pathway for targeted, evidence-guided repair using runtime error logs and reviewer critiques.
Figure 2: Two mutation operators with distinct routing and objectives.
  1. Reviewer-Gated Selection: Every candidate must pass through a strict reviewer agent that scores its correctness and originality on a 1–5 scale. Candidates are only admitted to the "winners bucket" (making them eligible for future crossover and pairing) if they pass both reviewer gates (score $\ge$ 4) and beat the median benchmark score of the current generation.
Figure 3: One generation cycle: bucket routing, agent operators, composition, benchmark, and review.

For large-scale scalability, CliffSearch also supports a distributed multi-island architecture where independent evolutionary islands asynchronously exchange high-performing "migrant" nodes over shared storage.

Figure 4: Distributed multi-island execution with asynchronous migration packets.

Datasets

The authors validated CliffSearch across three distinct algorithmic discovery tasks:

  • Transformer Hyper-Connection Evolution: Evolving the geometric laws that mix residual streams within a transformer block, evaluated using a fixed small-model nanoGPT configuration trained on the Shakespeare character dataset.
  • Optimizer Discovery on nanoGPT: Evolving PyTorch-compatible optimizer update rules, evaluated on the same nanoGPT/Shakespeare training stack.
  • Native Optimizer Ablation: A lower-cost testbed evaluating optimizers across a 32-run bundle spanning four classification datasets: two synthetic linear tasks (syn_clf_balanced_linear, syn_clf_noisy_imb_linear) and two tabular MLP tasks (tab_breast_cancer_mlp, tab_wine_mlp).

Key Insights and Ideas

  • Code-Only Mode Doesn't Mean Blind Search: Even when formal mathematical theory generation is turned off to save token budgets, forcing the LLM to maintain a summary_md tracking its design principles keeps the search grounded in coherent algorithmic concepts.
  • The Power of Recombination: In the hyper-connection task, the system independently discovered an orthogonal-manifold branch (Givens rotations) and a hyperbolic branch (Poincaré ball). A later crossover event successfully combined them into a powerful width/depth hybrid (PoincareGivensHybridHC) that delegated width transport to Givens rotations and depth scaling to Poincaré geometry.
  • Task-Dependent Exploitation: When shifted from complex transformer pretraining to simple tabular classification, the framework automatically pivoted its discovery strategy—moving away from expensive matrix-orthogonalization mechanisms (like Muon) toward lightweight, Adam-style control heuristics (cautious masking, gradient centralization).

Key Results

  • Hyper-Connection Breakthrough: In the code_only transformer study, CliffSearch discovered a node (PoincareGivensHybridHC) that achieved a mean validation loss of 0.00733, drastically outperforming both the baseline human seed (4.8555) and the best node found in the more constrained theory+code mode (1.6935).
  • Novel Optimizers: In the optimizer discovery task, the framework successfully surfaced MuonCausalMomentum (validation loss of 1.7782 vs. the Adam seed of 2.4420), which introduced a novel temporal gradient-energy weighting scheme to scale learning rates per-row without full second-moment estimation overhead.
  • Rigorous Filtering: The workflow-v2 prompt configuration successfully acted as a strict filter. For instance, it generated a candidate (HyperbolicMomentum) with the lowest raw loss in its run (0.3879) but correctly held it out from the winner pool because the reviewer flagged a flaw in its anti-windup bias-correction logic.

Limitations and Future Work

  • No Convergence Guarantees: Because the evolutionary operators are guided by open-ended LLM prompts, the framework lacks formal mathematical convergence guarantees.
  • Uncalibrated Reviewer Uncertainty: Reviewer confidence and uncertainty are currently compressed into simple scalar scores rather than well-calibrated probabilistic uncertainty models.
  • Latent Memory Novelty Checks: The reviewer agents judge originality based entirely on their internal, pre-trained latent memory. The authors note that a critical next step is integrating a retrieval-backed literature database (RAG) so that novelty claims can be cross-referenced against actual published papers in real-time.

Summary updated

BibTeX
@misc{mroueh2026cliffsearch,
  author = {Youssef Mroueh and Carlos Fonseca and Brian Belgodere and David Cox},
  title = {{CliffSearch: Structured Agentic Co-Evolution over Theory and Code for Scientific Algorithm Discovery}},
  year = {2026},
  eprint = {2604.01210},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.01210},
}
Figure