CliffSearch: Structured Agentic Co-Evolution over Theory and Code for Scientific Algorithm Discovery
Organizations: IBM Research
Abstract
Scientific algorithm discovery is iterative: hypotheses are proposed, implemented, stress-tested, and revised. Current LLM-guided search systems accelerate proposal generation, but often under-represent scientific structure by optimizing code-only artifacts with weak correctness/originality gating. We present CliffSearch, an agentic evolutionary framework in which the core evolution operators (pair selection, crossover, mutation, and review) are implemented as LLM agents, and the loop is designed around three principles: (1) each node is a structured scientific artifact, instantiated in either theory+code or code_only mode, (2) reviewer judgments of correctness and originality are first-class selection gates alongside optimization of the benchmark metric of interest, and (3) mutation is split into exploration and correction pathways with distinct objectives. Exploration mutation imports ideas from adjacent scientific domains to increase novelty, while correction mutation performs targeted evidence-guided repair using reviewer signals over theory, code, benchmark results, and runtime errors. We illustrate the framework on three benchmark-grounded studies: transformer hyper-connection evolution, optimizer discovery on a fixed nanoGPT stack, and a smaller native-optimizer ablation. Across these settings, the same loop supports explicit metric direction, reproducible persistence, and reviewer-gated comparison of discoveries under controlled search conditions. The result is a discovery workflow that prioritizes scientific interpretability and correctness while optimizing task metrics under controlled novelty constraints, rather than maximizing candidate throughput alone. Full run artifacts, interactive visualizations, and exported best nodes for the reported studies are available at https://cliffsearch.ai .
Figures & tables
| Node | Gen | Alias | Provenance | Primary metric ( ) | Corr | Orig |
| E1 | 1 | HyperbolicRotation Routing | mutation | 1.84487 | 4 | 4 |
| A2 | 2 | GivensHyperbolic Routing | crossover | 1.76830 | 4 | 4 |
| G2 | 2 | HyperbolicRotation Routing | elite copy | 1.84487 | 4 | 4 |
| H2 | 2 | GrassmannianSubspace Routing | fill | 1.69347 | 4 | 4 |
| A3 | 3 | GrassmannianHyperbolic Routing | crossover | 1.69830 | 4 | 3 |
| G3 | 3 | GrassmannianSubspace Routing | elite copy | 1.69347 | 4 | 4 |
| Gen | Alias | Role in the trajectory | Primary metric ( ) | Corr | Orig |
| 0 | GivensOrthogonal ManifoldHC | First strong orthogonal-manifold branch; replaces permutation mixtures with content-adaptive Givens routing. | 5.2677 | 4 | 4 |
| 0 | HouseholderCayley ManifoldHC | Parallel orthogonal family using Householder reflections for width and Cayley depth transport. | 5.4502 | 4 | 4 |
| 1 | PoincareHC | Exploration-mutation breakthrough: Poincaré-ball width routing with explicit gyro-midpoint aggregation. | 0.0085 | 4 | 4 |
| 2 | GivensWidthBeta DepthHC | Bridge crossover retaining Givens width transport while stabilizing depth redistribution. | 0.0090 | 5 | 4 |
| 3 | PoincareGivens HybridHC | Best final hybrid: Givens width routing plus Poincaré-modulated depth scaling. | 0.00733 | 5 | 4 |
| Prompt | Mode | Evol. params | Best seed | Best reviewer-valid non-seed | Valid non-seeds beating seed |
| short_json | theory+code | g3/p8, ac=F, hs5=T | SeedAdam 0.7291 | HyperbolicAdaptive 0.7120 | 2 |
| short_json | theory+code | g6/p12, ac=F, hs5=T | SeedAdam 0.7054 | SpecProjAdam 0.5348 | 4 |
| short_json | code-only | g3/p8, ac=F, hs5=T | SeedAdam 0.7030 | AGNSoftCautious CurvAdamW 0.7046 | 0 |
| short_json | code-only | g6/p12, ac=F, hs5=T | SeedAdamW 0.7040 | CautiousAdamProj 0.4261 | 10 |
| workflow_v2 | theory+code | g3/p8, ac=F, hs5=T | SeedAdamW 0.7193 | none reviewer-valid | 0 |
| workflow_v2 | theory+code | g6/p12, ac=T, hs5=F | SeedAdamW 0.7212 | CauAdam 0.7186 | 3 |
| Task | Stored benchmark primary metric | Directional score | Failure handling |
| Native optimizer (pytorch_optimizer) | Mean validation loss aggregated across the configured native classification tasks, benchmark random seeds, and small hyperparameter sweep; stored field is mean_val_loss . | Reported setting: higher_is_better=false , hence . | If all native benchmark evaluations fail: benchmark error. Otherwise mean is taken over the successful fixed evaluation bundle returned by the adapter. |
| Optimizer (MHC-lite adapter) | . With random-seed imputation over , . | Reported setting: higher_is_better=false , hence . | If all seeds fail: benchmark error. Else impute failed seeds with worst successful primary value. |
| Transformer hyper-connection (MHC-lite adapter) | (validation loss under custom hyper-connections). Same random-seed imputation/aggregation as optimizer: . | Reported setting: higher_is_better=false , hence . | If all seeds fail: benchmark error. Else impute failed seeds with worst successful primary value. |
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| S | Node | Gen | Alias | Primary metric | Score | Corr | Orig |
|---|---|---|---|---|---|---|---|
| A0 | 0 | Transformer Residual AttentionSeed | 4.8555 | -4.8555 | 5 | 1 | |
| B0 | 0 | MHCLiteAttention Seed | ERROR(code) | ERROR(code) | 2 | 2 | |
| C0 | 0 | HCAttentionSeed | ERROR(code) | ERROR(code) | 2 | 1 | |
| D0 | 0 | Hyperbolic PoincareRouting | 4.4953 | -4.4953 | 3 | 4 | |
| E0 | 0 | Hyperbolic RotationRouting | ERROR(code) | ERROR(code) | 2 | 4 | |
| F0 | 0 | HypExpRouteV1 | 5.4568 | -5.4568 | 4 | 3 |
| Paper | Geometry | Score / similarity | Aggregation primitive | Routing used? |
|---|---|---|---|---|
| Hyperbolic Attention Networks | ||||
| Gulcehre et al. [ 14 ] | Hyperboloid / Klein hyperbolic models | Hyperbolic distance-based attention | Einstein midpoint for attentive value aggregation | No |
| Fully Hyperbolic Neural Networks | ||||
| Chen et al. [ 15 ] | Lorentz model | Lorentzian attention | Lorentz centroid as a hyperbolic aggregation primitive | No |
| Hypformer | ||||
| Yang et al. [ 63 ] | Lorentz model | Hyperbolic softmax attention and linear hyperbolic attention | Lorentzian midpoint / centroid; explicitly relates Lorentz centroid, Einstein midpoint, and gyromidpoint | No |
| Paper | Geometry | Routing mechanism | Fusion after routing | Routing used? |
|---|---|---|---|---|
| HELM-MiCE | ||||
| He et al. [ 33 ] | Lorentz hyperbolic spaces with distinct curvatures across experts | Learned gating scores select routed experts using expert-centroid affinities | Lorentzian centroid merges selected expert outputs | Yes |
| GeoMoE | ||||
| Cao et al. [ 13 ] | Mixed-curvature graph representation learning | Curvature-guided adaptive routing via a graph-aware gating network | Geometry-aware expert fusion; centroid-style primitives appear after routing rather than as the router itself | Yes |
| HC-family paper | Constraint set / manifold | Where geometry is imposed | Audit relevance for the reported run |
|---|---|---|---|
| HC | |||
| Zhu et al. [ 22 ] | Unconstrained Euclidean matrix space | Learned dense residual-stream mixing matrix | This is the unconstrained dense baseline that motivated mHC-style stabilizing constraints. It is relevant mainly as the precursor to the search task, not as a novelty match for the discovered manifold families. |
| mHC | Birkhoff polytope / doubly stochastic matrices | Residual mixing matrix constrained by Sinkhorn-style doubly stochastic projection [ 65 , 12 , 53 ] | This is the closest direct precedent for the supplied MHCLiteAttentionSeed . It explains why permutation-mixture and doubly stochastic routing should be treated as known HC-line ingredients, not novel discoveries. |
| mHC-lite | Birkhoff polytope / permutation-mixture parameterization | Residual mixing matrix parameterized by convex combinations of permutation matrices [ 29 ] | Again a direct known starting point for the task. It matters because CliffSearch begins from this family and then departs from it toward hyperbolic, Grassmannian, Stiefel, and orthogonal routing laws. |
| KromHC , mHC-GNN | Doubly stochastic / Birkhoff variants | Residual mixer factorizations or application transfers of the same HC-line matrix geometry [ 58 , 48 ] | These broaden the direct HC family, but they still keep geometry on the residual mixing matrix rather than on hidden-state stream routing. They do not directly match the hyperbolic branches found in the run. |
| JPmHC | Stiefel and Grassmann manifolds | Residual mixing matrix constrained to orthogonal or subspace-structured manifolds [ 11 , 5 ] | This is the strongest direct HC-line comparison for the GrassmannianSubspaceRouting , StiefelFrameRouting , and related families. The manifold ingredient is known in HC literature, but our run places it inside custom stream-routing operators rather than as a published HC mixer design. |
| Alias family | Run nodes | Closest literature relation | Audit interpretation |
|---|---|---|---|
| TransformerResidual AttentionSeed | A0 | Standard residual Transformer baseline [ 4 ] | Known baseline; not part of the novelty audit. |
| MHCLiteAttention Seed , HCAttentionSeed | B0, C0 | Direct seeds from the HC / mHC / mHC-lite line [ 22 , 65 , 29 ] | Known starting points supplied by the task. |
| MHCLiteDtypeFix , HCAttentionSeed _DtypeFix | B1, C1 | No literature comparison needed | Engineering repair nodes rather than scientific discoveries. |
| HyperbolicPoincare Routing , HyperbolicPoincare RoutingV2 , PoincareRoute , PoincareHyperbolic Routing | D0, D1, E3, H3 | Hyperbolic attention papers use hyperbolic distances together with Einstein midpoint, Lorentz centroid, or softmax-style hyperbolic attention [ 14 , 15 , 63 ] | Closest to retrieval / analogy from known hyperbolic-attention motifs. In our run these nodes still use softmax or sigmoid gating over distances and Euclidean tensor merges, so they are better read as partial retrieval of the scoring idea than as exact reproductions of the manifold aggregation rules in the literature. |
| HypExpRouteV1 , HyperbolicExpMap Routing , HyperbolicExpMap RoutingV2 | F0, A1, D2, D3 | Closest to hyperbolic exp-map / tangent-space constructions in hyperbolic or mixed-curvature attention [ 63 , 19 ] | Literature-adjacent. These look like code-level adaptations of known hyperbolic geometry primitives to stream routing, not the clearest novelty candidates. |
| HyperbolicRotation Routing | E0, E1, G2 | No direct SO(4) / Givens-parameterized stream-routing analogue found in the surveyed manifold-attention papers | Strong novelty candidate. The surveyed literature did not produce an orthogonal-group routing family of this form. |
| S | Gen | Alias | Primary metric | Score | Corr | Orig |
|---|---|---|---|---|---|---|
| 0 | TransformerResidual AttentionSeed | 4.8555 | -4.8555 | 5 | 1 | |
| 0 | MHCLiteAttention Seed | 5.61363 | -5.61363 | 4 | 2 | |
| 0 | HCAttentionSeed | 5.75093 | -5.75093 | 4 | 1 | |
| 0 | HyperbolicGeodesic Routing | ERROR (code) | ERROR (code) | 1 | 3 | |
| 0 | GivensOrthogonal ManifoldHC | 5.2677 | -5.2677 | 4 | 4 | |
| 0 | PoincareBall RoutingHC | 6.441 | -6.441 | 4 | 4 |
| Alias family | Run nodes | Closest literature relation | Audit interpretation |
|---|---|---|---|
| PoincareBallRoutingHC , PoincareHC | g000_n0006, g001_n0012, g002_n0023, g003_n0031 | Hyperbolic attention, Lorentz/Einstein midpoint, and gyrovector-space aggregation [ 14 , 15 , 63 , 60 ] | Literature-grounded transfer rather than pure retrieval. The primitives are known, but PoincareHC is stronger than the earlier theory+code hyperbolic nodes because it actually performs intrinsic width aggregation through a gamma-weighted gyro-midpoint inside the HC operator rather than merely using hyperbolic scoring or projection. |
| GivensOrthogonal ManifoldHC , HouseholderCayley ManifoldHC | g000_n0005, g000_n0008 | Matrix-manifold parameterizations (Givens, Householder, Cayley) and recent manifold HC variants [ 5 , 11 , 64 ] | Strong novelty candidates. The underlying orthogonal parameterizations are known mathematics, but the surveyed attention and HC papers do not provide a direct analogue of these content-adaptive stream-routing operators inside a custom hyper-connection. |
| GivensWidthBeta DepthHC , PoincareGivens HybridHC | g002_n0017, g003_n0025 | Hybridization of the previous orthogonal family with the Poincaré family | Recombination novelty. These nodes are not best read as direct retrieval from one paper; they are principled crossovers that assign orthogonal geometry to width transport and retain Poincaré geometry as depth modulation. PoincareGivensHybridHC is the best final-performing node, but the more fundamental novelty event remains PoincareHC . |
| SinkhornDoubly StochasticHC | g003_n0026 | Direct HC / mHC / mHC-lite line with Sinkhorn/Birkhoff routing [ 65 , 29 , 53 ] | Repair-first node rather than a strong novelty claim. The reviewer’s originality score is appropriate because the node explicitly moves back toward known HC mechanisms. |
| Prompt | Mode | Node | Alias | Producer | Metric | Corr | Orig | Gate |
|---|---|---|---|---|---|---|---|---|
| short_json | theory+code | B3 | MuonCausalMomentum | mutation | 1.7782 | 4 | 4 | valid |
| short_json | theory+code | E3 | AdamW_GPD_AMR_v2 | repair | 1.9849 | 4 | 3 | held out |
| short_json | code-only | E2 | MuonSophiaV3_CosGa te | mutation | 1.7659 | 4 | 4 | valid |
| short_json | code-only | B3 | MuonSOAPGradNormAd aptive | mutation | 2.2217 | 4 | 4 | valid |
| workflow_v2 | theory+code | A3 | MuonCauchyRiemanni an | crossover | 2.5576 | 4 | 3 | held out |
| workflow_v2 | theory+code | A2 | MuonCauchyTrust | crossover | 2.8728 | 4 | 4 | valid |
| S | Node | Alias | Metric | Corr | Orig |
|---|---|---|---|---|---|
| A0 | SeedMuon | 3.9195 | 5 | 5 | |
| B0 | SeedAdam | 2.442 | 5 | 5 | |
| C0 | SeedAdamW | 4.82 | 5 | 5 | |
| D0 | MuonCaution | 3.9364 | 4 | 3 | |
| E0 | CautiousAdamW_GC | 4.8008 | 4 | 3 | |
| F0 | CautiousAdamW_GC | 4.8104 | 4 | 3 |
| S | Node | Alias | Metric | Corr | Orig |
|---|---|---|---|---|---|
| A0 | SeedMuon | 3.9195 | 5 | 5 | |
| B0 | SeedAdam | 2.442 | 5 | 5 | |
| C0 | SeedAdamW | 4.82 | 5 | 5 | |
| D0 | MuonCaution | 3.9289 | 4 | 3 | |
| E0 | CautiousGCAdamW | 4.8229 | 4 | 4 | |
| F0 | CautiousCentralize dAdam | 4.7893 | 4 | 3 |
| S | Node | Alias | Metric | Corr | Orig |
|---|---|---|---|---|---|
| A0 | SeedMuon | 3.9195 | 5 | 5 | |
| B0 | SeedAdam | 2.442 | 5 | 5 | |
| C0 | SeedAdamW | 4.82 | 5 | 5 | |
| D0 | MuonCausal | 3.8783 | 4 | 3 | |
| E0 | CauchySpectral | 3.9089 | 3 | 4 | |
| F0 | CauchyMomentum | 4.7602 | 3 | 3 |
| S | Node | Alias | Metric | Corr | Orig |
|---|---|---|---|---|---|
| A0 | SeedMuon | 3.9195 | 5 | 5 | |
| B0 | SeedAdam | 2.442 | 5 | 5 | |
| C0 | SeedAdamW | 4.82 | 5 | 5 | |
| D0 | MuonCaution | 3.9398 | 3 | 3 | |
| E0 | CautiousCentralize dAdamW | 4.688 | 4 | 4 | |
| F0 | CautiousGCAdam | 4.7293 | 4 | 4 |
| Prompt bundle | Mode | Evol. params | Best seed | Best raw non-seed | Best reviewer- valid non-seed | Valid non-seeds | Valid beating best seed |
|---|---|---|---|---|---|---|---|
| short | t+ c | g3/p8, ac=F, hs5=T | SeedAdam 0.7291 | AgreementAdam 0.6663 | HyperbolicAdaptive 0.7120 | 6 | 2 |
| short | t+ c | g6/p12, ac=F, hs5=T | SeedAdam 0.7054 | ConsistencyHarm _Adam 0.4874 | SpecProjAdam 0.5348 | 24 | 4 |
| short | c- only | g3/p8, ac=F, hs5=T | SeedAdam 0.7030 | AdaGradMomentumGC 0.5381 | AGNSoftCautious CurvAdamW 0.7046 | 8 | 0 |
| short | c- only | g6/p12, ac=F, hs5=T | SeedAdamW 0.7040 | CautiousAdamProj 0.4261 | CautiousAdamProj 0.4261 | 32 | 10 |
| wf-v2 | t+ c | g3/p8, ac=F, hs5=T | SeedAdamW 0.7193 | CauchyMomentum Adam_v2 0.6422 | none reviewer-valid | 0 | 0 |
| wf-v2 | t+ c | g6/p12, ac=T, hs5=F | SeedAdamW 0.7212 | HyperbolicMomentum 0.3879 | CauAdam 0.7186 | 4 | 3 |
| Run | Most repeated non-seed aliases | Best reviewer-valid family |
|---|---|---|
| short_json theory+code g3/p8 | HyperbolicAdam x2, HyperbolicAdaptive x2 | HyperbolicAdaptive (0.7120) |
| short_json theory+code g6/p12 | CauchyAdam x4, HyperbolicAdam x4, TanhMomentum_Adam x3 | SpecProjAdam (0.5348) |
| short_json code-only g3/p8 | AGNSoftCautiousCurvAdamW x3 | AGNSoftCautiousCurvAdamW (0.7046) |
| short_json code-only g6/p12 | CautiousAdamProj x6, CautiousAdamGN x2 | CautiousAdamProj (0.4261) |
| workflow_v2 theory+code g3/p8 | HyperSpectral x2 | none reviewer-valid |
| workflow_v2 theory+code g6/p12 | HyperbolicAdam x3, CauAdam x3, DRAWAdam x2 | CauAdam (0.7186) |
| Run | Alias | Metric | Corr/ Orig | Why held out |
|---|---|---|---|---|
| short_json theory+code g3/p8 | AgreementAdam | 0.6663 | 4/2 | Lower loss than the best seed, but reviewer judged it too close to known agreement-style Adam variants to count as sufficiently original. |
| short_json theory+code g6/p12 | ConsistencyHarm_Adam | 0.4874 | 5/3 | Very strong raw loss, but reviewer treated the harmonic-consistency combination as a literature-adjacent recombination rather than a stronger novelty claim. |
| short_json code-only g3/p8 | AdaGradMomentumGC | 0.5381 | 4/3 | Good loss, but originality stayed below the 4/4 winner threshold. |
| workflow_v2 theory+code g3/p8 | CauchyMomentumAdam_v2 | 0.6422 | 4/3 | Reviewer treated the robustification as a modest variation on known ingredients rather than a sufficiently new optimizer family. |
| workflow_v2 theory+code g6/p12 | HyperbolicMomentum | 0.3879 | 3/4 | Strongest raw non-seed in the entire audit, but reviewer rejected the bias-correction logic as not yet correct under the proposed anti-windup momentum scheme. |
| workflow_v2 code-only g6/p12 | CurvAdam_Refined | 0.6236 | 4/2 | Reviewer accepted correctness but scored novelty down, again showing that low loss alone was not enough to survive workflow-v2 review. |