Abstract
The ability to automatically generate accurate protocols for scientific experiments would represent a major step towards the automation of science. Large Language Models (LLMs) have impressive capabilities on a wide range of tasks, such as question answering and the generation of coherent text and code. However, LLMs can struggle with multi-step problems and long-term planning, which are crucial for designing scientific experiments. Moreover, evaluation of the accuracy of scientific protocols is challenging, because experiments can be described correctly in many different ways, require expert knowledge to evaluate, and cannot usually be executed automatically. Here we present an automatic evaluation framework for the task of planning experimental protocols, and we introduce BioProt: a dataset of biology protocols with corresponding pseudocode representations. To measure performance on generating scientific protocols, we use an LLM to convert a natural language protocol into pseudocode, and then evaluate an LLM's ability to reconstruct the pseudocode from a high-level description and a list of admissible pseudocode functions. We evaluate GPT-3 and GPT-4 on this task and explore their robustness. We externally validate the utility of pseudocode representations of text by generating accurate novel protocols using retrieved pseudocode, and we run a generated protocol successfully in our biological laboratory.
Introduction
Automating scientific discovery requires models capable of planning intricate, multi-step procedures. While Large Language Models (LLMs) excel at generating coherent text, they often falter when faced with long-term planning and the "brittle" nature of scientific protocols. In a laboratory setting, a single misplaced step or an omitted unit can invalidate weeks of work. BioPlanner introduces a novel framework and the BIOPROT dataset to programmatically evaluate and improve the planning logic of LLMs in the biological domain.
The Bottleneck of Protocol Evaluation
A primary challenge in scientific automation is evaluation. Standard NLP metrics like BLEU or BERTScore measure textual similarity rather than functional correctness. A protocol might "look" correct to a general-purpose metric while being biologically impossible. Conversely, manual evaluation by PhD-level experts is accurate but lacks the scalability needed for rapid model development. BioPlanner addresses this by translating fuzzy natural language instructions into structured Python-style pseudocode, enabling objective, automated grading.
Methodology: The Teacher-Student Framework
The core of BioPlanner is a "Teacher-Student" evaluation pipeline designed to distill complex instructions into measurable units.
- The Teacher Phase: A high-performing model (GPT-4) acts as the "Teacher," taking a natural language protocol and converting it into a set of pseudofunctions (e.g.,
spin_sample,add_buffer) and a ground-truth pseudocode sequence. - The Student Phase: The "Student" model under evaluation receives only the protocol’s title, a brief description, and the admissible pseudofunctions. Its task is to reconstruct the step-by-step pseudocode.
- Automated Grading: The output is evaluated using programmatic metrics, including Function Accuracy (correct calls), Levenshtein Distance (correct ordering), and SciBERTScore (accuracy of arguments like volumes and temperatures).
- Feedback Loops: The framework incorporates an automated debugger that provides the LLM with syntax errors or "undefined function" warnings, allowing for iterative self-correction.
The BIOPROT Dataset
To support this framework, the authors developed BIOPROT, a curated dataset of 100 biological protocols sourced from Protocols.io. Unlike general coding benchmarks, BIOPROT is domain-specific. The authors filtered over 9,000 protocols to select those with sufficient complexity and relevance. Every entry was manually audited by laboratory scientists to ensure the resulting pseudocode was biologically sensible and executable. This ensures that the model is tested on its understanding of biological context—such as knowing that a centrifugation step typically follows a mixing step.
Results and Real-World Validation
The evaluation of various models revealed significant performance gaps. GPT-4 emerged as the leader, achieving 70.6% accuracy in predicting the next step of a protocol, compared to 65% for GPT-3.5. Notably, GPT-4 demonstrated superior "sequence integrity," maintaining logical flow over long-term dependencies much more effectively than its predecessors. Open-source models like Llama-2-7B struggled, often failing to adhere to the required pseudocode format.
To validate the practical utility of the framework, the team used GPT-4 to generate a protocol for culturing E. coli and creating a glycerol stock. A scientist executed the generated instructions in a physical lab. The experiment was a success: the bacteria remained viable after storage at -80°C, proving that LLM-generated plans can be robust enough for real-world application.
Discussion and Future Directions
While BioPlanner marks a significant step toward automated science, limitations remain. The reliance on high-cost, closed-source APIs like GPT-4 presents a barrier to accessibility. Furthermore, while BIOPROT is a landmark for biology, the framework must be expanded to other disciplines like chemistry and material science.
The authors also highlight the "dual-use" risk: a system capable of planning complex biological experiments could potentially be misused. Robust safety guardrails are essential as these models become more capable. Future research will focus on fine-tuning smaller, open-source models to reach the performance levels of GPT-4, democratizing access to automated scientific planning.
Summary updated