arXiv:2610.19550cs.AIOct 2026

Manuscript Offprint

arXiv:2610.19550

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 Zhang

ABSTRACT

Closing the loop of AI-driven science requires reliably translating natural-language protocols into executable laboratory workflows despite protocol defects and heterogeneous hardware. Existing approaches often couple scientific interpretation with device-specific code generation, making errors difficult to localize and limiting reuse across laboratory platforms. We introduce LabCompiler, a robust protocol-to-execution framework that transforms imperfect natural-language protocols into verifiable human-machine workflows. Its protocol firewall diagnoses and repairs defects before compilation while preserving unaffected content, guided by troubleshooting knowledge accumulated through perturbation-guided self-evolution. A two-level, device-agnostic graph representation separates experimental semantics from hardware-specific implementation and supports capability-based device assignment with coordinated human execution. We further introduce a protocol recovery benchmark covering four controlled perturbation types and naturally occurring errors collected from protocols written by iGEM participants. Experiments show that LabCompiler outperforms frontier LLMs in protocol error correction while enabling coordinated human-machine execution across heterogeneous, partially automated laboratory settings.

1 INTRODUCTION

Artificial intelligence for science (AI4S) is moving toward closed-loop experimentation. Recent systems can synthesize literature (Qiu et al., 2025), formulate hypotheses (Baek et al., 2025), and design experimental procedures (Huang et al., 2025), while self-driving laboratories and robotic platforms are beginning to automate experimental execution and iterative optimization (Boiko et al., 2023). Connecting these capabilities requires translating natural-language protocols into actions that can be carried out in a particular laboratory. Researchers usually perform this translation, resolving implicit details and deciding how the available instruments should be used. When this work depends on individual interpretation, the same protocol may be executed differently by different operators. A standardized interface between experimental descriptions and laboratory actions would allow this translation to be reproduced and audited, making laboratory automation easier to scale.

Coding agents provide a natural foundation for such an interface, as they can generate programs, invoke external tools, and iteratively revise code based on execution feedback (Wang et al., 2024; Yang et al., 2024). Recent work has explored the use of coding agents to translate experimental protocols into machine-executable scripts (Inagaki et al., 2023; Gao et al., 2025; Jiang et al., 2026). Nevertheless, they still face three fundamental challenges. First, the protocol itself may be imperfect, containing incorrect parameters, missing steps, or ambiguous instructions. Direct compilation may therefore produce valid code that faithfully implements a scientifically invalid experiment. Second, direct protocol-to-code generation entangles scientific interpretation with device-specific implementation, making failures difficult to localize and limiting reuse across heterogeneous hardware. Third, many protocols are only partially automatable with available devices and require human manipulation or judgment to complete the experiment.

Figure

Figure 1: Overview of LabCompiler. Unlike traditional workflows that rely on manual interpretation and operation, LabCompiler transforms ambiguous natural-language protocols into human-machine workflows through diagnosis and repair, device-agnostic abstraction, and hybrid execution.

We introduce LabCompiler, a robust protocol-to-execution framework that addresses these challenges through a staged “diagnose-represent-execute” architecture, as illustrated in Figure 1. Its protocol firewall diagnoses and repairs defects before compilation while constraining unnecessary changes to valid experimental content. The firewall incorporates perturbations-guided self-evolution, through which diagnosis and repair outcomes on perturbed training protocols are examined against verified references and distilled into reusable troubleshooting knowledge. Accumulated in an external memory, this knowledge guides subsequent screening.

The repaired protocol is compiled into a Semantic Experiment Graph that captures operations and their control and material dependencies, then deterministically normalized into a Canonical Action Graph of standardized actions. This device-agnostic representation decouples experimental semantics from hardware-specific implementation. Related actions are grouped into execution units and assigned to compatible devices when possible, while unsupported operations remain human-execution steps. Automated units are grounded in physical resources, translated into device-specific code, and checked against device and resource constraints, with simulation used when available. The shared representation also allows execution assignments to adapt as laboratory capabilities expand.

We construct a benchmark for protocol recovery, which requires systems to identify and repair defects without predefined corrective options while preserving unaffected experimental information. Unlike LAB-Bench (Laurent et al., 2024), which uses multiple-choice questions for protocol troubleshooting, our benchmark evaluates protocol recovery by requiring systems to directly identify and repair defects in imperfect protocols. It combines structured perturbations of validated public protocols with naturally occurring errors curated from protocols written by iGEM competition teams and annotated by domain experts, enabling us to evaluate specific failure modes and examine whether recovery extends to errors encountered in practice. Our contributions are as following:

• We introduce LabCompiler, a staged protocol-to-execution framework that diagnoses protocol defects before compilation, reducing the propagation of protocol errors into downstream execution.

• We develop a two-level device-agnostic experiment representation and capability-grounded execution mechanism that separates scientific semantics from hardware-specific implementation while supporting coordinated machine-human workflows.

• We introduce a protocol correction benchmark and correction-guided self-evolution mechanism for evaluating and improving protocol diagnosis and repair.

References (73)