WorksComputer Science
automodel: A Skill for Agentic Model Discovery
Abstract
The search for better models, whether expressed as analytical equations or neural architectures, has increasingly shifted from manual design toward data-driven automation. While a multitude of algorithms exist, ranging from exhaustive search to AlphaEvolve, recent advances in general-purpose coding agents such as Claude Code and OpenAI Codex raise the question: could providing such systems with a "model discovery recipe" be enough to discover or improve models? We present automodel, an agent skill for general model discovery. With case studies in astrophysics, cardiovascular dynamics, precision agriculture, traffic flow, and vehicle tire dynamics, we show how commercial agents equipped with automodel can successfully identify novel and scientifically-relevant models. Our findings suggest that encoding model-discovery methodology as a portable agent skill can provide a simple, interactive, powerful and broadly applicable alternative to domain-specific automated discovery pipelines. The skill is available at: https://github.com/unlayer-ai/automodel.
Introduction
For centuries, the modeling of phenomena has relied on human expertise. Since the 20th century, advances in computational power and algorithms have made it possible to automate many steps in this process. Heuristics for discovering models as physics laws from data emerged before the 1990s [1], predating the subsequent development of genetic programming-based symbolic regression (SR), where compositions of operators, variables, and constants that fit the data are evolved [2, 3]. In 2009, Schmidt and Lipson used SR to demonstrate that Hamiltonians, Lagrangians, and other known physical laws could be recovered automatically from observational data [4]. Today, modern SR algorithms range from evolutionary to deep learning approaches, and have proven capable of discovering new candidate laws, for example in astrophysics [5, 6].
Models need not take the form of human-interpretable equations. Neural architecture search (NAS) seeks to automate the design of neural network architectures [7], while the broader field of automated machine learning (AutoML) also addresses the selection of model classes, preprocessing steps, and hyperparameter configurations [8, 9]. Although these tasks target different model representations, they often draw on the same families of search algorithms, including evolutionary algorithms, Bayesian optimization, and (deep) reinforcement learning. At a high level, they involve searching over structural choices—such as mathematical operators, neural network layers, or model classes—while also optimizing parameters such as equation coefficients, network weights, and regularization strengths. Crucially, the structural choices and allowed combinations need to be pre-specified: The modeler relying on these algorithms must therefore put effort into adapting and configuring these algorithms to the problem and data at hand.
Recent advances in large language models (LLMs) have expanded the possibilities for automated model discovery. Systems such as AlphaEvolve [10], ShinkaEvolve [11], OpenEvolve [12], and SkyDiscover [13] use LLMs to generate or revise executable programs based on task descriptions and evaluation feedback. When these programs implement models, this becomes a search over model structures. LLM-generated proposals are generally more expensive than simple mutations, but can incorporate domain knowledge and evidence from previous attempts; their added cost may therefore be offset by fewer evaluations needed to find useful improvements. This makes LLM-guided search particularly attractive when evaluating candidates requires expensive training, calibration, or simulation. Further, representing models directly as programs also reduces the need for model-specific encodings and variation operators.
The aforementioned methods rely on dedicated harnesses—software that coordinates LLM calls, candidate generation, and evaluation—to organise and scale discovery. Meanwhile, general-purpose coding agents such as Codex [14], Claude Code [15], and OpenCode [16] can inspect code, modify implementations, execute experiments, and use the results to guide subsequent changes. These capabilities motivate a complementary approach: can model discovery be organised as a reusable scientific workflow executed by a general-purpose coding agent?
In this work, we investigate this idea through automodel, a portable skill we introduce that provides coding agents with a reusable recipe for model discovery. The skill guides the agent through establishing an evaluator, proposing and implementing hypotheses, conducting experiments, and verifying apparent improvements. Models are assessed against objectives and scientific constraints specified by the researcher, while their representation and proposed modifications are adapted to the problem and the existing codebase. This allows the same workflow to address tasks ranging from discovering compact analytical expressions to modifying equations within scientific simulators.
The contribution posed in this paper is methodological: we package model discovery as a reusable skill that operates within existing coding-agent environments, supporting interactive problem formulation as well as model improvement. Through five scientific case studies, we examine its applicability across model representations, objectives, and validation requirements. Our aim is to assess the utility and limitations of this agentic workflow—in which researchers can interactively refine objectives, constraints, and evaluation procedures—rather than attempt to establish performance superiority over dedicated model-discovery methods.
Related Work
As mentioned in the introduction, model discovery spans a number of algorithms and model forms, from genetic programming for SR [3] to AutoML pipelines [8, 9] and LLM-based approaches. Here, we focus on the latter since automodel is a skill for LLM agents.
LLMs as optimizers and program generators. In Large Language Models as Optimizers, Yang et al. introduced Optimization by PROmpting (OPRO), in which an LLM is iteratively prompted to create a solution attempt, based on its previous attempts and respective scores, which are evaluated by an objective function [17]. While not applied to model discovery, OPRO’s pattern of proposal, evaluation, and feedback represents the core principle of LLM-based discovery. FunSearch applies this principle to executable programs, combining LLM-generated candidates with automated evaluation and a population-based search to discover mathematical constructions and algorithmic heuristics [18]. AlphaEvolve, ShinkaEvolve, OpenEvolve, and SkyDiscover broaden evolutionary code improvement to scientific and computational applications [10, 11, 12, 13]. AlphaEvolve in particular has been used to search for neural-network activation functions, while EvoPrompting has applied LLM-guided evolution to code-level NAS [19, 20].
From equation proposals to scientific agents. LLM-SR specializes in equation discovery, alternating LLM-generated equation structures with numerical parameter fitting and evolutionary selection [21]. OpenEvolve has been evaluated on SR for three-dimensional surface equations [22, 23]. For dynamical systems, LLM4ED uses scored proposals and LLM-based evolutionary operators to discover governing ordinary and partial differential equations [24].
LEMMA evolves mechanistic ecosystem models while fitting their parameters to time-series data [25]. LaSR guides symbolic search using a library of textual concepts extracted from successful hypotheses [26]. SR-Scientist proposes a harness that allows us to analyze data, implement equations, invoke evaluation tools, and refine candidates from experimental feedback [27].
Autoresearch and reusable experiment loops. Karpathy’s autoresearch provides a particularly close software precedent to automodel [28]. While the works above propose harnesses that are specialized to scalable search, Karpathy takes a general coding agent (e.g., OpenAI Codex or Claude Code) and provides a set of instructions in a Markdown file, plus a series of scripts to realize the experiment (improve language-model training code). This idea has since been generalized into a skill featuring user-defined goals, editable scope, verification procedures, baseline measurement, and persistent result logging [29]. Essentially, autoresearch showed how natural-language procedures and a small amount of supporting code infrastructure can lead to sustained optimization within existing generalist coding-agent environments.
Skills for research workflows. Skills have also been proposed for broader research methodology. ARIS coordinates research execution and cross-model review through Markdown-defined skills, persistent research records, and checks linking scientific claims to experimental evidence [30]. DisCo, introduced in Repo-To-Skill, distills operational knowledge from machine-learning repositories into reusable skills and supplies them to a research agent [31].
automodel belongs to this emerging family of instruction-driven research workflows. It packages a methodology specifically for scientific model discovery: establishing an evaluator, fitting a baseline, iterating over structural hypotheses with repeated parameter calibration, and performing an application-specific final assessment.
Method
automodel is an agent skill: a set of natural-language instructions and templates arranged in a specific format, for general-purpose coding agents to follow. It specifies a workflow rather than providing a dedicated orchestration engine or numerical optimizers; execution relies on the coding agent and its environment. The skill guides the agent to collaborate with the user to define the search problem, followed by autonomous optimization of model structure. The type of model is not pre-specified: it may as well be a closed-form expression as a deep neural network.
automodel organizes model discovery into four sequential phases: setup, baseline, iterate, and finalize (Figure 1). Each phase has a separate recipe and produces contextual records for the next phase or to resume a previous run.

Figure 1. The four phases of automodel. In phase 3, parallel agents are spawned to test different structural hypotheses through sequential attempts, while a coordinating agent compares results and redirects the next meta-iteration. The score and final check are defined for each application during setup.
Phase 1: Setup. The researcher establishes the intended model with the agent, its inputs and outputs, admissible properties, fitting objective, selection score, and resource budget. They implement or confirm the parameter-fitting routine (if any) that will be applied to a baseline model, and to new structural change attempts that will follow. They also decide how candidate performance will be measured and what evidence will constitute an external final check. The skill requires validation data or cross-validation for unpenalized error metrics such as root mean square error, whereas a complexity-penalized criterion (e.g. Akaike’s information criterion [32] or minimum description length [33]) may support selection on the fitted data alone. An external final check is still needed, as penalizing model complexity does not account for selecting the best of many candidate structures. Runtime and memory considerations are assessed so that the cost of evaluating candidates is known before the search. Setup also checks that the environment can spawn sub-agents and execute the required experiments. The agent records the decisions made during this phase in a CONTEXT.md file; this record is designed to keep track of choices and progress, and also to enable a later agent session to resume the work without relying on the conversation history. Progress is also tracked in a CHECKLIST.md file.
Phase 2: Baseline. This phase establishes a reference result and checks that candidate implementations can be compared through a working evaluator before structural search begins. In particular, the agent fits the parameters of an existing model when one is supplied, and otherwise implements and fits a simple parameterized baseline. A sub-agent then runs the complete evaluation pipeline, inspects whether the outputs are plausible, and records runtime and memory occupation, which will be used in Phase 3. This also verifies delegated file access and code execution.
Phase 3: Iterate. This phase implements the main search process, which consists of a nested loop where the agent acts as orchestrator, and sub-agents search in parallel. Namely, the agent is tasked with spawning sub-agents and assigning them non-overlapping search directions. The sub-agents are instructed to iteratively: (i) change the structure of the model according to their search direction, (ii) fit any free parameters, and (iii) record the respective results. Once the sub-agents have completed iterations, the orchestrating agent finalizes a meta-iteration by reviewing the sub-agents’ results and providing them with updated search directions, for them to start iterating again. It discards incomplete runs and independently re-evaluates shortlisted candidates using the common protocol before selecting a winner. Once meta-iterations are completed, the agent coordinates with the user to decide whether to continue the search or move on to Phase 4. Records of this phase are stored in structured folders containing the sub-agents’ outputs, as well as in CONTEXT.md as summaries.
The parameters (number of parallel sub-agents), (number of sub-agent iterations), and (number of meta-iterations) are decided at the beginning of this phase in consultation with the user, using the time and memory occupation estimated on the baseline model in Phase 2.
Phase 4: Finalization. Once the user is content with the model(s) found, they are assessed using the external check defined in Phase 1. This may be an untouched test set, an independent dataset, and/or checks of physical properties beyond the fitted range. If the result motivates further search, the same check should not be reused as independent evidence. What is frozen before that assessment depends on the scientific question: some applications fix both structure and fitted coefficients, while others fix a shared structural mechanism but refit permitted case-specific parameters. The final model, performance, acceptance criteria, and any limitations are added to the experiment record in CONTEXT.md.
The following sections present five case studies in which different researchers applied automodel to distinct scientific modeling problems. Each study explains how the shared workflow was adapted to its data, model representation, objectives, and evaluation protocol, and reports the resulting model and its assessment.
Case study 1: Astrophysics
Problem statement A galaxy’s stellar mass is the total mass of all the stars it contains, varying by roughly four orders of magnitude across the observed galaxy population. The stellar mass function (SMF), written , describes how common galaxies of each mass are: the number of galaxies per unit volume of space, per factor-of-ten interval (“dex”) in stellar mass. It is one of the most basic summary statistics in the study of how galaxies form, and provides a powerful constraint on any simulation or theory of galaxy formation. Because it is measured by counting galaxies in mass bins in a sky survey, the raw measurement is a histogram of counts, and is typically summarised with an analytic fitting formula. This is historically chosen by eye, the literature standard being the Schechter function [34] with extensions proposed by e.g. Saunders et al. [35] and Bernardi et al. [36].
SR provides a framework within which to search automatically for superior functional forms, overcoming the limited scope and potential confirmation bias of visual human fitting. Ford et al. [37] applied Exhaustive Symbolic Regression (ESR) [5] — which generates and scores all functions up to a fixed complexity, and so is guaranteed to find both the optimal function and a complete ranking — to the Sloan Digital Sky Survey (SDSS) survey measurement of the SMF by Bernardi et al. [36], using as the fitting variable. As the fit quality criterion, they adopted the Minimum Description Length (MDL) principle, in the form developed for symbolic regression by Bartlett et al. [5]: the preferred function is the one that communicates the data in the fewest nats (natural-logarithm units of information).
For a function fitted to binned counts under a Poisson likelihood, the description length is
where is the number of fitted parameters, the diagonal observed Fisher information, the number of nodes in the expression tree, and the number of distinct operators used. DL approximates the negative log Bayesian evidence, rewarding goodness of fit (low negative log-likelihood NLL) while penalising in a principled way the addition of parameters () and operators (). This makes it a robust single metric combining accuracy with complexity. A fitting function with lower DL compresses the data more efficiently.
Ref. [37] identifies functions, for example , that decisively beat the Schechter function, but did not reach the DL of the more complex Bernardi and Saunders forms. Being exhaustive, ESR cannot reach the complexities of the literature functions without enumerating every function within that complexity range, which is computationally prohibitive (realistically, ESR reaches complexity , while the Saunders and Bernardi functions contain operators). This motivates the use of a guided non-exhaustive search to attempt to bridge this gap, in this case automodel.
Method
automodel was used with Claude Code (Opus 4.8) with the following domain-specific choices on top of the baseline workflow.
(i) Objective and data organization. The structure-selection score is the description length of Eq. (1), while free parameters are fitted by maximizing the Poisson likelihood; its penalty is already an evidence-based regulariser. We therefore dropped the baseline train/validation/test split and fitted on the full binned data, as ESR does. We promoted generalisability in two additional ways. First, the survey provides two versions of the same measurement, derived from two different ways of inferring a galaxy’s brightness and hence stellar mass from galaxy images (“Sérsic” and “cmodel”); we treated these as two datasets and required a candidate to win on both. Second, following [37], we imposed “physicality” checks on the functions to ensure that they describe physically sensible SMFs (see below).
(ii) Model and evaluation. A candidate “model” here is a one-line function string in ESR’s operator basis (+, −, ×, ÷, pow, exp, log, inv). The shared train-and-evaluate harness is a single calibrated evaluator that fits the free parameters by Poisson likelihood (robust multi-start Nelder–Mead plus basin-hopping) and returns the two complexity terms of Eq. (1). It reproduces the DLs quoted in [5] to nat, so every candidate the agents generate is directly comparable with the published numbers.
(iii) Search. The agents were seeded with the already-evaluated ESR and literature functions — the current DL Pareto front — as both targets and scaffolds. We ran (three meta-iterations of four parallel agents, four sequential structural edits each) and scoring every candidate on both datasets. In practice, the agents reliably proposed families while the meta-agent performed the definitive fits in controlled batches. Finally, all leading forms were re-optimized with a multi-method global search (massive multistart, differential evolution, dual annealing, basin-hopping), confirming that their margins reflect genuine structure rather than an under-converged fit. The literature and ESR functions they are compared against are quoted at their published fits (re-fitting the Bernardi function to the Sérsic dataset with our evaluator lowers its DL by 14 nats, which would raise all Sérsic DL values in Table 1 by the same amount).
| Function | \multicolumn{2}{c}{dataset 1 (Sérsic)} | \multicolumn{2}{c}{dataset 2 (cmodel)} | |||
| Function | |||||
| Best ESR | 10/9 | +196.8 | +241.5 | +189.7 | +235.1 |
| Saunders | 21 | +169.4 | +187.9 | +144.6 | +164.3 |
| Bernardi | 23 | 0 | 0 | 0 | 0 |
| A2 (this work) | 13 | −23.5 | +9.2 | +76.3 | +109.1 |
| A5 (this work) | 19 | −36.5 | −21.9 | −15.7 | −5.7 |
Table 1. Goodness-of-fit statistics (description length DL and negative log-likelihood NLL) for the stellar mass function, defined relative to the Bernardi function (so negative numbers indicate superiority to Bernardi), for the two independent versions of the SMF dataset. is the number of operators in the expression (“complexity” as defined by ESR), which is independent of the dataset except for the best ESR, which is different between the two datasets. A2 and A5 are the automodel functions discussed in the text; the best ESR function and the two literature forms are shown for reference.
Results
The search returned seven functions that improve on the best exhaustive-search result; we label them A1–A7 in order of increasing complexity. One of them, A5, beats the Bernardi function in description length on both datasets:
which is the ESR-like single component augmented by one extra additive term, capturing the high-mass behaviour, and a power-law prefactor capturing the low-mass behaviour. A simpler five-parameter form, A2 , also beats Bernardi on one of two datasets. Table 1 shows the results for these functions.
A5 improves the description length relative to Bernardi by 36.5 and 15.7 nats on the two datasets respectively, using 19 operators against Bernardi’s 23. At the same time it improves the fit accuracy, as measured by a higher likelihood, by replacing the Bernardi two-component structure with a generalised single component. Figure 2 shows the functions overlaid on the binned data, together with the residuals in units of the Poisson measurement uncertainty. A5 and Bernardi are visually indistinguishable from the data and from each other, both scattering within about of the data uncertainties; the best ESR function (i.e. the best function at complexity ) by contrast is visibly inaccurate, running low at the smallest masses and drifting to – excursions through the intermediate range.
Figure 2. The best ESR function, the Bernardi function, and the best function found by automodel (A5), overplotted on the binned SMF data. Top: the number density against stellar mass, both logarithmic, with the measurements as points. Bottom: residuals in units of the Poisson measurement uncertainty. A5 and Bernardi both track the data to within about , as expected for a high-quality fit, while the complexity-limited ESR function is visibly worse.
Figure 3 places the result on the Pareto front. The upper panels show the negative log-likelihood (red) and DL of each function, relative to the overall best (A5). The ESR functions lie to the upper left; i.e., relatively poor quality but simple. They are beaten in both likelihood and DL by the Saunders and Bernardi functions (circled symbols). The stars show the functions discovered by automodel, which are significantly simpler than the literature functions while typically improving on both their likelihood and DL. The lower panel zooms in on the region around the lowest DL, showing that several of the automodel-discovered functions beat Bernardi.

Figure 3. Pareto fronts of (blue) and (red) against complexity, relative to the best value in each panel, for the two versions of the stellar mass function dataset. Connected points are the best ESR function at each complexity, circled markers are the Saunders and Bernardi literature forms and stars are the functions found by automodel, labelled A1–A7 by increasing complexity. The lower panels zoom in on the competition, the dashed horizontal line marking Bernardi’s value. The gold-rimmed A5 function beats Bernardi by description length on both datasets. (Markers can coincide: two of the functions are at complexity 19, and A5’s and markers lie exactly on top of one another on dataset 2.)
Beyond describing the data efficiently, a fitting formula for a number density must also be physically admissible: it must stay positive (a negative number of galaxies is meaningless), it should decrease as mass increases (reflecting the basic observational fact that there are more low-mass galaxies than massive ones), and its integral—the total mass contained in all stars per unit volume—must converge to a value below the total amount of baryonic mass available cosmologically. We verified all three for A5: it can safely be extrapolated beyond the measured range, and integrates to about 5% of the cosmologically available mass budget. It is therefore the empirically best SMF derived to date.
Case study 2: Cardiovascular modeling
Problem statement Patient-specific cardiovascular modeling integrates clinical measurements into physiological models to reproduce patients’ cardiovascular function. Here, CircAdapt is considered, a computationally efficient closed-loop model of the heart and circulation that combines phenomenological descriptions of myocardial mechanics, cardiac chamber interaction, valves, and the systemic and pulmonary circulations [38, 39, 40]. CircAdapt has been used extensively to simulate heart failure and electrical conduction disorders, where abnormal electrical activation patterns alter cardiac pump function.
Patient-specific use of such a model normally relies on calibrating its physiological parameters to clinical measurements. However, residual discrepancies between simulated and measured quantities may reflect limitations in the mathematical relationships that define the model itself. Therefore, automodel was used to test whether an agent-guided search could identify a physiologically interpretable modification of the CircAdapt equations. The search was performed using data from multiple patients, requiring any newly introduced structural mechanism to be shared between patients while retaining independent calibration of the existing CircAdapt parameters.
Method automodel was used with OpenAI Codex (GPT-5.6) with the following domain-specific choices on top of the baseline workflow.
(i) Objective and data organization. Cardiac magnetic resonance measurements from four patients with heart failure were considered, comprising six chamber-volume measurements per patient: left- and right-ventricular end-diastolic and end-systolic volumes and left- and right-atrial end-diastolic volumes. For each patient, model fit was quantified across these six measurements using the mean absolute percentage error (MAPE),
Three patients were used for model discovery (“development patients”), while the fourth was held out for testing.
(ii) Model and evaluation. A candidate model was defined as a modification of the CircAdapt model equations. The experiments used a C++ implementation of CircAdapt provided by Christoph M. Augustin and based on the formulation described in [41]. To distinguish structural improvements from ordinary parameter fitting, the same 14 physiological and geometrical parameters were independently calibrated for each patient, whereas any parameter introduced by a structural modification was shared across the development patients.
Baseline and candidate models were evaluated using the same patient-specific inputs, parameter bounds, convergence criteria, post-processing, and differential-evolution calibration. Simulations that failed to converge or produced invalid chamber volumes were rejected.
Each structural modification included an identity value that exactly recovered the original CircAdapt formulation, providing a direct consistency check for the implementation and evaluation pipeline.
In a preliminary exploration on Patient 1, automodel proposed a modification to the right-ventricular reference area that passed the identity check. A subsequent audit of the implementation showed that the new coefficient was algebraically equivalent to rescaling an existing CircAdapt parameter. We therefore included all five cardiac reference areas among the 14 parameters calibrated separately for each patient in the subsequent multi-patient searches.
(iii) Search. Following the single-patient exploration, the multi-patient search proceeded in two stages. The first multi-patient search used , corresponding to one meta-iteration, three parallel hypothesis agents, and one structural proposal per agent.
The agents were not restricted to modifying a predefined equation or physiological subsystem. The resulting candidate models targeted distinct mechanisms in myocardial activation, right-ventricular pressure–geometry coupling, and atrial–pericardial interaction.
Parameter fitting distinguished between shared structural coefficients and patient-specific CircAdapt parameters. Shared structural coefficients were screened via grid search. For each grid value, the 14 ordinary CircAdapt parameters were recalibrated independently for each patient. Candidate structures were compared using the mean of the patient-level MAPEs across the three development patients.
For the held-out patient, the best-found structural formulation and its shared coefficient were kept fixed, while the same 14 patient-specific CircAdapt parameters were recalibrated. This provided a verification of the model selected on the development cohort without using the held-out patient for structural discovery.
After completion of the held-out evaluation, a second and broader development-only search was run to test whether the selected mechanism remained competitive against a wider range of structural alternatives. This second search used , corresponding to two meta-iterations, four parallel hypothesis streams per meta-iteration, and two sequential structural attempts per stream. All 16 proposed equation modifications were implemented and evaluated using only the original three development patients. The search spanned multiple components of CircAdapt, including myocardial mechanics, chamber interaction, valves, circulation, and pericardial mechanics. The held-out patient was not used at any stage of this broader search.
Results The first multi-patient search produced three structurally distinct candidates modifying myocardial activation, right-ventricular pressure–geometry coupling, and atrial–pericardial interaction. The strongest improvement was obtained by modifying the myocardial activation model.
In the original CircAdapt model, myocardial contraction depends on the stretch of an internal contractile element within the muscle cells [41]. This dependence is described by the activation factor , which depends on , the normalized extension of this internal contractile element, according to
The modification found with automodel extends this relation by also accounting for the instantaneous deformation of the myocardial tissue:
where is a shared coefficient and measures this tissue-level deformation. The modified equation therefore combines information about the internal contractile state with the mechanical deformation experienced by the tissue. The shared coefficient was screened over , with giving the lowest mean development error among the tested values.
After full patient-specific recalibration, the selected modification reduced MAPE in all three development patients compared to the original CircAdapt formulation: from 4.15% to 3.77% in Patient 1, from 6.82% to 4.47% in Patient 2, and from 2.27% to 1.02% in Patient 3 (Figure 4A).
Figure 4. Performance of the structural model identified by automodel. Panel A: MAPE of the calibrated original CircAdapt formulation and the selected model. P1–P3 denote the development patients and P4 the held-out patient. Panel B: mean development MAPE of the selected model, the calibrated original formulation, and the five finalists retained from the subsequent search of 16 additional structural mechanisms. Lower MAPE indicates better agreement with the patient-specific measurements.
For the held-out patient 4, MAPE decreased from 5.21% to 4.84%. This smaller aggregate improvement was not uniform across individual chamber volumes, and is therefore interpreted as a modest held-out advantage rather than evidence of population-level generalisation.
In the broader second search, no newly tested modification outperformed the previously selected fibre-stretch activation model on the development patients. The best newly discovered alternative reached a mean development MAPE of 4.03%, while the five finalists from this broader search ranged from 4.03% to 4.19%, compared with 3.09% for the selected model. Thus, the activation modification identified in the first multi-patient search remained the best-performing structure among the broader set of tested mechanisms (Figure 4B).
Case study 3: Precision Agriculture
Problem statement Optimizing Nitrogen (N) fertilization in precision agriculture requires understanding site-specific crop responses to input factors. This challenge is hindered by traditional approaches that rely either on predefined parametric forms [42, 43], which may be too simplistic to capture diverse response patterns across a field, or on opaque machine learning models (e.g., neural networks), which limit interpretability [44]. To account for spatial variability in field characteristics like soil properties and terrain, fields are delineated into management zones (MZs) [45]. MZs are distinct subregions within a field that exhibit similar agronomic characteristics affecting crop yield. They are designed to help farmers treat these subregions separately, tailoring practices like N fertilizer application to local conditions to improve crop productivity while minimizing environmental impact [45].
Mathematically, the true yield function for a field site at coordinates is represented by a complex multivariate system denoted as . However, N-rate optimization does not focus on the absolute yield values, but rather on the functional form between the expected yield at (lat, lon) and the N rate. This functional form can be interpreted as the shape of the curve that relates the N rate and yield response, which defines the N-response curve. Since the absolute values are not necessary for optimization, any vertical shifts in N-response curves are eliminated to obtain the relative N-response curve. Hence, N-rate optimization isolates the functional relationship between the estimated relative crop yield, denoted as , and all admissible fertilizer rates , fixed between 0 and 150 pounds per acre (lbs/acre) for winter wheat. As such, the relative N-response curve is denoted as vs. .
Given a global set of pre-computed N-response curves for all field sites, denoted as , the specific subset of curves associated with the -th MZ is defined as . Building on the assumption that all sites within an MZ share an underlying functional form [44], the objective of this problem is to identify this shared structure for each MZ , expressed as a symbolic functional skeleton . A symbolic skeleton acts as an abstract mathematical template, capturing the structural form of the expression using constant placeholders rather than specific numerical values. Once a generalized skeleton is discovered for a given MZ, these placeholders are optimized to minimize the RMSE for each site within that zone, yielding a parametric site-specific N-response function.
Method automodel was used with Claude Code (Opus 5) with the following domain-specific choices:
(i) Objective and data organization. The data utilized here were derived from two winter wheat dryland fields located in Montana, USA, hereafter referred to as Field A and Field B. The field is spatially discretized into a grid, where each point or “site” corresponds to a 10 × 10 m area. Comprehensive details regarding the dataset, the formulation of the early-yield prediction problem, its 2D3D convolutional neural network (CNN) prediction model, the N-response curve generation process, and the MZ clustering method are documented in [44]. For this specific problem, Fields A and B have already been delineated into four and three distinct MZs, respectively, as shown in Figure 5 and Figure 6, and the N-response curves have been pre-computed for each -th MZ in both fields using a CNN. Under this partitioning, Field A consists of four MZs () containing 305, 289, 467, and 639 individual sites, respectively. Similarly, Field B comprises three MZs () containing 1,024, 1,566, and 1,623 individual sites, respectively.
Figure 5. Results obtained for Field A. (a) Delineated management zones and (b) Aligned approximated N-response curves for each MZ (N-rate vs. relative yield ) [44].
Figure 6. Results obtained for Field B. (a) Delineated management zones and (b) Aligned approximated N-response curves for each MZ (N-rate vs. relative yield ) [44].
For this application, we deviate from the standard automodel procedure by selecting models using in-sample error and performing finalization refitting on the same full dataset, rather than evaluating on a held-out set as the skill normally requires for unpenalized accuracy metrics. Because this constitutes a descriptive and explanatory task rather than a traditional predictive modeling problem requiring train-test data splitting, no data splits were considered. Note that the objective is to discover a single representative skeleton that effectively characterizes the shared agronomic response of an entire cluster. Consequently, the skeleton is derived using the complete collection of curves in and is then fitted to all sites within that specific cluster to yield localized parameterizations, rendering data holdouts unnecessary for this stage of functional discovery.
(ii) Model and evaluation. The search space was defined as the set of closed-form, univariate, and differentiable mathematical skeleton expressions , whose free parameters are the constant placeholders . Each candidate structure encapsulates three components: the skeleton expression, a data-driven routine that produces an initial guess for the placeholders from an individual curve, and per-placeholder box bounds. The automated search navigates this space by iteratively mutating the skeletons’ mathematical formulation while leaving the underlying evaluation protocol unaltered. For a given MZ, a skeleton is fitted independently to each of the curves. For a given field site in the -th MZ at coordinates , the parameter fitting process is formulated to minimize the sum of squared residuals, , across all sampled points of the site’s curve for the parameter vector . Here, is the instantiated function; that is, with its constant placeholders replaced by the specific parameter values in vector . Note that each target curve was previously standardized via curve-wise -score normalization (zero mean and unit variance across its sampled points). Because raw response curves across different sites vary substantially in vertical scale and amplitude, standardizing each curve individually places all sites on a common dimensionless scale. This prevents high-variance curves from dominating cluster-level aggregated error metrics during model selection. It is worth pointing out that the agents were not given a fitting routine; instead, they designed and implemented one themselves as part of automodel’s Phase 1, and then reused it for the entire study. Hence, since the generated functional forms are frequently highly non-convex with respect to their parameters , the agents employed the Trust-Region Reflective (TRF) algorithm, a bounded multi-start nonlinear least-squares optimization strategy.
Consistent with the descriptive nature of the task, the evaluator reports in-sample fit quality across all sites within an MZ. The performance is quantified by reporting the mean error over all field sites belonging to the -th MZ:
where represents the corresponding fitted N-response curve vector for that site; i.e., the instantiated skeleton using the already optimized parameter values for that location. Because the objective is to characterize the underlying functional shape of observed agronomic responses rather than to forecast unmeasured locations, no held-out data split is utilized, and no claims of generalization to unseen sites are made. For the purposes of this evaluation, the pre-computed response curves are treated as the ground-truth baseline; i.e., is used strictly as a goodness-of-fit metric to demonstrate which functional skeleton most accurately recovers their shape. While evaluating fidelity to these baseline curves inherently relies on the assumption that the CNN has accurately captured predictive agronomic responses, the objective of this stage remains descriptive: assessing the structural flexibility of the candidate skeletons in approximating these functional forms.
(iii) Search. The automodel skill was executed independently for each field. In Phase 1, the objective and data preprocessing steps were verified, followed by a shape-profile analysis of the target curves, which revealed important domain characteristics. For instance, 81.2% of sites in Field B’s MZ 1 showed yield declines at higher N rates, indicating that standard monotonically saturating functional families were structurally incapable of representing that zone.
Phase 2 established initial benchmarks using a sigmoidal baseline, . For Field B, the best-performing skeletons, previously discovered for Field A, were also evaluated as transfer baselines. Their poor performance confirmed that optimal functional forms do not directly transfer across distinct fields, highlighting the need for dedicated discovery per field.
Phase 3 executed the core discovery loop, structured as a multi-agent search parameterized by meta-iterations parallel agents sequential inner attempts per agent. Field A was configured with , , . Field B was initialized with , , ; however, runtime interruptions terminated two agents prematurely (after zero and one iteration, respectively), leaving the third agent to complete all three iterations. Hence, the orchestrator formulated and evaluated several additional candidates directly within that single meta-iteration. Across both fields, each agent explored a distinct, non-overlapping functional space, such as explicitly non-monotonic peaked expressions, higher-order Padé rational kernels, or composite warped-argument forms, by proposing incremental structural modifications to the candidate mathematical expressions. Between meta-iterations, an orchestrator synthesized the performance of all proposed modifications, separating helpful structural changes from refuted hypotheses to guide subsequent iterations.
| MZ | Method | Skeleton | |
| 1 | automodel | 0.0043 | |
| 1 | SeTGAP | 0.0113 | |
| 1 | Quadratic-plateau | 0.5411 | |
| 1 | Exponential | 0.0636 | |
| 2 | automodel | 0.0067 | |
| 2 | SeTGAP | 0.0185 | |
| 2 | Quadratic-plateau | 0.4107 | |
| 2 | Exponential | 0.0902 | |
| 3 | automodel | 0.0077 | |
| 3 | SeTGAP | 0.0553 | |
| 3 | Quadratic-plateau | 0.2286 | |
| 3 | Exponential | 0.1234 | |
| 4 | automodel | 0.0075 | |
| 4 | SeTGAP | 0.0251 | |
| 4 | Quadratic-plateau | 0.3226 | |
| 4 | Exponential | 0.1469 |
Table 2. Field A: Symbolic skeletons per MZ and mean error over all sites of the zone.
Human-in-the-loop consultation occurred at three decision points: (1) defining the search loop hyperparameters (, , ), (2) reviewing cross-agent candidate rankings before finalizing, and (3) arbitrating a complexity trade-off on Field B. For Field B, extending a seven-parameter skeleton to an eight-parameter variant yielded a 17–41% per-zone error reduction, exceeding the pre-registered threshold of improvement per added parameter, at the cost of increased parameter ill-conditioning. Upon reviewing the trade-off, the user selected the eight-parameter formulation.
Finally, Phase 4 performed final fits for the selected skeletons across all field sites using expanded multi-start optimization runs. An independent verification process confirmed the exact numerical reproducibility of the stored equations and residual errors. A coefficient-identifiability audit was also conducted, establishing, as a stated limitation, that while the final eight-parameter curves are highly accurate and reproducible, their individual site-level parameter constants exhibit weak identifiability and should not be interpreted independently across sites.
Results Tables 2 and 3 report the skeletons discovered by automodel for each MZ of Fields A and B, together with those produced by the neural SR-based method SeTGAP [46] and by the two classical parametric N-response models, quadratic-plateau [42] and exponential [43]. For every method, every MZ, and every field site, the placeholders of the corresponding skeleton were fitted with the same optimizer, described in the previous section, to minimize the distance to that site’s N-response curve, and we report the resulting mean error over all sites of the zone.
The two classical agronomic models are not competitive in either field. Averaged over zones, automodel-discovered formulations are 57.4× more accurate than quadratic-plateau and 16.2× more accurate than the exponential model on Field A, and 248.9× and 63.1× more accurate, respectively, on Field B. Notably, the agents observed that the failure of the quadratic-plateau model is structural rather than numerical. That is, both classical families are monotone and saturating by construction, whereas the agents observed that 38% of the sites of Field A’s MZ 4 and 81.2% of the sites of Field B’s MZ 1 exhibit a yield decline at high N rates. A monotone-saturating form cannot express an interior maximum, so for those sites it must either flatten through the peak or misplace the plateau, and the fitted error is dominated by that structural mismatch. Against SeTGAP, automodel performs better on average across both fields, being 4.2× more accurate on Field A and 9.7× more accurate on Field B, though no statistical significance is implied, as formal tests have not been performed. In all cases, automodel requires using more complex mathematical expressions with a greater number of fitting coefficients (e.g., up to 8 coefficients on Field B compared to SeTGAP’s maximum of 5). While this added complexity provides the flexibility needed to capture the response curve shapes and reduce fit error, it potentially challenges the interpretability of the resulting equations compared to simpler forms.
| MZ | Method | Skeleton | |
| 1 | automodel | 0.0021 | |
| 1 | SeTGAP | 0.0139 | |
| 1 | Quadratic-plateau | 0.4044 | |
| 1 | Exponential | 0.1401 | |
| 2 | automodel | 0.0016 | |
| 2 | SeTGAP | 0.0204 | |
| 2 | Quadratic-plateau | 0.4933 | |
| 2 | Exponential | 0.0990 | |
| 3 | automodel | 0.0020 | |
| 3 | SeTGAP | 0.0214 | |
| 3 | Quadratic-plateau | 0.5281 | |
| 3 | Exponential | 0.1221 |
Table 3. Field B: Symbolic skeletons per MZ and mean error over all sites of the zone.
Case study 4: Automotive tire modeling
Problem statement In vehicle dynamics and automotive engineering, accurate modeling of tire dynamics is fundamental to developing reliable digital twins and control algorithms that improve vehicle performance, safety, and handling. Indeed, tires constitute the only interface through which forces are transmitted between the vehicle and the road, and their behavior largely determines the overall dynamic response of ground vehicles.
Modeling pneumatic tires, however, is inherently challenging because of the complex physical phenomena involved, including viscoelastic material behavior, transient contact dynamics, load transfer, temperature effects, and nonlinear friction mechanisms. As a result, the conventional approach in vehicle dynamics relies on empirical or semi-empirical constitutive laws that express tire forces as functions of longitudinal and lateral slip. In particular, the most widely used model is Pacejka’s Magic Formula, which postulates a nonlinear relationship of the form [47]
where is a generic normalized tire output (normalized longitudinal force, lateral force, or aligning moment), is the independent variable (longitudinal or lateral slip), and the macro-parameters may depend on additional micro-parameters such as normal load and tire temperature. For instance, Eq. (6) may be applied to model the lateral tire force as a function of the lateral slip :
Alternative expressions to (7) can now be discovered using AI-based equation discovery methods. Indeed, since (7) is a purely empirical model rather than a physics-derived constitutive law, it offers no intrinsic advantage over alternative empirical models identified from data.
Method The automodel skill was used with Codex (GPT-5) to explore alternative analytical model structures. The workflow was adapted to the present tire-modelling problem through the following domain-specific choices.
(i) Objective and data splitting. The objective was to discover an analytical model for the normalized lateral tire force . The measurements were organized into five vertical-load bins with representative loads
Each load bin was represented by 200 sampled pairs . The three lowest-load bins were used jointly for parameter identification, resulting in 600 training observations. The fourth bin was reserved exclusively for structural validation and model selection, while the fifth bin was retained as an untouched test set. Consequently, the fifth bin was not used for parameter identification, structural hypothesis generation, or candidate-model ranking. The primary model-selection metric was the root-mean-square error of the normalized force,
The median absolute error,
and the coefficient of determination,
were used as complementary accuracy measures. Because is constant within each bin, the dimensional RMSE for a given bin can be recovered according to
(ii) Model and evaluation. A load-dependent Pacejka’s Magic Formula (7), without horizontal and vertical shifts, was adopted as the baseline. This choice ensured that the benchmark corresponded to the prescribed four-factor Pacejka structure rather than to an extended shifted Magic Formula. To improve numerical conditioning, the vertical load was represented by the centered variable
with , and the Pacejka macro-parameters were assumed to vary smoothly with load according to
The exponential parametrization of guarantees a positive stiffness factor over the investigated load range. The remaining macro-parameters were assigned affine load dependencies to retain a compact and interpretable baseline.
All eight secondary coefficients,
were identified simultaneously using the three training bins. Therefore, the baseline was not fitted independently at each load. Instead, a single set of secondary coefficients defined continuous functions of shared across the training conditions.
(iii) Search. After calibration of the baseline, the GPT-5 reasoning model assisted in generating alternative analytical structures. The structural search was subject to the following constraints:
The resulting model had to remain explicit and analytical;
The response had to remain bounded over the measured slip interval;
The model had to retain a continuous dependence on the vertical load;
Polynomial basis expansions were excluded;
Candidate structures could employ natural functions such as tanh, arctan, exp, and related smooth compositions;
The final candidate had to represent a genuinely non-Pacejka structure rather than merely adding standard shifts to the Magic Formula.
The search used , thus employing three parallel agents with different hypotheses and three meta-iterations; the explored candidate families included extended Pacejka formulations, hyperbolic-tangent saturation models, and inverse-tangent saturation models. Standard horizontal and vertical Pacejka shifts were included during the exploratory stage as consistency references. However, shifted or asymmetrically scaled Pacejka formulations were not considered novel model structures for the final non-Pacejka comparison. Among the genuinely alternative structures, the best validation performance was obtained with the load-dependent asymmetric hyperbolic-tangent model
where
In Eq. (19), the first hyperbolic-tangent term describes the transition from the approximately linear low-slip response to force saturation, the second hyperbolic-tangent term provides a smooth sign-dependent modulation, allowing the model to represent different response levels on the positive and negative slip branches, and the parameters and account for systematic horizontal and vertical offsets without requiring separate models for the two slip directions. The load dependencies were defined as
In particular, the exponential representations of ensures a positive transition-rate parameter. The complete secondary-parameter vector of the natural model was
For each candidate structure, the secondary coefficients governing both the slip response and its load dependence were identified jointly from bins 1–3, and parameter estimation was performed using bounded nonlinear least-squares optimization in MATLAB®. Multiple initial parameter vectors were used for every structure to reduce sensitivity to local minima. The same training observations, parameter bounds, convergence tolerances, number of initializations, and performance metrics were used for all candidate structures, and the load-dependent secondary coefficients were shared across the three training bins. Moreover, no model coefficient was fitted independently for a single training bin. This constraint required each candidate to explain both the slip dependence and the systematic variation with vertical load through one continuous analytical formulation. After fitting on bins 1–3, each candidate and its identified parameters were evaluated on bin 4 without recalibration. Candidate structures were ranked primarily according to validation RMSE, while the median absolute error and were inspected to ensure that the ranking did not result from a small number of unusually large residuals. Parameter vectors reaching prescribed optimization bounds were also recorded, since such behavior may indicate parameter correlation or limited practical identifiability. The asymmetric hyperbolic-tangent structure in Eq. (19) was selected as the best non-Pacejka model because it provided the lowest validation RMSE among the genuinely alternative analytical structures considered. Once this structure and its load-dependent secondary coefficients had been selected, both were frozen before the fifth bin was evaluated.
For the held-out fifth bin, neither the analytical structure nor any of its secondary coefficients was modified. In contrast to, e.g., the patient-specific calibration procedures for cardiovascular modeling (Section 5), no parameters were recalibrated on the test bin, because the objective was to assess direct extrapolation of the complete load-dependent tire model to a previously unused vertical-load condition. The final test evaluation therefore consisted only of inserting into the previously identified macro-parameter functions and evaluating the resulting force curve at the supplied test values of . The test RMSE, median absolute error, and were computed only after completion of validation-based model selection. The GPT-5 reasoning model was used to assist structural hypothesis generation, analytical formulation, and implementation of the candidate models, whereas all secondary coefficients were obtained from explicit numerical optimization, and all training, validation, and test metrics were computed directly from the experimental data. The final model structure, its implementation, the identified coefficients, and the resulting predictions were inspected by the author.
Results The model-discovery procedure selected the load-dependent asymmetric hyperbolic-tangent formulation (17) as the most accurate non-Pacejka analytical structure among the candidates considered. On the three training bins, the natural model reduced the normalized-force RMSE from 0.059 for the Pacejka baseline to 0.052, corresponding to a reduction of approximately 12.0%. The median absolute error decreased from 0.0367 to 0.0317, while the coefficient of determination increased from to . The improvement was retained on the independent validation bin, for which the RMSE decreased from 0.0467 to 0.0384, an improvement of approximately 17.8%, and the median absolute error decreased from 0.0331 to 0.0280. The corresponding validation coefficient of determination increased from 0.990 to 0.993. After model selection, the previously unused fifth load bin was evaluated once as the final test set. The natural model achieved a test RMSE of 0.0546, compared with 0.0583 for the Pacejka baseline, and reduced the median absolute error from 0.0518 to 0.0463. The test coefficient of determination consequently increased from 0.983 to 0.986. At the representative test load , these normalized RMSE values correspond to dimensional force errors of approximately 266.9 N for the natural model and 284.9 N for the Pacejka baseline. Although the relative improvement on the test set, approximately 6.3%, was smaller than that observed during validation, the natural model consistently outperformed the baseline across the training, validation, and test partitions. The results indicate that the combination of load-dependent saturation, stiffness, horizontal and vertical offsets, and a smooth sign-dependent modulation captures systematic features of the measured lateral-force response that are not represented by the unshifted Pacejka baseline. Nevertheless, because some identified coefficients approached their prescribed optimization bounds, the individual macro-parameters should be interpreted primarily as components of the resulting predictive law rather than as independently identifiable physical quantities.
A comparison between the Pacejka’s Magic Formula baseline and the selected model, with parameter values listed in Table 4, and the experimental data is illustrated in Figure 7, whereas the relevant performance indicators are reported in Table 5.
Figure 7. Comparison between the Pacejka Magic Formula baseline (dashed blue lines), the selected natural model (orange lines), and the experimental data.
| Model | Macro-parameter | Functional dependence | Secondary parameter | Value |
| Pacejka baseline | (−) | 2.46 | ||
| (kN) | −0.136 | |||
| (−) | 1.39 | |||
| (kN) | 0.00444 | |||
| (−) | 0.558 | |||
| (kN) | −0.0318 | |||
| (−) | 0.409 | |||
| (kN) | −0.0122 | |||
| Natural model | (−) | 0.562 | ||
| (kN) | −0.0296 | |||
| (−) | 2.67 | |||
| (kN) | −0.145 | |||
| (−) | 0.0240 | |||
| (kN) | 0.00432 | |||
| (−) | 0.200 | |||
| (kN) | 0.00461 | |||
| (−) | −0.298 | |||
| (kN) | −0.0241 | |||
| (−) | 0.0116 |
Table 4. Identified load-dependent parameters of the Pacejka baseline and the natural asymmetric hyperbolic-tangent model. The normalized load variable is , with . The coefficients multiplying represent sensitivities per unit load variation expressed in kN.
| Dataset | Model | RMSE | median | |
| Training, bins 1–3 | Pacejka baseline | 0.0592 | 0.0367 | 0.9869 |
| Natural model | 0.0521 | 0.0317 | 0.9899 | |
| Validation, bin 4 | Pacejka baseline | 0.0467 | 0.0331 | 0.9900 |
| Natural model | 0.0384 | 0.0280 | 0.9932 | |
| Test, bin 5 | Pacejka baseline | 0.0583 | 0.0517 | 0.9835 |
| Natural model | 0.0546 | 0.0463 | 0.9855 |
Table 5. Prediction performance of the Pacejka baseline and the natural asymmetric hyperbolic-tangent model. Model parameters are identified jointly using load bins 1–3. Bin 4 is used for validation, whereas bin 5 is retained as the final test set. RMSE and median absolute error are evaluated for the normalized lateral force .
Case study 5: Traffic flow modeling
Problem statement Macroscopic traffic models describe the evolution of vehicle density along a road. In the Lighthill–Whitham–Richards (LWR) model, density satisfies the scalar conservation law
where the fundamental diagram relates density to traffic flux and the corresponding velocity is . Classical fundamental diagrams provide compact and physically interpretable constitutive laws, but a fixed analytical form can retain systematic bias when it is embedded in a spatio-temporal traffic simulation. Replacing the diagram entirely with a flexible data-driven model may improve fit at the cost of interpretability and physical structure.
The intermediate hypothesis is considered here, that a calibrated classical diagram captures the principal traffic physics while its remaining bias can be represented by a compact multiplicative correction:
where is one of five established diagrams—Greenshields, the equilibrium Intelligent Driver Model (IDM), Weidmann, Triangular, or Del Castillo—whose calibrated coefficients remain fixed during structural discovery; the correction is dimensionless, and recovers the unmodified diagram. Restricting the selected corrections to positive exponential multipliers preserves the units, sign, and zeros of the baseline flux, while still allowing local and short-range spatial adjustments.
Method automodel was used with OpenAI Codex (GPT-5.6 Sol) with the following domain-specific choices on top of the baseline workflow. The implementation, configurations, and reproducibility materials are available in the automodel-traffic repository.
(i) Objective and data organization. We used density, velocity, and flow measurements from the NGSIM Interstate 80 data set. After nondimensionalization, the data comprise 79 spatial rows and 180 time samples; 75 interior spatial positions enter the objective. The split was chronological and fixed before model discovery: samples 0–63 were used to fit correction coefficients, samples 64–107 for structural validation and model selection, and samples 108–179 as a final held-out test interval. No shuffling was used. The two component errors are relative errors,
and candidate fit was summarized by
Structure selection used validation , where is the number of nodes in the expression tree. Thus, an added mechanism had to offset its complexity cost rather than merely produce a numerically negligible reduction in residual error.
(ii) Model and evaluation. A candidate model was a multiplier applied to one of the five fixed fundamental diagrams in Eq. (28). Each candidate was evaluated by solving Eq. (27) with the same initial state, measured boundary density, mesh, and time refinement as its baseline. The finite-volume update used a Rusanov/Godunov flux implemented with discrete exterior calculus operators. For nonlocal corrections, the wave-speed bound included the off-diagonal terms of the flux Jacobian, rather than treating a spatially coupled flux as pointwise.
The coefficient optimizer used deterministic bounded Powell searches with explicit starts and evaluation budgets. Candidates were rejected if their multipliers or simulations were non-finite, if they produced a non-positive multiplier or negative velocity on the relevant physical density domain, or if the corrected velocity violated the prescribed monotonicity check. Every expression, parameter vector, train/validation score, feasibility result, runtime, and memory measurement was retained.
(iii) Search. The search used : five meta-iterations, three parallel hypothesis streams per iteration, and three sequential structural attempts per stream. Every proposed structure was fitted separately to all five baseline diagrams, giving 225 baseline–candidate fits before final refitting on the combined train and validation interval. Early iterations explored positive pointwise polynomial, anchored, saturating, and rational corrections. Later iterations introduced short-range convolutions and Hodge-star features defined on the traffic mesh, and refined the most promising incumbents. Shortlisted candidates were re-evaluated in the root process before acceptance, and the test interval was not accessed during this search. Models were ranked by held-out . Improvement relative to a model’s own classical baseline was defined as .
Results Validation selected the following baseline-specific structures:
with
where is a local density-contrast feature, and let denote the quadratic Hodge-star feature obtained by squaring the dual one-cochain and mapping it back to primal nodes. These structures admit a direct physical reading. Because every is a positive multiplier, a correction changes the magnitude of the baseline flux and velocity without changing the baseline’s zero-flow states. The contrast vanishes in a spatially homogeneous state, so terms containing act only where the density varies over the short convolution window. They can therefore be interpreted as compact non-equilibrium corrections at developing traffic fronts, rather than as changes to the homogeneous fundamental diagram.
The refitted Greenshields coefficients have and . The constant term raises the low-density branch, the negative linear and quadratic terms progressively temper this uplift as density increases, and the contrast term adjusts the flux near spatial transitions. This supplements the rigid parabolic Greenshields curve with both density-dependent curvature and a local traffic-state correction. For IDM, both fitted coefficients are negative and the correction is proportional to ; the non-negative Hodge feature modulates the strength of that response with local traffic loading. The model therefore leaves uniform flow unchanged but reacts more strongly to density variations in heavily loaded states, consistent with a queue-front or anticipation effect absent from an equilibrium closure.
The Weidmann correction is the most directly interpretable. Its fitted , so it increases flux at intermediate densities while remaining exactly one at both and . It preserves the free-flow and jam limits and modifies only the interior of the diagram. The Triangular model has and gates the contrast by density: it is inactive in empty or homogeneous traffic but becomes more influential as congestion develops. Finally, the Del Castillo fit has and . It combines a small global uplift with suppression as the three-cell density aggregate grows and an additional response at spatial density contrasts. Taken together, the selected structures suggest that the residual bias is baseline dependent: some diagrams mainly need a correction to their homogeneous density dependence, whereas others benefit from sensitivity to short-range traffic heterogeneity. These interpretations are structural hypotheses, not identified driver-behaviour mechanisms, and require validation on other roads and traffic regimes.
Table 6 compares the five classical diagrams with the corresponding structures found in the automodel search. automodel–Del Castillo attained the lowest held-out density, velocity, and aggregate errors, with . The automodel–Greenshields correction produced the largest improvement over its baseline, reducing test by 23.17%. automodel improved held-out for four of the five baseline families; the exception was IDM, for which the score increased by 2.30%. Figure 8 shows the measured spatio-temporal fields beside the five automodel predictions. The models reproduce the broad traffic regimes but smooth out part of the fine-scale variability in the data.

Figure 8. Measured I80 fields and predictions from the five selected automodel corrections. Density is shown in the top row and velocity in the bottom row; the first column contains the measurements and the remaining columns the model predictions. The outlined regions in the measured density panel distinguish the development and held-out time intervals.
Held-out I80 prediction errors. Lower is better for all error columns. Parentheses give rank by full-precision test across the ten models. is the percentage reduction in test relative to the model’s own classical baseline; positive values indicate improvement. AM denotes automodel.
| Model | (rank) | |||
| Greenshields | 0.294 | 0.313 | 9.230 (10) | — |
| AM–Greenshields | 0.255 | 0.277 | 7.092 (3) | +23.17% |
| IDM | 0.258 | 0.270 | 6.957 (2) | — |
| AM–IDM | 0.256 | 0.277 | 7.117 (4) | −2.30% |
| Weidmann | 0.265 | 0.288 | 7.651 (8) | — |
| AM–Weidmann | 0.265 | 0.281 | 7.459 (7) | +2.51% |
| Triangular | 0.269 | 0.294 | 7.919 (9) | — |
| AM–Triangular | 0.256 | 0.277 | 7.118 (5) | +10.11% |
| Del Castillo | 0.257 | 0.279 | 7.197 (6) | — |
| AM–Del Castillo | 0.253 | 0.267 | 6.780 (1) | +5.80% |
Table 6. Held-out I80 prediction errors. Lower is better for all error columns. Parentheses give rank by full-precision test across the ten models. is the percentage reduction in test relative to the model’s own classical baseline; positive values indicate improvement. AM denotes automodel.
Discussion
Across the five case studies, general-purpose coding agents equipped with automodel were able to discover useful and scientifically plausible candidate models, ranging from standalone analytical expressions to equations embedded in simulators. Although the skill also allows neural architecture changes in principle, these case studies do not evaluate neural architecture search. In astrophysics, the selected stellar mass function improved on the tested literature forms while extending discovery beyond the complexity ceiling accessible to Exhaustive Symbolic Regression. In precision agriculture, the discovered expressions outperformed traditional baselines on nitrogen response curve fitting and performed competitively with a specialized neural SR approach. In automotive modeling, an asymmetric hyperbolic-tangent formulation provided an alternative to the unshifted Pacejka’s Magic Formula, retaining an accuracy advantage at a previously unused load.
The cardiovascular and traffic applications further illustrate how discovery can proceed through targeted modifications of established models. In CircAdapt, a shared modification of myocardial activation was evaluated while the existing patient-specific parameters were independently recalibrated. In traffic modeling, compact multiplicative corrections retained the sign and zero-flow states of classical fundamental diagrams while introducing additional density dependence or sensitivity to spatial heterogeneity. These examples show that agent-guided discovery can build on existing scientific knowledge and software, allowing researchers to preserve selected properties while investigating where the original formulation is inadequate. This customisability and interactivity with the user are lacking in most function discovery algorithms.
The common element across these applications is the discovery procedure, whose implementation was adapted to each problem. The researcher still defines the scientific objective, admissible changes, fitting procedure, and evidence required to accept a result. The agent can then inspect the implementation, propose structural hypotheses, conduct experiments, and use their outcomes to guide subsequent attempts under the user’s supervision. Interactivity is particularly useful when inspecting failures reveals an unsuitable functional family or exposes a trade-off between accuracy, complexity, and interpretability, as occurred in precision agriculture. In the cardiovascular application, a proposed modification passed the identity check, but a researcher-led audit showed that its new coefficient duplicated the effect of an existing parameter. The resulting workflow therefore supports both model search and the practical work of formulating and checking a modeling problem.
Model discovery algorithms are often compared in terms of the compute or runtime required to reach a given level of accuracy [48]. Comparisons involving automodel should account for numerical calibration, agent inference, and researcher involvement. Stochasticity can be assessed through repeated independent runs, while the amount and timing of human feedback should also be documented. The most direct comparison is with the same coding agent working without the skill. As a first test of this, in the astrophysics case study of § 4 we gave three independent sessions of the same agent and model the evaluator, data, and already-evaluated functions used by automodel but replacing the skill with a generic instruction to improve the model. Their wall time and compute were capped at those of the automodel run and their token budget at our estimate of its usage. Each session considered the task complete after 40–65 minutes, having used less than half of its token budget. Although two of the three found functions that beat A5 on one of the two datasets, only one found a new physically admissible function beating the Bernardi function on both datasets and by significantly smaller margins than A5. The best automodel-found function thus remained clearly the best overall; this appears to be a consequence of the skill’s enforced meta-iterations continuing the search until a single function succeeded on both datasets, thus increasing the agents’ persistence. More systematic control tests—and more detailed comparisons with traditional search algorithms—remain to be made.
Finally, accurate and physically admissible expressions do not by themselves establish an underlying mechanism. The discovered structures provide hypotheses whose mechanistic interpretation requires independent validation. Controlled experiments with known governing equations could additionally assess recovery of the generating structure, accounting for mathematically equivalent formulations and limits of identifiability. In real-world applications, this requires the insight of domain experts.
Conclusion
We introduced automodel, a portable skill for scientific model discovery with general-purpose coding agents. Across five case studies in different scientific fields, we showcased the effectiveness of a shared workflow that combines domain expertise, numerical experimentation, and agent-guided exploration to discover useful models and refine existing scientific formulations. automodel provides a reusable foundation for extending this approach to new modeling problems and scientific domains. The skill lives as an evolving, open source project at https://github.com/unlayer-ai/automodel: contributions are welcome.
Acknowledgments
HD is supported by Royal Society University Research Fellowship 211046.
EB is supported by a scholarship funded by Ministerial Decree no. 118 of 2 March 2023, under the National Recovery and Resilience Plan (NRRP), financed by the European Union – NextGenerationEU – Mission 4, Investment 4.1.
GM and JWS were supported by a USDA-NIFA-AFRI project, titled Using Precision Technology in On-farm Field Trials to Enable Data-Intensive Fertilizer Management (Accession Number 2016-68004-24769), and by a USDA-NRCS program, titled Improving the Economic and Ecological Sustainability of US Crop Production through On-Farm Precision Experimentation (Award Number NR213A7500013G021).
The work of AL is supported by the European Union (European Research Council (ERC), ALPS, 101039481). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the ERC Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
Author Contributions
MV conceived the project, formulated the problem and overall methodology, and led the manuscript preparation. MV and HD developed the automodel skill. HD conducted and wrote the astrophysics case study (§ 4). EB conducted and wrote the cardiovascular modeling case study (§ 7). GM and JWS conducted and wrote the precision agriculture case study (§ 8). LR conducted and wrote the automotive tire modeling case study (§ 9). AL conducted and wrote the traffic flow modeling case study (§ 10). All authors contributed to reviewing, editing and approving the final manuscript.
References
- [1]Patrick W. Langley, Herbert A. Simon, Gary Bradshaw, and Jan M. Zytkow. Scientific Discovery: Computational Explorations of the Creative Process. MIT Press, 1987.
- [2]John R. Koza. Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press, 1992.
- [3]Gabriel Kronberger, Bogdan Burlacu, Michael Kommenda, Stephan M Winkler, and Michael Affenzeller. Symbolic regression. Chapman and Hall/CRC, 2024.DOI
- [4]Michael Schmidt and Hod Lipson. Distilling free-form natural laws from experimental data. science, 324(5923):81–85, 2009.DOI
- [5]Deaglan J. Bartlett, Harry Desmond, and Pedro G. Ferreira. Exhaustive Symbolic Regression. IEEE Transactions on Evolutionary Computation, 28(4):950–964, January 2024.DOI
- [6]Miles Cranmer, Alvaro Sanchez Gonzalez, Peter Battaglia, Rui Xu, Kyle Cranmer, David Spergel, and Shirley Ho. Discovering symbolic models from deep learning with inductive biases. Advances in neural information processing systems, 33:17429–17442, 2020.arxiv.org/abs/2006.11287
- [7]Barret Zoph and Quoc V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations, 2017.arxiv.org/abs/1611.01578
- [8]Matthias Feurer, Aaron Klein, Katharina Eggensperger, Jost Springenberg, Manuel Blum, and Frank Hutter. Efficient and robust automated machine learning. In Advances in Neural Information Processing Systems, volume 28, 2015.
- [9]Xin He, Kaiyong Zhao, and Xiaowen Chu. AutoML: A survey of the state-of-the-art. Knowledge-based systems, 212:106622, 2021.DOI
- [10]Alexander Novikov, Ngân Vũ, Marvin Eisenberger, Emilien Dupont, Po-Sen Huang, Adam Zsolt Wagner, Sergey Shirobokov, Borislav Kozlovskii, Francisco JR Ruiz, Abbas Mehrabian, et al. AlphaEvolve: A coding agent for scientific and algorithmic discovery. arXiv preprint arXiv:2506.13131, 2025.arxiv.org/abs/2506.13131
- [11]Robert Lange, Yuki Imaizuku, and Edoardo Cetin. Shinkaevolve: Towards open-ended and sample-efficient program evolution. In International Conference on Learning Representations, volume 2026, pages 74026–74078, 2026.arxiv.org/abs/2509.19349
- [12]Asankhaya Sharma. Openvolve: an open-source evolutionary coding agent, 2025.
- [13]Shu Liu, Mert Cemri, Shubham Agarwal, Alexander Krentsel, Ashwin Naren, Qiuyang Mang, Zhifei Li, Akshat Gupta, Monishwaran Maheswaran, Audrey Cheng, Melissa Pan, Ethan Boneh, Kannan Ramchandran, Koushik Sen, Matei Zaharia, Alexandros G. Dimakis, and Ion Stoica. SkyDiscover: A flexible, adaptive framework for AI-driven scientific and algorithmic discovery. In Proceedings of the ACM Conference on AI and Agentic Systems, CAIS ’26, page 122311227, New York, NY, USA, 2026. Association for Computing Machinery.DOI
- [14]OpenAI. Codex CLI. https://developers.openai.com/codex/cli/. Documentation. Accessed 26 September 2026.
- [15]Anthropic. Claude Code: Overview. https://code.claude.com/docs/en/overview. Documentation. Accessed 26 September 2026.
- [16]OpenCode contributors. OpenCode documentation. https://opencode.ai/v2/docs. Accessed 26 September 2026.
- [17]Chengrun Yang, Xuezhi Wang, Yifeng Lu, Hanxiao Liu, Quoc V. Le, Denny Zhou, and Xinyun Chen. Large language models as optimizers. In International Conference on Learning Representations, 2024.arxiv.org/abs/2309.03409
- [18]Bernardino Romera-Paredes, Mohammadamin Barekatain, Alexander Novikov, Matej Balog, M. Pawan Kumar, Emilien Dupont, Francisco J. R. Ruiz, Jordan S. Ellenberg, Pengming Wang, Omar Fawzi, Pushmeet Kohli, and Alhussein Fawzi. Mathematical discoveries from program search with large language models. Nature, 625:468–475, 2024.
- [19]Alex Vitivitsky, Michael Boratko, Matej Grcic, Razvan Pascanu, Deep Shah, and Petar Veličković. Mining generalizable activation functions, 2026.
- [20]Angelica Chen, David M. Dohan, and David R. So. EvoPrompting: Language models for code-level neural architecture search. In Advances in Neural Information Processing Systems, 2023.arxiv.org/abs/2302.14838
- [21]Parshin Shojaee, Kazem Meidani, Shashank Gupta, Amir Barati Farimani, and Chandan K. Reddy. LLM-SR: Scientific equation discovery via programming with large language models. In International Conference on Learning Representations, 2025.arxiv.org/abs/2404.18400
- [22]Pablo Samuel Castro, Nenad Tomasev, Ankit Anand, Navodita Sharma, Rishika Mohanta, Aparna Dev, Kuba Perlin, Siddhant Jain, Kyle Levin, Noemi Elteto, Will Dabney, Alexander Novikov, Glenn C. Turner, Maria K. Eckstein, Nathaniel D. Daw, Kevin J. Miller, and Kim Stachenfeld. Discovering symbolic cognitive models from human and animal behavior. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 6849–6890. PMLR, 2025.DOI
- [23]Sanchit Kabra, Shobhnik Kriplani, Parshin Shojaee, and Chandan K. Reddy. SURFACEBENCH: A geometry-aware benchmark for symbolic surface discovery. Transactions on Machine Learning Research, 2026.arxiv.org/abs/2511.10833
- [24]Mengge Du, Yuntian Chen, Zhongzheng Wang, Longfeng Nie, and Dongxiao Zhang. LLM4ED: Large language models for automatic equation discovery, 2024.arxiv.org/abs/2405.07761
- [25]Scott Spillias, Jacob G. D. Rogers, Fabio Boschetti, Elizabeth A. Fulton, Magda Guglielmo, Suk Yee Yong, and Rowan Trebilco. Data-driven discovery of mechanistic ecosystem models with LLMs. Methods in Ecology and Evolution, 17(4):1303–1321, 2026.DOI
- [26]Arya Graveli, Atharva Sehgal, Omar Castilla-Reyes, Miles Cranmer, and Swarat Chaudhuri. Symbolic regression with a learned concept library. In Advances in Neural Information Processing Systems, 2024.
- [27]Shijie Xia, Yuhan Sun, and Pengfei Liu. SR-Scientist: Scientific equation discovery with agentic AI. In International Conference on Learning Representations, 2026.arxiv.org/abs/2510.11661
- [28]Andrej Karpathy. autoresearch. https://github.com/karpathy/autoresearch, 2026. Software repository. Accessed September 28, 2026.
- [29]Udit Goenka. Autoresearch. https://github.com/uditgoenka/autoresearch, 2026. Software repository. Accessed September 28, 2026.
- [30]Ruofeng Yang, Yongcan Li, and Shuai Li. ARIS: Autonomous research via adversarial multi-agent collaboration, 2026.arxiv.org/abs/2605.03042
- [31]Jianlyu Chen, Yuyang Hu, Hongjin Qian, Jiawei Liu, Wenqing Wei, Xiaolong Chen, Defu Lian, Zhicheng Dou, Chaozhuo Li, Qiwei Ye, and Zheng Liu. Repo-to-skill: Distilling GitHub repositories into AI4AI skills, 2026.arxiv.org/abs/2609.02749
- [32]Petre Stoica and Yngve Selen. Model-order selection: a review of information criterion rules. IEEE Signal Processing Magazine, 21(4):36–47, 2004.
- [33]Jorma Rissanen. Modeling by shortest data description. Automatica, 14(5):465–471, 1978.DOI
- [34]Paul Schechter. An analytic expression for the luminosity function for galaxies. The Astrophysical Journal, 203:297–306, January 1976.DOI
- [35]Will Saunders, Michael Rowan-Robinson, Andy Lawrence, George Efstathiou, Nick Kaiser, Richard S. Ellis, and Carlos S. Frenk. The 60-mu.m and far-infrared luminosity functions of IRAS galaxies. Monthly Notices of the Royal Astronomical Society, 242:318–337, January 1990.
- [36]Mariangela Bernardi, Alan Meert, Ravi K. Sheth, Vinu Vikram, Marc Huertas-Company, Simona Mei, and Francesco Shankar. The massive end of the luminosity and stellar mass functions: dependence on the fit to the light profile. Monthly Notices of the Royal Astronomical Society, 436(1):697–704, November 2013.
- [37]Amelia Ford, Harry Desmond, Deaglan J. Bartlett, and Pedro G. Ferreira. The functional form of galaxy and halo luminosity and mass functions. Monthly Notices of the Royal Astronomical Society, 550(4):stag1333, August 2026.
- [38]Theo Arts, Tammo Delhaas, Peter Bovendeerd, Xander Verbeek, and Frits W. Prinzen. Adaptation to mechanical load determines shape and properties of heart and circulation: the CircAdapt model. American Journal of Physiology–Heart and Circulatory Physiology, 288:H1943–H1954, 2005.
- [39]T. Arts, T. Delhaas, P. Bovendeerd, X. Verbeek, and F. W. Prinzen. Three-wall segment (TriSeg) model describing mechanics and hemodynamics of ventricular interaction. Annals of Biomedical Engineering, 37:2234–2255, 2009.DOI
- [40]John Walmsley, Theo Arts, Nicolas Derval, Pierre Bordachar, Hubert Cochet, Sylvain Ploux, Frits W. Prinzen, Tammo Delhaas, and Joost Lumens. Fast simulation of mechanical heterogeneity in the electrically asynchronous heart using the MultiPatch module. PLoS Computational Biology, 11:e1004284, 2015.DOI
- [41]Christoph M. Augustin, Matthias A. F. Gsell, Elias Karabelas, Erik Willemen, Frits W. Prinzen, Joost Lumens, Edward J. Vigmond, and Gernot Plank. A computationally efficient physiologically comprehensive 3D–0D closed-loop model of the heart and circulation. Computer Methods in Applied Mechanics and Engineering, 386:114092, 2021.DOI
- [42]Donald G. Bullock and David S. Bullock. Quadratic and quadratic-plus-plateau models for predicting optimal nitrogen rate of corn: A comparison. Agronomy Journal, 86(1):191–195, 1994.DOI
- [43]Shunkei Kakimoto, Taro Mieno, Takashi Tanaka, and David Bullock. Causal forest approach for site-specific input management via OFPE. Computers and Electronics in Agriculture, 199:107164, 2022.DOI
- [44]Giorgio Morales and John Sheppard. Counterfactual analysis of neural networks used to create fertilizer management zones. In Int. Joint Conf. on Neural Networks, Yokohama, Japan, June 2024.arxiv.org/abs/2403.10730
- [45]Richard B. Ferguson, Gary W. Hergert, James S. Schepers, Carol A. Gotway, Joel E. Cahoon, and Todd A. Peterson. Site-specific nitrogen management of irrigated maize. Soil Science Society of America Journal, 66(2):544–553, 2002.
- [46]Giorgio Morales and John Sheppard. Learning parametric nitrogen fertilizer response curves using neuro symbolic regression. In IEEE Congress on Evolutionary Computation (CEC): Workshop on Symbolic Regression and Equation Discovery, 2026.arxiv.org/abs/2605.31276
- [47]Hans B. Pacejka. Tire and Vehicle Dynamics. 3rd ed. Elsevier, Amsterdam, 2012.
- [48]William La Cava, Bogdan Burlacu, Marco Virgolin, Michael Kommenda, Patryk Orzechowski, Fabrício Olivetti de França, Ying Jin, and Jason H Moore. Contemporary symbolic regression methods and their relative performance. Advances in Neural Information Processing Systems, 2021(DB1):1, 2021.




