arXiv(opens in a new tab)cs.SEOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.09995

Designing Collaborative AI-Driven Workflows for Scientific Software Engineering

Akash Dhruv, Max Knobbe, Pedro Machado, Anshu Dubey

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Agentic artificial intelligence systems can carry out a broad range of tasks in software engineering and scientific research, from writing and translating code to running workflows for data analysis and visualization. In scientific computing, the difficulty is verifying that agent-generated code is both correct and understandable to teams whose members bring different areas of expertise. We therefore argue that these systems are best used within collaborative team structures rather than as full automation. In the workflows we propose, domain experts write the specification and plan, and agents operate under a deterministic orchestration pattern to write the target code. Each stage ends with a numerical comparison against the reference code and requires human review and approval before the next begins. We evaluate these workflows on the translation of a large high-energy physics application from Fortran to C++, running the same task under different orchestrators, design patterns, and models. Across fourteen experiments, a simple author-reviewer loop with enforced limits completed a comparable number of files to a multi-agent workflow at about one-third of the cost per file.

Keywords: Scientific software engineering, Large language models, Agentic workflows, Human-AI collaboration, Code translation, Research software, Loop engineering, Graph engineering

1. Introduction

Scientific software is a research instrument whose development is chronically under-resourced. A numerical code can usually only be modified safely by someone who understands the science it encodes, and such expertise is scarce. The codes are long-lived and carry decades of modifications and domain knowledge that is rarely documented in the published literature. Previous work in research software engineering has argued that investment in software practice is an investment in science, and that long-lived applications need continuous maintenance to remain correct and usable (Heroux et al., 2023; Godoy et al., 2025). Any substantial change to a scientific codebase, such as adding features, refactoring, porting to new hardware, or translating it to another language, is therefore necessary but limited by available developer time. Modernizing legacy code is a common example, where the aim is to preserve the encoded domain knowledge and keep the code usable (Shipman and Randles, 2023).

Large language models (LLMs) are now widely used as coding assistants (Chen et al., 2021; Jimenez et al., 2024), and agentic tools place them inside loops in which they read files, run commands, and revise their work based on feedback (Yang et al., 2024; Liu et al., 2024b). This can lower the cost of software development and maintenance, but an agent's output is not guaranteed to be correct and its behavior over long tasks is difficult to control (Lahlou et al., 2026). Because agentic systems require human supervision, unconstrained agent behavior directly increases supervisor workload. Moreover, an agent overseen by a single person can pass an existing regression suite while introducing errors the suite misses. Such errors accumulate and make the code harder to maintain, which poses a risk to the quality and numerical correctness of scientific software.

We argue that agents are better used within a collaborative structure than in full automation, with work divided into stages that humans can easily review and verify. In the workflows we propose, domain experts write the specification and plan for each stage of the work, and agents carry out the mechanical work in bounded orchestration patterns. Each stage ends with a numerical comparison against the reference code, and only a human can record the approval that lets the next stage proceed. Building on empirical studies of the effect of AI coding assistants on developer productivity and code quality (Ziegler et al., 2024; Dakhel et al., 2023), we explicitly separate the roles of supervision, implementation, and acceptance. This keeps the human developer engaged and preserves their understanding of the code.

To test this approach, we use a computational Lab Notebook built on the practices we developed in our earlier work on reproducible computational research (Dhruv and Dubey, 2023), which provides a controlled environment in which the same task can be repeated under equivalent conditions.

The Lab Notebook is a versioned directory tree that holds the code, configuration, and the agentic layer (specification, plan, tools, and logs) for each stage. Keeping this state in shared files rather than in a user's private orchestrator configuration is what lets the same task be rerun under a different orchestrator

∗^{*}Preprint for comparison. As in the experimental sciences, the Lab Notebook provides consistent record keeping and reproducibility for computational work (Graziani, 2021; O'Neal, 2023).

The test case we examine here is the translation of Monte Carlo for FeMtobarn processes (MCFM) (Campbell and Ellis, 1999; Campbell et al., 2011; Campbell and Neumann, 2019; Campbell et al., 2021), a widely used parton-level Monte Carlo program for precision collider phenomenology, written in Fortran. Modern high-performance computing (HPC) requirements make translation to C++ and a more modular software architecture desirable, with the eventual goal of integrating it into device-portable codes such as Pepper (Bothmann et al., 2024). Code translation is a suitable test case because the existing code provides a numerical reference for each translated routine, so correctness can be measured directly. Translation is also already one of the main applications of LLMs in scientific computing and an active research area (Assunção et al., 2025; Pietrini et al., 2024; Valero-Lara et al., 2025; Dearing et al., 2024; Davis et al., 2025). In our earlier work, we used CodeScribe 1^{1}, an LLM-driven tool, to generate Fortran–C++ interface layers for MCFM, allowing existing and translated code to run together during an incremental migration (Dhruv and Dubey, 2025). In this paper, we extend CodeScribe's architecture to design autonomous agentic workflows and evaluate their performance and efficiency.

We run the same translation task, starting from the same commit and the same agentic layer, under different strategies and models. The strategies range from a simple author-reviewer loop to a multi-agent workflow running concurrent agents. In our experiments, the control needed to use agents on scientific software came from deliberate design of the workflow architecture and the agent execution policy. Adding concurrency without careful design did not improve the outcome and increased the cost.

The paper is organized as follows. Section 2 states five design principles and describes the workflow architectures we examine. Section 3 presents the case study and the experimental design. Section 4 reports the evaluation and results, and Section 5 concludes with the implications and limitations.

References (34)