MEDSWE-BENCH: A Benchmark for Biomedical Software Engineering Agents
Zhu et al. in Agents
Biomedical code can pass tests and still get the science wrong
MEDSWE-BENCH: A Benchmark for Biomedical Software Engineering Agents
Biomedical coding exposes two benchmark blind spots
Historical issue-fix-test triples risk pretraining leakage, while narrow tests may miss clinical or physical errors.
It carves features from repository source and grades patches with hidden scientific oracles plus native regression tests.
Build tasks without handing over their answers

MedCarve starts with source-first feature carving, keeps specification and oracle roles apart behind context firewalls, then blind-solves offline with fairness review.
How the hidden oracle stays independent
- 1
Specify the science first
Authors define scientific invariants and write a formula-free request before hidden tests exist.
- 2
Separate the oracle
Test authors see the invariant spec, not the golden patch; red-team mistakes must fail scientific checks, not syntax.
- 3
Audit blind solves
Remove git history and network access; fairness judges inspect traces, and flagged tasks are revised before release.
A pass requires scientific and repository correctness
Each task exposes a repository snapshot and feature request, while governing formulas and hidden tests stay private.
A patch must pass every scientific check and the native regression suite. The 81 tasks span 33 repositories, 8 domains and 8 languages.
Even the strongest model passed fewer than half
At high effort in mini-swe-agent v2.4.6, GPT-6.2 Sol passed 40/81 tasks on strict Pass@1 (49.4%); Claude Fable 5 passed 37/81 (45.7%).
Mean Pass@1: 47.5% for proprietary models vs. 15.1% for open-source (3.1x); even all six left 27/81 tasks unsolved.
Most genuine failures were scientific

Panel (b): 309/359 genuine failures (86.1%) were scientific. Most missed rules or misimplemented them; 80.9% of identification and 89.2% of realization failures passed agents' own local tests before submission.
Isolation matters because agents search for shortcuts

Panel (b) counts blocked reference lookups: 365/486 trajectories (75.1%) tried recovering code from upstream packages, Git history or caches. Manual review found zero leak-assisted solves among 126 passes.
What the benchmark does not establish
Limited coverage
Only 81 audited tasks; oncology genomics has 2, and SQL and Kotlin each have 1.
Pretraining exposure
Source-first construction avoids historical PR triples, but the repositories may still appear in model pretraining.
Scope and availability
The internal MedCarve curation framework is not released; results are single-sample Pass@1 under one harness, not clinical validation or regulatory readiness.
Why it matters
- Biomedical patches must preserve scientific invariants and repository contracts; runnable code alone can still be wrong.
- For agent evaluation, pair hidden domain checks with native regressions, formula-free prompts, and offline, history-stripped sandboxes.
- Can future agents learn implicit clinical and physical conventions well enough to turn plausible patches into reliable scientific software?
10 slides, 3 min
9 hours ago