arXiv:2609.37849cs.SESep 2026

Manuscript Offprint

arXiv:2609.37849

Is manual software optimization a thing of the past?

Pavlin G. Poličar, Martin Špendl, Tomaž Hočevar

ABSTRACT

Context: Scientific software is increasingly required to process larger datasets while maintaining acceptable execution times. Software optimization traditionally requires substantial expertise in programming, algorithms, and numerical methods. Recent advances in large language models (LLMs) offer the possibility of automating much of this process.

Objectives: We investigate whether LLM-based agents can autonomously achieve substantial performance improvements in scientific software, including mature implementations that have already been extensively optimized by human developers.

Methods: We tasked an LLM-based agent with optimizing software for three computational problems: t-SNE, single-sample gene set enrichment analysis (ssGSEA), and graphlet counting. Humans defined the scope, correctness criteria, and a verification mechanism, after which the agent worked autonomously, in some cases for several hours. Code maintainers reviewed each resulting implementation and verified its correctness.

Results: The optimized implementations were faster in all tested configurations, by up to two orders of magnitude over the fastest existing tools. The improvements included low-level code optimizations, mathematical reformulations, and an entirely new algorithm for graphlet counting.

Conclusion: Software optimization can increasingly be delegated to autonomous agents, with the human role shifting from implementing optimizations to deciding which software to optimize, defining objectives, providing verification mechanisms, and ensuring the correctness of the final software. For well-scoped, verifiable problems, we argue that manual software optimization may be a thing of the past.

Keywords Software optimization, Agentic optimization, Algorithmic complexity, Large language models.

1 Introduction

Scientific research increasingly relies on software for data analysis, simulation, and other computational tasks [2]. As datasets grow, the efficiency of this software increasingly determines which analyses are feasible. Yet optimizing non-trivial scientific software requires expertise in software engineering, numerical computing, and algorithm design, as well as considerable development effort.

Recent advances in large language models (LLMs) have enabled agents that can generate, modify, test, and benchmark software. Performance can be improved at different levels, from low-level code optimizations, such as better memory access patterns, vectorization, or parallelization, to reformulating the computation mathematically or replacing the algorithm altogether. Whether LLM agents can autonomously find improvements beyond the low-level ones, even for well-scoped problems with verifiable results, remains unclear, as existing evaluations report mostly surface-level gains [9].

We investigate this question on three computational problems: t-SNE, single-sample gene set enrichment analysis (ssGSEA), and graphlet counting. In each case, humans defined the scope, correctness criteria, and a verification

∗^{*}Corresponding author: pavlin.policar@fri.uni-lj.si

Figure

Figure 1: Runtime of existing and agent-optimized implementations on a consumer-grade M1 MacBook Pro. (a) t-SNE optimization phase (8 threads) on subsamples of a single-cell data set. (b) ssGSEA implementations on 1,000 samples with increasing gene sets. (c) Graphlet counting implementations on random (Erdős–Rényi) graphs with 10k nodes and an increasing number of edges.

mechanism, after which an LLM agent worked without further intervention. The resulting implementations were faster in every case study, by up to two orders of magnitude over the fastest existing tools, with improvements spanning all three levels.