An AI agent rewrites ASE's numerical algorithms: six kernels 22–24 times faster, and optimizers needing 3.1–3.4 times fewer force evaluations on unseen problems
Synopsis
AIOA places a large-language-model coding agent in a keep-or-discard loop that rewrites the numerical algorithms of the atomistic simulation library ASE, with verifiers the agent cannot alter guarding each keep. Across three independent runs, six numerical kernels ran 22–24 times faster on average in Python with NumPy and SciPy while returning unchanged results; on blind held-out problems, optimizers from the best configuration needed 3.1–3.4 times fewer force evaluations than L-BFGS for structure relaxation and 4.6–17 times fewer than standard CI-NEB for reaction paths.
Interpretation
The numerical kernels and optimizers of the atomistic simulation library ASE can be improved by coding agents inside an automated loop, with speed and convergence-cost gains that recur across independent runs. Earlier automated searches of this kind mostly targeted training code or compiler-coupled kernel speedups, while ASE's algorithms were still refined mainly by hand by domain experts. Three independent runs made the six kernels 23.9, 24.1 and 21.8 times faster in Python with NumPy and SciPy, a 23.2-fold geometric mean across runs, with per-kernel gains from 12-fold to 99-fold.
Each iteration commits one change, measures it on an optimization set, and keeps it only if the metric improves and every gate passes; otherwise it reverts the change but leaves it in the history the agent reads. The keep-or-discard loop follows autoresearch's design, with the difference that verification is added to the keep test. Kernel tasks require outputs to match stock ASE within floating-point reordering, the module's own unit tests to pass, and an adversarial reviewer agent that sees only the diff to execute a counterexample.
Method-level optimizers still need fewer force evaluations on blind held-out problems the agent never saw, and the gains cannot be attributed to parameter tuning alone. The parameter-floor comparison shows that on five of the six library-start tasks, tuning alone captures most of the speedup. The best configuration, the informed Fable 5.1 runs, needed 15.0–16.4 force evaluations per held-out relaxation unit across 30 units against 50.5 for L-BFGS, and 128–481 per reaction across 19 held-out reactions against 2,236 for CI-NEB with ODE12r.
Perspective
The demonstrated scope is six numerical kernels of ASE 3.28.0 in Python 3.11 with NumPy and SciPy, plus relaxation and reaction-path tasks computed with GFN1-xTB and GFN2-xTB; every relaxation unit starts near an equilibrium structure, so the relaxer gains are shown within one basin.
With three runs per configuration the comparisons are descriptive, and differences below about 10–15% are invisible; the optimization-set score tracked held-out results only loosely (Spearman 0.49 and 0.14 for the six runs). On the drug-like molecules of concurrent work, started far from their minima, the informed relaxers needed more force evaluations than Sella and failed to converge more often.
