Two lessons from using LLM agents to automate computational reproducibility pipelines
This is the first in a series of posts I’m writing to describe workflows I’ve developed and interaction patterns I’ve learnt for working with LLMs. This post highlights two lessons I learnt from a reproducibility experiment1 on a corpus of papers for my dissertation which is still in progress, so I have left out paper details and results. I also want these posts to be applicable to activities or things you might do daily and outside an academic context.
Background
What’s a reproducibility pipeline? in this context
The process of understanding, setting up, running, and verifying code for scientific experiments. I ran it on papers that contain computational experiments and results, and share code for those experiments either in the supplementary material submitted with the paper or as a link to the GitHub repository in the paper.
Goal of the experiment
I want to know how much of a computational reproducibility pipeline an LLM agent can automate so that a reviewer (artifact evaluator) who runs the code has less work to do and can still trust the results.
The pipeline
Current work highlights two problems with using agents to automate reproducibility pipelines:
- Agents are much better at solving a single step that is precisely specified than at solving the whole task from end to end.2
- Agents struggle with correctly assessing stopping points and validating their progress towards results that papers report.3
I split the reproducibility pipeline into four stages that run in this order: Survey, Environment, Inputs, Execution. The split was based on metrics and steps that I thought would make each stage a relatively independent sub-problem that could be automated without much context about other stages. It also draws on my earlier work, ReproScore4 and ReproReady.5
Each stage is a fresh agent session that sees the paper’s code and files that the previous agent wrote and nothing else. The agent can only write scripts and files and does not have permission to run anything. I ran the scripts, assessed what it produced for each stage and decided whether to move to the next stage6. This split makes files the main way for an agent to communicate and give me instructions.
This divides work into the following roles:
Human
- Taking actions to transition between various stages of reproducing code (setting up, installing, running, etc.)
- Assessing how well each stage was completed
Agent
- Automating steps within a stage — a single sub-problem
- Writing files and instructions for the human
- Writing logs and structured data for future agents
The lessons in this post are about the Environment stage that sets up the software environment and includes:
- Setting up a virtual environment
- Resolving and installing dependencies
- Checking for imports without package declarations
I created the prompt 10-environment.md for this stage by combining:
- A
_preamble.mdfile containing information shared across stages - Stage-specific instructions for the Environment stage
Figure 1 shows one paper’s folder structure after the Environment stage. I will be focusing on MANUAL_STEPS.md and stage-E.json in this post.
attempt-1/the root from which commands are runrepo/the paper's coderepro/everything added by the agent and meprompts/10-environment.mdshared_preamble.md+ Environment task
scripts/10_env/10_venv.sh11_install.sh12_import_smoke.shreports/stage-E.jsonagent's structured summaryMANUAL_STEPS.mdwhat I need to doREPRODUCIBILITY.mdagent's summary of findings and resultsSURVEY.mdfindings from an initial survey of the repository
logs/env/
Figure 1: The folder structure for a reproducibility attempt for one paper, grouped by who creates each file.
Lesson 1: Say what you want and what you don’t
After the Environment stage, the MANUAL_STEPS.md file told me to install uv and “Nothing else”:
## Environment
1. **Install `uv` (prerequisite for all `10_env/*` scripts).** […]
2. **Nothing else for E.** No credentials, API keys, or dataset/model downloads happen in the Environment stage […]But I still had to run these three scripts after installing uv:
bash repro/scripts/10_env/10_venv.sh
bash repro/scripts/10_env/11_install.sh
bash repro/scripts/10_env/12_import_smoke.shThis information was instead present in the terminal output and the stage-E.json report but not in MANUAL_STEPS.md, which is where I want all the instructions for me to be. I shouldn’t have to piece together an ordered set of instructions from logs and reports in inconsistent locations.
This was because my initial instructions when creating 10-environment.md were unclear and defined manual steps as the things a script cannot do instead of everything the human needs to do:
## Manual steps
Anything the human must do by hand that a script cannot (a login-walled package index, a conda-only dependency, a system library) goes in `repro/MANUAL_STEPS.md` under an `## Environment` heading, and in the report's `manual_steps[]`.I instructed my coding agent to revise _preamble.md (chunk that’s common to prompts for all stages):
Me
Write all the steps needed to be taken by the human in repro/MANUAL_STEPS.md […]
Coding agent
[…] append one `## <Stage>` section containing exactly three parts:
1. **Prerequisites** — installs, credentials, licenses, or a redirect clone the human must arrange first (only if any).
2. **Commands** — the exact, copy-pasteable command sequence, in order — including the scripts you wrote (not only the steps a script cannot do). […]
3. **Expected evidence** — one to three lines on what the log or output must show for the stage to have cleared […]I ran the Environment stage again for the same paper with the revised prompt. Figure 2 shows the Environment section of MANUAL_STEPS.md for both runs.
Before
## Environment
1. **Install `uv` (prerequisite for all `10_env/*` scripts).** […]
2. **Nothing else for E.** No credentials, API keys, or dataset/model downloads happen in the Environment stage (the import smoke runs with `HF_HUB_OFFLINE=1`). […][… 10 lines …]
"human_check": "bash repro/scripts/10_env/10_venv.sh && bash repro/scripts/10_env/11_install.sh && bash repro/scripts/10_env/12_import_smoke.sh […]
[… 29 lines …]After
## Environment
### Prerequisites
- `uv` must be on `PATH` (`curl -LsSf https://astral.sh/uv/install.sh | sh`). […]
### Commands
Run from the copy root, in order:
```bash
bash repro/scripts/10_env/10_venv.sh
bash repro/scripts/10_env/11_install.sh
bash repro/scripts/10_env/12_import_smoke.sh
```
[… 9 lines …]Figure 2: The instructions in MANUAL_STEPS.md before and after revising the prompt. Before, the commands were only in stage-E.json.
Lesson 2: Provide explicit structure and templates if you plan to use an agent’s output in a pipeline
The agent’s final message in the terminal after completing the Environment stage was really long and difficult to read. For certain papers, I had to scroll up multiple pages of the terminal window, find the commands, copy, scroll down, paste, scroll back, copy the next one, etc. From the output, I couldn’t tell whether and where the agent had saved this information. Lesson 1 showed that the commands weren’t in MANUAL_STEPS.md, where I expected them.
The “Notes for the next stages” were time-consuming to parse and figure out what commands I needed to run for the next stage — a lot of the information here belongs in a log/file, not just the terminal output. I want the agent to follow a fixed template for the last message at the end of a stage and not include notes.
Me
[…] I want to keep a running list of instructions for the reproducer and not have to rely on terminal history for the instructions.
Coding agent
[…] your session's **last message is exactly** the block below, with the placeholders filled and nothing added:
```
Stage <id> finalized — proposed outcome: <outcome>.
Run (from the copy root):
<the command sequence>
Expect: <one or two lines of evidence>
Runbook: repro/MANUAL_STEPS.md ## <Stage> · findings: repro/REPRODUCIBILITY.md
```
No notes for the next stage (they live in the report and `REPRODUCIBILITY.md`, which the next session reads), no apparatus vocabulary, and do not repeat the command block anywhere else in the message.After re-running the stage with the revision to the prompt, the final message in the terminal was only 7 lines instead of 35, as Figure 3 shows.
Before (35 lines, 3,088 characters)
All Environment-stage deliverables are in place. Here's the summary.
Stage E (Environment) — complete
[… 18 lines …]
Human verification (the anti-drift target)
bash repro/scripts/10_env/10_venv.sh && \
bash repro/scripts/10_env/11_install.sh && \
bash repro/scripts/10_env/12_import_smoke.sh
Expected: the smoke log ends with all PASS lines, summary: N/N import checks OK, 0 failed, and prints mps_available=True / cuda_available=False, exit_code=0.
Notes for the next stages
- Manual prerequisite: uv must be installed (auto-fetches CPython 3.11). No login-walled index or system library needed.
[… 4 lines …]After (7 lines, 553 characters)
Stage E finalized — proposed outcome: scripted.
Run (from the copy root):
bash repro/scripts/10_env/10_venv.sh
bash repro/scripts/10_env/11_install.sh
bash repro/scripts/10_env/12_import_smoke.sh
Expect: the smoke log ends with SMOKE_RESULT=PASS all entry-point imports resolved (PASS import main, PASS import prepare_data, PASS for every evaluate dependency) and prints mps_available=True / cuda_available=False; each script log ends exit_code=0.
Runbook: repro/MANUAL_STEPS.md ## Environment · findings: repro/REPRODUCIBILITY.mdFigure 3: The agent’s final terminal message after the Environment stage before and after revising the prompt. The strip above each block shows the scale of output that was reduced.
Conclusions
Say what you want in a prompt, not only what you don’t. My prompt defined manual steps by what a script cannot do, so the agent left out the three scripts I needed to run.
If you’ll use an agent’s output in a script or a repetitive step be explicit about where it should be and provide a template.
Notes
-
Checking if the code in scientific papers can produce the results the paper reports
-
Bogin et al., SUPER, EMNLP 2024
-
Wang et al., DeployBench, arXiv 2026
-
Bhaskar and Stodden, Reproscreener, ACM REP 2024
-
My ReproReady post