KnowEvo: Knowledge Evolution for Protein Optimization

Zijie Xing, Xingyue Liu, Runze Wang, Luoming Hu, Yanming Shen

TL;DR

KnowEvo is a framework that treats scientific knowledge as a collection of modular, executable code blocks that evolve through iterative experimentation. By organizing these blocks into mutation trees and using an agentic sandbox for evidence-driven refinement, it allows Large Language Models (LLMs) to systematically accumulate and improve domain expertise for complex tasks like protein optimization.

What Problem Does This Paper Address?

While LLMs have shown a knack for generating scientific hypotheses, they struggle with the "persistence" of knowledge. In human scientific discovery, progress is iterative: experts develop heuristics, test them, and refine them based on feedback. Current LLM systems, however, usually keep their "expertise" buried in opaque model weights or scattered across transient prompts.

This creates three major hurdles:

  1. Lack of Structure: Knowledge isn't naturally continuous; it's discrete and compositional, making it hard to optimize like a neural network.
  2. Entangled Credit Assignment: When a complex design succeeds or fails, it’s difficult to know which specific part of the strategy was responsible.
  3. Sparse Feedback: Scientific signals (like a single energy score) are often too thin to guide a model toward a structured update of its internal logic.

Methods

The authors propose KnowEvo, which shifts the optimization target from model parameters to externalized knowledge.

  • Executable Expertise Blocks: Instead of using natural language prompts, KnowEvo represents knowledge as Python code blocks. Each block encodes a specific design mechanism (e.g., "replace surface glycines to reduce flexibility"). This makes the strategy deterministic, inspectable, and modular.
  • Strategy Mutation Trees: These blocks are organized into trees that track the lineage of revisions. As a strategy is refined, new versions are added as child nodes.
  • Forward Phase (Budget Allocation): The framework uses a Thompson-sampling-style approach to decide which strategy to test. It balances "exploitation" (using strategies that have worked well) with "exploration" (testing new or uncertain revisions).
  • Backward Phase (Agentic Revision): When a strategy accumulates enough data, a "code agent" steps in. Unlike simple prompt-based refinement, this agent operates in a revision sandbox. It can inspect execution traces, run diagnostic scripts, and validate new code before committing it to the mutation tree.
Figure 1: Overall framework of KnowEvo. KnowEvo evolves executable strategy mutation trees by alternating forward node evaluation with backward sandbox-based program revision.

Datasets

The framework was evaluated on protein optimization tasks using enzyme sequences from the BRENDA dataset.

  • Stability Task: Evaluated using the Rosetta REF2015 energy function.
  • Solubility Task: Evaluated using a SaProt-based solubility predictor.
  • Cross-Predictor Evaluation: To ensure the gains weren't just "overfitting" to one simulator, the authors also tested Rosetta-evolved strategies against ThermoMPNN.

Key Insights and Ideas

  • Knowledge as Code: By turning heuristics into code, the authors provide the LLM with a "memory" that is structured and executable. This allows for fine-grained updates—changing a specific threshold or adding a conditional check—without rewriting the entire strategy.
  • The Power of the Sandbox: The agentic sandbox is a game-changer. It allows the LLM to act more like a human researcher—diagnosing failures by looking at specific cases rather than just guessing based on a summary prompt.
  • Learning "Negative" Rules: One of the most interesting findings was the evolution of "veto" rules. In one case study, the system learned not to perform certain mutations in flexible loops because they frequently led to backbone strain, demonstrating that knowing what not to do is as vital as knowing what to do.
An example of a strategy lineage showing how simple initial rules evolve into complex, conditional logic.

Key Results

KnowEvo consistently outperformed monolithic program evolution and prior LLM-guided baselines (like GEPA and AdaEvolve) across all metrics.

  • Protein Stability: The framework improved the pass@1 rate (the probability that the top-ranked suggestion is successful) from 42.4% (root blocks) to 50.5%.
  • Protein Solubility: The gains were even more dramatic, with pass@1 jumping from 31.6% to 51.5%.
  • Ranking Quality: Metrics like MRR (Mean Reciprocal Rank) and NDCG@5 also saw significant boosts, meaning the system didn't just find more successful mutations—it got much better at putting the best ones at the top of the list.
Table 1: Comparisons across stability and solubility tasks. Bold indicates the best result for each task.

Limitations and Future Work

  • Proxy Rewards: The study relies on computational simulators (Rosetta, SaProt). While these are standard in the field, the ultimate test would be wet-lab validation to see if these evolved strategies hold up in real biological systems.
  • Computational Cost: The agentic revision process involves significant LLM token usage, which is more expensive than simple prompting.
  • Node Interactions: Currently, the framework treats strategy blocks as somewhat independent. The authors suggest that future work could model these as a compositional graph, allowing the system to learn how different expertise blocks interact or should be sequenced.

Summary updated

Abstract

Large language models (LLMs) have shown promise in scientific discovery, yet systematically accumulating and refining reusable scientific knowledge remains challenging. Existing approaches primarily improve LLM-based problem solving through parameter optimization or feedback-driven refinement of prompts, programs, and solution trajectories, leaving acquired expertise either embedded in model weights or scattered across iterative problem-solving processes. As a result,knowledge is difficult to systematically inspect, evaluate, and refine. We propose KnowEvo, a framework that treats externalized knowledge itself as the optimization target. Our key insight is that scientific knowledge is inherently modular: multiple interacting mechanisms jointly determine the design outcomes. This makes knowledge evolution fundamentally challenging, as improvements cannot be attributed to individual components in isolation. To address this, KnowEvo represents knowledge as executable expertise blocks and organizes their refinements into strategy mutation trees, enabling structured exploration over a combinatorial knowledge space. The framework combines a Thompson-style forward allocation strategy that adaptively distributes evaluation budgets across strategy variants with a backward revision process, in which a code agent operates in an isolated sandbox to translate rollout evidence into localized program updates. This design enables persistent accumulation, evaluation, and refinement of mechanistic expertise across iterative experimentation. We evaluate KnowEvo on protein optimization tasks including stability and solubility. Results show that knowledge evolution consistently improves over initial strategy blocks and outperforms monolithic program evolution and prior LLM-guided evolution baselines across metrics such as pass@k, MRR, MAP,and NDCG@5. Code is available at https://github.com/recynie/KnowEvo.
BibTeX
@inproceedings{xing2026knowevo,
  author = {Zijie Xing and Xingyue Liu and Runze Wang and Luoming Hu and Yanming Shen},
  title = {{KnowEvo: Knowledge Evolution for Protein Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=EhDIRuO3zy},
}
Figure