Evolving Protein Transition Planners with Minimal Physical Counterexamples

Proteins change shape to do their jobs. An enzyme closes around its substrate, and a signaling switch flips between "on" and "off" forms. Computing a physically plausible path between two known shapes is hard because a protein has thousands of coordinates. A useful fact helps: most large motions follow a handful of collective directions. Normal mode analysis, which treats the protein as a network of springs and extracts its softest vibrations, recovers these directions from a single structure. Robotics-style planners have used those directions to steer a search from one shape to the other. Those planners are hand-written, though, and their weakest parts are improvised: when to recompute the spring modes, which modes to follow, and how to resolve atom collisions. LLM coding loops, which write a program, run it, read the result and revise it, have recently produced better heuristics than hand design on routing and scheduling problems. They have not been aimed at this kind of physical search code.

We propose an LLM program-evolution loop that rewrites the steering policy of a normal-mode-guided path planner. It runs inside a fixed, trusted physics harness. After each run the LLM sees one short counterexample instead of a log, for example: "the search stalled at step 412, where these three residues collide, and the current modes capture only 31% of the remaining displacement to the goal." The bet is twofold. Free-form code search should find steering rules that a parameter sweep over the hand-written planner cannot express. Physically minimal feedback should be what makes that search sample-efficient enough to be worth running.

Core Claim

Two parts of normal-mode path planning are currently hand-coded: the schedule for recomputing modes and choosing among them, and the rule for resolving side-chain collisions. LLM-driven refinement of these two parts, guided by a single short physical counterexample per evaluation, should yield planners with two properties. On held-out proteins they should reach the goal shape more often or at lower CPU cost than the hand-written planner. They should also beat that planner after its parameters are tuned with Bayesian optimization on the same evaluation budget. The claim is falsifiable at two points. If tuning the planner's existing parameters matches the evolved code, then free-form code search adds nothing here. If evolution that sees only a scalar score matches evolution that sees counterexamples, then the feedback design is not the active ingredient.

Where This Sits

The planner we start from is the one of An NMA‐guided path planning approach for computing large‐amplitude conformational changes in proteins. That method grows a random search tree, of the kind used in robot motion planning, along low-frequency elastic-network modes. It recomputes the modes periodically to escape the spring approximation and fixes side-chain collisions with random local perturbations. It reaches goal shapes below 2 Å RMSD on several domain-motion proteins and converges on adenylate kinase in 10 iterations and about 80 CPU-minutes. This paper supplies the harness, and its open costs motivate the work. Recomputing modes is expensive for large assemblies, and random collision fixing is crude in dense packing, a difficulty that the flexible-protein constraint work in A Constraint Solver for Flexible Protein Model makes concrete. Attenuating dependence on structural data in computing protein energy landscapes shows that fewer than 10 modes from one H-Ras structure reconstruct an 87-structure ensemble to under 0.6 Å. This result constrains the design: the evolved code should choose among a small mode set, and it should not try to discover collective directions from scratch.

The search method comes from $A_2$DEPT: Large Language Model–Driven Automated Algorithm Design via Evolutionary Program Trees. It evolves whole algorithms as a tree of programs with Boltzmann selection, mutations and self-healing of missing subroutines, and it reports a 9.8% reduction in mean normalized optimality gap over template-bound heuristic design. It works on combinatorial problems that return a scalar score and no physical diagnosis. The feedback method comes from PGS: Effective LLM Code Refinement via Property-Oriented and Structurally Minimal Feedback. PGS shows that LLM repair improves when the model receives the shortest failing counterexample to a stated property, with bug-fix rates up to 67.9%, and degrades when it receives large test dumps. We carry that idea from unit tests into geometry.

Two systems are the closest prior work at the intersection, and both differ in what they modify. AgentFold uses tree search over code to redesign the neural architecture of a small ESMFold trunk. It improves lDDT by 7.5% over independent Codex proposals, at 5,000 GPU-hours and 170M tokens. It does not write search algorithms over energy landscapes. Automating MD simulations for Proteins using Large language Models: NAMD-Agent automates setup of brute-force molecular dynamics from templates and succeeds on 5 of 7 systems. It does not change the search algorithm, and it leaves adaptive steering as future work. Our proposal changes the search algorithm itself and leaves the physics untouched.

Research Program

Harness. We reimplement the planner of Kirillova et al. as a fixed harness. The harness owns the protein model, the elastic network, collision checking, the goal test (RMSD below 2 Å) and the CPU-time accounting. Exactly two functions are exposed to evolution. The first, a steering function, decides at each expansion which modes to follow, how far to step, and whether to recompute modes. It can read the current structure, the goal, the mode set and cheap statistics. The second, a collision handler, decides how to move clashing atoms. The evolved code cannot alter the energy model or the goal test. This rules out the reward-hacking failure in which a planner "succeeds" by loosening its own checks. Before any evolution we will check that the reimplementation approximately reproduces the reported adenylate kinase behavior.

Counterexample extractor. After each run a checker evaluates a few properties: whether the goal was reached, where progress toward the goal stalled, which residues collide at the stall, and how much of the remaining displacement lies in the span of the current modes. This last quantity is the standard overlap measure between a displacement and a mode subspace. The checker returns only the single most informative violation, rendered in a few lines. The rule we will test is to report the earliest stall, its smallest clashing residue set, and the overlap value. The design is the geometric counterpart of PGS's minimal counterexample.

Evolution loop. An A2DEPT-style program tree proposes small diffs to the two functions. Small diffs also ease the credit-assignment problem the research file notes for that method. Selection uses a fitness that combines goal success with CPU time on a training set of transitions. The counterexamples are added to the prompt of the next mutation.

Data split. Evolution uses open/closed pairs drawn from the Database of Macromolecular Movements. Every protein used in testing is excluded from it. The held-out test set is adenylate kinase (4AKE to 1AKE), the four domain-motion proteins of Kirillova et al. (ATP sulfurylase, DAP dehydrogenase, EIAV capsid P26, LAO binding protein), and H-Ras (1QRA to 4Q21). We report three metrics. The first is the success rate at reaching the goal below 2 Å over repeated seeds. The second is median CPU time and the number of mode recomputations. The third is path plausibility, measured as the maximum clash count and the highest energy along the path under one common force field shared by all methods. We do not have reference transition paths, so plausibility is judged by these physical proxies and by inspection, not by distance to a ground-truth path.

Baselines

The naive reference point is the reimplemented hand-written planner with its published settings. For comparison, the file reports goal RMSD below 2 Å on the domain-motion proteins and about 80 CPU-minutes over 10 iterations on adenylate kinase (An NMA‐guided path planning approach for computing large‐amplitude conformational changes in proteins). The file gives no reported success rate over seeds or numerical path energies, so we measure those ourselves for every method on the same hardware.

The strongest competitor is the same planner with its existing knobs tuned by Bayesian optimization on the training set. The knobs are the number of modes, step size, recompute interval and perturbation magnitude for collisions. This baseline is the strongest because it captures any gain that comes simply from better settings and not from new logic. It receives exactly as many planner evaluations as the evolution loop. Beating it means a higher held-out success rate, or equal success at clearly lower CPU time, on a majority of test proteins across seeds.

Three ablations isolate the ingredients. The first is evolution with scalar fitness only, which is A2DEPT as published and with no counterexamples. It isolates the feedback. The second is evolution fed the full run log, which separates the effect of minimality from the effect of having any physical information. The third is zero-shot LLM rewriting of the two functions, keeping the best of the same number of independent samples. This mirrors the independent-proposal baseline in AgentFold and isolates the value of closing the loop. All LLM variants use the same model and token budget.

Why not just…?

Why not just tune the hand-written planner? This is the real threat, and it is a baseline here, not a strawman. If the hand-written structure is already right and only its constants are off, Bayesian optimization will match evolved code at far lower cost, and we will report that result as the answer. The case for code search rests on rules that no fixed parameter can express. Two examples are recomputing modes only when the subspace overlap with the goal falls, and choosing collision moves from the identity of the clashing residues. The matched-budget comparison decides this directly.

Why not just run A2DEPT unchanged? It may work. Its fitness signal, though, says only that a run was slow or failed, not why. The research file notes that refinement gains in LLM loops often plateau after 2–4 iterations. PGS attributes this kind of failure to uninformative or overloaded feedback. The scalar-fitness ablation measures whether physical counterexamples move the plateau. If they do not, the proposal reduces to an application of A2DEPT.

Why not train a reinforcement learning agent on dihedral moves? Conformer-RL is efficient on an 8-monomer lignin, sampling 10x fewer conformers at under 1% of the runtime. Its authors note, however, that the action space grows exponentially with rotatable bonds, that rings are frozen, and that the method has not been shown on protein domain motions. Our search acts on fewer than about ten collective modes, not individual torsions, so we do not expect a learned policy to transfer at this scale. We do not include it as a baseline.

Why not sample paths with a generative flow network that needs no hand-picked coordinates? Collective Variable Free Transition Path Sampling with Generative Flow Network outperforms its baseline on alanine dipeptide, polyproline and chignolin. The file contains no numbers for it and no evidence that it scales to proteins the size of adenylate kinase or H-Ras. It also answers a different question, sampling a distribution of paths under molecular dynamics instead of finding one feasible path cheaply. We treat it as complementary and out of scope. We do not claim the evolved planners beat it.

Decisive Checks

Three outcomes settle the proposal. The first is held-out success and CPU time against the matched-budget tuned planner on adenylate kinase, the four domain-motion proteins and H-Ras. If the tuned planner wins, the code-search premise fails here. The second is the gap between counterexample-guided and scalar-fitness evolution at equal token budget. A gap near zero falsifies the feedback claim. The third is whether the best evolved functions, read as code, contain an identifiable rule that explains their gain, such as an overlap-triggered recompute or a residue-aware collision move. We test each candidate rule by transplanting it alone into the hand-written planner. If transplanting the rule recovers most of the gain, the work yields a reusable planning insight and not an opaque program. If no single rule accounts for the gain, we will report that as well.