Rules to Tools: Executable Checks for LLM Agents in Scientific Computing
Organizations: School of Computer Science, Carnegie Mellon University · DP Technology
Abstract
Scientific coding agents receive equations, boundary conditions, and output requirements in writing, then must assess the programs they revise. Rules to Tools (R2T) supplies prepared executable checks of public scientific requirements. Matched SciCode repair groups share written checks, starting programs, model, and budgets; the tool group receives a callable implementation. Across two task-ID cohorts, complete repair is 26/30 with text and 29/30 with the prepared checks. Three task IDs favor tools, one favors text, and eleven tie. The eight-ID cohort scores 13/16 versus 15/16, with a task-cluster bootstrap 95% interval of [-12.5, 43.75] percentage points for the difference. The larger shared-definition SciCode cohort ties at 13/24 per group. Five development-exposed tasks with alternate starting programs score 3/10 versus 7/10. The tool group favors tasks 17, 77, and 11; initial checks flag task 17 and report no violation for tasks 77 and 11. Task 37 favors text and has no initial reported violation. A fresh source-through-Python arm also reaches 15/16, matching the dedicated command's aggregate. In a matched PDE comparison, detailed text scores 23/24 and checks score 24/24, with 31.2% lower reported model output for checks. Agent-side output savings vary by cohort, while public CPU use rises in both task-ID cohorts. These results measure task-dependent repair outcomes and agent-side costs with prepared checks.
Figures & tables
| Public source and rule | Probe on the candidate | Admitted error | Returned observation |
|---|---|---|---|
| SciCode 12 public radial equation and Numerov recurrence | , , and on grids of 65, 129, and 97 points | Relative residual | Largest residual and its value in each setting |
| SciCode 22 public harmonic rotation and field reconstruction | Degrees 1 and 2; rotation of 0.41 radians about an axis proportional to ; four directions | Relative discrepancy | Largest field discrepancy and values by degree |
| SciCode 73 public reciprocal-cell geometry | Cell lengths , angles , polar maximum , wavelength | Continuous discrepancy; no binary threshold | Worst reflection, ring key, expected spacing, and discrepancy |
| PDE flow public boundary and flow equations | Capture one complete vector field whose magnitude matches the returned grid; differentiate on the physical grid with four boundary layers cropped | Text uses pointwise relative matching; tool uses grid-relative | Boundary error, divergence and momentum residuals, or unavailable status |
| Benchmark | Artifact | Public measurement | Support design |
|---|---|---|---|
| SciCode | Numerical module | Boundary, recurrence, rotation, response | Written rules and prepared checks |
| PDE | Solver field | Boundary and equation residual | Matched checks; separate flow delivery |
| MDArena | Molecular workflow | Structure, protocol, artifact | Historical support forms |
| AInstein | Repository | Public API and domain probes | Historical support forms |
| Benchmark | Comparison | Tasks | Text | Tools |
| Matched written definitions and prepared checks | ||||
| SciCode | Task-ID-heldout matched checks | 8 | 13/16 | 15/16 |
| SciCode | Independent task-ID extension | 7 | 13/14 | 14/14 |
| SciCode | Shared-definition cohort | 12 | 13/24 | 13/24 |
| SciCode | Development-exposed alternate programs | 5 | 3/10 | 7/10 |
| PDE | Detailed shared definitions | 12 | 23/24 | 24/24 |
| Access | Complete | Native steps | Model tokens | Public CPU |
|---|---|---|---|---|
| Written rules | 13/16 | 95.83% | 7.25M | 456.90s |
| Initial report | 14/16 | 98.96% | 8.68M | 521.24s |
| Source through Python | 15/16 | 99.48% | 8.51M | 509.39s |
| Dedicated command | 15/16 | 95.83% | 7.88M | 633.15s |
Appendix figures & tables7 assets
Supplementary material from the paper’s appendix.
Appendix
| Task ID | Initial violation | Text | Tools | Tool-minus-text |
|---|---|---|---|---|
| 17 | Yes | 1/2 | 2/2 | pp |
| 21 | No | 2/2 | 2/2 | pp |
| 36 | No | 2/2 | 2/2 | pp |
| 37 | No | 2/2 | 1/2 | pp |
| 48 | Yes | 2/2 | 2/2 | pp |
| 50 | No | 2/2 | 2/2 | pp |
| Task ID | Initial check violation | Text | Tools |
|---|---|---|---|
| 11 | No | 1/2 | 2/2 |
| 27 | No | 2/2 | 2/2 |
| 32 | No | 2/2 | 2/2 |
| 34 | Yes | 2/2 | 2/2 |
| 39 | No | 2/2 | 2/2 |
| 55 | No | 2/2 | 2/2 |
| Task | Written | Initial report | Source in Python | Dedicated |
|---|---|---|---|---|
| 17 | 1/2 | 2/2 | 2/2 | 2/2 |
| 21 | 2/2 | 2/2 | 2/2 | 2/2 |
| 36 | 2/2 | 2/2 | 2/2 | 2/2 |
| 37 | 2/2 | 2/2 | 2/2 | 1/2 |
| 48 | 2/2 | 2/2 | 2/2 | 2/2 |
| 50 | 2/2 | 2/2 | 2/2 | 2/2 |
| Benchmark | Original | Extended | Native partial (%) | Added output (k) |
|---|---|---|---|---|
| MDArena | 8/18 | 10/18 | 84.49 | 623.6 |
| AInsteinBench | 7/15 | 9/15 | 93.23 | 333.3 |
Automated Program Repair
Automated program repair develops methods that locate software faults and produce validated fixes with limited human effort.
See all 158 papers