---
title: Piecewise Stochastic CBFs
url: https://www.emergentmind.com/topics/piecewise-stochastic-control-barrier-functions
type: topic
---

# Piecewise Stochastic CBFs

Searching arXiv for the cited papers and closely related work on piecewise stochastic control barrier functions.
I’ll look up the specified arXiv IDs and related terms to ground the article in the most relevant preprints.
Piecewise stochastic control barrier functions are safety certificates for stochastic control systems in which the barrier condition is represented, enforced, or synthesized regionwise rather than through a single globally smooth template. In the recent literature, this piecewise structure appears in several technically distinct forms: piecewise-constant barriers over partitions of the safe set, piecewise-affine probabilistic control barrier functions defined by polyhedral complements, mode-dependent residual corrections for switching systems, and neural barrier functions that are affine on ReLU activation regions. Across these variants, the central objective is the same: construct a controller or safety filter that certifies probabilistic invariance over a finite horizon, either through expectation inequalities, chance constraints, or infinitesimal-generator conditions [2507.17703].

## 1. Formal definitions and safety semantics

For discrete-time nonlinear stochastic systems with additive noise,
\[
x_{k+1}=f(x_k,u_k)+w_k,
\]
a stochastic control barrier function (s-CBF) is formulated in terms of a safe set \(X_s\), initial set \(X_0\subseteq X_s\), unsafe set \(X_u=\mathbb{R}^n\setminus X_s\), a feedback law \(\pi\), and scalars \(\eta,\beta\in[0,1]\). The defining conditions are nonnegativity \(B(x)\ge 0\), unsafe-set separation \(B(x)\ge 1\) on \(X_u\), initial-set over-approximation \(B(x)\le \eta<1\) on \(X_0\), and the stochastic decrease condition
\[
\mathbb{E}\!\left[B\bigl(f(x,\pi(x))+w\bigr)\mid x,\pi(x)\right]\le B(x)+\beta,\qquad \forall x\in X_s.
\]
Under these conditions, the closed-loop safety probability satisfies
\[
P_s \ge 1-(\eta+N\beta),
\]
where \(P_s\) is the infimum, over \(x_0\in X_0\), of the probability that the trajectory remains in \(X_s\) for \(k=0,\dots,N\) [2507.17703].

A complementary formulation uses one-step chance constraints. For the discrete-time stochastic system
\[
x_{k+1}=F(x_k,u_k,\xi_k)=f(x_k,u_k)+g(x_k,\xi_k),
\]
with i.i.d. disturbance \(\xi_k\sim P_\xi\), a function \(h\) is a \(\delta\)-probabilistic C-BF if, for fixed \(\delta\in(0,1)\) and \(\alpha\in[0,1]\),
\[
\forall x\in S\ \exists u\in U:\ \mathbb{P}_\xi\{h(F(x,u,\xi))\ge \alpha h(x)\}\ge 1-\delta.
\]
When
\[
\delta \le 1-(1-\epsilon)^{1/N},
\]
enforcing the one-step condition with violation \(\delta\) guarantees the \(N\)-step exit probability bound \(P_N(x;\pi)\le \epsilon\) [2512.04194].

In continuous time, the stochastic control barrier framework is posed for the Itô SDE
\[
dx_t=[f(x_t)+g(x_t)u_t]\,dt+V\,dv_t.
\]
A stochastic zeroing control barrier function is a \(C^2\) certificate \(B\) on a domain \(\mathcal{D}\subseteq \mathcal{C}\) satisfying positivity on \(\mathcal{D}\), negativity outside \(\mathcal{D}\), and
\[
\sup_{u\in\mathcal{U}}\,[\mathcal{L}B(x)+\alpha(B(x))]\ge 0,
\]
where the Itô infinitesimal generator is
\[
\mathcal{L}B(x)=\frac{\partial B}{\partial x}[f(x)+g(x)u]+\frac12\operatorname{tr}\!\left(V^\top \frac{\partial^2 B}{\partial x^2}V\right).
\]
Under a linear \(\alpha(s)=ks\), Proposition 1 gives the bound
\[
\mathbb{P}[x_t\in \operatorname{int}(\mathcal{D})\ \forall t\in[0,T]]\ge (B(x_0)/c)e^{-cT},
\]
with \(c=\sup_{x\in\mathcal{D}}B(x)\) [2506.21697].

## 2. Piecewise representations of the barrier certificate

One widely used construction partitions the safe set itself:
\[
X_s=\bigcup_{i=1}^K X_i,\qquad X_i\cap X_j=\emptyset\ (i\neq j),
\]
and defines a piecewise-constant barrier
\[
B(x)=b_i\ \text{on }X_i,\qquad B(x)=1\ \text{if }x\notin X_s.
\]
For control synthesis, a constant control \(u_i\in U\) is associated with each cell \(X_i\), and the expectation inequality reduces to linear constraints in the constants \(b_i\), the transition probabilities, and the per-cell slack \(\beta_i\). In the barrier-only precursor, the more general piecewise template
\[
B(x)=
\begin{cases}
B_i(x), & x\in X_i,\\
1, & x\notin X_s
\end{cases}
\]
specializes to piecewise-constant stochastic barrier functions (PWC-SBFs), for which synthesis becomes a minimax program [2404.16986].

A second construction places the partition on the complement of the safe set. The complement is decomposed into open polyhedra
\[
P_i=\{x\in\mathbb{R}^n\mid C_i x<b_i\},\qquad i=1,\dots,P,
\]
with \(C_i\) having rows \(c_{ij}^\top\). The piecewise-affine barrier is
\[
h(x)=\min_{i\in[P]} h_i(x),\qquad h_i(x)=\max_{j\in[F_i]}(c_{ij}^\top x-b_{ij}),
\]
and the safe set is
\[
S=\{x\mid h(x)\ge 0\},
\]
equivalently \(S=\mathbb{R}^n\setminus \bigcup_i P_i\). This min–max representation directly supports irregular polygonal safety geometry and chance-constrained filtering [2512.04194].

A third representation is induced by the parameterization itself. For ReLU stochastic neural control barrier functions, the network defines finitely many polyhedral regions determined by activation patterns \(S\). On each region,
\[
B(x)\big|_{\text{region }S}=W_{\mathrm{eff}}(S)x+r_{\mathrm{eff}}(S),
\]
and the region is
\[
X(S)=\bigcap_{\text{layers }i}\Bigl(\bigcap_{j\in S_i}\{x:\text{pre-activation}_{ij}(x)\ge 0\}\cap \bigcap_{j\notin S_i}\{x:\text{pre-activation}_{ij}(x)\le 0\}\Bigr).
\]
Because the network is affine on each \(X(S)\), safety verification can be reduced to regional NLP, LP, or QP subproblems rather than a single global nonlinear verification task [2506.21697].

This suggests that “piecewise” is not a single canonical ansatz. In the current literature it denotes a family of constructions in which stochastic safety conditions become tractable after decomposing state space, unsafe geometry, switching surfaces, or activation regions.

## 3. Synthesis and optimization formulations

For piecewise-constant s-CBFs, the joint synthesis of the barrier and controller is posed as a minimax problem over cell values \(b_i\), controls \(u_i\), and safety parameters \(\eta,\beta\):
\[
\min_{b,u,\eta,\beta}\ \max_{T_i\in\mathcal{P}_i(u_i)\,\forall i}\ \{\eta+N\beta\},
\]
subject to \(b_i\ge 0\), \(b_i\le \eta\) on cells intersecting \(X_0\), and
\[
\sum_{j=1}^K b_j\,T_{ij}+T_{i,u}\le b_i+\beta_i,\qquad 0\le \beta_i\le \beta.
\]
Here \(\mathcal{P}_i(u_i)\) is the feasible simplex of transition probabilities. The method in [2507.17703] shows that this minimax problem is equivalent to a single linear program with zero duality gap, so the controller and barrier certificate are synthesized within one LP.

For piecewise-affine probabilistic safety filters, exact online evaluation at state \(x\), given a nominal input \(\bar u=\bar\kappa(x)\), solves
\[
\min_{u\in U}\ \|u-\bar u\|^2
\]
subject to
\[
\max_{j\in[F_i]}\,[c_{ij}^\top f(x,u)-q_{ij}(x)]\ge 0,\qquad \forall i\in[P],
\]
where
\[
q_{ij}(x)=b_{ij}-\alpha h(x)-Q_{\delta^{(i)}}[c_{ij}^\top g(x,\xi)],\qquad \delta^{(i)}\ge 0,\ \sum \delta^{(i)}\le \delta.
\]
Introducing binary variables \(s_{ij}\in\{0,1\}\) to select the active facet yields an MIQP when \(f\) is affine in \(u\) and \(U\) is polyhedral, and a MINLP in the general case. The same paper proposes a heuristic alternative: choose an index assignment \(j=(j_1,\dots,j_P)\), solve the small QP
\[
\min \|u-\bar u\|^2 \quad \text{s.t.}\quad c_{i\,j_i}^\top f(x,u)\ge q_{i\,j_i}(x),\ i=1,\dots,P,
\]
and enumerate assignments in a heuristic order until one QP is feasible [2512.04194].

For switching systems with uncertain nominal models, piecewise residuals are introduced into the CLF/CBF constraints:
\[
d^V(x,u)=\sum_{r=1}^R \delta_r(x)d_r^V(x,u),\qquad
d^h(x,u)=\sum_{r=1}^R \delta_r(x)d_r^h(x,u).
\]
After modeling these residuals by a structured multi-output Gaussian process, the chance-constrained CLF/CBF conditions are converted into second-order cone constraints. The resulting controller is obtained from a convex SOCP of the form
\[
\min f^\top z
\quad\text{s.t.}\quad
\sum_r \delta_r\|M_r^i z+n_r^i\|_2 \le \sum_r \delta_r (p_r^i)^\top z+q_r^i,\ i=1,\dots,n_c,
\]
with \(z=[u^\top;d;t]\) [2403.18041].

| Construction | Optimization | Characteristic |
|---|---|---|
| Piecewise-constant s-CBF | Dual linear program with zero gap | Joint synthesis of barrier and controller |
| Piecewise-affine probabilistic CBF | MIQP or MINLP; heuristic QPs or NLPs | Safety filter with quantile tightening |
| Switching residual CBF/CLF | Convex SOCP | Chance constraints in SOC form |

A plausible implication is that piecewise stochastic CBFs are valued not only for expressivity but for the way regionalization exposes exact or nearly exact convex substructure.

## 4. Learning, unknown disturbances, and neural variants

When the disturbance law is unknown, the quantile-based piecewise-affine framework replaces the true quantile \(Q_\delta[c^\top g(x,\xi)]\) with an empirical quantile \(Z_{(k)}\) computed from samples \(\xi_1,\dots,\xi_N\). By a binomial-tail argument, if
\[
N>\log(\gamma)/\log(1-\delta),
\]
then with probability at least \(1-\gamma\) the empirical quantile lower-bounds the true quantile. Enforcing the resulting tightened linear constraints yields a \((\delta,\gamma)\)-PCBF and therefore \(P_N\le \epsilon\) with confidence at least \(1-N\gamma\). The same framework explicitly allows arbitrary (data-driven) quantile estimators and was tested under Laplace and Student-\(t\) noise, where heavy-tailed tests confirm asymptotic coverage [2512.04194].

For switching systems, uncertainty enters the barrier constraints through mode-dependent residuals relative to a nominal model,
\[
d_r^h=[L_{f_r}h-L_{\hat f}h]+[L_{g_r}h-L_{\hat g}h]u,
\]
and similarly for \(d_r^V\). A dataset \(\mathcal{D}_r\) is collected in each region \(\mathcal{R}_r\), and the stacked residual \(d_r(x,u)=[d_r^V;d_r^h]\) is modeled by an independent MOGP with kernel
\[
k_r((x,y),(x',y'))=y^\top \Lambda_r(x,x')y',\qquad y=[1;u].
\]
With RKHS-norm bound assumptions, the paper establishes
\[
|d_r^\bullet(x,u)-m_r^\bullet(x,u)|\le \beta_r \sigma_r^\bullet(x,u)
\]
with probability at least \(1-\delta\), which is then embedded into probabilistic CLF/CBF constraints [2403.18041].

Neural SNCBFs introduce another form of piecewise structure. For smooth networks with \(C^2\) activations such as tanh or softplus, one can directly evaluate \(\partial B\), \(\partial^2 B\), and \(\mathcal{L}B\); the paper proposes a verification-free synthesis framework that replaces infinitely many constraints by a finite scenario program and certifies them globally using Lipschitz bounds obtained through LMIs. For ReLU networks, the framework becomes verification-in-the-loop: synthesis alternates with systematic enumeration of activation patterns reachable from an initial point, and each region is checked for correctness and control-feasibility counterexamples. The reported implementation exploits the fact that on each linear region the drift condition reduces to an affine function in \((x,u)\), so verification is regional and local rather than global [2506.21697].

## 5. Guarantees, feasibility, and compositional extensions

The piecewise-affine probabilistic formulation derives its guarantees from a facetwise union bound. For any polyhedron \(i\),
\[
\mathbb{P}\{h_i(F(x,u,\xi))<\alpha h(x)\}
\le
\min_j \mathbb{P}\{c_{ij}^\top F(x,u,\xi)<b_{ij}-\alpha h(x)\},
\]
and summing over \(i\) yields a total one-step violation bounded by \(\sum \delta^{(i)}\). Combined with
\[
\delta \le 1-(1-\epsilon)^{1/N},
\]
this gives the \(N\)-step exit-probability guarantee \(P_N(x;\pi)\le \epsilon\) whenever the one-step condition is enforced at each step [2512.04194].

For switching systems with GP residuals, feasibility of the CBF chance constraint is analyzed exactly at the SOC level. For a given mode \(r\), the regional constraint
\[
\|A_r^h(x)u+b_r^h(x)\|_2 \le c_r^h(x)u+d_r^h(x)
\]
is feasible if and only if there exists \(u\) satisfying
\[
[d_r^h,c_r^h]\,[1;u]\ge 0
\]
and
\[
[1,u^\top]\,S_r(x)\,[1;u]\le 0,
\]
with \(S_r(x)\) defined from \(A_r^h,b_r^h,c_r^h,d_r^h\). Corollary 2 gives a necessary feasibility condition, and Corollary 3 gives a sufficient one: if \(S_r^3(x)\prec 0\), then the SOC is feasible [2403.18041].

In continuous-time stochastic hybrid systems, piecewise or subsystem-wise structure appears through control pseudo-barrier functions \(\mathcal{B}_{i,p_i}\) attached to subsystems and modes. Under small-gain conditions expressed through matrices \(\Lambda\) and \(\Delta\), and a weighting vector \(\mu\in\mathbb{R}_{>0}^N\) such that
\[
\mu^\top(-\Lambda+\Delta)<0,
\]
the global barrier
\[
\mathcal{B}(x,p)=\sum_{i=1}^N \mu_i\,\mathcal{B}_{i,p_i}(x_i)
\]
is a valid control barrier for the interconnected system. The associated finite-time probability bound in Theorem 3.5 upper-bounds the probability of reaching the unsafe set over \([0,T]\) in terms of \(\gamma\), \(\lambda\), \(\hat\kappa\), and \(\psi\) [2012.07296].

A common misconception is that piecewise stochastic barrier methods are merely heuristic approximations. The cited results show stronger statements: zero-gap LP reformulations, necessary and sufficient SOC feasibility conditions, and explicit finite-horizon probability bounds are available in several nontrivial subclasses.

## 6. Benchmarks, comparative behavior, and limitations

The piecewise-affine probabilistic CBF framework was evaluated on quadruped corridor navigation, unknown-distribution safety filtering, and large-scale path planning. In corridor navigation, with \(x=(p^x,p^y,\theta)\), horizon \(N=20\), \(\Delta t=0.1\), and safe set \(|p^y|\le 0.5\) modeled by \(h(x)=\min\{-p^y+0.5,\ p^y+0.5\}\), the method was compared against Cosner et al. and Fushimi et al. At \(\sigma=0.03\), start at origin, and target exit probabilities \(\epsilon=\{0.2,0.1,0.01,0.001\}\), the reported empirical values over 5000 trials were \(\{0.0766,0.0374,0.0046,0.0002\}\), closer to target than the alternatives. In the unknown-distribution setting, over 500 runs, conformal prediction was “very tight but computation explodes as \(\epsilon\downarrow\) (up to seconds per step),” the scenario approach had “moderate conservatism, computation linear in \(N_s\) (hundreds of ms),” and the empirical-quantile method had “moderate conservatism, computation \(\sim 1\) ms independent of \(N_s\).” In 2D path planning with 13 irregular polygonal obstacles, \(N=150\), \(\epsilon=0.1\), and \(\sigma=0.03\), the heuristic QP sequence achieved average solve time \(5.4\) ms versus \(7.3\) ms for the full MIQP, and maximum \(17.3\) ms versus \(44.6\) ms, with negligible suboptimality in \(99\%\) of cases [2512.04194].

The LP-based piecewise stochastic control barrier synthesis of [2507.17703] reported four benchmarks with horizon \(N=50\) and safety target \(\delta_s=0.95\). For a 2D linear unstable system with \(K=100\), the method gave \(\eta\approx 0.002\), \(\beta\approx 3.6\times 10^{-4}\), the bound \(1-(\eta+N\beta)=0.98\), and synthesis time \(\approx 2.4\) s; Monte-Carlo over 500 trials gave \(100\%\) empirical safety. For a 2D linear nonconvex safe set, \(K=100\) gave \(\eta\approx 0.03\), \(\beta\approx 2.2\times 10^{-4}\), \(P_s\ge 0.96\), and time \(\approx 3.2\) s, with 6 violations in 500 trials. For the 3D thermal-regulation model, \(K=900\) gave \(\eta\approx 0.0429\), \(\beta\approx 2.3\times 10^{-4}\), \(P_s\ge 0.95\), and time \(\approx 497\) s. For the 4D nonlinear unicycle, \(K=2400\) gave \(\eta\approx 0.02\), \(\beta\approx 6\times 10^{-4}\), \(P_s\ge 0.95\), and time \(\approx 3946\) s, with zero safety violations in 500 simulations [2507.17703].

The broader PWC-SBF literature emphasizes scalability and comparative performance. The barrier-only synthesis in [2404.16986] reduces to minimax optimization and offers three algorithms: dual LP, iterative counter-example guided synthesis, and gradient descent. The benchmarks report that PWC-SBFs “outperform state-of-the-art methods, namely sum-of-squares and neural barrier functions,” and “can scale to eight dimensional systems.” The data also makes the principal limitations explicit: “curse of dimensionality still looms; partition design is art not science; non-smooth loss requires careful tuning of step-sizes and stopping criteria” [2404.16986].

For neural SNCBFs, the reported trade-off is between expressive coverage and verification efficiency. The smooth 20-neuron softplus inverted pendulum example converged to \(\psi^\ast\approx -4.2\times 10^{-4}\), with full safety ensured by Theorem 2; the CARLA unicycle achieved coverage \(\sim 72.5\%\) of the true safe set in 64 min training. In the ReLU verification-in-the-loop regime, a \(2\times 16\)-ReLU Darboux network passed verification in 86 epochs and covered \(\sim 54.4\%\) of the safe set, while the 3-state unicycle with \(3\times 16\)-ReLU required 95 epochs and achieved \(41.2\%\) coverage. The paper summarizes the contrast as a trade-off between “expressivity/coverage (higher for smooth networks)” and “verification efficiency (much faster per step for ReLU piecewise linear nets)” [2506.21697].

Taken together, these results position piecewise stochastic control barrier functions as a broad research program rather than a single algorithmic recipe. The unifying pattern is regionalization: once safety is decomposed across cells, facets, modes, or activation regions, stochastic guarantees can be enforced by LP, SOCP, MIQP, MINLP, QP, NLP, scenario programs, or verification-in-the-loop counterexample refinement, depending on the disturbance model and the chosen barrier parameterization.

Source: https://www.emergentmind.com/topics/piecewise-stochastic-control-barrier-functions