Agentic Calibration of Grey-Box Simulation Models: An LLM-Driven Alternative

arXiv cs.LG Papers

Summary

This paper introduces an agentic calibration method that uses a large language model as an optimizer for calibrating grey-box simulation models in cost-effectiveness analysis. The LLM-driven approach achieves competitive performance with substantially fewer model evaluations compared to traditional methods like Nelder-Mead and Bayesian optimization.

arXiv:2607.18308v1 Announce Type: new Abstract: Calibration of grey-box simulation models is a constrained optimization problem in which model evaluations are expensive, the parameter space can be high-dimensional, and the search must respect plausibility constraints. Although the simulation code is fully available to the analyst, the joint effect of multiple parameters remains difficult to predict analytically. Classical optimizers such as Nelder--Mead (NM) are simple to deploy but sample-inefficient, particularly under constraints. Modern Bayesian Optimization methods achieve competitive solutions with far fewer evaluations but require non-trivial modeling machinery for constraint handling. We introduce an agentic calibration method in which a large language model acts as the optimizer, with constraints incorporated as a plain-language section of the system prompt. We evaluate the agentic method, NM, and Bayesian Optimization (BO) on an anal cancer simulation model under both unconstrained and clinically constrained calibration. Under unconstrained calibration, the agentic method achieves substantially lower best error than BO and NM, while requiring fewer model evaluations. Under constrained calibration, the agentic method reaches comparable error levels and both outperform NM. These results are obtained at the cost of increased inference time per iteration. Agentic calibration achieves competitive performance with substantially fewer model evaluations, and constraint handling is essentially free at the modeller-facing interface through simple textual specifications rather than additional modelling machinery. The main trade-off lies in increased per-iteration inference cost, making the approach particularly suitable when simulation time dominates. Beyond performance, the per-iteration rationale makes the search auditable and explainable, so its decisions can be scrutinised and justified to third parties.
Original Article
View Cached Full Text

Cached at: 07/22/26, 08:19 AM

# Agentic Calibration of Grey-Box Simulation Models: An LLM-Driven Alternative
Source: [https://arxiv.org/html/2607.18308](https://arxiv.org/html/2607.18308)
Mireia Díaz1,3Josep Lluis Arcos4Jesús Cerquides4

\(1Unit of Infections and Cancer – Information and Interventions \(UNIC\-I&I\), Cancer Epidemiology Research Program, Catalan Institute of Oncology\-IDIBELL, L’Hospitalet de Llobregat, Spain 2Autonomous University of Barcelona \(UAB\), Spain 3Centro de Investigación Biomédica en Red de Epidemiología y Salud Pública \(CIBERESP\), Ministerio de Ciencia, Innovación y Universidades, Madrid, Spain 4Artificial Intelligence Research Institute, IIIA\-CSIC, Spain \)

###### Abstract

Background\.Calibration of simulation models used in cost\-effectiveness analysis \(CEA\) is a constrained optimization problem in which model evaluations are expensive, the parameter space can be high\-dimensional, and the search must respect clinical plausibility constraints\. Although the simulation code is fully available to the analyst, making the model grey\-box rather than strictly black\-box, the joint effect of multiple parameters on the outputs remains difficult to predict analytically\. Classical derivative\-free optimizers such as Nelder–Mead \(NM\) are simple to deploy but sample\-inefficient, particularly under constraints\. Modern Bayesian Optimization \(BO\) methods such as BAxUS achieve competitive solutions with far fewer evaluations but require non\-trivial modeling machinery for constraint handling\.

Methods\.We introduce an agentic calibration method in which a large language model \(LLM\) acts as the optimizer\. At each iteration, the LLM is provided with the history of parameter guesses, the simulated outputs, the calibration targets, and a structured breakdown of per\-group residuals, and proposes the next parameter vector together with a rationale\. Constraints are incorporated as a plain\-language section of the system prompt, requiring no additional surrogate models or constraint\-specific machinery\. The resulting optimization trace is human\-readable and can be audited after the fact, in contrast to the opaque internal mechanisms of GP surrogates or simplex\-based methods\. We evaluate the agentic method, NM, and BAxUS on a 10\-dimensional anal cancer simulation model under both unconstrained and clinically constrained calibration\.

Results\.Under unconstrained calibration, the agentic method achieves substantially lower median best error than BAxUS and NM, while requiring 16 model evaluations, compared to 110 for BAxUS and several hundred to several thousand for NM\. Under constrained calibration, the agentic method reaches comparable error levels and both outperform NM, with the agentic method requiring no additional implementation to support constraints\. These results are obtained at the cost of increased inference time per iteration\.

Conclusions\.Agentic calibration achieves competitive performance with substantially fewer model evaluations, and constraint handling is essentially free at the modeller\-facing interface through simple textual specifications rather than additional modelling machinery\. The main trade\-off lies in increased per\-iteration inference cost, balanced by a reduced number of simulations, making the approach particularly suitable when simulation time dominates, as is often the case in CEA\. Beyond performance, the per\-iteration rationale makes the search auditable, so its decisions can be scrutinised and justified, an attractive property for regulated health\-technology\-assessment settings\.

Keywords\.LLM agents, Bayesian Optimization, BAxUS, Nelder–Mead, model calibration, cost\-effectiveness analysis, simulation models\.

## 1Introduction

Health\-economic decision modelling, and in particular cost\-effectiveness analysis \(CEA\), relies on simulation\-based models whose parameters are only partially identified from observational data\. Calibrating such models, that is, finding parameter vectors that reproduce a set of epidemiological or clinical targets, is a frequent bottleneck in cost\-effectiveness analyses\[[1](https://arxiv.org/html/2607.18308#bib.bib1);[2](https://arxiv.org/html/2607.18308#bib.bib2)\]\. From an optimization standpoint, calibration is challenging for three reasons: each evaluation requires running the full simulation, the objective surface is often non\-convex, and clinical knowledge typically imposes constraints that the optimizer must respect\.

An important characteristic of CEA calibration is that the simulation code is fully available to the analyst\. Unlike the strictly black\-box setting commonly assumed in the optimization literature\[[3](https://arxiv.org/html/2607.18308#bib.bib3);[4](https://arxiv.org/html/2607.18308#bib.bib4);[5](https://arxiv.org/html/2607.18308#bib.bib5)\], a CEA calibration is more accurately described as a grey\-box problem\. In this setting, the structure of the model \(parameter meanings, transition probabilities, target metrics\) is known and interpretable, yet the joint effect of multiple parameters on the simulated outputs remains difficult to predict analytically\. The available knowledge about the model can be substantial: for many calibrations, a domain expert can reason qualitatively about the direction in which a parameter should be adjusted given a residual pattern\. Such problem\-specific reasoning is precisely the kind of information that black\-box optimizers cannot exploit\.

Classical derivative\-free algorithms, such as Nelder–Mead \(NM\)\[[6](https://arxiv.org/html/2607.18308#bib.bib6)\]and simulated annealing, are well understood and easy to deploy, but their sample efficiency is poor and they have no principled way of incorporating soft inequality constraints beyond rejection sampling or penalty terms\. Bayesian Optimization\[[3](https://arxiv.org/html/2607.18308#bib.bib3);[4](https://arxiv.org/html/2607.18308#bib.bib4)\]replaces direct search with a probabilistic surrogate, typically a Gaussian Process \(GP\), and an acquisition function balancing exploration and exploitation\. Modern high\-dimensional BO variants such as BAxUS\[[5](https://arxiv.org/html/2607.18308#bib.bib5)\]and SAASBO\[[7](https://arxiv.org/html/2607.18308#bib.bib7)\], together with constraint\-aware extensions\[[8](https://arxiv.org/html/2607.18308#bib.bib8)\], currently represent the state of the art for expensive black\-box optimization in moderate\-to\-high dimensions\.

A third option has recently become viable\. Large language models \(LLMs\) trained on text and code perform competitively as in\-context optimizers\[[9](https://arxiv.org/html/2607.18308#bib.bib9);[10](https://arxiv.org/html/2607.18308#bib.bib10);[11](https://arxiv.org/html/2607.18308#bib.bib11)\]in applications ranging from prompt optimization to materials discovery\[[12](https://arxiv.org/html/2607.18308#bib.bib12);[13](https://arxiv.org/html/2607.18308#bib.bib13)\]\. Existing work in this line has primarily targeted strictly black\-box settings\. The present paper instead applies an LLM\-driven optimizer to a grey\-box calibration problem, where the code, the parameter semantics and the clinical interpretation of the targets are all made available to the model in natural language\. Three features make this approach particularly relevant in the calibration setting\. First, the LLM can ingest the full natural\-language description of a problem, including the meaning of each parameter, the targets, and the constraints, and use this information to reason about which residuals matter most, in a way analogous to an experienced human modeller\. Second, the analyst\-facing interface remains compact: constraints, target adjustments, and reparameterisations are all changes to the prompt rather than to the surrogate or acquisition code\. Third, the method is auditable: because the LLM states a written rationale for each proposed parameter vector, the calibration produces a human\-readable trace of why the search moved as it did\. This contrasts with the opaque numeric internals of classical methods, whose individual steps are not easily explained in domain terms\. An analyst can inspect the trace to check that the search respected the clinical reasoning behind the targets and constraints, to detect when the optimizer has latched onto an implausible region, and to document and defend the modelling choices to collaborators or reviewers\. This traceability is particularly valuable in the regulated health\-technology\-assessment context in which CEA models are submitted, where modelling decisions must be transparent and justifiable\.

This paper introduces and evaluates an agentic calibration method built on these ideas, and compares it on a 10\-dimensional anal cancer model against Nelder–Mead as a classical baseline and BAxUS as a representative state\-of\-the\-art BO method\. Our contribution is fourfold\. First, we describe an LLM\-driven iteration loop with an explicit, auditable protocol suitable for regulated CEA workflows, in which every iteration records both the proposed parameter vector and a written rationale\. Second, we introduce a constrained variant that requires no additional surrogate, only a textual description of the constraints\. Third, we report head\-to\-head benchmarks on a 10\-dimensional anal cancer model under both unconstrained and constrained calibration\. Finally, we directly discuss the trade\-offs introduced by the LLM in the loop, including inference cost, reproducibility, and the absence of formal convergence guarantees\.

## 2Background

This section reviews the main components relevant to our setting: cost\-effectiveness analysis as the application domain, Bayesian Optimization and its high\-dimensional and constrained variants as the standard approach to calibration, and recent work on large language models as potential in\-context optimizers\.

### 2\.1Cost\-effectiveness analysis

CEA compares competing health interventions by weighing incremental costs against incremental health benefits, typically summarised as the incremental cost\-effectiveness ratio \(ICER\), the additional cost per unit of health gained such as a quality\-adjusted life year \(QALY\)\[[14](https://arxiv.org/html/2607.18308#bib.bib14);[15](https://arxiv.org/html/2607.18308#bib.bib15)\]\. When the relevant clinical events unfold over long horizons or cannot be directly observed in trials, these quantities are estimated with simulation models, most commonly state\-transition Markov cohort models or microsimulations, that project disease progression, costs, and outcomes under each strategy\[[16](https://arxiv.org/html/2607.18308#bib.bib16);[17](https://arxiv.org/html/2607.18308#bib.bib17)\]\.

The parameters governing these models, for instance transition probabilities between health states, are often not directly measured but are taken from the scientific literature or elicited from expert sources, each of which carries its own intrinsic uncertainty\. Because these initial estimates rarely reproduce observed real\-world outcomes, the model must be calibrated: the free parameters are tuned until the model’s outputs match a set of observed targets, such as prevalence or mortality by age group\[[1](https://arxiv.org/html/2607.18308#bib.bib1);[2](https://arxiv.org/html/2607.18308#bib.bib2)\]\. Because each candidate parameter vector requires a full run of the simulation, and clinical knowledge restricts plausible parameter combinations, calibration is naturally cast as an expensive, constrained optimization problem\.

### 2\.2Bayesian Optimization

Bayesian Optimization\[[3](https://arxiv.org/html/2607.18308#bib.bib3);[4](https://arxiv.org/html/2607.18308#bib.bib4)\]is the standard framework for optimizing expensive black\-box objectives, those for which each evaluation is costly and no gradient information is available\. Rather than searching the parameter space directly, it maintains a probabilistic surrogatep​\(f∣𝒟\)p\(f\\mid\\mathcal\{D\}\)of the unknown objective,ff, given the evidence gathered so far,𝒟\\mathcal\{D\}\. The surrogate is often a Gaussian Process \(GP\), which returns at each candidate point both a predicted mean and a calibrated uncertainty\. This uncertainty estimate lets the loop decide where to sample next\. At each step the method selects the queryxt\+1=arg⁡maxx⁡α​\(x;𝒟\)x\_\{t\+1\}=\\arg\\max\_\{x\}\\alpha\(x;\\mathcal\{D\}\), whereα\\alphais an acquisition function such as Expected Improvement \(EI\) or Upper Confidence Bound \(UCB\)\[[3](https://arxiv.org/html/2607.18308#bib.bib3)\]\. The acquisition encodes an explicit exploration–exploitation trade\-off: high mean improvement and high posterior uncertainty both increase the score, so the loop balances refining the current best region against probing regions it has not yet explored\. The selected point is then evaluated, the surrogate is updated, and the cycle repeats until the evaluation budget is exhausted\. This sample efficiency is what makes BO attractive when each evaluation is computationally expensive\.

### 2\.3High\-dimensional BO and BAxUS

Standard BO degrades sharply as the dimension grows, because the posterior uncertainty becomes nearly uniform across the search space and the acquisition surface becomes dominated by boundary effects\[[18](https://arxiv.org/html/2607.18308#bib.bib18)\]\. Several scalable variants address this issue\. In the CEA calibration context, BO with additive kernels has been used for stepwise calibration of simulation models, exploiting structure in how parameter subsets affect the simulated outputs\[[19](https://arxiv.org/html/2607.18308#bib.bib19)\]\. SAASBO places a sparse axis\-aligned prior over the active dimensions\[[7](https://arxiv.org/html/2607.18308#bib.bib7)\]\. A separate line of work uses local trust regions: TuRBO restricts the search to trust regions whose size is modulated by the GP’s local lengthscales\[[21](https://arxiv.org/html/2607.18308#bib.bib21)\], and BAxUS\[[5](https://arxiv.org/html/2607.18308#bib.bib5)\]extends this idea by adaptively embedding the search into nested random subspaces, whose dimensionality is increased only when there is evidence that the current embedding has been exhausted\.

### 2\.4Constrained BO

In the constrained setting, the standard approach is the Probability of Feasibility \(PoF\) framework of\[[8](https://arxiv.org/html/2607.18308#bib.bib8)\]: each constraintci​\(x\)≤0c\_\{i\}\(x\)\\leq 0is modelled by its own GP, and the ordinary acquisitionα​\(x\)\\alpha\(x\)is multiplied by the surrogate’s estimated probability that every constraint holds atxx,

αc​\(x\)=α​\(x\)⋅∏iΦ​\(−μi​\(x\)σi​\(x\)\)⏟Pr⁡\[ci​\(x\)≤0\]\.\\alpha\_\{\\text\{c\}\}\(x\)=\\alpha\(x\)\\cdot\\prod\_\{i\}\\underbrace\{\\Phi\\\!\\left\(\\frac\{\-\\mu\_\{i\}\(x\)\}\{\\sigma\_\{i\}\(x\)\}\\right\)\}\_\{\\Pr\[\\,c\_\{i\}\(x\)\\,\\leq\\,0\\,\]\}\.\(1\)Hereμi​\(x\)\\mu\_\{i\}\(x\)andσi​\(x\)\\sigma\_\{i\}\(x\)are the posterior mean and standard deviation of theii\-th constraint GP atxx, andΦ\\Phiis the standard normal CDF, so each factor is the probability that constraintiiis satisfied\. This product shrinks the acquisition of likely\-infeasible points toward zero\. This formulation is principled but introduces additional machinery: one extra GP per constraint, an additional evaluation of each constraint function on every queried point, and careful optimization of the joint acquisition function\. The approach scales poorly as the number of constraints grows and the dimension increases, since each additional GP suffers from the same lengthscale estimation and conditioning issues that motivate high\-dimensional BO in the first place; specialised constrained variants such as SCBO\[[22](https://arxiv.org/html/2607.18308#bib.bib22)\]have been proposed to address these limitations\. Despite these developments, Bayesian Optimization still requires increasingly complex modelling machinery in such settings, motivating the exploration of alternative approaches\.

### 2\.5Large language models

Large language models \(LLMs\) are the result of decades of progress in statistical and computational approaches to language\. Earlynn\-gram models gave way in the 2000s to language models that learned distributed word representations, and the introduction of the Transformer architecture in 2017\[[23](https://arxiv.org/html/2607.18308#bib.bib23)\]removed the sequential bottleneck of recurrent networks and enabled training at unprecedented scale\. Successive generations of pretrained models, such as BERT for encoder\-style understanding and the GPT family for generative modelling, demonstrated that a single architecture, trained on broad text corpora with a self\-supervised objective, could be adapted to a wide range of tasks\. The release of GPT\-3\[[24](https://arxiv.org/html/2607.18308#bib.bib24)\]marked a turning point by showing that, beyond a certain scale, models acquire the ability to perform new tasks from a handful of natural\-language examples in the prompt, with no parameter updates\. This in\-context learning behaviour reframed LLMs as general\-purpose programmable components rather than as fixed text generators\.

The impact on artificial intelligence has been substantial\. The combination of instruction tuning and reinforcement learning from human feedback produced assistants that reliably follow structured prompts and complex instructions, and consumer\-facing systems such as ChatGPT brought conversational AI into mainstream use within months of their release\. More recent models devote part of their decoding budget to explicit “reasoning” tokens before producing a final answer, materially improving performance on tasks that require multi\-step arithmetic, planning or quantitative comparison\. Beyond natural\-language tasks, LLMs and their multimodal extensions are now routinely applied across science and engineering: in software development, where they assist with code generation, review and debugging; in the life sciences, where they support literature synthesis, protein design and molecular property prediction; in chemistry and materials, where agentic systems plan and prioritise experiments\[[12](https://arxiv.org/html/2607.18308#bib.bib12)\]; and in clinical and biomedical informatics, where they are used for clinical decision support, medical question answering and structured extraction from electronic health records\. The breadth of these applications motivates the question taken up in this paper: whether the same class of models can serve as a competitive optimizer inside a quantitative scientific workflow such as CEA model calibration\.

### 2\.6LLMs as optimizers

The ability of large language models to perform tasks specified through a small number of natural\-language examples\[[24](https://arxiv.org/html/2607.18308#bib.bib24)\]has motivated their use as in\-context optimizers, where they propose candidate solutions from a textual specification and feedback about previous trials\[[9](https://arxiv.org/html/2607.18308#bib.bib9);[10](https://arxiv.org/html/2607.18308#bib.bib10)\]\. This behaviour rests on in\-context learning, which has been characterised as a form of implicit Bayesian inference: by conditioning on the examples in its prompt, a pretrained Transformer effectively infers a latent task and predicts accordingly\[[25](https://arxiv.org/html/2607.18308#bib.bib25)\]\. When the inferred task is optimization, the in\-context history of trials plays the role of conditioning data, while the next\-token distribution acts as the acquisition policy\. From this perspective, an LLM can be viewed as a soft acquisition function: a single in\-context pass implicitly weighs prior evidence and proposes a next point that trades exploration against exploitation\.

When an LLM is embedded in a loop of this kind, where it repeatedly observes feedback, reasons about it, and acts to pursue a goal, it is usually referred to as an agent, and the resulting system as agentic\. In contrast to a single question\-and\-answer exchange, an agent operates over multiple steps, maintains a running context of what it has tried and observed, and chooses each action in light of the outcomes of its previous ones\. In the calibration setting, the goal is to minimise the calibration error, the observations are the simulated outputs and residuals returned after each guess, and the actions are the parameter vectors the model proposes\.

## 3Methods

### 3\.1The agentic calibration method

#### 3\.1\.1Overview of the agentic calibration loop

The central idea of the agentic method is to cast calibration as a task that an LLM can perform by reasoning, much as a human modeller would, rather than as a purely numerical search\. A skilled modeller tuning a model by hand does not treat it as a black box: they inspect the current residuals, draw on their understanding of what each parameter means and how it influences the outputs, and adjust their next guess accordingly\. The agentic method reproduces this workflow by placing an LLM in the role of the optimizer and giving it the same contextual information a modeller would rely on, while a harness, a small code layer that manages the calibration loop, handles the simulation runs and keeps a record of the trajectory\.

Concretely, the LLM is provided with the same information an experienced human modeller would consult during a calibration session: a description of the model, the list of free parameters with their bounds and their clinical meaning, the calibration targets, the history of attempted guesses with their simulated outputs and the corresponding errors, and, where applicable, the constraints\. Table[1](https://arxiv.org/html/2607.18308#S3.T1)describes, for each of these information items, the kind of information it represents and where it comes from, using the anal cancer model of our experiments as a running example; Appendix A provides further details on these items, including the model description, the system prompt through which they are conveyed to the LLM, and worked iteration logs\. At every iteration, the LLM returns a new parameter vector together with a short written rationale\. The simulation is then run by the calibration harness that mediates every model evaluation; the resulting outputs and residuals are appended to the history that is shown to the LLM on the next iteration\. The loop terminates when the iteration budget is exhausted, returning the best feasible point observed during the run as the calibrated solution\.

Table 1:Information supplied to the LLM during the calibration loop\. For each item we describe the kind of information it represents and where it comes from, illustrated with the 10\-dimensional anal cancer model used in our experiments\. The history block is rebuilt every iteration from all evaluations observed so far, and the constraints row applies only to the constrained calibration setting\.Beyond the mechanics of the loop, the agentic method differs from classical and BO\-based optimizers in what it can use as input: rather than scalar feedback alone, the LLM ingests natural\-language descriptions of the model, the parameters and the calibration targets\. The effective “prior” over good parameter vectors at each iteration combines the parameter semantic metadata included in the system prompt, a summary of the simulation model source code produced once before calibration begins and described in section[3\.1\.3](https://arxiv.org/html/2607.18308#S3.SS1.SSS3), and the model’s own pretrained knowledge of epidemiology and numerical optimization\.

The architecture is illustrated in Figure[1](https://arxiv.org/html/2607.18308#S3.F1)\.

![Refer to caption](https://arxiv.org/html/2607.18308v1/x1.png)Figure 1:Agentic calibration loop\. The harness drives the simulation model and the LLM through a fixed protocol\. The LLM never invokes simulation calls directly; the harness mediates every evaluation, enforcing parameter bounds and recording the full trajectory\.
#### 3\.1\.2The interaction protocol

The LLM is required to produce outputs in a structured format with two blocks: \(i\) a brief reasoning section, in which the model describes what the previous residuals indicate and why the next guess is expected to improve the fit; and \(ii\) a guess section, in which the model returns the next parameter vector in a machine\-readable form\. Two design choices are relevant to the behaviour of the loop\.

The first is that evaluations are mediated by the harness: the LLM does not call the simulation model itself\. The harness parses the proposed guess, executes the simulation and supplies the resulting outputs on the next iteration\. This separation keeps every model evaluation observable, replayable, and auditable by a non\-technical CEA reviewer, and it ensures that the cost of each iteration is predictable\.

The second is that the feedback is structured by group\. At every iteration, the LLM receives not only the scalar calibration error but also a breakdown of residuals by clinically relevant stratum, such as age group, including signed biases and both absolute and relative deviations\. This is the structured analogue of presenting a human modeller with a calibration\-target plot annotated by stratum\. In practice, the LLM uses these signals to localise which groups are being missed and to make targeted parameter adjustments, rather than treating the objective as an opaque scalar\.

#### 3\.1\.3Code summarisation

Because the simulation model is a grey\-box, its source code is made available to the LLM in addition to the parameter and target descriptions\. As a pre\-calibration step, the model source files are concatenated, up to a configurable size limit and with non\-model directories excluded, and submitted in a single call to an LLM, which is asked to produce a short summary describing how each free calibration parameter is expected to affect the simulated outputs\. This summary is appended as a dedicated section of the system prompt used by every subsequent iteration\. The summarisation step is performed once per calibration run and adds a fixed, one\-off inference cost\. This step provides the LLM with structural information about the model, derived from the source code, that would otherwise be unavailable to black\-box optimizers\. In deployments where the model source cannot be exposed to an LLM, for example due to data\-protection or intellectual\-property considerations, the summarisation step can simply be omitted, and the calibration proceeds using only the parameter description and the per\-iteration log of evaluations\.

#### 3\.1\.4Constraint handling

Adding constraints to the agentic method requires only extending the calibration specification with a textual description of the constraints, expressed in any form a domain expert would use: “p50≤p40≤…p\_\{50\}\\leq p\_\{40\}\\leq\\dots”, “no two adjacent transitions may differ by more than a factor of two”, “the cumulative incidence in\[40,60\]\[40,60\]must not exceedXX”, and so on\. This description is appended to the system prompt as a dedicated Constraints section, with an explicit instruction that any guess violating the constraints is to be considered invalid, even if it would lower the error\. Consequently, no additional surrogate is fitted, no constraint\-aware acquisition function is constructed, and constraints can be modified at any time by editing the textual description, with no changes to the optimizer required\. This allows constraints to be expressed at the level of domain reasoning rather than as numerical functions required by standard optimizers\.

Compared with the PoF framework, in which the modeller must expose numeric constraint functions and the optimizer must fit an additional GP per constraint, a combination that becomes problematic as the number of constraints or the input dimension grows\[[22](https://arxiv.org/html/2607.18308#bib.bib22)\], the agentic constraint mechanism reduces the modeller’s effort to a short textual description\.

#### 3\.1\.5Robustness to hallucinations

A common concern when using LLMs in scientific workflows is the possibility of spurious or ungrounded outputs \(“hallucinations”\) that are plausible in form but not grounded in the underlying problem\. Two characteristics of the present design mitigate this risk in the calibration setting\.

The first is accountability through an explainable log\. Each iteration records the parameter guess together with its written rationale, the resulting simulated outputs and per\-stratum residuals, and the corresponding update to the best\-so\-far value\. The trajectory is therefore fully auditable a posteriori, and any proposal whose rationale is inconsistent with the residual pattern or with the clinical constraints can be identified by the analyst or by an external reviewer\. When a calibration run fails to converge to an acceptable error level, the same log enables a post\-mortem analysis: the iteration\-by\-iteration reasoning reveals whether the agent was misinterpreting the residual pattern, struggling to satisfy a particular constraint, or oscillating between competing regions of the parameter space, providing actionable guidance for prompt refinements\.

The second is the limited agency granted to the LLM\. It does not execute the simulation, manipulate the constraint set, or modify the calibration code\. Every parameter vector is evaluated by the harness and checked for feasibility before being incorporated into the trajectory\. Consequently, a hallucinated proposal at most yields a sub\-optimal evaluation in a single iteration; it cannot compromise the integrity of the calibration loop nor produce a result that violates the declared constraints\.

### 3\.2Experimental setup

#### 3\.2\.1Model and calibration settings

We consider a 10\-dimensional Markov model of anal cancer natural history\. The calibration parameters consist of ten transition probabilities stratified by age group, corresponding to the annual probability of regression of high\-grade squamous intraepithelial lesions \(HSIL\)\. Lower regression probabilities imply a longer time spent in pre\-cancerous states and therefore higher simulated cancer incidence\. As a result, the qualitative direction in which each parameter should move given an observed residual is often intuitive for a domain expert\. Two settings are evaluated\. In the unconstrained calibration, the ten parameters are allowed to vary within their natural ranges, with no clinical plausibility constraints enforced\. In the constrained calibration, the same parameters are subject to a clinical monotonicity constraint, namely that HSIL regression probability follow a non\-increasing trend across age groups\. A full description of the model, including its health states, transition structure, semestral cycle, calibration target and role in the cost\-effectiveness analysis, is provided in Appendix A\.

#### 3\.2\.2Compared methods

We compare three optimizers\. The first is NM, the classical derivative\-free simplex method\[[6](https://arxiv.org/html/2607.18308#bib.bib6)\], included as a widely used and easily deployed baseline; in the constrained calibration, infeasible points are penalised by returning\+∞\+\\infty\. We restrict the classical baseline to NM because, in earlier experiments comparing several derivative\-free optimizers on this class of calibration problems, it proved the most sample\-efficient classical method, clearly outperforming alternatives such as simulated annealing and particle swarm optimization\[[20](https://arxiv.org/html/2607.18308#bib.bib20)\]\.

The second is BAxUS, a high\-dimensional BO method that adaptively embeds the search in nested random subspaces\. As a surrogate we use a GP with an Automatic Relevance Determination \(ARD\) kernel and a Gamma prior on the lengthscales, which discourages degenerate near\-zero or very large lengthscales, improving numerical stability when data are scarce\. For the constrained calibration, we enforce feasibility by wrapping BAxUS in the PoF framework\.

The agentic method follows the protocol described in section[3\.1](https://arxiv.org/html/2607.18308#S3.SS1), with the system prompt built from the calibration specification\. The optimizer is a locally hosted reasoning LLM, namely Qwen3\.6 27B\[[26](https://arxiv.org/html/2607.18308#bib.bib26)\], used with 4\-bit quantisation and a context length of 128k tokens\. It is configured with a per\-iteration reasoning budget of 2,048 tokens and a preset sampling temperature of 0\.05\. The code summarisation step \(section[3\.1\.3](https://arxiv.org/html/2607.18308#S3.SS1.SSS3)\) is performed once at initialisation using the same backend\.

#### 3\.2\.3Inference hardware

All agentic experiments were executed on a local workstation equipped with two NVIDIA RTX 4000 GPUs, with 20 GB of VRAM each\. Because inference is performed on local hardware, no per\-token charges are incurred\. As a reference for deployments that would rely on a frontier\-model API, a rough estimate based on the prompt and reasoning token counts produced by this setup places the equivalent cost at approximately0\.100\.10€ per iteration using Claude’s Opus 4\.7, or about1\.601\.60€ per calibration run\. A typical CEA project requires a moderate number of calibration runs, so both options remain compatible with standard budgets\.

#### 3\.2\.4Evaluation budgets

To reflect the very different per\-iteration costs of the methods, the following evaluation budgets are used\. NM uses the standard convergence criterion of the simplex method, which in practice consumes from a few hundred to several thousand model evaluations\. BAxUS is given 10 initial random samples and 100 BO iterations, for a total of 110 model evaluations\. The agentic method uses one initial\-guess evaluation and 15 LLM iterations, for a total of 16 model evaluations\.

Each method is run ten times under both calibration settings, varying the random seed across runs\. We report the median, mean, and standard deviation of the best feasible error attained\.

## 4Results

Across both calibration settings, the agentic method reduces the calibration error by two to three orders of magnitude compared to Nelder–Mead\. Compared to BAxUS, it achieves comparable or better solution quality while using roughly one\-seventh as many model evaluations\. Table[2](https://arxiv.org/html/2607.18308#S4.T2)reports the best feasible error reached by each method, together with the evaluation count and wall\-clock time, aggregated over the ten runs under both calibration settings on the 10\-dimensional anal cancer model\. We report calibration accuracy first, then a qualitative inspection of the calibrated solutions, the computational performance in wall\-clock time, and finally the monetary cost\.

Table 2:Best feasible error, evaluation count and wall\-clock time on the 10\-dimensional anal cancer model\. The median, mean and standard deviation of the error, together with wall\-clock times, are reported across ten runs\. For BAxUS and the agentic method the evaluation count is fixed by the budget, while for NM, whose simplex terminates by its own convergence criterion, the mean number of evaluations is reported\.![Refer to caption](https://arxiv.org/html/2607.18308v1/x2.png)Figure 2:Per\-method comparison on the 10D anal cancer model, for the NM, BAxUS and agentic methods\. Columns: unconstrained \(left\) and constrained \(right\) calibration\. The solid black line in the middle row is the observed calibration target\. In the bottom row, the shaded area corresponds to the inter\-quartile range \(IQR\) of ten calibrations\.Figure[2](https://arxiv.org/html/2607.18308#S4.F2)summarises the comparison across the three methods in three rows\. The top row presents each method’s best\-found parameter vector, namely the calibrated annual HSIL regression probabilities across the age strata\. The middle row shows the corresponding model output obtained with those probabilities: the simulated anal cancer incidence \(coloured lines\) against the observed calibration target \(dashed black line\)\. The bottom row shows the overall error of the curves above, as the best\-so\-far calibration error per iteration across ten runs\. Note how, under unconstrained calibration, the calibrated probabilities are not coherent and oscillate across adjacent age strata \(top\-left panel\), even though the resulting model output still fits the target closely; the constrained scheme removes this oscillation by enforcing the clinical plausibility constraint\.

### 4\.1Calibration accuracy

Under unconstrained calibration, the agentic method reaches a median best error approximately27×27\\timeslower than BAxUS and nearly three orders of magnitude lower than NM, despite using about one\-seventh of the evaluations of BAxUS and a small fraction of those of NM\. The per\-iteration convergence behaviour is shown in the left column of the bottom row of Figure[2](https://arxiv.org/html/2607.18308#S4.F2)\.

Under constrained calibration, the agentic method is within the same order of magnitude as BAxUS, and both clearly outperform NM, which does not reach the10−710^\{\-7\}level despite consuming on the order of10410^\{4\}evaluations \(Figure[2](https://arxiv.org/html/2607.18308#S4.F2), bottom row, right column\)\. Notably, the agentic method achieves this performance using only a textual description of the constraints, without any additional constraint\-handling machinery\. This difference in modeller\-facing complexity is not reflected in wall\-clock time, but becomes evident when specifying constraints, which requires substantially more engineering effort in BO\-based methods, despite the substantially smaller evaluation budget of the agentic method\. The agentic standard deviation is somewhat larger than in the unconstrained case in absolute terms, but all ten runs converge within a factor of two of the BAxUS median, indicating that the constrained variant remains robust\. This increased variance likely reflects the tighter feasible region induced by the constraints, which reduces the margin for corrective adjustments\.

### 4\.2Computational performance

Most of the wall\-clock time of the agentic method is spent on LLM inference rather than on simulation calls\. On our infrastructure, a full agentic run takes roughly 4–7×\\timesas long as a BAxUS run on the same problem\.

Under constrained calibration the picture changes for the classical baseline method as well\. Because NM has no native constraint\-handling mechanism and must reject every infeasible candidate it proposes, its evaluation count rises from486486in the unconstrained setting to21,91721\{,\}917when constraints are enforced, a roughly45×45\\timesincrease\. Almost all of these additional evaluations are spent on infeasible candidates that are discarded, which is why NM ends up slower than BAxUS despite the latter’s surrogate\-model overhead\. The agentic method is also slower than BAxUS in this setting, for the same inference\-bound reason as in the unconstrained case\. This highlights that the overall performance depends on the relative cost of simulation and inference\.

## 5Discussion

The agentic method is particularly well suited to several recurring situations in CEA calibration\. A first situation is that of very small evaluation budgets: a single simulation can take minutes, in which case even 100 evaluations may be impractical, and the structured per\-group residual feedback used by the agentic method enabled convergence in approximately fifteen iterations on the 10\-dimensional anal cancer model considered\.

A second situation is that of grey\-box problems with interpretable parameters\. Where the parameters and targets carry a clinical interpretation, an experienced modeller can reason qualitatively about which parameter adjustment a given residual pattern requires; for instance, increasing the annual HSIL regression probability reduces simulated cancer incidence in the affected age group\. The agentic method can leverage the same intuition by ingesting the natural\-language description of the model and parameters, whereas derivative\-free and BO\-based optimizers must rediscover these relationships from evaluations alone\.

A third situation involves frequently changing constraints: calibration is often iterative for the analyst, with new plausibility constraints added as the team learns more about the model’s behaviour, and updating a textual description is far less costly than re\-engineering an optimizer\. A further practically important comparison, not captured by standard performance metrics, concerns the modeller\-facing effort required to add a new clinical constraint\. Table[3](https://arxiv.org/html/2607.18308#S5.T3)summarises the changes each method requires; an extended version that details how the specific constraint used in our experiment is encoded under each method is given in Appendix B\.

A fourth situation arises when an auditable rationale is required\. As discussed in section[3\.1\.5](https://arxiv.org/html/2607.18308#S3.SS1.SSS5), each iteration produces a written justification of the proposed parameter update, which can be retained as an artefact for regulatory dossiers and peer review and used for post\-mortem analysis when a run fails to converge\. Classical and BO\-based optimizers do not produce a directly comparable explanation of their proposals\.

Table 3:Modeller\-facing changes required to add a new clinical constraint, by method\.The agentic method also involves a few practical considerations worth keeping in mind\. The first is inference cost, which amounts to a trade\-off between money and time\. LLM inference dominates the time per iteration, and on our hardware the loop is about 4–7×\\timesslower than BAxUS\. The size of this gap depends on the computing resources available: more capable GPUs, or a hosted API such as Claude or GPT, make inference faster and can bring the loop level with or ahead of BAxUS, at a higher monetary cost\. Once inference is fast enough, the per\-iteration time is instead dominated by the simulation model itself, which is the common regime in practice, especially when each simulation takes minutes to run\. Either way the method is scalable, and, as discussed in section[3\.2\.3](https://arxiv.org/html/2607.18308#S3.SS2.SSS3), the total monetary cost stays modest for both local and API deployments at the scale of a typical CEA project\.

A second consideration is more theoretical than practical: the absence of formal convergence guarantees\. NM and BO both offer at least partial theoretical guarantees of progress under standard assumptions, whereas the agentic method’s behaviour depends on the model, the prompt, and the decoding parameters\. In practice, however, the methodology proposed here is precisely what guides the LLM towards convergence: the structured calibration history, the explicit objective, and the iterative feedback loop steer the model’s choices in a consistent direction\. Accordingly, in our experiments performance was consistent, with only somewhat higher variance under constraints, and this variance can plausibly be reduced further through modest prompt refinement or a larger per\-iteration reasoning budget\.

A third point to keep in mind when implementing the method concerns reproducibility\. An NM or BO run with a fixed random seed is exactly reproducible on the same machine\. An LLM\-driven loop is reproducible only insofar as the inference backend provides deterministic sampling and keeps the model weights fixed\. The local\-backend results reported here reproduce across runs under the same configuration; an API deployment would additionally require the provider to pin the model version to offer comparable guarantees\.

A fourth consideration is that the effectiveness of the method depends on the LLM possessing the domain knowledge required to reason about the model and its parameters, since part of the available knowledge at each iteration is the model’s own pretrained understanding of the application domain \(section[3\.1](https://arxiv.org/html/2607.18308#S3.SS1)\)\. The anal cancer model used here involves parameters and targets whose qualitative behaviour is well represented in the general epidemiological and clinical literature on which the LLM was pretrained\. More complex or specialised domains, where the relevant relationships are rare, proprietary, or absent from public training corpora, may exceed the model’s pretrained knowledge\. In such cases, fine\-tuning the LLM on domain\-specific material, so that it acquires the knowledge needed for the agentic calibration to be effective, may be necessary\.

Finally, from a conceptual perspective, the agentic method can be related to Bayesian Optimization and naturally suggests a range of possible extensions\. The agentic method can be viewed as a BO loop in which the surrogate is the LLM’s representation of the calibration history and the acquisition function is the LLM’s implicit rule for choosing the next point\. The analogy is informal, as there is no closed\-form posterior, no explicit balance parameter, and no convergence guarantee, but it is useful\. Exploitation is driven by the running best value, the per\-group residual signs, and prompt instructions that favour refinement once a promising region is found\. Exploration arises both implicitly, from the model’s sampling temperature, and explicitly, from the instruction to take larger steps in early iterations\. Constraints are handled in the prompt, with the LLM asked to justify that a guess is feasible before proposing it\.

The closest framing in the BO literature is the recent line of work on LLM\-guided acquisition selection\[[10](https://arxiv.org/html/2607.18308#bib.bib10);[13](https://arxiv.org/html/2607.18308#bib.bib13)\], in which the LLM chooses which acquisition function to use at each step within an otherwise standard, black\-box BO loop\. Our setting differs in two ways: the LLM plays the role of the acquisition function rather than choosing among predefined ones, and the problem is treated as grey\-box rather than black\-box, allowing the LLM to incorporate the textual description of the simulation model and the clinical meaning of the parameters into its proposals\.

These observations suggest a continuum of designs in which the agentic method is the limit case where the surrogate is entirely implicit\. Intermediate designs constitute natural extensions of this work, for example: \(i\) a small GP surrogate fitted in parallel and used to validate the LLM’s proposals before evaluation; \(ii\) the LLM selecting among a fixed set of acquisition functions at each step, in the spirit of\[[13](https://arxiv.org/html/2607.18308#bib.bib13)\]; or \(iii\) the LLM generating candidates inside a trust region defined by a TuRBO\-style state\[[21](https://arxiv.org/html/2607.18308#bib.bib21)\]to bound exploration explicitly\. We consider these promising directions for follow\-up work\.

## 6Conclusions

We presented an agentic calibration method for simulation models in cost\-effectiveness analysis\. The method drives an LLM through a structured iteration loop in which the model proposes parameter vectors and a calibration harness mediates every simulation call\. On a 10\-dimensional anal cancer model, the agentic method achieved comparable or better solution quality than BAxUS under both unconstrained and constrained calibration, while requiring fewer model evaluations, indicating improved sample efficiency\. Constraint handling is achieved through a simple textual description, avoiding the additional modelling machinery required by BO\-based approaches\. By treating calibration as a grey\-box problem, the method leverages the natural\-language description of the model and parameters, an information source that classical and BO\-based optimizers cannot directly exploit\. The main trade\-off introduced by this approach lies in runtime: LLM inference increases the per\-iteration cost, and the method is slower than BAxUS under the experimental setup considered\. However, the reduced number of model evaluations makes the approach particularly suitable when simulation time is the dominant computational cost, a common situation in cost\-effectiveness modelling\. A complementary limitation is the absence of formal convergence guarantees, in contrast to classical and BO\-based methods\. Beyond performance, the method produces a human\-readable and auditable optimization trace, which can facilitate model validation, communication, and regulatory review in health technology assessment settings\. Taken together, the agentic method provides a practical and flexible alternative for model calibration, particularly in settings with limited evaluation budgets and evolving clinical constraints\.

## Competing interests

The authors declare that they have no competing interests\.

## References

- \[1\]Stout NK, Knudsen AB, Kong CY, McMahon PM, Gazelle GS\. Calibration methods used in cancer simulation models and suggested reporting guidelines\.Pharmacoeconomics\. 2009;27:533–545\.
- \[2\]Vanni T, Karnon J, Madan J, White RG, Edmunds WJ, Foss AM, Legood R\. Calibrating models in economic evaluation: a seven\-step approach\.Pharmacoeconomics\. 2011;29\(1\):35–49\.
- \[3\]Shahriari B, Swersky K, Wang Z, Adams RP, de Freitas N\. Taking the human out of the loop: a review of Bayesian optimization\.Proceedings of the IEEE\. 2016;104\(1\):148–175\.
- \[4\]Garnett R\.Bayesian Optimization\. Cambridge University Press; 2023\.
- \[5\]Papenmeier L, Nardi L, Poloczek M\. Increasing the scope as you learn: adaptive Bayesian optimization in nested subspaces \(BAxUS\)\.Advances in Neural Information Processing Systems\. 2022;35\.
- \[6\]Nelder JA, Mead R\. A simplex method for function minimization\.The Computer Journal\. 1965;7\(4\):308–313\.
- \[7\]Eriksson D, Jankowiak M\. High\-dimensional Bayesian optimization with sparse axis\-aligned subspaces \(SAASBO\)\. In:Proceedings of UAI 2021\. 2021\.
- \[8\]Gardner J, Kusner M, Xu Z, Weinberger K, Cunningham J\. Bayesian optimization with inequality constraints\. In:Proceedings of ICML 2014\. 2014:937–945\.
- \[9\]Yang C, Wang X, Lu Y, Liu H, Le QV, Zhou D, Chen X\. Large language models as optimizers\. In:Proceedings of ICLR 2024\. 2024\.
- \[10\]Liu T, Astorga N, Seedat N, van der Schaar M\. Large language models to enhance Bayesian optimization\.arXiv:2402\.03921\. 2024\.
- \[11\]Zhu Z, Tang Y, Tang X, Zhang J, Gao C, Zhang S, Xu H, Guan T\. Large language models as calibration agents in hydrological modeling: feasibility and limitations\.Geophysical Research Letters\. 2026;53\(2\)\. doi:10\.1029/2025GL120043\.
- \[12\]Ramos MC, Collison CJ, White AD\. A review of large language models and autonomous agents in chemistry\.Chemical Science\. 2025;16:2514–2572\.
- \[13\]Song X, Tian Y, Lange RT, Lee C, Tang Y, Chen Y\. Position: Leverage foundational models for black\-box optimization\. In:Proceedings of the 41st International Conference on Machine Learning \(ICML\)\. PMLR\. 2024;235:46168–46180\.
- \[14\]Drummond MF, Sculpher MJ, Claxton K, Stoddart GL, Torrance GW\. Methods for the Economic Evaluation of Health Care Programmes\. 4th ed\. Oxford University Press; 2015\.
- \[15\]Sanders GD, Neumann PJ, Basu A, et al\. Recommendations for conduct, methodological practices, and reporting of cost\-effectiveness analyses: second panel on cost\-effectiveness in health and medicine\.JAMA\. 2016;316\(10\):1093–1103\.
- \[16\]Caro JJ, Briggs AH, Siebert U, Kuntz KM\. Modeling good research practices—overview: a report of the ISPOR\-SMDM Modeling Good Research Practices Task Force\-1\.Value in Health\. 2012;15\(6\):796–803\.
- \[17\]Siebert U, Alagoz O, Bayoumi AM, et al\. State\-transition modeling: a report of the ISPOR\-SMDM Modeling Good Research Practices Task Force\-3\.Medical Decision Making\. 2012;32\(5\):690–700\.
- \[18\]Wang Z, Hutter F, Zoghi M, Matheson D, de Freitas N\. Bayesian optimization in a billion dimensions via random embeddings\.Journal of Artificial Intelligence Research\. 2016;55:361–387\.
- \[19\]Gómez\-Guillén D, Díaz M, Arcos JL, Cerquides J\. Bayesian Optimization with Additive Kernels for a Stepwise Calibration of Simulation Models for Cost\-Effectiveness Analysis\.International Journal of Computational Intelligence Systems\. 2024;17:249\.
- \[20\]Gómez\-Guillén D, Díaz M, Arcos JL, Cerquides J\. Bayesian optimization with additive kernels for the calibration of simulation models to perform cost\-effectiveness analysis\. In:Artificial Intelligence Research and Development\(Proceedings of CCIA 2023\)\. Frontiers in Artificial Intelligence and Applications\. IOS Press; 2023\.
- \[21\]Eriksson D, Pearce M, Gardner J, Turner RD, Poloczek M\. Scalable global optimization via local Bayesian optimization \(TuRBO\)\.Advances in Neural Information Processing Systems\. 2019;32\.
- \[22\]Eriksson D, Poloczek M\. Scalable constrained Bayesian optimization \(SCBO\)\. In:Proceedings of AISTATS 2021\. 2021\.
- \[23\]Vaswani A, Shazeer N, Parmar N, Uszkoreit J, Jones L, Gomez AN, Kaiser Ł, Polosukhin I\. Attention is all you need\.Advances in Neural Information Processing Systems\. 2017;30:5998–6008\.
- \[24\]Brown TB, Mann B, Ryder N, Subbiah M, Kaplan J, Dhariwal P, et al\. Language models are few\-shot learners\.Advances in Neural Information Processing Systems\. 2020;33:1877–1901\.
- \[25\]Xie SM, Raghunathan A, Liang P, Ma T\. An explanation of in\-context learning as implicit Bayesian inference\. In:International Conference on Learning Representations \(ICLR\)\. 2022\.
- \[26\]Yang A, Li A, Yang B, Zhang B, Hui B, Zheng B, et al\. Qwen3 technical report\.arXiv:2505\.09388\. 2025\.

Similar Articles

Counterfactual Graph for Multi-Agent LLM Calibration

arXiv cs.CL

This paper introduces CAGE, a counterfactual graph-based method for calibrating multi-agent LLM systems, evaluating on benchmarks like TriviaQA and MMLU-Pro across various communication topologies. The method outperforms existing post-hoc and LLM-elicited calibration approaches.

Poor Man's Agentic Modeling: Simulating Large LLM-Agent Societies on a Laptop

arXiv cs.AI

This paper proposes a method for simulating large LLM-agent societies on a laptop by fitting low-parameter surrogate models from a few hundred queries, using a statistical-physics-based taxonomy to predict when this approximation holds. The approach is validated on EconAgent and several other simulations using DeepSeek-elicited agent behaviors.