arXiv:2610.12076cs.LGOct 2026

Manuscript Offprint

arXiv:2610.12076

Exploiting Gradients in Bayesian Inference of Expensive Simulators

Šimon Soldát, Václav Šmídl

1st1^{st} Šimon Soldát 1,2^{1,2}, 2nd2^{nd} Václav Šmídl 1^{1}

1^{1}Department of Computer Science, Faculty of Electrical Engineering, Czech Technical University in Prague, Czech Republic

2^{2}Institute of Plasma Physics of the Czech Academy of Sciences, Prague, Czech Republic

soldasim@fel.cvut.cz, smidlva1@fel.cvut.cz

Abstract—Simulators based on differential equations are ubiquitous in science and engineering. They are often used in simulation-based inference to evaluate the posterior distribution of the input parameters based on real-world observations of the simulator outputs. However, inference becomes challenging when individual simulator evaluations are computationally expensive. In such cases, a Bayesian optimization-based active learning approach with Gaussian process surrogate models has been used to maximize the information obtained from a limited simulation budget. Recently, gradients of simulator outputs with respect to input parameters have become increasingly available, yet they are rarely exploited for inference. Even though we only need to learn the simulator input-output relationship, gradient information can provide an additional valuable signal to guide the active learning procedure. This is of particular interest in the case of expensive simulators, when sample efficiency is crucial.

In this paper, we demonstrate how incorporating gradient information into the Gaussian process surrogate accelerates Bayesian optimization-based inference under a limited simulation budget. Our results show significant improvement in convergence speed from using gradient information. For reverse-mode differentiation, the inference efficiency gains are maintained when accounting for the additional computational cost. In contrast, for forward-mode differentiation, the inference speed-up does not outweigh the computational costs. These results indicate that gradient-enhanced surrogates are beneficial primarily in problems where the number of parameters exceeds the output dimensionality, where reverse-mode differentiation is efficient.

Index Terms—simulation-based inference, Bayesian inference, Bayesian optimization, Gaussian process, adjoint gradients

I. INTRODUCTION

Computer simulators are prevalent in modern science, providing a means to study complex physical systems across domains ranging from fluid dynamics [10], computational biology [11], ecology [13], epidemiology [22], etc. A common task is simulation-based inference (SBI): given observations of a real-world system, one seeks to recover the posterior distribution over the simulator's input parameters that are consistent with those observations. This arises naturally when calibrating the simulator to match observed data, or when seeking to estimate quantities of the physical system which cannot be directly measured. The parameter posterior can be directly evaluated for given parameters by running the simulator and evaluating how well the outputs correspond to the observed data under an observation likelihood model. By repeating this process, the full posterior distribution can be characterized. However, this inference task becomes challenging when the simulator is computationally expensive. In many settings of practical interest, a single forward simulation may require hours of compute [2], rendering exhaustive posterior exploration infeasible. With a limited simulation budget, one must carefully select which parameter configurations to evaluate.

Bayesian optimization (BO) offers a principled framework for this challenge. Rather than using the expensive simulator directly, one maintains a probabilistic surrogate model that approximates the simulator function. The most common choice is the Gaussian process (GP) model. The surrogate allows for a cheap posterior approximation and a principled way to guide further simulator queries through the maximization of an acquisition function, which is evaluated based on the surrogate's predictions. This approach to simulator inference has received significant attention [6], [8], [16], [19]–[21] and was recently unified by the authors under the Bayesian Optimization for Simulator Inverse Problems (BOSIP) framework [18].

To address the task of posterior characterization, the classic BO procedure must be substantially adapted. Classical BO aims to merely optimize some objective (e.g., find the parameters most consistent with the observed data), and to this end employs optimization-focused acquisition functions like the Expected Improvement. In contrast, BOSIP addresses the active learning problem of estimating the full parameter posterior distribution. This fundamentally different objective requires propagating the surrogate's predictive uncertainty through the likelihood to obtain a notion of the uncertainty in the posterior PDF estimate. The posterior uncertainty is essential for the evaluation of the specialized information-focused acquisition functions, such as Maximum Variance or Expected Integrated Variance [8] used in BOSIP. Consequently, BOSIP acquires different data than the classical BO approach. The difference between BO and BOSIP is illustrated in Figure 1, which shows iterations 5 and 10 of both approaches on a trivial toy problem with a linear simulator function, Gaussian likelihood, and a uniform parameter prior. The classical BO approach (left) seeks to maximize the log-posterior probability,

© 2026 IEEE. Š. Soldát and V. Šmídl, “Exploiting Gradients in Bayesian Inference of Expensive Simulators,” ICMLT 2026, doi:10.1109/ICMLT69916.2026.11689621

Figure

Mean Squared Error

Mean Squared Error

(a) Iter. 5

Posterior Distribution

(b) Iter. 10

Posterior Distribution

(c) Iter. 5

(d) Iter. 10

  • simulator function - true MSE

data points surrogate model

observation optimum

  • simulator function - true posterior

data points surrogate model

observation approx. posterior

Fig. 1: Comparison of BO (left) and BOSIP (right) on trivial example with uniform prior p(x)p(x), linear simulator y=xy = x, normal likelihood p(z∣y)=N(y,0.2)p(z|y) = \mathcal{N}(y, 0.2), and observation zo=0z_o = 0. The MAP solution is x^=0\hat{x} = 0 and the full Bayesian posterior is p(x∣zo)=N(0,0.2)p(x|z_o) = N(0, 0.2). The classic BO-based approach focuses data at the mode of the posterior in order to find the maximizer x^\hat{x}, while BOSIP spreads data across the high-probability regions in order to learn the shape of the posterior p(x∣zo)p(x|z_o).

which is equivalent to the mean-squared error (MSE) in this case. The surrogate model directly approximates the MSE, and the Expected Improvement acquisition concentrates data around the mode of the posterior. The BOSIP approach (right) instead models the simulator outputs, and the surrogate of the simulator is then used to compute an approximation of the full posterior distribution. The MaxVar acquisition function selects points that maximize the uncertainty in the posterior PDF estimate. Note that the uncertainty in the posterior PDF is distinct from the surrogate's uncertainty in the prediction of the simulator outputs, as it is distorted by propagating the surrogate's predictive distribution through the likelihood and multiplying by the prior. This approach spreads the data more evenly across the high-probability regions in order to identify the exact shape of the posterior.

Meanwhile, simulators based on differential equations increasingly offer access to gradients through automatic differentiation frameworks [3], [4], [7], [9], [14], [15]. Crucially, the cost of reverse-mode gradient computation only scales with the output dimensionality, providing cheap gradient information in high-dimensional parameter settings. In contrast, the cost of forward-mode differentiation scales with input dimensionality, making it suitable when the number of outputs exceeds parameter dimensionality. Despite the growing availability of simulator gradients, they remain largely untapped in the context of simulation-based inference. This represents an unrealized potential, as with expensive simulators we seek to maximize the information gathered from each simulation to remain sample-efficient. There exist well-established techniques for incorporating derivative information directly into Gaussian processes [17], [23], [24]. This yields a gradient-enhanced GP surrogate, which propagates gradient information into the predictions of the functional values themselves, improving predictive performance.

In this work, we bring gradient-enhanced GPs into Bayesian simulation-based inference. Our contributions are as follows: We describe how gradients can be incorporated into GP-based surrogate models within the BOSIP inference loop, and show that this substantially accelerates posterior convergence and improves approximation quality within a limited simulation budget. We validate our approach across seven benchmarks (including analytical toy problems and PDE-governed simulators), achieving significant and consistent performance improvements over gradient-free baselines. We show that in problems with higher parameter dimensionality than output dimensionality, reverse-mode differentiation maintains performance benefits when accounting for the additional computational cost. In contrast, in problems with high output dimensions, the inference speed-up from forward-mode differentiation does not outweigh the added computational costs. Therefore, the benefits of gradient-enhanced surrogates are primarily realized in problems with lower output dimensions, where the reverse-mode is efficient. Finally, we demonstrate that the benefits of reverse-mode gradients increase in higher-dimensional parameter spaces, representing a promising avenue for future work.

The paper is structured as follows: In section II, we define the simulator inference problem and present the BOSIP approach. In section III, we show how gradient information can be cleanly incorporated into the method. In section IV, we demonstrate the performance benefits of exploiting gradients on several benchmarks. Lastly, in section V, we discuss practical implications of our findings and limitations of the proposed approach.

References (22)