---
title: 'CPED-NCBFs: Expert Demo Neural CBFs'
url: https://www.emergentmind.com/topics/cped-ncbfs
type: topic
---

# CPED-NCBFs: Expert Demo Neural CBFs

CPED-NCBFs denotes a framework for **Conformal Prediction for Expert Demonstration-based Neural Control Barrier Functions**, in which a neural control barrier function is learned from expert demonstrations and then verified with **split conformal prediction** to obtain probabilistic safety guarantees over sampled safe, unsafe, and derivative-constrained regions [2507.15022]. The method is designed for control-affine nonlinear systems in which a barrier function \(h\) defines the safe set \(\mathcal{C} := \{x \in \mathbb{R}^n \mid h(x)\ge 0\}\), and its central technical claim is that calibration quantiles computed on held-out data can be converted into data-driven robustness margins for training and verification. Within the neural CBF literature, CPED-NCBFs occupy a specific niche: they are demonstration-driven, region-calibrated, and probabilistic rather than worst-case symbolic.

## 1. Formal setting and barrier-based safety objective

CPED-NCBFs are formulated for a control-affine nonlinear dynamical system
\[
\dot{x} = f(x) + g(x)u,
\]
with state \(x \in \mathcal{X} \subseteq \mathbb{R}^n\) and control input \(u \in \mathcal{U} \subseteq \mathbb{R}^m\), where \(f\) and \(g\) are locally Lipschitz [2507.15022]. The safe set is represented by a function \(h\), with the goal that
\[
\mathcal{C} := \{x \in \mathbb{R}^n \mid h(x)\ge 0\}
\]
is forward invariant under a suitable controller.

The framework uses the standard continuous-time CBF condition: there exists an extended class-\(\mathcal{K}\) function \(\alpha\) such that
\[
\sup_{u\in\mathcal{U}} \left\langle \nabla h(x), f(x)+g(x)u \right\rangle + \alpha(h(x)) \ge 0.
\]
To implement safety online, the method adopts the usual CBF-QP safety filter
\[
\pi_{\text{safe}}(x) = \min_{u \in \mathbb{U}} \left\|u - \pi_{\text{ref}}(x)\right\|^2
\]
subject to
\[
\mathcal{L}_{f} h(x) + \mathcal{L}_{g} h(x) u + \kappa(h(x)) \ge 0.
\]
This places CPED-NCBFs squarely within the standard barrier-certificate pipeline: a neural network parameterizes the barrier, and a minimally invasive quadratic program enforces the barrier inequality at runtime.

What distinguishes the framework is not the control law itself, but the source of supervision and the verification strategy. The neural CBF \(h_\theta(x)\) is learned from **expert demonstrations** \(\{(x_i,u_i)\}_{i=1}^{N_1}\), rather than from exhaustive state-space coverage, and the resulting verification problem is addressed with split conformal prediction rather than SMT, MIP, or interval-based worst-case reasoning [2507.15022].

## 2. Demonstration-derived domains and local propagation conditions

The learning problem is organized around three region-specific datasets: \(\mathcal{X}_s\) for safe states, \(\mathcal{X}_u\) for unsafe states, and \(\mathcal{X}_d\) for derivative-constrained states near the safety boundary [2507.15022]. Because demonstrations cover only part of the state space, the method defines a local demonstration domain by
\[
\mathcal{D}' := \bigcup_{i=1}^{N_1} \mathcal{B}_{\epsilon,p}(x_i), \qquad \mathcal{D} := \text{int}(\mathcal{D}'),
\]
where \(\mathcal{B}_{\epsilon,p}(x_i)\) is the closed \(p\)-norm ball of radius \(\epsilon\). An unsafe layer \(\mathcal{N}\) is similarly defined around the unsafe region by a width \(\sigma\), and the stated objective is to ensure \(h_\theta(x)<0\) on \(\mathcal{N}\), so that the zero level set lies inside the unsafe boundary layer.

A key structural element is a set of local Lipschitz propagation lemmas that connect sampled constraints to neighborhood-wise guarantees. For safe states, if \(h_\theta\) is Lipschitz with local constant \(L_{h_\theta}(x)\), if \(X_s\) is an \(\epsilon\)-net of \(\mathcal{D}\) with
\[
\epsilon \le \gamma_s / L_{h_\theta}(x_i) \quad \forall x_i \in X_s,
\]
and if
\[
h_\theta(x_i) \ge \gamma_s,
\]
then
\[
h_\theta(x) > 0 \quad \forall x \in \mathcal{D}.
\]
The unsafe analogue states that if \(X_u\) is an \(\bar{\epsilon}\)-net of \(\mathcal{N}\) with
\[
\bar{\epsilon} < \gamma_u / L_{h_\theta}(x_i) \quad \forall x_i \in X_u,
\]
and
\[
h_\theta(x_i) \le -\gamma_u,
\]
then
\[
h_\theta(x) < 0 \quad \forall x \in \mathcal{N}.
\]

For the derivative condition, the paper introduces a function \(q(x)\) and states that if \(q(x)\) is Lipschitz with constant \(L_q(x)\), if \(X_d\) is an \(\epsilon\)-net of \(\mathcal{D}\) with
\[
\epsilon \le \gamma_d / L_q(x_i) \quad \forall x_i \in X_d,
\]
and if
\[
\langle \nabla h_\theta(x_i), f(x_i)+g(x_i)u_i\rangle \ge -\alpha(h_\theta(x_i)) + \gamma_d
\]
for all \(x_i \in X_d\), then
\[
q(x)\ge 0 \quad \forall x \in \mathcal{D}.
\]
These lemmas supply the local geometric rationale for using region-wise robustness margins \(\gamma_s,\gamma_u,\gamma_d\): sampled separation, together with sufficient sample density and Lipschitz regularity, propagates to the surrounding domain.

## 3. Scenario optimization and split-conformal quantile calibration

The central verification problem is the choice of robustness margins. If the margins are too small, safety may fail; if they are too large, the learned safe set becomes unnecessarily conservative [2507.15022]. CPED-NCBFs formalize this through a scenario optimization problem:
\[
\mathrm{SOP}:\begin{cases}
\boldsymbol{\gamma} = [\gamma_i]_{i \in \{s,u,d\}} \\
\text{min} \quad \mathbf{1}^\top \boldsymbol{\gamma} \\
\text{s.t.} \quad q_1(x_i) \leq -\gamma_s, \quad \forall x_i \in \mathcal{X}_s, \\
\qquad\; q_2(x_i) \leq -\gamma_u, \quad \forall x_i \in \mathcal{X}_u, \\
\qquad\; q_3(x_i) \leq -\gamma_d, \quad \forall x_i \in \mathcal{X}_d, \\
\qquad\; \boldsymbol{\gamma} \in \mathbb{R}^3,
\end{cases}
\]
with
\[
q_{1}(x)= -h_{\theta}(x)\,\mathds{1}_{\mathcal{X}_{s}},
\]
\[
q_{2}(x)= h_{\theta}(x)\,\mathds{1}_{\mathcal{X}_{u}},
\]
\[
q_{3}(x)= -\frac{\partial h_{\theta}}{\partial x}(f(x)+g(x)u(x)) - \kappa\left(h_{\theta}(x)\right)\mathds{1}_{\mathcal{X}_{d}}.
\]

The paper’s main statistical result, stated as **Theorem 1: Safety Quantification of Neural CBF**, uses split conformal prediction on i.i.d. calibration samples from each constraint set [2507.15022]. For each set \(\mathcal{X}_i\), \(i \in \{s,u,d\}\), the conformal scores are
\[
s_j^{(i)} = q_i(x_j^{(i)}),
\]
and the quantile is
\[
\hat{q}_i := \text{Quantile}_{1 - \alpha/m} \left( \{ s_j^{(i)} \}_{j=1}^N \right),
\]
where \(m\) is the number of constraint sets. Choosing \(\epsilon \in (0,1)\) and \(\beta \in (0,1)\) such that
\[
\mathcal{I}_{1 - \epsilon}(N - l + 1, l) \leq \beta, \quad \text{where } l = \lfloor (N + 1)\alpha/m \rfloor,
\]
the theorem states that, with probability at least \(1 - \beta\),
\[
\mathbb{P}_{x \in \mathcal{X}_i} \left( q_i(x) \leq \hat{q}_i \right) \geq 1 - \epsilon
\quad \forall i \in \{s, u, d\}.
\]

The quantiles \(\hat q_i\) are then turned into training margins by setting
\[
\gamma_k \leftarrow \hat{q}_k,\qquad k\in\{s,u,d\}.
\]
The interpretation given in the paper is direct. If \(\hat{q}_i \le 0\), the corresponding constraint is satisfied on most of the region with high confidence. If \(\hat{q}_i > 0\), the magnitude measures the observed severity of violation, and retraining with that margin enforces stricter separation.

## 4. Loss construction and iterative training procedure

CPED-NCBFs parameterize the barrier as a feedforward neural network \(h_\theta(x)\) and optimize a weighted composite loss
\[
L_\theta(\theta) = \lambda_s L_1 + \lambda_u L_2 + \lambda_d L_3,
\]
where
\[
L_1(\theta) = \frac{1}{N} \sum_{x_i \in X_s} \max(0, q_1(x_i)+\gamma_s^*),
\]
\[
L_2(\theta) = \frac{1}{N} \sum_{x_i \in X_u} \max(0, q_2(x_i)+\gamma_u^*),
\]
\[
L_3(\theta) = \frac{1}{N} \sum_{x_i \in X_d} \max(0, q_3(x_i)+\gamma_d^*).
\]
The three terms penalize failures of safe-state positivity, unsafe-state negativity, and derivative feasibility, respectively [2507.15022].

Training is explicitly organized as a **two-stage** procedure. First, all margins are initialized to zero and \(h_\theta\) is trained until the loss is small. Second, a separate validation set, excluded from training, is used to compute conformal scores and quantiles \(\hat q_k\). If any quantile is positive, the corresponding margin is updated and the network is retrained. The paper describes the loop as follows: sample data from \(\mathcal{X}_s,\mathcal{X}_u,\mathcal{X}_d\); initialize all \(\gamma_k=0\); train the NCBF until the current loss becomes nonpositive or sufficiently small; for each constraint set, draw \(N\) i.i.d. validation samples, compute the scores, sort them decreasingly, choose \(l = \lfloor (N+1)\alpha/3 \rfloor\), set \(\hat q_k\) to the corresponding score, update \(\gamma_k \leftarrow \hat q_k\), and retrain. The procedure returns the final learned \(h_\theta\) [2507.15022].

The separation between training and calibration is essential to the method’s statistical interpretation. The calibration quantiles are intended to reflect generalization beyond the optimization samples rather than memorization of the training set. This is the point at which CPED-NCBFs diverge most sharply from purely optimization-based barrier learning.

## 5. Guarantee structure, assumptions, and known limitations

The guarantee delivered by CPED-NCBFs is **probabilistic** rather than deterministic [2507.15022]. The theorem provides a simultaneous high-confidence statement over the three constraint regions, parameterized by a violation level \(\epsilon\) and confidence level \(\beta\), under the assumption that the calibration samples are i.i.d. samples drawn from each constraint set. The method therefore certifies that each calibrated constraint is satisfied on at least a \(1-\epsilon\) fraction of its region with probability at least \(1-\beta\), rather than proving a pointwise worst-case statement over the entire state space.

The framework is also explicitly local in its data geometry. The demonstration layer \(\mathcal{D}\) and unsafe layer \(\mathcal{N}\) are central objects, and the propagation lemmas depend on \(\epsilon\)-nets or \(\bar\epsilon\)-nets, local Lipschitz constants, and region-specific margins. This means that expert-demonstration coverage is not incidental: it is part of the verification mechanism itself.

The paper identifies several practical limitations. The guarantee depends on the representativeness of the held-out calibration data. Performance can become conservative when the estimated margins \(\gamma_k\) are large or when data are scarce. In the authors’ summary, the method is attractive when the barrier is neural and hard to verify symbolically, when expert data are available, and when a probabilistic safety certificate is acceptable, but it does not constitute a deterministic global proof [2507.15022].

A closely related conformal formulation, **CP-NCBF**, learns a neural barrier and then verifies or corrects it with split conformal prediction to obtain a probabilistically certified safe set, but it is not expert-demonstration-based [2503.17395]. In that framework, the conformal score is the worst barrier-condition violation
\[
s(x)=\max_{i\in\{1,2,3\}}\zeta_i(x),
\]
the quantile threshold is \(\hat q\), and the corrective margin is set as \(\psi=-\hat q\) [2503.17395]. This suggests that CPED-NCBFs should be understood as a demonstration-specialized extension of the same statistical verification idea rather than as a fundamentally different safety formalism.

## 6. Experimental evidence and position within the NCBF verification literature

The reported experiments cover a 2D point-mass collision-avoidance system and a unicycle model learned from expert demonstrations [2507.15022]. In the point-mass case,
\[
\dot{x}_1 = -x_1 + (x_1^2 + \delta)u_1,\qquad \dot{x}_2 = -x_2 + (x_2^2 + \delta)u_2,
\]
with \(\delta=1\), state \(x=[x,y]^\top\), control \(u=[v_x,v_y]^\top\), safe set
\[
\mathcal{S}=\{x : x_1\le 1,\ x_2\le 1\},
\]
and candidate CBF
\[
h(x)=\min\{1-x_1,\ 1-x_2\}.
\]
The dataset is generated with **boundary-focused radial sampling**, including safe samples, unsafe samples, derivative samples, and a buffer band of width \(w\) around the safe/unsafe transition. Evaluation is reported as the maximum trajectory radius \(r\in[0.1,3.1]\) for which the learned barrier remains safe.

In the unicycle case,
\[
\dot{\mathbf{x}}(t) = [v(t)\cos\theta(t),\ v(t)\sin\theta(t),\ \omega(t)]^\top,
\]
with \(\mathbf{x}=[x,y,\theta]^\top\) and \(\mathbf{u}=[v,\omega]^\top\). Expert demonstrations are generated using an MPC controller combined with a pre-trained barrier function
\[
h(\mathbf{x}) = (x - R \sin \theta)^2 + (y + R \cos \theta)^2 + 2R^2 - D_s^2.
\]
The task is to reach either \((5,0,\pi)\) or \((-5,0,-\pi)\) while staying safe, and the reported metric is safety rate over 100 trajectories [2507.15022].

| System | Setup | Reported outcome |
|---|---|---|
| Point mass | Generalization versus rollout radius \(r\) | With 390 samples, FM-NCBF is unsafe at all \(r\) while CPED-NCBF is safe up to \(r=1.1\); with 650 samples, FM-NCBF is safe up to \(r=0.7\) and CPED-NCBF up to \(r=2.5\); with 910 and 1430 samples, CPED-NCBF is safe up to \(r=2.7\) |
| Unicycle | Safety over 100 simulated trajectories | At 1,000 samples, FM-NCBF is 90.5% and CPED-NCBF 98.8%; at 5,000 samples, 98.1% versus 99.1%; at 10,000 samples, 99.7% versus 99.4% |

The main empirical pattern is that CPED-NCBFs outperform the fixed-margin baseline in low-data settings and improve generalization from expert demonstrations to previously unseen states [2507.15022]. The paper also notes that when sample availability is low, the estimated \(\gamma\) can become large, making the barrier more conservative; conversely, with large datasets, the FM-NCBF baseline can slightly outperform CPED-NCBF on the unicycle benchmark.

Within the broader literature, CPED-NCBFs are positioned against symbolic and bound-based verification methods. The paper explicitly contrasts them with **SMT**, **mixed-integer programming (MIP)**, and **interval or bound-propagation methods**, arguing that those approaches can become overly conservative or computationally expensive in high dimensions [2507.15022]. Other strands of the literature pursue different tradeoffs: exact verification for ReLU NCBFs via generalized Nagumo conditions and piecewise-linear decomposition [2310.09360]; synthesis with efficient exact verification for ReLU barriers using boundary regularization and exact region checking [2410.20326]; continuous-time stochastic neural CBFs with Lipschitz certificates for the network, Jacobian, and Hessian-trace terms [2403.19332]; scalable post-training verification using linear bound propagation and McCormick relaxations [2511.06341]; and LightCROWN for tighter Jacobian bounds with smooth nonlinear activations such as \(\tanh\) [2605.07757]. This suggests a division of labor in the field: exact and relaxation-based verifiers target worst-case certification, whereas CPED-NCBFs target calibration-based probabilistic assurance in the expert-demonstration regime.

Source: https://www.emergentmind.com/topics/cped-ncbfs