Analysis software written by an open-weight language model from a written specification: a pilot test on a toy Monte Carlo of a germanium detector
Abstract
An earlier note (DOI 10.5281/zenodo.24318078) reported energy-reconstruction algorithms for a germanium detector that a commercial language model wrote in a dialogue with the author. Data of running experiments cannot be sent to a commercial service. This note tests the division of work that follows from this restriction: a commercial model writes a specification in plain text and sees no data; an open-weight model, run at a computing centre, writes the program from the specification, and the program is executed on the data. The open-weight model was DeepSeek-V4.1-Flash-1017, served on eight A100 GPUs at NERSC. The data were a toy Monte Carlo of an inverted-coaxial detector. For stages of increasing difficulty (trapezoidal filter; optimum filter with a drift-time correction; correction from five pulse-shape quantities) the model wrote a correct program at the first attempt. On a hidden test sample with lines that are not in the calibration, the programs reach 3.52, 2.58 and 2.18 keV FWHM at Qββ, the same as a reference implementation (3.52, 2.59, 2.18 keV). The three programs took 21 minutes of generation. In a fourth stage the model wrote its own Levenberg-Marquardt fit for a correction with 18 constants built from the eml operator, again correct at the first attempt (2.18 keV). In a fifth stage without a recipe the model added shape quantities of its own (the variance of the drift-time distribution, principal components of the rising edge) and a robust fit, and reached 2.11 to 2.13 keV at Qββ in six attempts; it also overfitted the calibration lines and once exceeded the allowed number of constants, which it corrected itself in the next attempt. All programs together took 80 minutes of generation. The author did not write code. The appendices list the specification, the loop, the data generator, the reference solution, the evaluation and the ten programs written by the model.
// Source
Authors: M. Misiaszek
Institutions: Jagiellonian University