---
title: Constrained Expected Improvement in Bayesian Optimization
url: https://www.emergentmind.com/topics/constrained-expected-improvement
type: topic
---

# Constrained Expected Improvement in Bayesian Optimization

Constrained expected improvement (CEI) denotes a family of acquisition functions that extend expected improvement from unconstrained Bayesian optimization to black-box optimization with constraints. In the canonical formulation, one seeks
\[
\min_{x \in \mathcal{X}} f(x)\quad \text{s.t.}\quad c(x)\le 0,
\]
models the objective and constraint with Gaussian processes, defines the incumbent as the best feasible observation so far, and scores a candidate by the posterior expectation of feasible improvement. Under conditional independence of the objective and constraint posteriors, this yields the familiar product of objective EI and probability of feasibility; in more general settings, the same idea appears as expected hyper-volume improvement under an extended domination rule, as a chance-constrained criterion over uncertain inputs, or as a cost-gated modification of EI for cumulative-regret control [2505.11323][1510.00503][2205.04901].

## 1. Canonical CEI in constrained Bayesian optimization

The standard CEI construction begins with a constrained Bayesian optimization problem
\[
\begin{aligned}
\min_{x \in \mathcal{X}} &\quad f(x) \\
\text{s.t.} &\quad c(x) \le 0,
\end{aligned}
\]
where \(f\colon \mathbb{R}^d \to \mathbb{R}\) and \(c\colon \mathbb{R}^d \to \mathbb{R}\) are expensive black-box functions and \(\mathcal{X}\subset \mathbb{R}^d\) is compact. CEI models \(f\) and \(c\) with separate Gaussian processes,
\[
f(x)\mid \text{data}\sim \mathcal{N}(\mu_t^f(x),(\sigma_t^f(x))^2),\qquad
c(x)\mid \text{data}\sim \mathcal{N}(\mu_t^c(x),(\sigma_t^c(x))^2),
\]
and defines the best feasible incumbent by
\[
f_t=\min\{f(x_i): c(x_i)\le 0,\ i=1,\dots,t\}.
\]
The unconstrained improvement is
\[
I_t^f(x)=\max\{f_t-f(x),0\},
\]
while constrained improvement introduces the feasibility indicator
\[
A_t^c(x)=
\begin{cases}
1,& \text{if } c(x)\le 0,\\
0,& \text{otherwise,}
\end{cases}
\qquad
I_t^{\mathrm c}(x)=A_t^c(x)\max\{f_t-f(x),0\}.
\]
Under conditional independence of the objective and constraint posteriors, the CEI acquisition becomes
\[
\mathrm{EI}_t^{\mathrm c}(x)=\mathbb{E}[I_t^{\mathrm c}(x)\mid \text{data}]
= P_t(x)\,\mathrm{EI}_t^f(x),
\]
with
\[
P_t(x)=\mathbb{P}(c(x)\le 0\mid \text{data})
=\Phi\!\left(-\frac{\mu_t^c(x)}{\sigma_t^c(x)}\right).
\]
The next evaluation is chosen by
\[
x_{t+1}=\arg\max_{x\in\mathcal X} P_t(x)\,\mathrm{EI}_t^f(x).
\]
For multiple independent constraints \(c_i(x)\le 0\), the same construction yields
\[
\mathrm{EI}_t^{\mathrm c}(x)=\left(\prod_{i=1}^m P_t^{(i)}(x)\right)\mathrm{EI}_t^f(x),
\]
so CEI explicitly trades off potential objective improvement against posterior feasibility [2505.11323].

## 2. Feasibility structures: extended domination and chance constraints

A more general formulation embeds objectives and constraints into a single ordered space. In BMOO, objective values \(\yo\in\Yo=\mathbb{R}^p\) and constraint values \(\yc\in\Yc=\mathbb{R}^q\) are mapped through
\[
\psi(\yo,\yc)=
\begin{cases}
(\yo,0) & \text{if } \yc\le 0,\\
(+\infty,\max(\yc,0)) & \text{otherwise,}
\end{cases}
\]
and the extended domination rule is defined by
\[
y_1 \lhd y_2 \quad \Longleftrightarrow \quad \psi(y_1)\prec \psi(y_2),
\]
where \(\prec\) is ordinary Pareto domination. This construction ensures that feasible points always dominate infeasible points, feasible points are compared by objectives only, and infeasible points are compared by constraint violations. The corresponding expected hyper-volume improvement is
\[
\mathrm{EI}_n(x)=\int_{G_n} P_n(\xi(x)\lhd y)\,dy,
\]
with \(G_n\) the current non-dominated region in joint objective–constraint space. When at least one feasible point is available, the infeasible component vanishes and the criterion reduces, up to a multiplicative constant, to the usual constrained EI or constrained EHVI; when no feasible point is known, the criterion remains well defined and directs the search toward reduced constraint violation rather than collapsing to a degenerate rule [1510.00503].

A different generalization arises in chance-constrained optimization with uncertain inputs. Here controlled variables \(\mathbf{x}\) and uncontrolled random inputs \(\mathbf{U}\) define the problem
\[
\begin{split}
\mathbf{x}^*
= &\arg \min_{\mathbf{x}\in\mathcal{S_X}} \ \mathbb{E}[f(\mathbf{x},\mathbf{U})] \\
\text{s.t. }&
\mathbb{P}\big(g_i(\mathbf{x},\mathbf{U})\le 0,\ i=1,\dots,l\big)\ge 1-\alpha.
\end{split}
\]
The paper reformulates this as a deterministic constrained problem in the design space using
\[
z(\mathbf{x})=\mathbb{E}[f(\mathbf{x},\mathbf{U})],\qquad
c(\mathbf{x})=1-\alpha-\mathbb{E}\!\left[1_{\{g_i(\mathbf{x},\mathbf{U})\le 0,\ i=1,\dots,l\}}\right].
\]
With Gaussian-process models on the joint \((\mathbf{x},\mathbf{u})\)-space, the resulting expected feasible improvement is
\[
EFI^{(t)}(\mathbf{x}) = EI^{(t)}(\mathbf{x})\cdot \mathbb{P}(C^{(t)}(\mathbf{x})\le 0),
\]
where \(EI^{(t)}\) is EI for the GP of the mean objective \(Z^{(t)}\), and \(C^{(t)}\) is the chance-constraint surrogate. The same work then uses a Stepwise Uncertainty Reduction criterion to choose the uncontrolled input at which the expensive simulator should be queried, thereby separating selection of the design point \(\mathbf{x}\) from selection of the uncertainty realization \(\mathbf{u}\) [2103.05706].

## 3. Dependence between objective and constraints

The canonical CEI factorization
\[
\mathrm{ECI}(x)=\mathrm{EI}(x)\times \mathbb{P}(z(x)\ge c)
\]
depends on independence between the objective and constraint models. A recent extension replaces independent Gaussian processes by a bivariate Gaussian process with a shared spatial correlation function \(R(\mathbf{x},\mathbf{x}')\) and constant cross-correlation parameter \(\rho\), so that
\[
\operatorname{Cov}(y(\mathbf{x}),z(\mathbf{x}'))=\rho \sigma_y \sigma_z R(\mathbf{x},\mathbf{x}').
\]
Under this model, \((y(\mathbf{x}),z(\mathbf{x}))\mid\text{data}\) is bivariate normal, and the constrained expected improvement
\[
\mathrm{ECI}(\mathbf{x})
=
\mathbb{E}\!\left\{\max \{ 0, y_{\min} - y(\mathbf{x}) \} \, I \left( z(\mathbf{x}) \ge c \right) \right\}
\]
no longer factorizes. Instead, Proposition 1 gives the closed form
\[
\mathrm{ECI}(\mathbf{x})=\big(t_1(\mathbf{x})+t_2(\mathbf{x})\big)\,t_3(\mathbf{x}),
\]
where \(t_3(\mathbf{x})\) is the joint probability that \(y(\mathbf{x})\le y_{\min}\) and \(z(\mathbf{x})\ge c\), expressed using the bivariate normal cdf \(\Phi_2\), and \(t_1(\mathbf{x})+t_2(\mathbf{x})\) is the associated conditional expected improvement derived from truncated bivariate normal moments. In this formulation, feasibility and improvement are coupled by \(\rho\); positive or negative dependence alters both the joint event probability and the conditional magnitude of improvement.

The same paper reports a cure-process optimization case study with decision vector \(\mathbf{x}=(T_1,t_1,T_2,t_2)^\top\), deformation as objective, and degree of cure as constraint with threshold \(c=0.96\). In that application, the bivariate-GP CEI and the independent-GP CEI exhibit similar convergence, the final optima are very close, and the bivariate model is about three times more expensive computationally. The authors interpret this outcome as evidence that a separable covariance with a single global \(\rho\) may be too restrictive for that application, even though the correlated CEI is theoretically the correct expression under dependence [2506.00174].

## 4. Convergence theory and asymptotics

A central recent development is the first rigorous convergence-rate analysis of CEI. For the noise-free constrained problem with compact \(\mathcal{X}\), separate objective and constraint GPs, and at least one initial feasible sample, the simple regret
\[
r_t=f_t-f(x^*)
\]
admits explicit upper bounds in both RKHS and GP-sampling settings. Under RKHS assumptions \(f\in\mathcal H_f(\mathcal X)\), \(c\in\mathcal H_c(\mathcal X)\), bounded kernels, and bounded RKHS norms, CEI satisfies
\[
r_t=\mathcal{O}\!\big(t^{-1/2}\log^{(d+1)/2}(t)\big)
\quad \text{for squared exponential kernels},
\]
and
\[
r_t=\mathcal{O}\!\big(t^{-\nu/(2\nu+d)}\log^{2\nu/(2\nu+d)}(t)\big)
\quad \text{for Matérn kernels}.
\]
Under GP priors for \(f\) and \(c\), the same rates hold with probability at least \(1-\delta\). The proof strategy combines posterior mean error bounds, lower bounds on feasibility probability at the true optimum, and information-gain control of posterior variance decay. The same analysis extends to multiple independent constraints by replacing \(P_t(x)\) with \(\prod_{i=1}^m P_t^{(i)}(x)\); the rate in \(t\) is unchanged, while the constants absorb the feasibility-probability factors [2505.11323].

A separate RKHS-based theory for unconstrained EI provides a useful comparison point. For fixed Gaussian-process priors and noiseless observations \(z_n=f(x_n)\) on a compact domain \(X\subset\mathbb{R}^d\), EI converges on any function in the associated RKHS, with worst-case loss
\[
L_n(EI(\pi), \mathcal{H}_\theta(X),R)
=
\begin{cases}
O\big(n^{-\nu/d}(\log n)^\alpha\big), & \nu \le 1,\\[4pt]
O\big(n^{-1/d}\big), & \nu > 1.
\end{cases}
\]
An \(\varepsilon\)-greedy modification recovers essentially minimax rates for all finite \(\nu\), and standard empirical-Bayes shrinkage
\[
\hat{\sigma}_n^2=\hat{R}_n^2(\theta)/n
\]
can cause EI to miss the true minimum with positive probability, whereas the alternative
\[
\hat{\sigma}_n^2=\hat{R}_n^2(\hat{\theta}_n)
\]
recovers the fixed-prior rates in probability. The same source presents these results as informative for CEI design rather than as a direct CEI theorem. This suggests that explicit exploration and conservative uncertainty calibration may be as important for CEI as they are for EI, especially when feasibility regions are small or disconnected [1101.3501].

## 5. Acquisition optimization and numerical pathologies

The mathematical definition of CEI is often simpler than its numerical optimization. A recent analysis shows that analytic EI and its constrained, noisy, and parallel variants can vanish numerically in large regions of the search space. The difficulty increases as the number of observations, dimensionality of the search space, or number of constraints grow, because both acquisition values and gradients can underflow to zero. For classical CEI with independent outputs,
\[
\mathrm{CEI}_{y^*}(x)
=
\mathbb{E}_{\mathbf f(x)}
\left[
[f_1(x)-y^*]_+ \prod_{i=2}^M \mathbbm{1}_{f_i(x)\le 0}
\right]
\]
is commonly implemented as EI multiplied by feasibility probabilities, and the product of several small terms is especially prone to numerical collapse. LogEI and LogCEI address this by moving to log-space; in the sequential constrained case, the simplest LogCEI representation is
\[
\mathrm{LogCEI}_{y^*}(x)
=
\mathrm{LogEI}_{y^*}(x)
+
\sum_{i=2}^M \log p_i^{\mathrm{feas}}(x),
\]
so products of feasibility probabilities become sums of log-probabilities. The constrained experiments in that work show that LogCEI outperforms the naive CEI implementation and converges faster than SCBO, with gains that increase with dimensionality and the number of constraints [2310.20708].

A different strategy is to approximate and optimize the acquisition by particle methods. BMOO estimates
\[
\mathrm{EI}_n(x)=\int_{G_n}P_n(\xi(x)\lhd y)\,dy
\]
with particles approximately uniform on the non-dominated region \(G_n\), updated by a Remove–Resample–Move scheme closely analogous to subset simulation. A second SMC population is then used in the input domain to concentrate candidate points where the probability of improvement is high. This particle formulation does not remove the acquisition-optimization problem, but it replaces fragile direct quadrature and naive global search by sequential importance sampling and MCMC moves adapted to the changing geometry of the dominated region [1510.00503].

## 6. Broader interpretations and related formulations

The phrase “constrained expected improvement” is sometimes used more broadly than feasibility-constrained black-box optimization. In noisy Bayesian optimization for maximizing an unknown function under cumulative-regret evaluation, the Expected Improvement-Cost algorithm constrains EI by an evaluation-cost inequality rather than by feasibility. With incumbent
\[
\xi_n=\max_{1\le i\le n}\mu_n(x_i),
\]
the evaluation cost is
\[
L_n(x)=\frac{\mathbb{E}_n\big[(\xi_n-f(x))^+\big]}{N-n},
\]
and only points satisfying
\[
\alpha_n^{\mathrm{EI}}(x)\ge L_n(x)
\]
are eligible. If no candidate satisfies the inequality, the current best sampled point is resampled. This is a risk- or regret-gated version of EI rather than a feasibility-constrained EI, but it preserves the same “expected gain under a constraint” structure and yields a high-probability cumulative-regret bound
\[
R_N = O\big(\sqrt{N}\,\gamma_N\,(\log N)^{1/2}\big),
\]
comparable to GP-TS and within a logarithmic factor of GP-UCB [2205.04901].

A second broadening places constrained EI inside Bayesian optimization of composite functions \(f(x)=g(h(x))\). In that setting, \(h:X\to\mathbb{R}^m\) is expensive and vector-valued, \(g:\mathbb{R}^m\to\mathbb{R}\) is cheap, and the acquisition is
\[
EI\text{-}CF_n(x)=\mathbb{E}_n\!\left[\big\{g(h(x))-f_n^*\big\}^+\right].
\]
Constrained optimization is recovered by taking \(h_1(x)\) as objective, \(h_i(x)\) for \(i>1\) as constraints, and
\[
g(y)=
\begin{cases}
y_1, & \text{if } y_i\ge 0 \text{ for all } i>1,\\
-\infty, & \text{otherwise.}
\end{cases}
\]
The same source states that, when specialized in this way, \(EI\text{-}CF\) is equivalent to the constrained EI proposed by Schönlau and Gardner. Because \(g(h(x))\) is generally non-Gaussian under the posterior of \(h(x)\), the paper develops Monte Carlo evaluation and an unbiased stochastic gradient estimator for differentiable \(g\), thereby reframing CEI as one instance of EI over transformed multi-output Gaussian-process posteriors [1906.01537].

A third, non-BO usage appears in reinforcement learning. In f-divergence constrained policy improvement, the policy-update step solves
\[
\max_{\pi(\cdot\mid s)}\ \sum_a \pi(a\mid s)A^{\pi_{\mathrm{old}}}(s,a)
\quad \text{s.t.}\quad
D_f\!\big(\pi(\cdot\mid s)\,\Vert\,\pi_{\mathrm{old}}(\cdot\mid s)\big)\le \delta.
\]
The objective is the expected advantage under the new policy, and the constraint is an information-theoretic trust region. The paper explicitly interprets this as a constrained expected improvement problem: maximize expected improvement, measured by advantage, subject to a divergence constraint controlling the size and geometry of the update. Different \(f\)-divergences, and in particular the \(\alpha\)-divergence family, alter the reweighting of actions, the exploration–exploitation profile, and the compatible critic objective [1801.00056].

Across these formulations, the common structure is stable: an expected gain term is maximized under an auxiliary restriction that prevents unboundedly aggressive updates. What changes from one setting to another is the meaning of the restriction—feasibility, chance reliability, computational or regret cost, or information-theoretic distance—and the corresponding geometry of the admissible search step.

Source: https://www.emergentmind.com/topics/constrained-expected-improvement