Structure-Anchored Programmatic Skills for Long-Horizon Protein Editing

When an AI system tries to improve a protein by editing its amino-acid sequence one step at a time, it hits the same wall that trips up robots and web agents: performance falls off a cliff as the plan gets longer. The clearest evidence comes from STRIDE, a system that trains a large language model to output an explicit list of discrete edits — insert, delete, replace a residue at a position — rather than regurgitating a finished sequence in one shot STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories. Framing protein optimization as a trajectory of edits raises success from 42% to 89% on short jobs, but success collapses to 26% once a plan needs three to ten edits. The failure is not biological but bookkeeping: each insert or delete shifts every downstream position number, and the model loses track of which residue it is touching.

This proposal argues that the fix is representational, not a matter of more parameters or longer thinking chains. Instead of identifying a residue by its integer position in a 1D string — a label that becomes stale the moment the string changes — we anchor every edit to the residue's identity in the protein's 3D contact graph, and we fold long edit lists into a small number of reusable, parameterized "skills," the same trick that lets symbolic-program agents survive fifty-step horizons in text games Lifting Traces to Logic: Programmatic Skill Induction with Neuro-Symbolic Learning for Long-Horizon Agentic Tasks. The planner's internal state is a multimodal protein representation — frozen protein language model embeddings refined by a small geometry-respecting graph network, in the style of ProtEGNN Just Add Structure: Protein Language Models Combined with Structural Equivariance Excel at Protein Tasks — so the agent always knows what it has done in terms of physical contacts, not stale indices.

Core Claim

The claim has two parts. First, the horizon collapse in protein edit planners is caused largely by an ungrounded action representation: integer indices that drift and a 1D token state that diverges from the molecule. Replacing indices with structural anchors and bundling edits into jointly-applied macros should flatten the horizon curve — the success rate at three-to-ten edits should rise from STRIDE's 26% toward its short-horizon ceiling, without increasing model scale. Second, macro-level actions are not just a compression device; they are the right granularity for crossing epistatic fitness valleys. Roh et al. show that zero-shot protein language models are essentially blind to specific non-additive interactions between mutation pairs (median held-out Spearman correlation 0.008), while a lightweight supervised head over the same frozen embeddings recovers them (0.292), and that the top epistatic pair recovered in the GB1 binding assay, residues G41 and V54, sits about 5.5 Å apart in 3D — a physical contact Latent Encoding of Epistasis in Protein Language Models. A planner whose primitive action is "jointly mutate this contacting pair" can look ahead through valleys where a greedy single-point policy sees only a neutral or damaging first step.

The contrast with the closest existing work is sharp. STRIDE supplies the trajectory-planning formulation and the training recipe, but plans purely in 1D token space with raw positional indices, needs a 14B model for even partial bookkeeping, and has no notion of steric packing or contact geometry STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories. EvoAb brings structure into the loop through a fast thermodynamic reward and structure-aware diffusion, but it refines short antibody loops round by round, with no explicit multi-step plan, no backtracking out of dead ends, and a rigid antigen backbone Structure-Guided Reinforcement Learning for High-Affinity Antibody Design. We keep STRIDE's task and benchmarks, change the action space and state representation, and borrow one training idea from elsewhere: STAR-MD stops error snowballing in long physical rollouts by perturbing historical context frames during training so the model learns to self-correct Scalable Spatio-Temporal SE(3) Diffusion for Long-Horizon Protein Dynamics; we apply the same noise-perturbation to the planner's accumulated edit-state history so it recovers from earlier mistakes instead of compounding them.

Research Program

The system, which we call anchored-skill editing, has three components. The first is the anchored action space. Where STRIDE writes an edit as REPLACE(idx, aa), we write it against the current structural state:

$$a = \big(\mathrm{op},\; s,\; x\big), \qquad s = (\text{residue id in contact graph},\; \text{local motif context})$$

Here $s$ names a residue by its node in the 3D contact graph (built from predicted or experimental coordinates) together with a short structural context, and $x$ is the replacement amino acid or edit payload. Because $s$ refers to the molecule rather than to a string offset, it never goes stale: after an insertion, every residue keeps its anchor. The contact graph and per-residue embeddings come from a frozen protein language model feeding an E(3)-equivariant graph network — the ProtEGNN recipe, which reached a Spearman correlation of 0.90 on GB1 mutational effects with only 400K trainable parameters, matching a 5.7B-parameter fine-tuned model Just Add Structure: Protein Language Models Combined with Structural Equivariance Excel at Protein Tasks. This choice is deliberate: it tests whether geometric inductive bias substitutes for the raw scale STRIDE found necessary.

The second component is skill induction. NSI lifts successful action traces into parameterized programs using four operators — branching, variable lifting, loop folding, and modular crossover — and thereby compresses 7.4 atomic actions into each programmatic invocation, keeping success high past fifty steps where ReAct-style baselines hit 0% after roughly 22 Lifting Traces to Logic: Programmatic Skill Induction with Neuro-Symbolic Learning for Long-Horizon Agentic Tasks. NSI's acknowledged weakness is that its symbolic predicates are hand-crafted per domain. We avoid that bottleneck by deriving predicates from structure itself: contact-pair mutation, secondary-structure-element substitution, interface-neighborhood remodeling, and loop folding over tandem repeats. Concretely, we run STRIDE-style supervised fine-tuning on macro trajectories constructed from multi-mutant data — mutations grouped by contact proximity rather than listed positionally — and then the same group-relative policy optimization with rewards from two cheap oracles: a supervised pairwise epistatic head in the style of Roh et al., and a fast thermodynamic scorer of the kind EvoAb built precisely because FoldX is too slow for inner-loop evaluation Structure-Guided Reinforcement Learning for High-Affinity Antibody Design.

The third component is self-correcting rollout training. During policy optimization, we perturb the planner's state history (past edits and their observed effects on the multimodal state) with small corruptions, and reward trajectories that detect and repair the corruption. This is the direct transplant of STAR-MD's contextual noise perturbation, which lifted structural validity on the ATLAS 100ns molecular-dynamics benchmark from the next best 68.3% to 85.3% by teaching the model to self-correct instead of snowballing errors Scalable Spatio-Temporal SE(3) Diffusion for Long-Horizon Protein Dynamics. We also want the planner to know when to stop: on unsolvable or unreachable objectives, large reasoning models fabricate execution justifications rather than detecting infeasibility (o1-preview detects unsolvability only 27% of the time on PlanBench) LLMs Still Can't Plan; Can LRMs? A Preliminary Evaluation of OpenAI's o1 on PlanBench, and a protein planner that hallucinates success is worse than one that declares a valley uncrossable.

Proposed Experiments

The first study measures the horizon curve. On STRIDE's own suite — TAPE GFP fluorescence, AAV capsids, and the longer-horizon settings of MEGA-MolEdit STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories — we stratify results by required edit count and plot success rate against horizon. The decisive quantity is the gap between short and long horizons. STRIDE reports 89% overall success with 97% novel variants but 26% at three-to-ten edits; we want the long-horizon band above roughly 60% while holding overall success and novelty at or above STRIDE's numbers under the same oracle budget and wall clock.

The second study tests epistatic traversal. Using the ProteinGym multi-mutant subset (85,135 multi-mutants across eleven functional assays) and the Megascale set of 89,706 measured stability double mutants across 149 domains ProteinGym: Large-Scale Benchmarks for Protein Design and Fitness Prediction, we construct tasks whose optimum requires a coordinated pair of substitutions whose intermediate is neutral or deleterious, and compare how often anchored-pair macros reach the joint optimum versus greedy single-point policies. Prediction quality is scored by Spearman correlation against measured fitness; for reference, the supervised setting on ProteinGym substitution assays reaches 0.613 with ProteinNPT ProteinGym: Large-Scale Benchmarks for Protein Fitness Prediction and Design, and the supervised pairwise epistasis head moves specific-epistasis Spearman from 0.02 to 0.37 on GB1 Latent Encoding of Epistasis in Protein Language Models.

The third study resolves the scale-versus-bias tension the literature leaves open. STRIDE reports that a 4B model fails completely at edit bookkeeping while 14B partially succeeds; ProtEGNN shows geometric structure substitutes for parameters in mutational prediction Just Add Structure: Protein Language Models Combined with Structural Equivariance Excel at Protein Tasks. If anchoring really removes the bookkeeping burden, a 4B anchored planner should approach the 14B index-based one. If it does not, the failure is in the planning itself, not the representation — an informative negative either way. A fourth, smaller evaluation on the SAbDab pre-2023 train / SAb23H2-Ab 2023-test antibody split checks transfer beyond generic proteins, where EvoAb's structure-guided reinforcement learning lowered mean predicted binding ΔΔG from 2.89 to 2.45 kcal/mol and improved DockQ from 0.18 to 0.25 Structure-Guided Reinforcement Learning for High-Affinity Antibody Design; no reported result found on Lacuna for anchored planners on this split, so we establish the first numbers.

Baselines

The naive reference point is one-shot generation with post-hoc ranking: produce a candidate sequence in a single pass and score it with a protein language model, exactly the standard supervised fine-tuning configuration STRIDE evaluated, which reached a 42% optimization success rate on the full-action protein tasks STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories. It is the right floor because it isolates what explicit planning buys at all; anything we build that cannot beat 42% has no reason to exist. The strongest competitor is STRIDE-GRPO itself: a 14B Qwen3 model post-trained with supervised fine-tuning on Levenshtein-aligned edit trajectories followed by group-relative policy optimization, reporting 89% success and 97% novelty overall but 26% at three-to-ten edits STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories. We run it on the identical datasets, oracle queries, and tuning budget, and give our model the same or smaller parameter count. Beating it means matching or exceeding 89% overall success and 97% novelty while clearly raising the three-to-ten-edit band above its 26%; matching 89% with an unchanged 26% at long horizons would falsify our claim. A third baseline is greedy single-point search with a fast thermodynamic scorer, which represents how a practitioner would actually iterate today; it is cheap and strong on smooth objectives but cannot cross epistatic valleys, and the physics-based variants are too slow for many rounds, as the EvoAb authors note when motivating their fast reward model Structure-Guided Reinforcement Learning for High-Affinity Antibody Design. Finally, the key ablation is our own planner with the anchored action space replaced by STRIDE-style integer indices while keeping the macros, the multimodal state, and the training recipe identical. This isolates the structural anchoring as the ingredient responsible for any horizon gain; if the index-based ablation performs equally well, the anchoring story is wrong and the win came from macro compression or rollout training instead.

Why not just…?

Why not just use a bigger model with more thinking tokens? This is the scale answer, and the evidence against it is consistent: even OpenAI's o1-preview, trained specifically for extended reasoning, drops from 97.8% on standard Blocksworld to 23.6% when plans require twenty to forty steps, detects unsolvability only 27% of the time, and costs $42.12 per hundred instances where a classical symbolic planner solves them perfectly in milliseconds LLMs Still Can't Plan; Can LRMs? A Preliminary Evaluation of OpenAI's o1 on PlanBench. STRIDE's own data complicates the pure pessimism — going from 4B to 14B did restore partial bookkeeping — so scale genuinely helps at the margins. Our third experiment settles this head-on: if a 4B anchored planner matches the 14B index-based one, representation beats scale; if not, we report that the bookkeeping failure is deeper than indexing and scale remains necessary. We do not assume the answer.

Why not just do one-shot inverse folding and rank the candidates? Pure structural inverse-folding models collapse their vocabulary toward a few residues like tyrosine and glycine, which is why EvoStruct has to adapt protein language model priors back into them EvoStruct: Bridging Evolutionary and Structural Priors for Antibody CDR Design via Protein Language Model Adaptation], and zero-shot scoring is blind to the specific epistasis that dominates multi-mutant landscapes (Spearman 0.008) Latent Encoding of Epistasis in Protein Language Models]. More directly, STRIDE already ran this comparison on the same benchmarks: direct sequence-to-sequence optimization achieves 42% success versus 89% for explicit edit trajectories STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories. One-shot generation is our floor baseline for exactly this reason.

Why not just run greedy or MCMC search with FoldX scoring? Two cited problems: physics-based scorers are too slow to sit inside an iterative loop, which is why EvoAb built a fast learned replacement Structure-Guided Reinforcement Learning for High-Affinity Antibody Design], and greedy search cannot take the first step into a valley where a single substitution is neutral or destabilizing before its partner rescues it — precisely the specific epistasis that supervised pairwise heads recover (0.02 to 0.37 Spearman on GB1) but step-wise policies cannot see Latent Encoding of Epistasis in Protein Language Models]. Our second experiment is designed so that this alternative fails visibly: the optima sit behind coordinated pairs, and the greedy baseline is included to show it does.

Why not just apply NSI to proteins directly? NSI's machinery — trace lifting, loop folding, variable lifting — is exactly what we import, but its symbolic predicates are hand-crafted per domain, which its own presentation flags as the transfer bottleneck Lifting Traces to Logic: Programmatic Skill Induction with Neuro-Symbolic Learning for Long-Horizon Agentic Tasks]. Text-game predicates like "is-heated" have no protein analogue; deriving predicates from the contact graph (pairs, motifs, interfaces) is our concrete answer, and the ablation that strips anchoring while keeping macros tests whether that derivation is doing real work or whether generic skill compression alone suffices. This is a real threat: if macro compression alone fixes the horizon curve, the multimodal component is decorative, and we would report that honestly.

Decisive Checks

The proposal stands or falls on three numbers. The horizon curve on the STRIDE suite must show the three-to-ten-edit band well above the reported 26% while overall success stays at or above 89% with comparable novelty, under matched oracle budgets STRIDE: Post-Training LLMs to Reason and Refine Bio-Sequences via Edit Trajectories. The epistatic-traversal tasks must show anchored pair macros reaching coordinated optima that the greedy and one-shot baselines miss on ProteinGym multi-mutants and Megascale. And the scale study must show a small anchored planner competing with a much larger index-based one, converting the literature's open tension between model scale and geometric inductive bias into a measured trade-off. If the horizon curve flattens but the ablation shows macro compression, not anchoring, is responsible, the proposal's central claim is wrong — and the fallback finding, that programmatic skill induction alone repairs long-horizon protein editing, would still be worth reporting.