LabCompiler: A Framework for Verifiable Human-Machine Laboratory Execution from Imperfect Protocols

Jingyuan Li, Dongzhan Zhou, Minting Pan, Yujie Liu, Yuan Gao, Yankai Jiang, Xinyu Gu, Zhe Liu, Yang Li, Bo Zhang, Lei Bai, Tong Si, Weinan ZhangarXiv 2026

TL;DR

LabCompiler is a robust framework designed to bridge the gap between messy, natural-language scientific protocols and reliable laboratory automation. By implementing a "protocol firewall" to fix errors and a device-agnostic intermediate representation, it enables verifiable, hybrid workflows where robots and humans work in tandem across diverse hardware environments.

What Problem Does This Paper Address?

The dream of "self-driving laboratories" often hits a wall when faced with the reality of human-written protocols. Scientific instructions are frequently ambiguous, contain missing steps, or specify incorrect parameters. Current AI agents often try to generate device-specific code directly from these imperfect descriptions. This leads to two major issues:

  1. Brittle Execution: Errors in the protocol are baked into the code, making them hard to debug.
  2. Lack of Portability: The scientific intent is entangled with specific hardware (e.g., a specific Opentrons robot), making it nearly impossible to run the same experiment in a different lab without starting over.

Furthermore, most labs are only partially automated. A truly useful system must coordinate tasks between sophisticated robots and human operators who handle the "last mile" of manual manipulation.

Methods

LabCompiler tackles these challenges through a staged "diagnose-represent-execute" architecture:

  1. Protocol Firewall: Before any code is written, a screening agent runs an iterative diagnose-repair-verify loop. It identifies defects like missing quenching steps or inconsistent volumes. Crucially, it uses perturbation-guided self-evolution: it learns from a memory of past troubleshooting cases to improve its diagnostic accuracy over time.
  2. Device-Agnostic Abstraction: The framework translates the repaired protocol into a two-level graph:
  3. Semantic Experiment Graph ($G_{sem}$): Captures the "science"—materials, operations, and dependencies—without worrying about hardware.
  4. Canonical Action Graph ($G_{can}$): Normalizes these operations into a standardized vocabulary of 26 actions (e.g., liquid_transfer, plate_reading).
  5. Capability-Grounded Hybrid Execution: The system groups actions into "execution units" and matches them against a library of 45 integrated devices. If a unit can be automated, it generates device-specific code; if not, it generates clear instructions for a human operator.
Figure 2: Overview of LabCompiler. It first screens and repairs ambiguous natural-language proto- cols, then converts them into device-agnostic semantic and canonical representations. The resulting actions are grouped into execution units and capability-matched to human or automated execution.

Datasets

The authors introduced a new, rigorous benchmark for protocol recovery:

  • Controlled Perturbation Subset: 2,400 instances derived from validated public protocols (SciRecipe), where specific errors (like step deletions or parameter swaps) were systematically introduced.
  • Real-World iGEM Subset: 259 instances of naturally occurring errors found in protocols written by iGEM competition teams, curated and corrected by domain experts.
  • LAB-Bench: The system was also validated against existing benchmarks to ensure broad applicability.

Key Insights and Ideas

  • "Fix it First" Philosophy: By treating protocol repair as a prerequisite for compilation, LabCompiler prevents the propagation of scientific errors into physical actions.
  • Decoupling Science from Hardware: The two-level graph representation allows a protocol to be "compiled" once and then "linked" to whatever hardware is available in a specific lab, much like how software compilers work.
  • Humans as First-Class Citizens: Instead of viewing manual steps as a failure of automation, LabCompiler treats human intervention as a valid execution route, ensuring the entire workflow remains coordinated and auditable.
  • Troubleshooting Memory: The self-evolution mechanism allows the model to distill "experience" into an external memory, significantly boosting performance on complex, cross-step inconsistencies that stump standard LLMs.

Key Results

LabCompiler significantly outperformed frontier models like GPT-5.6 Sol and Claude Opus 5 across all metrics:

  • Error Correction: On the controlled benchmark, the self-evolved LabCompiler achieved 77.6% classification accuracy*, compared to 62.2% for GPT-5.6 Sol.
  • Real-World Robustness: It showed an even larger advantage on naturally occurring iGEM errors, reaching a 76.8% accuracy score, indicating strong robustness to the messy reality of lab practice.
  • Execution Accuracy: It achieved 74.7% route accuracy (assigning tasks to the right executor) and 63.3% device executability, outperforming the strongest direct LLM baseline by over 10 percentage points.
Comparison of LabCompiler against various LLM baselines in classification accuracy and correction scores.

Limitations and Future Work

While powerful, LabCompiler currently operates within a finite action space of 26 canonical actions and a specific set of device backends. The authors acknowledge that expanding this vocabulary is necessary for more complex experimental domains.

The current validation relies heavily on expert review and simulators; the next critical step is validating the framework through extensive real-world wet-lab experiments to see how it handles the physical variability of biological and chemical systems. Future work will also focus on expanding the device library to include more specialized analytical instruments.

Summary updated

BibTeX
@misc{li2026labcompiler,
  author = {Jingyuan Li and Dongzhan Zhou and Minting Pan and Yujie Liu and Yuan Gao and Yankai Jiang and Xinyu Gu and Zhe Liu and Yang Li and Bo Zhang and Lei Bai and Tong Si and Weinan Zhang},
  title = {{LabCompiler: A Framework for Verifiable Human-Machine Laboratory Execution from Imperfect Protocols}},
  year = {2026},
  eprint = {2610.19550},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.19550},
}
Figure