betaFeedback

WorksComputer Science

Latent Barrier Steering: Hierarchical Safety for Generative Planning

Abstract

We introduce Latent Barrier Steering (LBS), a hierarchical semantic-to-path framework for safe flow-matching-based generative planning. Existing control-barrier-function (CBF) safety filters for diffusion and flow-matching planners act locally on generated samples, either during sampling or after prediction. Such repair is effective for small violations, but can struggle when a new constraint blocks the whole selected behavior mode rather than merely perturbing it locally. LBS decouples behavior selection from path certification through two coordinated interventions: it first steers the generator's behavior latent toward rollouts with larger safety margin, then decodes the steered latent and applies a path-space CBF quadratic program (QP) only for residual violations. We show that latent steering increases the margin available to the path-space corrector, yielding finite-time recovery guarantees and reduced correction burden. Experiments across navigation and robot end-effector planning tasks show that LBS preserves safety while improving goal reaching and reducing correction burden compared with path-level safety filters.

Introduction

Robotic path planning must combine expressive behavior generation with strong safety guarantees. Generative policies, including diffusion and flow-matching planners, are attractive because they model multimodal trajectory distributions and synthesize diverse high-dimensional behaviors from demonstrations [16, 10, 34, 23, 17, 5, 3, 2]. Yet deployment safety is not inherited from offline training: new obstacles, workspace limits, or feasibility constraints can shift the test-time problem away from the demonstrations used to train the generator. This has motivated safe generative planners that combine learned samplers with control barrier functions (CBFs), which encode safety through a barrier-defined set, and impose constraints through quadratic programs or related filtering steps [1, 13, 27, 39, 40, 8, 41]. Existing CBF-based generative planners instantiate this idea primarily as path-level repair: they inject barrier constraints into the denoising or flow-generation process, or apply a CBF correction phase after a trajectory has been generated [40, 8, 41]. In both cases, the intervention acts on sample or waypoint coordinates, pushing unsafe portions of the trajectory back toward the safe set while staying close to the generator’s original output. This is effective when the generated trajectory is already nearly safe, so that only a short segment must be moved away from an obstacle. Under larger constraint shifts, however, the new constraint may block a substantial portion of the selected behavior mode. The corrector is then no longer making a local geometric repair: it must reshape a long connected segment of the rollout, which can increase intervention energy and leave the final trajectory safe but far from the goal.

When path-level repair has to reshape a long segment of a rollout, the desired solution may be another behavior that the generator already knows how to produce. A multimodal demonstration dataset can contain several valid ways to solve the same start-goal task, such as passing above, below, or between obstacles, and generative policies can represent these alternatives as diverse rollouts. In standard generative planners, however, this diversity is usually accessed through stochastic sampling: the initial noise or sampling seed determines which behavior appears, with no direct handle for a safety filter to choose a rollout that is easier to certify. Geometry-aligned behavior latents, as in parameterized diffusion policies (PDP), provide such a handle by learning a low-dimensional coordinate in which nearby latent values decode to similar trajectories and larger latent moves induce more substantial behavior changes [44]. This suggests a different division of labor for safe generative planning as shown in Figure 1: use the behavior latent to select or interpolate a safer rollout before asking a path-level CBF corrector to enforce the final constraints.

Figure 1. Latent Barrier Steering separates behavior selection from path repair. A vanilla flow-matching planner may generate a goal-reaching but unsafe rollout under a new constraint. A path-space CBF corrector such as SAFEFLOWMATCHER can enforce safety locally, but may produce a trajectory that is safe while no longer reaching the goal when the selected behavior mode is blocked. LBS first steers the behavior latent from z0z_0 to z+z_+ toward a safer rollout, then applies path-level CBF repair only for residual violations, yielding a trajectory that is both safe and goal-reaching.

In this paper, we propose Latent Barrier Steering (LBS), a two-stage framework for safe parameterized flow matching that separates behavior selection from path certification. LBS first applies a CBF quadratic program (CBF-QP) in the behavior latent space to steer the decoded rollout toward a larger robust safety margin. It then decodes the steered latent and applies a path-space CBF-QP only to the remaining waypoint-level violations. This semantic-to-path structure lets the planner change the selected behavior before invoking local path repair. Theoretically, we show that latent steering improves the safety margin handed to the path-space corrector, yielding finite-time latent recovery when a safe latent is reachable and tighter path-level correction-time and intervention-energy certificates. Empirically, LBS improves safety, goal reaching, and correction efficiency across constrained planning tasks. Our contributions are:

  • Introduce semantic-to-path safety with parameterized flow matching. We build on a parameterized flow-matching planner whose geometry-aligned latent indexes different rollout behaviors. LBS uses this latent as the first point of safety intervention, steering the selected behavior before applying path-space CBF certification.

  • Analyze when latent steering reduces path-space correction. We show that increasing the latent safety margin gives the path-space corrector a less-violating warm start. This yields finite-time latent recovery when a safe latent is reachable, and tighter correction-time and intervention-energy certificates for the downstream CBF-QP.

  • Demonstrate safer and more goal-directed constrained planning. Across constrained planning tasks, LBS preserves safety while improving goal reaching and reducing correction energy compared with path-level safety filters.

Related Work

Generative policies for planning. Diffusion and flow-based generative models provide expressive trajectory priors for robot planning and control, with diffusion planners modeling flexible multimodal behavior through iterative denoising and flow-matching planners improving sampling efficiency through deterministic transport [16, 10, 34, 23, 24, 17, 5, 37, 29, 3, 2]. These models have been applied to offline RL, visuomotor imitation, navigation, manipulation, and diverse human-demonstration datasets [25, 33, 18]. Their strength is that a single learned sampler can represent many plausible trajectories for the same task context. However, the generated behavior is usually selected by conditioning variables or stochastic noise, so multimodal diversity does not by itself provide a controllable safety mechanism under new constraints.

Safety certification for generative planners. Control barrier functions (CBFs) and related invariance tools provide a standard way to enforce safety by maintaining the forward invariance of a superlevel set, often through a quadratic program that minimally modifies a nominal command [1, 13, 27, 39]. Recent safe generative planners attach this machinery to diffusion or flow sampling: SAFEDIFFUSER embeds finite-time invariance into the diffusion process, SAFEFLOW introduces flow-matching barrier functions for safe trajectory generation, and SAFEFLOWMATCHER decouples prediction from correction by applying a finite-time CBF certificate only to the final path-space correction phase [40, 8, 41]. These methods provide formal safety mechanisms at test time, but their interventions are still expressed in sample or waypoint coordinates. They therefore primarily address local path repair after the generator has already selected a behavior.

Behavior latents and controllable multimodality. Controllable multimodality has a long history in parameterized actions, options, and skills, where a policy selects both a discrete behavior and continuous parameters that adapt the behavior to a task instance [36, 20, 7, 15, 26, 32, 9, 11, 42, 14, 45]. Related work on skill discovery and latent-action imitation learns reusable behavior abstractions from demonstrations or interaction data [28, 33, 21, 31, 38]. PDP brings this idea to diffusion policies by learning a continuous behavior latent whose geometry is aligned with trajectory similarity, turning noise-driven diversity into an optimizable behavior handle [44]. These threads motivate our use of a behavior latent as the semantic coordinate for safety-aware steering before path-level certification.

Background

Parameterized flow matching for trajectory planning

Let D\mathcal{D} denote the waypoint space, and let τ=(τ0,…,τH)∈DH+1\tau= (\tau^{0}, \ldots, \tau^{H}) \in\mathcal{D}^{H+1} denote a planning trajectory over horizon HH under context cc. Flow matching learns a time-dependent vector field vt(⋅,c;θ)v_t(\cdot, c; \theta) whose ODE transports a simple prior p0p_0 to the demonstration distribution q(τ∣c)q(\tau\mid c) [23, 24]: ddtψt(τ0,c)=vt(ψt(τ0,c);c,θ)\frac{d}{dt}\psi_t(\tau_0,c) = v_t(\psi_t(\tau_0,c);c,\theta), with τ0∼p0\tau_0 \sim p_0 and ψ1(τ0,c)∼q(⋅∣c)\psi_1(\tau_0,c) \sim q(\cdot\mid c). Following conditional flow matching, a standard objective samples τ0∼p0\tau_0 \sim p_0, τ1∼q(⋅∣c)\tau_1 \sim q(\cdot\mid c), t∼Unif⁡[0,1]t \sim\operatorname{Unif}[0,1], sets τt=(1−t)τ0+tτ1\tau_t = (1-t)\tau_0 + t\tau_1, and regresses the optimal-transport velocity:

LFM(θ)=E[∥vt(τt,c;θ)−(τ1−τ0)∥22].(1)\mathcal{L}_{\mathrm{FM}}(\theta) = \mathbb{E}\left[\left\|v_t(\tau_t,c;\theta) - (\tau_1-\tau_0)\right\|_2^2\right]. \tag*{(1)}

To expose a controllable behavior coordinate, we follow parameterized diffusion policies and learn a trajectory encoder qϕ(z∣τ)q_\phi(z \mid\tau) for a low-dimensional latent z∈Z⊂Rdzz \in\mathcal{Z} \subset\mathbb{R}^{d_z} [44]:

qϕ(z∣τ)=N(μϕ(τ),diag⁡(σϕ2(τ))),zˉ(τ)=μϕ(τ),(2)q_\phi(z \mid\tau) = \mathcal{N}\left(\mu_\phi(\tau),\operatorname{diag}(\sigma_\phi^2(\tau))\right), \qquad\bar{z}(\tau)=\mu_\phi(\tau), \tag*{(2)}

where zˉ(τ)\bar{z}(\tau) is the deterministic code used for conditioning. The generator produces τ(z;ξ)=Gθ(c,z,ξ)\tau(z;\xi) = G_\theta(c,z,\xi), with stochastic seed ξ\xi or deterministic decode τ^θ(z,c)\hat{\tau}_\theta(z,c). With latent prior p(z)p(z) and nonnegative weights λrec,λKL,λgeo\lambda_{\mathrm{rec}},\lambda_{\mathrm{KL}},\lambda_{\mathrm{geo}}, we write a generic parameterized flow-matching objective as

LPFM(θ,ϕ)=LFM(θ;z,c)+λrecEτ,z∼qϕ[∥τ−τ^θ(z,c)∥22]+λKLEτ[DKL(qϕ(z∣τ) ∥ p(z))]+λgeoLgeo,(3)\begin{aligned} \mathcal{L}_{\mathrm{PFM}}(\theta,\phi) &= \mathcal{L}_{\mathrm{FM}}(\theta;z,c) + \lambda_{\mathrm{rec}}\mathbb{E}_{\tau,z\sim q_\phi}\left[\left\|\tau-\hat{\tau}_\theta(z,c)\right\|_2^2\right] \\ &\quad+ \lambda_{\mathrm{KL}}\mathbb{E}_{\tau}\left[D_{\mathrm{KL}}\left(q_\phi(z\mid\tau)\,\|\,p(z)\right)\right] + \lambda_{\mathrm{geo}}\mathcal{L}_{\mathrm{geo}}, \tag*{(3)} \end{aligned}

where the geometry loss aligns trajectory and latent distances. For a sampled pair (τi,τj)(\tau_i,\tau_j), PDP computes a trajectory distance δijX=dsoftDTW(X(τi),X(τj))\delta_{ij}^{X} = d_{\mathrm{softDTW}}(X(\tau_i),X(\tau_j)) between behavior–trace feature sequences X(τi)X(\tau_i) and X(τj)X(\tau_j) using soft-DTW [6], and a latent distance δijz=∥zˉ(τi)−zˉ(τj)∥2\delta_{ij}^{z} = \|\bar{z}(\tau_i)-\bar{z}(\tau_j)\|_2. It then penalizes Lgeo=E(i,j)[(δijz−κgeoδijX)2]\mathcal{L}_{\mathrm{geo}} = \mathbb{E}_{(i,j)}[(\delta_{ij}^{z}-\kappa_{\mathrm{geo}}\delta_{ij}^{X})^2], with scale κgeo>0\kappa_{\mathrm{geo}}>0. This geometry term encourages zz to act as a behavior coordinate: nearby latents decode to similar trajectory traces, while larger latent displacements correspond to larger behavioral changes.

Control barrier functions for path safety

For a control-affine system x˙=f(x)+g(x)u\dot{x}=f(x)+g(x)u with state x∈Dx \in D and input u∈Uu \in\mathcal{U}, and a C1C^1 barrier b:D→Rb:D\to\mathbb{R}, a control barrier function defines safety as C={x:b(x)≥0}\mathcal{C}=\{x:b(x)\geq0\} and enforces forward invariance through the inequality Lfb(x)+Lgb(x)u+α(b(x))≥0L_f b(x)+L_g b(x)u+\alpha(b(x))\geq0, where Lf,LgL_f,L_g are Lie derivatives and α\alpha is a class-K\mathcal{K} rate [1, 13]. Given a nominal input unomu^{\mathrm{nom}}, the standard CBF-QP chooses the closest safe input:

u∗=arg⁡min⁡u∈U ∥u−unom∥22s.t.Lfb(x)+Lgb(x)u+α(b(x))≥0(4)u^*=\underset{u\in\mathcal{U}}{\arg\min}\ \left\|u-u^{\mathrm{nom}}\right\|_2^2 \quad\mathrm{s.t.}\quad L_f b(x)+L_g b(x)u+\alpha(b(x))\geq0 \tag*{(4)}

For states that may start outside C\mathcal{C}, fractional-power rates α(b)=κcbfsgn⁡(b)∣b∣ρ\alpha(b)=\kappa_{\mathrm{cbf}}\operatorname{sgn}(b)|b|^\rho with rate constant κcbf>0\kappa_{\mathrm{cbf}}>0 and fractional-power exponent 0<ρ<10<\rho<1 give finite-time convergence into C\mathcal{C} [27, 39, 40].

Safe generative planners apply such constraints during diffusion or flow sampling, or as a correction phase after unconstrained prediction [40, 8, 41]. SAFEFLOWMATCHER’s hard-correction phase satisfies, at sampling time tt, for corrected waypoint τtc,k\tau_t^{c,k} (waypoint kk of the path at time tt) and correction input utku_t^k,

∇b(τtc,k)⊤utk+ϵsgn⁡(b(τtc,k)−δ)∣b(τtc,k)−δ∣ρ+wtkrtk≥0,(5)\nabla b(\tau_t^{c,k})^\top u_t^k+\epsilon\operatorname{sgn}(b(\tau_t^{c,k})-\delta)|b(\tau_t^{c,k})-\delta|^\rho+w_t^k r_t^k\geq0, \tag*{(5)}

where ϵ>0\epsilon>0 is the convergence rate, 0<ρ<10<\rho<1 is the same fractional-power exponent as in (4), δ≥0\delta\geq0 is the robustness margin, and wtk≥0w_t^k\geq0 is a vanishing weight schedule paired with a per-waypoint slack variable rtkr_t^k that together deactivate after switch time twt_w. The corrector enters Cδ={b≥δ}\mathcal{C}_\delta=\{b\geq\delta\} within correction time

TSFM≤tw+(δ−b(τtwc,k))1−ρϵ(1−ρ).(6)T_{\mathrm{SFM}}\leq t_w+\frac{\left(\delta-b(\tau_{t_w}^{c,k})\right)^{1-\rho}}{\epsilon(1-\rho)}. \tag*{(6)}

This bound depends on the pre-correction barrier margin, the downstream quantity tightened in § 4.

Latent Barrier Steering

We introduce Latent Barrier Steering (LBS), a two-stage safety framework for generative planning that separates behavior-level steering from path-level certification. Prior CBF-based generative planners apply certified correction after a plain generator has already selected a behavior mode, leaving the corrector to repair the resulting rollout in waypoint or sample space. LBS instead builds on a parameterized flow-matching planner whose geometry-aligned behavior latent indexes different task-solving rollouts. At test time, Stage I treats this latent as the first safety intervention point: given a differentiable barrier function for the deployment constraint, it steers the latent toward a decoded rollout with a larger worst-case barrier margin. Stage II then uses this decoded rollout as a safety-aware warm start for a downstream path-space CBF-QP corrector, which enforces the remaining waypoint constraints under standard barrier-certificate conditions.

LBS Objective with a Geometry-Aligned Latent

Stage I steers the behavior coordinate of a parameterized flow-matching planner. For a fixed task context cc, each latent z∈Zz\in\mathcal{Z} decodes to a rollout

τ(z)=Gθ(c,z)=(τ0(z),…,τH(z))∈DH+1.\tau(z)=G_\theta(c,z)=\left(\tau^0(z),\ldots,\tau^H(z)\right)\in\mathcal{D}^{H+1}.

We use a deterministic decode τ(z)\tau(z) by fixing the sampling randomness. The geometry-regularized objective in § 3.1 encourages local latent moves to induce controlled rollout changes. Because the encoder is KL-regularized toward the prior p(z)=N(0,I)p(z)=\mathcal{N}(0,I), Stage I restricts steering to a compact region Ω⊂Z\Omega\subset\mathcal{Z} around the prior center, induced by latent clipping. The prior is used only to organize the latent space during training. At test time, Stage I optimizes a single latent within Ω\Omega, which contains the encoded demonstration modes and their interpolation region. On this region, we assume the decoder and barrier are locally Lipschitz. This is an analysis assumption encouraged by the geometry objective rather than guaranteed by it (Appendix § 10.§ 4). Concretely, for z,z′∈Ωz,z'\in\Omega and x,x′∈Dx,x'\in D,

∥τ(z)−τ(z′)∥≤Lτ∥z−z′∥,∣b(x)−b(x′)∣≤Lb∥x−x′∥.\left\|\tau(z)-\tau(z')\right\|\leq L_\tau\left\|z-z'\right\|,\qquad\left|b(x)-b(x')\right|\leq L_b\left\|x-x'\right\|.

This local geometry is the condition that makes latent-space safety steering meaningful: a controlled update in zz produces a controlled change in the decoded rollout.

We now define the latent safety objective. Using the barrier bb and robustness margin δ\delta from § 3.2, Stage I assigns each latent a differentiable approximation to the worst shifted waypoint margin of its decoded rollout:

mβ(z):=−1βlog⁡∑k=0Hexp⁡(−β(b(τk(z))−δ)),β>0.m_{\beta}(z) := -\frac{1}{\beta}\log\sum_{k=0}^{H}\exp\left(-\beta\left(b(\tau^{k}(z))-\delta\right)\right), \qquad\beta> 0.

This soft-min margin satisfies

min⁡k(b(τk(z))−δ)−log⁡(H+1)β≤mβ(z)≤min⁡k(b(τk(z))−δ).\min_{k}\left(b(\tau^{k}(z))-\delta\right)-\frac{\log(H+1)}{\beta}\le m_{\beta}(z)\le\min_{k}\left(b(\tau^{k}(z))-\delta\right).

so εsoft=log⁡(H+1)/β\varepsilon_{\mathrm{soft}}=\log(H+1)/\beta is the only gap between mβm_{\beta} and the true worst-waypoint margin; see Appendix § 10.§ 1. Combining this construction with the local geometry above gives

∣mβ(z)−mβ(z′)∣≤LbLτ∥z−z′∥,z,z′∈Ω.\left|m_{\beta}(z)-m_{\beta}(z')\right|\le L_bL_{\tau}\left\|z-z'\right\|,\qquad z,z'\in\Omega.

with proof in Appendix § 10.§ 2. Thus, controlled motion in the behavior latent produces controlled changes in the rollout safety margin. The strongest Stage I target is the safe-latent set Zδ:={z∈Z:mβ(z)≥0}\mathcal{Z}_{\delta}:=\{z\in\mathcal{Z}:m_{\beta}(z)\ge0\}, whose elements decode to rollouts satisfying the buffered waypoint constraint up to the soft-min gap. LBS, however, does not require Stage I to reach this set before handoff: increasing mβm_{\beta} already reduces the barrier deficit that Stage II must correct. This is the margin quantity used in § 4.2 for latent CBF steering and in § 4.3 to relate latent progress to the path-space correction burden. Because mβm_{\beta} is defined over discrete waypoints, all guarantees following are stated at the waypoint level. Appendix § 10.§ 3 extends these margins to continuous path segments.

Stage I: Latent CBF Steering

Stage I uses the latent margin mβm_{\beta} from § 4.1 as a barrier over the behavior latent. Rather than modifying waypoints independently, it updates zz so that the pretrained decoder produces a rollout with larger safety margin before path-space correction. We model latent steering as z˙=uz\dot{z}=u_z and choose the smallest modification to a reference latent update uzrefu_z^{\mathrm{ref}}. In our implementation, uzref(z)=−γzzu_z^{\mathrm{ref}}(z)=-\gamma_z z with γz>0\gamma_z>0, which mildly contracts the latent toward the prior center and discourages off-support drift. At each latent zz, LBS solves

uz⋆(z)=arg⁡min⁡u∈Rdz ∥u−uzref(z)∥22s.t.∇mβ(z)⊤u+κ sgn⁡(mβ(z))∣mβ(z)∣ρ≥0,(7)u_z^{\star}(z)=\underset{u\in\mathbb{R}^{d_z}}{\arg\min}\ \left\|u-u_z^{\mathrm{ref}}(z)\right\|_2^2\quad\mathrm{s.t.}\quad\nabla m_{\beta}(z)^{\top}u+\kappa\,\operatorname{sgn}(m_{\beta}(z))\left|m_{\beta}(z)\right|^{\rho}\ge0, \tag*{(7)}

where κ>0\kappa>0 and 0<ρ<10<\rho<1 are the CBF rate and exponent. Because Eq. (7) has one affine constraint, it is the projection of uzrefu_z^{\mathrm{ref}} onto a half-space. Let ψ(z):=∇mβ(z)⊤uzref(z)+κ sgn⁡(mβ(z))∣mβ(z)∣ρ\psi(z):=\nabla m_{\beta}(z)^{\top}u_z^{\mathrm{ref}}(z)+\kappa\,\operatorname{sgn}(m_{\beta}(z))\left|m_{\beta}(z)\right|^{\rho}. Then, whenever ∇mβ(z)≠0\nabla m_{\beta}(z)\ne0,

uz⋆(z)=uzref(z)+[−ψ(z)]+∥∇mβ(z)∥22∇mβ(z).(8)u_z^{\star}(z)=u_z^{\mathrm{ref}}(z)+\frac{[-\psi(z)]_{+}}{\left\|\nabla m_{\beta}(z)\right\|_2^2}\nabla m_{\beta}(z). \tag*{(8)}

Thus, Stage I follows the reference update when it already satisfies the latent barrier condition, and otherwise adds the minimum correction along ∇mβ\nabla m_{\beta}; the derivation is in Appendix § 11.§ 1.

Proposition 1 (Latent margin decrease). Let V(z):=[−mβ(z)]+V(z):=[-m_{\beta}(z)]_{+}. Along the Stage I flow z˙=uz⋆(z)\dot{z}=u_z^{\star}(z), whenever mβ(z)<0m_{\beta}(z)<0 and ∇mβ(z)≠0\nabla m_{\beta}(z)\ne0,

V˙(z(t))≤−κV(z(t))ρ.\dot{V}(z(t))\le-\kappa V(z(t))^{\rho}.

Proposition 1 says that Stage I decreases the margin deficit whenever the unsafe decoded rollout has a first-order latent direction for improvement. The proof is a direct consequence of the CBF constraint and is given in Appendix § 11.§ 2. When this first-order sensitivity is uniformly nonzero on the unsafe part of Ω\Omega, the same fractional-power rate gives finite-time recovery.

Theorem 1 (Finite-time Stage-I recovery). Suppose the latent flow z˙=uz⋆(z)\dot{z}=u_z^{\star}(z) remains in Ω\Omega before reaching Zδ\mathcal{Z}_{\delta}, and suppose there exists gm>0g_m>0 such that ∥∇mβ(z)∥2≥gm\left\|\nabla m_{\beta}(z)\right\|_2\ge g_m for all z∈Ωz\in\Omega with mβ(z)<0m_{\beta}(z)<0. Then, for any z0∈Ωz_0\in\Omega with mβ(z0)<0m_{\beta}(z_0)<0, z(t)∈Zδz(t)\in\mathcal{Z}_{\delta} for t≥Tz:=∣mβ(z0)∣1−ρ/(κ(1−ρ))t\ge T_z:=\left|m_{\beta}(z_0)\right|^{1-\rho}/(\kappa(1-\rho)). Moreover, Zδ\mathcal{Z}_{\delta} is forward-invariant.

The proof is in Appendix § 11.§ 3. In practice, Stage I uses projected Euler steps with either backpropagated or finite-difference estimates of ∇mβ\nabla m_{\beta}; implementation details and generator-call cost are given in Appendix § 13.

Stage II Correction and Handoff

Stage I returns a steered latent z+z_+ and decoded rollout τ(z+)\tau(z_+). Stage II then applies the path-space CBF-QP from § 3.2 to certify the remaining waypoint-level violations. The key question is whether improving the latent margin mβm_\beta actually reduces the path-space violation.

Let b~tw(z):=min⁡k(b(τc,k(z))−δ)\tilde{b}_{t_w}(z) := \min_k(b(\tau^{c,k}(z))-\delta) denote the shifted path margin at the start of hard correction, where twt_w is the switch time used by the path-space corrector. For predictor–corrector methods, the switch-time path may differ from the decoded rollout; write this deviation as εpred(z):=max⁡k∥τc,k(z)−τk(z)∥2\varepsilon_{\mathrm{pred}}(z) := \max_k \lVert\tau^{c,k}(z)-\tau^k(z)\rVert_2. For a post-hoc corrector applied directly to τ(z)\tau(z), εpred(z)=0\varepsilon_{\mathrm{pred}}(z)=0.

Proposition 2 (Latent-to-path margin transfer). Under the local regularity condition in § 4.1, for all z∈Ωz \in\Omega,

∣b~tw(z)−mβ(z)∣≤εsoft+Lbεpred(z),εsoft=log⁡(H+1)β.\left|\tilde{b}_{t_w}(z)-m_\beta(z)\right| \le\varepsilon_{\mathrm{soft}}+L_b\varepsilon_{\mathrm{pred}}(z), \qquad\varepsilon_{\mathrm{soft}}=\frac{\log(H+1)}{\beta}.

Proposition 2 is the formal handoff from latent steering to path correction: increasing mβ(z)m_\beta(z) improves the initial path-space margin up to the soft-min gap and any predictor deviation. The proof is in Appendix § 12.§ 1. Thus, Stage I does not need to certify the trajectory by itself; it only needs to reduce the deficit that Stage II starts from.

Corollary 1 (Reduced Stage-II correction burden). Let V+:=[−b~tw(z+)]+V_+ := [-\tilde{b}_{t_w}(z_+) ]_+ be the initial Stage-II barrier deficit. With Stage-II CBF rate ϵ>0\epsilon> 0 and exponent ρ∈(0,1)\rho\in(0,1), the path-space corrector satisfies

Tcorr(z+)≤tw+V+1−ρϵ(1−ρ).T_{\mathrm{corr}}(z_+) \le t_w+\frac{V_+^{1-\rho}}{\epsilon(1-\rho)}.

If the squared intervention magnitude is bounded by cIIVpathρc_{\mathrm{II}}V_{\mathrm{path}}^\rho during correction, then

JII(z+)≤cIIV+1+ρϵ(1+ρ).J_{\mathrm{II}}(z_+) \le\frac{c_{\mathrm{II}}V_+^{1+\rho}}{\epsilon(1+\rho)}.

Corollary 1 shows why the latent stage is useful even when it does not reach Zδ\mathcal{Z}_\delta: by decreasing V+V_+, Stage I tightens both the certified correction-time bound and the intervention-energy bound. The proof follows the standard fractional-power CBF argument and is given in Appendix § 12.§ 2.

It remains to choose when to stop latent steering. Running Stage I longer reduces the terminal deficit but incurs additional latent-steering cost. In the exact-gradient limit, the descent law from Proposition 1 gives V+1−ρ=V01−ρ−ηκ(1−ρ)NzV_+^{1-\rho}=V_0^{1-\rho}-\eta\kappa(1-\rho)N_z, where V0:=[−mβ(z0)]+V_0 := [-m_\beta(z_0)]_+. Combining this decrease with a per-step Stage-I cost cIc_I and the Stage-II energy bound above yields a cost-sensitive stopping rule.

Theorem 2 (Cost-sensitive Stage-I handoff). Suppose the Stage-I decrease law holds along the latent trajectory and the margin-transfer slack in Proposition 2 is absorbed into the Stage-II deficit. For V0>0V_0>0, the resulting upper bound on total cost is minimized at V+⋆=(cIϵ/cII)1/(2ρ)V_+^\star=(c_I\epsilon/c_{\mathrm{II}})^{1/(2\rho)}. The corresponding handoff iteration is N⋆=(V01−ρ−(V+⋆)1−ρ)/(ηκ(1−ρ))N^\star=(V_0^{1-\rho}-(V_+^\star)^{1-\rho})/(\eta\kappa(1-\rho)) when V+⋆<V0V_+^\star<V_0; otherwise, LBS hands off to Stage II immediately.

Theorem 2 says that Stage I should stop once another latent update is expected to cost more than the correction energy it saves downstream. The convexity argument and the explicit total-cost expression are deferred to Appendix § 12.§ 3.

Experiments

We evaluate whether combining behavior-latent steering with path-space CBF certification improves constrained flow-matching planning. The experiments are organized around four questions. Q1: How does LBS compare with existing safe generative planners across different domains and test-time safety constraints? Q2: How does LBS change the generated behavior before path-space correction? Q3: How effective is Stage I’s latent steering design compared with alternative ways of selecting the behavior latent? Q4: What does Stage I achieve on its own, and what does it hand off to Stage II?

Setup. We evaluate on constrained planning tasks spanning low-dimensional navigation, long-horizon maze navigation, and robot end-effector planning. In each domain, the pretrained flow-matching planner is trained on a multimodal dataset with several feasible ways to reach the goal. At test time, we keep the pretrained planner fixed and introduce three different safety constraints, shown in Figure 2. These constraints vary how much the originally generated rollout must change before it can be certified, but the method is not given this structure explicitly. Full domain construction, obstacle layouts, model architectures, and training details are provided in Appendix § 14.

Experimental domains and test-time safety constraints

Figure 2. Experimental domains and test-time safety constraints. Each row shows one planning domain: 2D point-navigation, Maze2D, and Franka 3D end-effector planning. The first column visualizes the original scene and multimodal demonstration dataset, where multiple behaviors can reach the same goal. The remaining columns show three test-time safety constraints imposed on the same pretrained planner. Green circles denote starts, orange stars denote goals, and red shaded regions denote unsafe sets. These constraints test whether a method can preserve safety and goal reaching when certification requires more than local path repair.

Baselines and Metrics. We compare LBS against vanilla flow-matching planner, SAFEDIFFUSER [40], SAFEFLOW [8], and SAFEFLOWMATCHER [41], which corresponds to using Stage II without latent steering. We report Barrier Safety (referred to as Safety below, with Maze2D walls handled as described in Appendix § 14.§ 3), Reach, final goal distance (ED), CBF intervention Energy, curvature smoothness (CS), and per-episode Stage-I/Stage-II runtime. Together, these metrics distinguish whether a method is safe, goal-reaching, or both, with low correction burden.

Performance Comparison Across Domains and Constraints

Table 1 reports Safety, Reach, and intervention Energy for all three constraints in each domain. Final goal distance, curvature smoothness, and runtime are reported in Appendix § 17. This comparison evaluates whether LBS improves the overall safety–performance tradeoff relative to existing path-level safety filters under the same pretrained planner and test-time constraints.

ConstraintMethod2D Safety↑2D Reach↑2D Energy↓Franka Safety↑Franka Reach↑Franka Energy↓Maze2D Safety↑Maze2D Reach↑Maze2D Energy↓
IVanilla FM12%100%–12%100%–0%50%–
ISAFE DIFFUSER100%10%1.226100%0%0.0023100%0%0.0288
ISAFE FLOW100%18%1.077100%16%0.0020100%0%0.1208
ISAFE FLOW MATCHER100%18%1.166100%14%0.0075100%0%0.2668
IFull LBS100%100%0.037100%100%0.0004100%95%0.010
IIVanilla FM0%100%–0%100%–38%50%–
IISAFE DIFFUSER100%34%0.728100%0%0.0023100%7%0.0010
IISAFE FLOW100%20%0.976100%0%0.0023100%25%0.0624
IISAFE FLOW MATCHER100%22%1.051100%0%0.008698%18%0.1404
IIFull LBS100%90%0.160100%100%0.0004100%90%0.009
IIIVanilla FM0%100%–0%100%–28%50%–
IIISAFE DIFFUSER100%0%1.321100%0%0.0023100%7%0.0072
IIISAFE FLOW100%4%1.262100%0%0.0023100%38%0.0345
IIISAFE FLOW MATCHER100%4%1.366100%0%0.0086100%53%0.0740
IIIFull LBS100%82%0.303100%98%0.0028100%93%0.004

Table 1. Performance comparison across domains and test-time safety constraints. Each domain uses the same pretrained flow-matching planner across methods. Final goal distance, curvature smoothness, and runtime are reported in Appendix § 17.

Across domains and constraints, the table shows a clear separation between goal-directed generation and certified safety. The unconstrained flow-matching planner often preserves the task behavior learned from demonstrations, so its rollouts remain close to the goal, but it has no mechanism to adapt that behavior to new safety constraints. This leads to goal-reaching trajectories that are frequently unsafe. Existing CBF-based safety filters correct this failure in the opposite direction: they reliably improve safety, but because the intervention is applied in sample or waypoint space after a behavior has already been selected, the corrected trajectory can lose the structure needed to complete the task. This is reflected not only in reduced reach, but also in larger final distance (Table 6) and higher correction energy.

DomainConstraintMethodSafety↑Reach↑ED↓Energy↓CS↓T-I (s)↓T-II (s)↓
2DIVanilla FM12%100%0.21–0.88–0.09
2DISafeDiffuser100%10%6.381.2261.56–0.11
2DISafeFlow100%18%5.571.0771.42–0.10
2DISafeFlowMatcher100%18%5.611.1661.56–0.10
2DIFull LBS100%100%0.230.0370.870.350.10
2DIIVanilla FM0%100%0.21–0.88–0.09
2DIISafeDiffuser100%34%3.750.7281.24–0.12
2DIISafeFlow100%20%4.900.9761.31–0.11
2DIISafeFlowMatcher100%22%4.991.0511.44–0.11
2DIIFull LBS100%90%0.890.1601.030.650.11
2DIIIVanilla FM0%100%0.21–0.88–0.10
2DIIISafeDiffuser100%0%6.831.3211.61–0.12
2DIIISafeFlow100%4%6.441.2621.48–0.10
2DIIISafeFlowMatcher100%4%6.521.3661.66–0.10
2DIIIFull LBS100%82%0.970.3030.821.800.11
FrankaIVanilla FM12%100%0.002–0.14–0.08
FrankaISafeDiffuser100%0%0.2500.00230.18–0.09
FrankaISafeFlow100%16%0.2140.00200.17–0.08
FrankaISafeFlowMatcher100%14%0.2410.00750.79–0.08
FrankaIFull LBS100%100%0.0160.00040.280.800.09
FrankaIIVanilla FM0%100%0.002–0.14–0.08
FrankaIISafeDiffuser100%0%0.2500.00230.18–0.10
FrankaIISafeFlow100%0%0.2510.00230.17–0.09
FrankaIISafeFlowMatcher100%0%0.2760.00860.87–0.09
FrankaIIFull LBS100%100%0.0170.00040.341.100.09
FrankaIIIVanilla FM0%100%0.002–0.14–0.09
FrankaIIISafeDiffuser100%0%0.2500.00230.18–0.11
FrankaIIISafeFlow100%0%0.2510.00230.17–0.10
FrankaIIISafeFlowMatcher100%0%0.2760.00860.87–0.10
FrankaIIIFull LBS100%98%0.0420.00280.501.550.10
Maze2DIVanilla FM0%50%2.69–0.17–0.44
Maze2DISafeDiffuser100%0%5.130.02880.11–0.63
Maze2DISafeFlow100%0%4.970.12080.21–0.84
Maze2DISafeFlowMatcher100%0%4.830.26680.63–0.84
Maze2DIFull LBS100%95%0.710.0100.154.500.68
Maze2DIIVanilla FM38%50%2.69–0.17–0.42
Maze2DIISafeDiffuser100%7%6.380.00100.10–0.50
Maze2DIISafeFlow100%25%3.310.06240.20–0.70
Maze2DIISafeFlowMatcher98%18%3.760.14040.42–0.68
Maze2DIIFull LBS100%90%0.870.0090.163.800.58
Maze2DIIIVanilla FM28%50%2.69–0.17–0.43
Maze2DIIISafeDiffuser100%7%6.370.00720.10–0.49
Maze2DIIISafeFlow100%38%2.430.03450.19–0.69
Maze2DIIISafeFlowMatcher100%53%2.080.07400.30–0.69
Maze2DIIIFull LBS100%93%0.270.0040.294.100.62

Table 6. Full performance comparison across all test-time safety constraints. Best per-column value within each constraint block is bolded; ties and values within 10% of the per-column optimum are also bolded. Stage-I and Stage-II runtimes are not bolded. Constraints I, II, III correspond to mode selection, mode interpolation, and residual correction, respectively.

Full LBS changes this pattern by intervening before path-space certification: the latent stage can change the selected behavior, giving Stage II a rollout that is closer to both the safe set and the task solution. This explains why LBS preserves goal reaching while maintaining high safety, and why its CBF intervention energy is lower in most settings. Because all methods use the same pretrained planner within each domain, the gains come from where safety intervention is applied at test time rather than from a stronger generator or additional task-specific training. The runtime columns in Table 6 reflect the current implementation tradeoff: Stage I adds overhead due to zeroth-order finite-difference gradients, while Stage II remains comparable to path-level baselines. This overhead grows linearly with the behavior-latent dimension dzd_z (Appendix § 13.§ 3), which is set by the number of demonstrated behavior modes rather than by the horizon or robot degrees of freedom (dz≤4d_z \le4 in all domains), and the resulting 0.35–4.50 s of Stage I is incurred once before execution. Thus, under the present implementation, the main efficiency gain appears as reduced correction burden rather than lower wall-clock time; cheaper latent-gradient estimators should reduce the Stage I cost while preserving the qualitative advantage.

Ablation: Latent Steering Provides the Warm Start

The main comparison shows that LBS improves the safety–goal-reaching tradeoff, but the table alone does not explain how the two stages interact. We therefore visualize a representative episode in Figure 3, comparing path-space correction with and without the latent-steering stage. The figure is organized as two rows with five columns. The first row shows Full LBS: the rollout is first decoded from the initial behavior latent, then updated through Stage I, and finally passed to Stage II for path-space CBF correction. The second row removes Stage I and applies the same Stage II corrector directly to the original decoded rollout. The first panel of Full LBS is therefore the same rollout as the Stage-II-only warm start shown in the third panel of the second row.

Figure 3. Latent steering provides the warm start needed for path-space repair. Stage I performs behavior-level selection by steering the latent and changing the decoded rollout before certification; Stage II then applies path-level CBF repair to remove residual violations. The second row removes Stage I and applies the same path-space correction directly, corresponding to SAFEFLOWMATCHER. Without the latent-steered warm start, the local corrector remains tied to the original rollout and fails to produce a goal-reaching safe path. With Stage I, the corrected trajectory starts from a better behavior and Stage II only needs to repair the remaining local violation.

This visualization isolates the role of Stage I. Before path-space correction, the initial rollout is unsafe and poorly positioned for local repair. When Stage II starts directly from this cold rollout, the CBF-QP can push the trajectory toward the safe set, but the correction remains tied to the originally selected behavior and fails to recover a goal-reaching path. In contrast, Stage I changes the decoded behavior before certification: by the third column of the LBS row, the rollout is not necessarily fully safe, but it is already in a much better region for downstream correction. Starting from this latent-steered warm start, Stage II only needs to remove residual waypoint-level violations, and the final trajectory remains both safe and task-completing.

This ablation supports the central semantic-to-path design of LBS. Stage I is not intended to replace CBF certification, and Stage II is not sufficient when initialized from a behavior that is incompatible with the new constraint. The improvement comes from their composition: latent steering changes the selected behavior at the level of the generator, while path-space correction certifies the remaining local violations. The comparison also explains the lower intervention energy observed in Table 1: after Stage I, the corrector starts from a less-violating and more goal-directed rollout, so it does not need to perform a large deformation in waypoint space.

Ablation Study of the Stage-I Latent Steering

Table 2 compares ways of selecting the latent before path-space correction. All methods use the same pretrained generator, the same safety margin mβ(z)m_{\beta}(z), and the identical Stage-II corrector:

  • Best-of-NN (BoN): sample NN latents from the prior and select the decoded rollout with the largest mβm_{\beta}. We report N∈{1,4,16,64}N \in\{1, 4, 16, 64\} (BoN-NN).

  • Plain latent gradient ascent (PLGA): directly ascend mβ(z)m_{\beta}(z), with the best step size per domain from {10−3,…,1}\{10^{-3}, \ldots, 1\}.

PLGA and LBS share the same initial latent, gradient estimator, clipping region Ω\Omega, early-stopping criterion, and Stage-I wall-clock budget: the update rule is the only difference. We also report Stage I only, which decodes the steered latent without Stage-II correction. Table 2 supports three observations:

Method2D Safety↑2D Reach↑Franka Safety↑Franka Reach↑Maze2D Safety↑Maze2D Reach↑
Stage II only (SAFEFLOWMATCHER)100%4%100%0%100%53%
Stage I only10%100%10%100%20%95%
BoN-1 + Stage II100%0%100%0%100%0%
BoN-4 + Stage II100%0%100%0%90%48%
BoN-16 + Stage II100%0%100%32%100%5%
BoN-64 + Stage II100%0%100%36%98%0%
PLGA + Stage II100%76%100%92%100%68%
Full LBS100%82%100%98%100%93%

Table 2. Alternatives to Stage I (Constraint III). All methods share the pretrained generator, the safety margin mβm_\beta, and the Stage-II corrector.

  • Neither stage suffices alone. Stage II alone is safe but rarely reaches the goal, whereas Stage I alone preserves reach but leaves residual violations. Stage I does not need to reach the buffered safe-latent set for the two to combine well: its terminal margin is still negative in most episodes, yet it shrinks the deficit handed to Stage II (§ 5.4).

  • Increasing NN does not recover goal reaching. BoN reaches the goal in at most 48% of episodes for any NN, and Reach is non-monotonic in NN (in Maze2D, 48% at N=4N = 4 but 0% at N=64N = 64). BoN can only choose among behaviors exposed by prior sampling, and selecting by safety margin among them favors conservative behaviors that do not complete the task.

  • The CBF-QP update outperforms plain gradient ascent. PLGA, which does optimize the latent, closes most of the gap, but LBS achieves higher Reach in all three domains, with the largest gap in Maze2D, where preserving task-level structure during safety optimization is hardest. PLGA always moves along ∇zmβ\nabla_z m_{\beta}, so it keeps pushing the latent toward higher-margin, often

more conservative behaviors even when the margin is already improving fast enough. The CBF-QP instead follows the reference update uzrefu_z^{\mathrm{ref}} whenever it already satisfies the prescribed margin-improvement condition, and otherwise adds only the smallest correction along ∇zmβ\nabla_z m_\beta needed to satisfy it (Eq. (8)). This better preserves goal-directed behavior when aggressive margin ascent conflicts with progress toward the goal.

What Stage-I Latent Steering Hands Off to Stage II

Section 5.3 shows that Stage-I latent steering yields the best safety–reach trade-off once combined with Stage II, but not what the steering itself changes before the handoff. We therefore track the Stage-I latent trajectory directly (Table 3): how much the latent margin improves, whether the steering gradient remains informative, and how far from the buffered safe-latent set Stage I leaves the latent when Stage II takes over. The gradient norms show no systematic collapse in the evaluated regions, and the latent margin improves substantially in every domain, including 2D point-navigation, where clipping activates in every episode. The terminal margin nevertheless remains negative in most episodes: Stage I typically does not reach the buffered safe-latent set on its own, but hands Stage II a much smaller deficit. This is the warm-start role analyzed in Proposition 2 and Corollary 1.

DomainInitial →\to terminal mβm_\beta∣∇mβ∣2|\nabla m_\beta|_2Clip frequencyTerminal mβ<0m_\beta< 0
2D−1.03→−0.08-1.03 \to-0.080.46100%90%
Franka−0.21→−0.006-0.21 \to-0.0060.098%84%
Maze2D−0.63→−0.11-0.63 \to-0.110.1822%88%

Table 3. Stage-I diagnostics for Constraint III in each domain. Initial →\to terminal mβm_\beta: median buffered latent margin before and after Stage I. ∥∇mβ∥2\|\nabla m_\beta\|_2: median norm of the estimated pulled-back gradient along the Stage-I iterates. Clip frequency: fraction of episodes in which the projection onto Ω\Omega activates at least once. Terminal mβ<0m_\beta< 0: fraction of episodes whose buffered margin is still negative when Stage I hands off to Stage II.

Limitations and Conclusion

We presented Latent Barrier Steering (LBS), a two-stage framework for safe flow-matching planning that steers a geometry-aligned behavior latent before path-space CBF certification. LBS gives the path-space corrector a safer, more goal-directed warm start, reducing the need to reshape an unsuitable rollout locally. Our analysis shows that latent margin improvement reduces the Stage II deficit, yielding finite-time recovery conditions and tighter correction-time and intervention-energy certificates. Empirically, LBS improves the safety–goal–reaching tradeoff over path-level safety filters across constrained planning tasks. The safety guarantee covers the planned path certified by Stage II. For Franka, this is the planned end-effector path, so tracking error and full-body collisions are outside its scope. The finite-time Stage I result depends on local regularity and non-vanishing pulled-back gradients of the learned latent-to-trajectory map, which the training objective encourages but does not certify. The current zeroth-order Stage I implementation also adds runtime overhead. Cheaper gradient estimators or learned margin critics are natural next steps.

Acknowledgments and Disclosure of Funding

This work used computational resources and services provided by the Unity Research Computing Platform. We also thank the anonymous reviewers for their comments and suggestions, which helped strengthen and clarify this work.

References

Notation

  • Z⊂Rdz\mathcal{Z} \subset\mathbb{R}^{d_z}: latent space; Ω⊂Z\Omega\subset\mathcal{Z}: compact region of validity for the latent CBF analysis.

  • τ(z)=(τ0(z),…,τH(z))∈DH+1\tau(z) = (\tau^0(z), \ldots, \tau^H(z)) \in\mathcal{D}^{H+1}: rollout at latent zz with context and noise fixed or averaged out.

  • hk(z)≜b(τk(z))−δh_k(z) \triangleq b(\tau^k(z)) - \delta: per-waypoint shifted barrier; mβ(z)=−β−1log⁡∑ke−βhk(z)m_\beta(z) = -\beta^{-1} \log\sum_k e^{-\beta h_k(z)}: softmin margin.

  • Zδ={z∈Z:mβ(z)≥0}\mathcal{Z}_\delta= \{z \in\mathcal{Z} : m_\beta(z) \ge0\}: robust safe latent set.

  • uzref:Z→Rdzu_z^{\mathrm{ref}} : \mathcal{Z} \to\mathbb{R}^{d_z}: locally bounded reference update; uz⋆u_z^\star: solution of (7).

  • Jτk(z)∈RdD×dzJ_{\tau^k}(z) \in\mathbb{R}^{d_D \times d_z}: Jacobian of τk\tau^k at zz; Hτk(z)H_{\tau^k}(z): Hessian tensor.

  • [x]+=max⁡(x,0)[x]_+ = \max(x, 0), applied componentwise on vectors.

  • Uref=sup⁡z∈Ω∥uzref(z)∥2U_{\mathrm{ref}} = \sup_{z \in\Omega} \lVert u_z^{\mathrm{ref}}(z) \rVert_2, ∥∇mβ∥∞=sup⁡z∈Ω∥∇mβ(z)∥2\lVert\nabla m_\beta\rVert_\infty= \sup_{z \in\Omega} \lVert\nabla m_\beta(z) \rVert_2, Mm=sup⁡z∈Ω∣mβ(z)∣M_m = \sup_{z \in\Omega} |m_\beta(z)|.

  • gmg_m is the non-degeneracy lower bound on ∥∇mβ∥2\lVert\nabla m_\beta\rVert_2 on the unsafe set (hypothesis of Theorem 1); LbL_b, LτL_\tau are the Lipschitz constants of the barrier and decoder from Section 4.1; Lm≤LbLτL_m \le L_bL_\tau is the resulting Lipschitz constant of mβm_\beta (Appendix B.2); L∇mL_{\nabla m} is the Lipschitz constant of ∇mβ\nabla m_\beta used in the optional discrete-time analysis (Appendix C.4).

Auxiliary Soft-Min and Geometry Facts

This appendix collects three small derivations and one geometry remark that the main text invokes without proof. Sections B.1–B.3 are referenced from Section 4.1; Section B.4 comments on the modeling status of the local geometry condition.

Soft-min margin and soft-min gap

The soft-min surrogate mβm_\beta in main-text eq. (4.1) sandwiches the true worst-waypoint margin: for any β>0\beta> 0 and any finite collection {hk}k=0H⊂R\{h_k\}_{k=0}^{H} \subset\mathbb{R},

min⁡khk−log⁡(H+1)β≤mβ=−β−1log⁡∑k=0He−βhk≤min⁡khk.(9)\min_k h_k - \frac{\log(H+1)}{\beta} \le m_\beta= -\beta^{-1}\log\sum_{k=0}^{H}e^{-\beta h_k} \le\min_k h_k. \tag*{(9)}

This is the bound stated in main-text eq. (4.1); the soft-min gap is ϵsoft=β−1log⁡(H+1)\epsilon_{\mathrm{soft}} = \beta^{-1}\log(H+1).

Proof. Let h⋆=min⁡khkh_\star= \min_k h_k. Since e−βh⋆≤∑ke−βhk≤(H+1)e−βh⋆e^{-\beta h_\star} \le\sum_k e^{-\beta h_k} \le(H+1)e^{-\beta h_\star}, applying −β−1log⁡(⋅)-\beta^{-1}\log(\cdot) (which reverses inequalities) gives h⋆−β−1log⁡(H+1)≤mβ≤h⋆h_\star- \beta^{-1}\log(H+1) \le m_\beta\le h_\star, which is (9).

The soft-min gradient is the softmax distribution: ∂hkmβ=wk≜e−βhk/∑je−βhj∈[0,1]\partial_{h_k}m_\beta= w_k \triangleq e^{-\beta h_k}/\sum_j e^{-\beta h_j} \in[0,1] with ∑kwk=1\sum_k w_k = 1. Hence mβm_\beta is 1-Lipschitz in h\mathbf{h} under ∥⋅∥∞\lVert\cdot\rVert_\infty, since ∣mβ(h)−mβ(h′)∣≤∥w∥1∥h−h′∥∞=∥h−h′∥∞|m_\beta(\mathbf{h}) - m_\beta(\mathbf{h}')| \le\lVert\mathbf{w}\rVert_1\lVert\mathbf{h} - \mathbf{h}'\rVert_\infty= \lVert\mathbf{h} - \mathbf{h}'\rVert_\infty by Hölder’s inequality.

Lipschitz latent margin

This subsection derives main-text eq. (4.1): the Lipschitz constant Lm≤LbLτL_m \le L_bL_\tau for z↦mβ(z)z \mapsto m_\beta(z).

Derivation of eq. (4.1). Write hk(z):=b(τk(z))−δh_k(z) := b(\tau^k(z)) - \delta and h(z):=(h0(z),…,hH(z))\mathbf{h}(z) := (h_0(z), \ldots, h_H(z)). By main-text eq. (4.1), each hkh_k is LbLτL_bL_\tau-Lipschitz on Ω\Omega:

∣hk(z)−hk(z′)∣≤Lb∥τk(z)−τk(z′)∥2≤LbLτ∥z−z′∥2.|h_k(z) - h_k(z')| \le L_b\lVert\tau^k(z) - \tau^k(z')\rVert_2 \le L_bL_\tau\lVert z - z'\rVert_2.

Combined with the 1-Lipschitzness of mβm_\beta in h\mathbf{h} under ∥⋅∥∞\lVert\cdot\rVert_\infty (Section B.1),

∣mβ(z)−mβ(z′)∣≤∥h(z)−h(z′)∥∞=max⁡k∣hk(z)−hk(z′)∣≤LbLτ∥z−z′∥2.|m_\beta(z) - m_\beta(z')| \le\lVert\mathbf{h}(z) - \mathbf{h}(z')\rVert_\infty= \max_k |h_k(z) - h_k(z')| \le L_bL_\tau\lVert z - z'\rVert_2.

The constant Lm≤LbLτL_m \le L_bL_\tau does not depend on β\beta: the soft-min weights only redistribute Lipschitz mass across waypoints, never amplify it.

Waypoint-to-segment buffer

This subsection extends the waypoint-level margin to safety on continuous path segments, as referenced from § 4.1. Suppose consecutive decoded waypoints are at most ℓ\ell apart and bb is LbL_b-Lipschitz. We show

min⁡kb(τk(z))≥Lbℓ2⟹[τk(z),τk+1(z)]⊆{x:b(x)≥0}∀k,(10)\min_k b(\tau^k(z)) \ge\frac{L_b\ell}{2} \quad\Longrightarrow\quad[\tau^k(z),\tau^{k+1}(z)] \subseteq\{x : b(x) \ge0\}\quad\forall k, \tag*{(10)}

a one-step Lipschitz bridge using the elementary geometric fact that any point on a line segment is at most half the segment length from at least one endpoint.

Derivation of (10). Fix kk and x∈[τk(z),τk+1(z)]x \in[\tau^k(z),\tau^{k+1}(z)]. The two distances ∥x−τk∥2\lVert x-\tau^k\rVert_2 and ∥x−τk+1∥2\lVert x-\tau^{k+1}\rVert_2 sum to ∥τk+1−τk∥2≤ℓ\lVert\tau^{k+1}-\tau^k\rVert_2 \le\ell, so at least one is ≤ℓ/2\le\ell/2. Calling the corresponding waypoint yy, LbL_b-Lipschitzness of bb gives

b(x)≥b(y)−Lb∥x−y∥2≥min⁡kb(τk(z))−Lbℓ2≥0b(x) \ge b(y)-L_b\lVert x-y\rVert_2 \ge\min_k b(\tau^k(z))-\frac{L_b\ell}{2} \ge0

by hypothesis. Thus b(x)≥0b(x) \ge0 for every xx on every inter-waypoint segment.

The factor of 12\frac{1}{2} comes entirely from the geometric step “the nearer endpoint is within ℓ/2\ell/2”; without it the buffer would have to be LbℓL_b\ell. Choosing δ≥Lbℓ/2\delta\ge L_b\ell/2 in the main text is the tightest robustness margin that makes a buffered waypoint certificate sufficient for segment safety.

Remarks on the latent safe set and learned latent geometry

Interpretation of the latent safe set. The safe-latent set Zδ={z:mβ(z)≥0}\mathcal{Z}_\delta= \{z : m_\beta(z) \ge0\} is the preimage, through the learned decoder, of planned trajectories that satisfy the buffered waypoint condition. It is not a physical forward-invariance certificate for the robot dynamics. Stage I also does not optimize a notion of safety defined by Euclidean latent geometry alone: for every candidate zz, LBS decodes τ(z)\tau(z), evaluates the trajectory-space barriers b(τk(z))b(\tau^k(z)), and updates zz through the pulled-back gradient ∇zmβ(z)\nabla_zm_\beta(z), so the update is determined by the safety of the decoded trajectory. Accordingly, the forward invariance of Zδ\mathcal{Z}_\delta in Theorem 1 refers to the latent flow z˙=uz∗(z)\dot{z}=u^*_z(z), and the final safety claim of LBS is the path-space certificate provided by Stage II. This is consistent with existing safe generative planners [40, 8, 41], which also impose safety on the trajectories generated by a diffusion or flow-matching model. LBS adds a behavior-selection step before path-space correction. Throughout the paper, safety refers to the satisfaction of these constraints by the generated plan. It is distinct from the security and privacy of the generative model itself [30, 22].

Learned latent geometry. The local Lipschitz condition (main-text eq. (4.1)) is an analysis assumption, not a global consequence of the soft-DTW objective. The geometry loss [6] encourages nearby latents to decode to nearby behavior traces, but global bi-Lipschitz guarantees would require stronger conditions such as full training support, smooth non-collapsed decoder, and exclusion of off-manifold extrapolation. We therefore restrict Stage I to a clipped region Ω\Omega around the prior center and rely on the local condition only inside Ω\Omega.

Relation to parameterized diffusion policies. The geometry objective is inherited from parameterized diffusion policies (PDP) [44], which show that, trained on multimodal demonstrations, it yields a low-dimensional behavior manifold that supports smooth interpolation between demonstrated strategies and the synthesis of intermediate behaviors. PDP also ablates this term: removing it produces a geometrically warped latent space and substantially degrades gradient-based adaptation, while a discrete behavior representation cannot synthesize intermediate strategies. Meaningful latent interpolation therefore does not come from flow matching alone, but from the combination of multimodal demonstrations, the geometry-alignment objective, and a continuous behavior-conditioned generator. Constraint II in our experiments tests this property directly: every demonstrated mode is blocked, so success requires decoding an unseen intermediate behavior rather than selecting a demonstrated one. LBS reaches the goal in 90%, 100%, and 90% of episodes in 2D point-navigation, Franka, and Maze2D, respectively, at 100% Safety (Table 1). We do not claim robustness to arbitrarily misaligned latent spaces. LBS relies on this learned local structure and uses it only within Ω\Omega.

Proofs for Stage-I Latent Steering

This appendix proves the Stage-I results stated in § 4.2: the closed-form projection (Section C.1), Proposition 1 (Section C.2), and Theorem 1 (Section C.3). A discrete-time and inexact-gradient version is given as an optional extension (Section C.4).

Closed-form projection for the latent CBF-QP

This subsection derives the closed-form solution (8). With ψ(z):=∇mβ(z)Tuzref(z)+κsgn⁡(mβ(z))∣mβ(z)∣ρ\psi(z) := \nabla m_{\beta}(z)^{\mathsf{T}}u_z^{\mathrm{ref}}(z) + \kappa\operatorname{sgn}(m_{\beta}(z))|m_{\beta}(z)|^{\rho} as defined in the main text, (7) has a single linear inequality constraint, so its solution is the Euclidean projection of uzrefu_z^{\mathrm{ref}} onto a closed half-space.

Derivation of (8). Form the Lagrangian

L(u,μ)=∥u−uzref∥22−μ(∇mβTu+κsgn⁡(mβ)∣mβ∣ρ),μ≥0.\mathcal{L}(u,\mu)=\lVert u-u_z^{\mathrm{ref}}\rVert_2^2-\mu\left(\nabla m_{\beta}^{\mathsf{T}}u+\kappa\operatorname{sgn}(m_{\beta})|m_{\beta}|^{\rho}\right),\qquad\mu\ge0.

Stationarity gives u−uzref=μ2∇mβu-u_z^{\mathrm{ref}}=\frac{\mu}{2}\nabla m_{\beta}, i.e., u=uzref+λ∇mβu=u_z^{\mathrm{ref}}+\lambda\nabla m_{\beta} with λ:=μ/2≥0\lambda:=\mu/2\ge0. If ψ(z)≥0\psi(z)\ge0, the reference is feasible and complementary slackness gives λ=0\lambda=0. If ψ(z)<0\psi(z)<0, the constraint binds at the optimum, so ψ(z)+λ∥∇mβ∥22=0\psi(z)+\lambda\lVert\nabla m_{\beta}\rVert_2^2=0, giving λ=−ψ(z)/∥∇mβ∥22>0\lambda=-\psi(z)/\lVert\nabla m_{\beta}\rVert_2^2>0. Combining the two cases yields λ(z)=[−ψ(z)]+/∥∇mβ(z)∥22\lambda(z)=[-\psi(z)]_+/\lVert\nabla m_{\beta}(z)\rVert_2^2 and (8).

The projection has no free parameter: once uzrefu_z^{\mathrm{ref}} and the CBF rate (κ,ρ)(\kappa,\rho) are fixed, uz∗u_z^* is uniquely determined wherever ∇mβ(z)≠0\nabla m_{\beta}(z)\ne0.

Proof of Proposition 1: latent margin decrease

Let V(z):=[−mβ(z)]+V(z):=[-m_{\beta}(z)]_+. We show that whenever the CBF constraint in (7) is satisfied at zz with mβ(z)<0m_{\beta}(z)<0, the latent flow z˙=uz∗(z)\dot z=u_z^*(z) produces V˙(z)≤−κV(z)ρ\dot V(z)\le-\kappa V(z)^\rho.

Proof of Proposition 1. On {mβ(z)<0}\{m_{\beta}(z)<0\}, V(z)=−mβ(z)>0V(z)=-m_{\beta}(z)>0 and sgn⁡(mβ)=−1\operatorname{sgn}(m_{\beta})=-1. The CBF constraint in (7) becomes ∇mβ(z)Tuz∗(z)≥κV(z)ρ\nabla m_{\beta}(z)^{\mathsf{T}}u_z^*(z)\ge\kappa V(z)^\rho. Since V(z)=−mβ(z)V(z)=-m_{\beta}(z) on this set, V˙(z(t))=−m˙β(z(t))=−∇mβ(z(t))Tuz∗(z(t))\dot V(z(t))=-\dot m_{\beta}(z(t))=-\nabla m_{\beta}(z(t))^{\mathsf{T}}u_z^*(z(t)). Combining,

V˙(z(t))≤−κV(z(t))ρ.\dot V(z(t))\le-\kappa V(z(t))^\rho.

Proof of Theorem 1: finite-time recovery

Theorem 1 adds a non-degeneracy hypothesis ∥∇mβ(z)∥2≥gm>0\lVert\nabla m_{\beta}(z)\rVert_2\ge g_m>0 on the unsafe set, under which the descent inequality from Proposition 1 integrates to a finite-time bound. Before the proof we record well-posedness of the Stage-I flow.

Lemma 1 (Well-posedness of the latent flow). Under the local Lipschitz condition of § 4.1, the non-degeneracy hypothesis, and locally Lipschitz uzrefu_z^{\mathrm{ref}}, the closed-form solution uz∗u_z^* in (8) is locally bounded and locally Lipschitz on Ω∖Zδ\Omega\setminus\mathcal{Z}_{\delta}. Hence z˙=uz∗(z)\dot z=u_z^*(z) admits a unique Carathéodory solution from any z(0)∈Ωz(0)\in\Omega until it enters Zδ\mathcal{Z}_{\delta} or exits Ω\Omega.

Proof. On Ω∖Zδ\Omega\setminus\mathcal{Z}_{\delta}, the denominator ∥∇mβ∥22\lVert\nabla m_{\beta}\rVert_2^2 is bounded below by gm2>0g_m^2>0. Since ∇mβ\nabla m_{\beta}, mβm_{\beta}, and uzrefu_z^{\mathrm{ref}} are locally Lipschitz on Ω\Omega, and ψ↦[−ψ]+\psi\mapsto[-\psi]_+ is 1-Lipschitz, (8) is a rational function of locally Lipschitz quantities with bounded-below denominator, so uz∗u_z^* is locally Lipschitz. Picard–Lindelöf applies on Ω∖Zδ\Omega\setminus\mathcal{Z}_{\delta}.

Proof of Theorem 1. On Ω∖Zδ\Omega\setminus\mathcal{Z}_{\delta} and under non-degeneracy, Proposition 1 gives the strict descent

V˙(z(t))≤−κV(z(t))ρ,V(z(t))>0.(11)\dot V(z(t))\le-\kappa V(z(t))^\rho,\qquad V(z(t))>0. \tag*{(11)}

The scalar comparison ODE y˙=−κyρ\dot y=-\kappa y^\rho with y(0)=y(0)=V(z0)y(0)=y(0)=V(z_0) separates as y−ρ dy=−κ dty^{-\rho}\,dy=-\kappa\,dt and integrates to y(t)1−ρ=y(0)1−ρ−κ(1−ρ)ty(t)^{1-\rho}=y(0)^{1-\rho}-\kappa(1-\rho)t, vanishing at t∗=y(0)1−ρ/(κ(1−ρ))t^*=y(0)^{1-\rho}/(\kappa(1-\rho)). By the comparison lemma [19 Lemma 3.4], V(z(t))≤y(t)V(z(t))\le y(t) on [0,t∗][0,t^*], so V(z(t))=0V(z(t))=0 for t≥Tz=∣mβ(z0)∣1−ρ/(κ(1−ρ))t\ge T_z=|m_{\beta}(z_0)|^{1-\rho}/(\kappa(1-\rho)). Forward invariance of Zδ\mathcal{Z}_{\delta} follows because at any boundary point V=0V=0 and V˙≤0\dot V\le0 by (11), interpreted as zero at V=0V=0.

Optional: discrete-time and inexact-gradient steering

This subsection states a robustness guarantee for the discrete-time projected Euler iterate of § 4.2 when the latent gradient is replaced by a finite-difference estimate. It is not used by the main-text claims but supports implementation analysis. We first record an auxiliary Lipschitz bound on ∇mβ\nabla m_\beta used by Taylor’s theorem along the Euler step.

Lemma 2 (Lipschitz gradient of mβm_\beta). If, in addition to the conditions of § 4.1, τ\tau is C2C^2 on Ω\Omega with ∥Jτ∥op≤Lτ\lVert J_\tau\rVert_{\mathrm{op}} \le L_\tau, ∥Hτ∥op≤Mτ\lVert H_\tau\rVert_{\mathrm{op}} \le M_\tau, and ∇b\nabla b is L∇bL_{\nabla b}-Lipschitz, then ∇mβ\nabla m_\beta is Lipschitz on Ω\Omega with

L∇m≤MτLb+Lτ2L∇b+β(H+1)2(LbLτ)2.(12)L_{\nabla m} \le M_\tau L_b + L_\tau^2 L_{\nabla b} + \frac{\beta(H+1)}{2}(L_bL_\tau)^2. \tag*{(12)}

Proof. Writing ∇mβ(z)=∑kwk(z)∇hk(z)\nabla m_\beta(z) = \sum_k w_k(z)\nabla h_k(z) with ∇hk=JτkT∇b∘τk\nabla h_k = J_\tau^{k\mathsf{T}}\nabla b \circ\tau^k, we bound the two factors separately. Each ∇hk\nabla h_k is (MτLb+Lτ2L∇b)(M_\tau L_b+L_\tau^2L_{\nabla b})-Lipschitz by adding/subtracting Jτk(z′)T∇b(τk(z))J_{\tau^k}(z')^{\mathsf T}\nabla b(\tau^k(z)). The softmax w(h)w(h) has Jacobian ∂hw=β(diag⁡(w)−wwT)\partial_h w = \beta(\operatorname{diag}(w)-ww^{\mathsf T}) with operator norm ≤β/2\le\beta/2 (a covariance with eigenvalues bounded by 1/21/2, since Var⁡w(v)≤1/2\operatorname{Var}_w(v)\le1/2 for unit vv, with equality at two-point uniform ww). Combined with ∥∂zh∥op≤H+1LbLτ\lVert\partial_z h\rVert_{\mathrm{op}} \le\sqrt{H+1}L_bL_\tau and Cauchy–Schwarz, ∥w(z)−w(z′)∥1≤β(H+1)2LbLτ∥z−z′∥2\lVert w(z)-w(z')\rVert_1 \le\frac{\beta(H+1)}{2}L_bL_\tau\lVert z-z'\rVert_2. Combining (with ∥∇hk∥2≤LbLτ\lVert\nabla h_k\rVert_2 \le L_bL_\tau),

∥∇mβ(z)−∇mβ(z′)∥2≤L∇h∥z−z′∥2+∥w(z)−w(z′)∥1LbLτ,\lVert\nabla m_\beta(z)-\nabla m_\beta(z')\rVert_2 \le L_{\nabla h}\lVert z-z'\rVert_2+\lVert w(z)-w(z')\rVert_1L_bL_\tau,

giving (12).

Theorem 3 (Inexact-gradient discrete-time recovery). Let ∇mβ^(z)=∇mβ(z)+e(z)\widehat{\nabla m_\beta}(z)=\nabla m_\beta(z)+e(z) with sup⁡Ω∥e(z)∥2≤εg\sup_\Omega\lVert e(z)\rVert_2\le\varepsilon_g, and let u^z(z)\widehat u_z(z) be the closed-form QPQP solution (8) using ∇mβ^\widehat{\nabla m_\beta} in place of ∇mβ\nabla m_\beta. Suppose Lemmas 1–2 hold and the Euler iterate zi+1=zi+ηu^z(zi)z_{i+1}=z_i+\eta\widehat u_z(z_i) remains in Ω\Omega. Then

Vi+1≤Vi−ηκViρ+c1ηεg+c2η2,Vi:=[−mβ(zi)]+,(13)V_{i+1}\le V_i-\eta\kappa V_i^\rho+c_1\eta\varepsilon_g+c_2\eta^2,\qquad V_i:=[-m_\beta(z_i)]_+, \tag*{(13)}

*with structural constants c1,c2c_1,c_2 depending on L∇mL_{\nabla m}, sup⁡Ω∥uz∗∥2\sup_\Omega\lVert u_z^*\rVert_2, and the bounds in § 4.1. For any ϵ>0\epsilon>0 with κϵρ>c1ϵg+c2η\kappa\epsilon^\rho>c_1\epsilon_g+c_2\eta, the iterates enter {z:mβ(z)≥−ϵ}\{z:m_\beta(z)\ge-\epsilon\} in N∗≤V01−ρ/[η(1−ρ)(κ−ϵ−ρ(c1ϵg+c2η))]N^*\le V_0^{1-\rho}/[\eta(1-\rho)(\kappa-\epsilon^{-\rho}(c_1\epsilon_g+c_2\eta))] iterations, with equilibrium gap ϵ=O((ϵg+η)1/ρ)\epsilon=O((\epsilon_g+\eta)^{1/\rho}).

Proof. Step 1 bounds the perturbed barrier rate. Let ψ^=∇mβ^Tuzref+κsgn⁡(mβ)∣mβ∣ρ=ψ+eTuzref\widehat\psi=\widehat{\nabla m_\beta}^{\mathsf T}u_z^{\mathrm{ref}}+\kappa\operatorname{sgn}(m_\beta)|m_\beta|^\rho=\psi+e^{\mathsf T}u_z^{\mathrm{ref}}, so ∣ψ^−ψ∣≤sup⁡Ω∥uz∗∥2ϵg|\widehat\psi-\psi|\le\sup_\Omega\lVert u_z^*\rVert_2\epsilon_g. A direct expansion of ∇mβ(z)Tu^z(z)\nabla m_\beta(z)^{\mathsf T}\widehat u_z(z) using ∇mβ=∇mβ^−e\nabla m_\beta=\widehat{\nabla m_\beta}-e and the closed-form u^z=uz∗+λb∇mβ^\widehat u_z=u_z^*+\lambda_b\widehat{\nabla m_\beta} yields, on mβ<0m_\beta<0, ∇mβ(z)Tu^z(z)≥κV(z)ρ−c1ϵg\nabla m_\beta(z)^{\mathsf T}\widehat u_z(z)\ge\kappa V(z)^\rho-c_1\epsilon_g, where c1c_1 absorbs ∣eTuzref∣|e^{\mathsf T}u_z^{\mathrm{ref}}| and the 1-Lipschitz dependence of [−ψ^]+[-\widehat\psi]_+ on ψ^−ψ\widehat\psi-\psi. Step 2 applies Taylor’s theorem to mβm_\beta along the Euler step using Lemma 2: mβ(zi+1)≥mβ(zi)+η∇mβ(zi)Tu^z(zi)−12L∇mη2∥u^z(zi)∥22m_\beta(z_{i+1})\ge m_\beta(z_i)+\eta\nabla m_\beta(z_i)^{\mathsf T}\widehat u_z(z_i)-\frac{1}{2}L_{\nabla m}\eta^2\lVert\widehat u_z(z_i)\rVert_2^2, and substituting Step 1 plus ∥u^z∥2≤sup⁡Ω∥uz∗∥2\lVert\widehat u_z\rVert_2\le\sup_\Omega\lVert u_z^*\rVert_2 gives (13). Step 3: whenever Vi≥ϵV_i\ge\epsilon, Vi−ρ≤ϵ−ρV_i^{-\rho}\le\epsilon^{-\rho}, so (13) bounds Vi+1≤Vi−ηκ′ViρV_{i+1}\le V_i-\eta\kappa'V_i^\rho with κ′=κ−ϵ−ρ(c1ϵg+c2η)>0\kappa'=\kappa-\epsilon^{-\rho}(c_1\epsilon_g+c_2\eta)>0. Discrete fractional-power decay yields the N∗N^* bound; balancing κϵρ=c1ϵg+c2η\kappa\epsilon^\rho=c_1\epsilon_g+c_2\eta gives the equilibrium gap.

Proofs for Stage-II Correction and Handoff

This appendix proves the Stage-II results stated in § 4.3: Proposition 2 (Section D.1), Corollary 1 (Section D.2), and Theorem 2 (Section D.3).

Proof of Proposition 2: latent-to-path margin transfer

Proof of Proposition 2. Decompose b~tw(z)−mβ(z)\widetilde b_{t_w}(z)-m_\beta(z) into a soft-min gap and a predictor gap.

Soft-min gap. By the soft-min sandwich (Section B.1) applied to hk(z)=b(τk(z))−δh_k(z)=b(\tau^k(z))-\delta, with m^(z):=min⁡khk(z)\widehat m(z):=\min_k h_k(z), ∣m^(z)−mβ(z)∣≤ϵsoft=β−1log⁡(H+1)|\widehat m(z)-m_\beta(z)|\le\epsilon_{\mathrm{soft}}=\beta^{-1}\log(H+1).

Predictor gap. By Lipschitzness of bb and the definition of ϵpred(z)\epsilon_{\mathrm{pred}}(z),

∣b(τtwc,k(z))−b(τk(z))∣≤Lb∥τtwc,k(z)−τk(z)∥2≤Lbϵpred(z).|b(\tau_{t_w}^{c,k}(z))-b(\tau^k(z))|\le L_b\lVert\tau_{t_w}^{c,k}(z)-\tau^k(z)\rVert_2\le L_b\epsilon_{\mathrm{pred}}(z).

Subtracting δ\delta and taking minima over kk (using ∣min⁡kfk−min⁡kgk∣≤max⁡k∣fk−gk∣|\min_k f_k-\min_k g_k|\leq\max_k|f_k-g_k|) gives ∣b~tw(z)−m^(z)∣≤Lbϵpred(z)|\tilde{b}_{\mathrm{tw}}(z)-\hat{m}(z)|\leq L_b\epsilon_{\mathrm{pred}}(z).

Combine. The triangle inequality yields the bound stated in Proposition 2.

Remark 1 (Predictor-sensitivity bound). For a SAFEFLOWMATCHER-style corrector whose predictor is a Lipschitz ODE with field LvL_v-Lipschitz in state, standard ODE sensitivity gives ϵpred(z)≤LτeLvttwξˉ+∫0ttwwsrs ds\epsilon_{\mathrm{pred}}(z)\leq L_\tau e^{L_v t_{\mathrm{tw}}}\bar{\xi}+\int_0^{t_{\mathrm{tw}}}w_s r_s\,\mathrm{d}s, where ξˉ\bar{\xi} controls initial perturbation and the integral captures the soft-slack term in (5). For a post-hoc path-space CBF-QP applied directly to τ(z)\tau(z), ϵpred(z)≡0\epsilon_{\mathrm{pred}}(z)\equiv0 and Proposition 2 reduces to the soft-min-only bound.

Proof of Corollary 1: correction time and energy

Proof of Corollary 1. The Stage-II CBF-QP with fractional-power rate ϵ\epsilon and exponent ρ\rho enforces V˙path≤−ϵVpathρ\dot{V}_{\mathrm{path}}\leq-\epsilon V_{\mathrm{path}}^\rho on Vpath>0V_{\mathrm{path}}>0, parallel to (11). Integrating yields Vpath(t)1−ρ=V+1−ρ−ϵ(1−ρ)(t−tw)V_{\mathrm{path}}(t)^{1-\rho}=V_+^{1-\rho}-\epsilon(1-\rho)(t-t_{\mathrm{w}}) for t∈[tw,Tcorr]t\in[t_{\mathrm{w}},T_{\mathrm{corr}}], so

Tcorr≤tw+V+1−ρϵ(1−ρ).T_{\mathrm{corr}}\leq t_{\mathrm{w}}+\frac{V_+^{1-\rho}}{\epsilon(1-\rho)}.

For the energy bound, JII(z+)≤∫twTcorrcIIVpath(t)2ρ dtJ_{\mathrm{II}}(z_+)\leq\int_{t_{\mathrm{w}}}^{T_{\mathrm{corr}}}c_{\mathrm{II}}V_{\mathrm{path}}(t)^{2\rho}\,\mathrm{d}t. Substituting Vpath(t)2ρ=(V+1−ρ−ϵ(1−ρ)(t−tw))2ρ/(1−ρ)V_{\mathrm{path}}(t)^{2\rho}=(V_+^{1-\rho}-\epsilon(1-\rho)(t-t_{\mathrm{w}}))^{2\rho/(1-\rho)} and the change of variables u=V+1−ρ−ϵ(1−ρ)(t−tw)u=V_+^{1-\rho}-\epsilon(1-\rho)(t-t_{\mathrm{w}}) gives

JII(z+)≤cIIϵ(1−ρ)∫0V+1−ρu2ρ/(1−ρ) du=cIIV+1+ρϵ(1+ρ).J_{\mathrm{II}}(z_+)\leq\frac{c_{\mathrm{II}}}{\epsilon(1-\rho)}\int_0^{V_+^{1-\rho}}u^{2\rho/(1-\rho)}\,\mathrm{d}u=\frac{c_{\mathrm{II}}V_+^{1+\rho}}{\epsilon(1+\rho)}.

Proof of Theorem 2: cost-sensitive handoff

Proof of Theorem 2. Stage-I descent in continuous time. Under the non-degeneracy hypothesis along the Stage-I trajectory, the comparison lemma applied to Proposition 1 gives V(t)1−ρ=V01−ρ−κ(1−ρ)tV(t)^{1-\rho}=V_0^{1-\rho}-\kappa(1-\rho)t for t∈[0,V01−ρ/(κ(1−ρ))]t\in[0,V_0^{1-\rho}/(\kappa(1-\rho))] (same scalar argument as in Section C.3). Identifying t=Nzηt=N_z\eta in the exact-gradient limit gives the discrete decay law

V+1−ρ=V01−ρ−ηκ(1−ρ)Nz,(14)V_+^{1-\rho}=V_0^{1-\rho}-\eta\kappa(1-\rho)N_z, \tag*{(14)}

so the number of Stage-I iterations needed to reach a given terminal deficit V+V_+ is Nz(V+)=(V01−ρ−V+1−ρ)/(ηκ(1−ρ))N_z(V_+)=(V_0^{1-\rho}-V_+^{1-\rho})/(\eta\kappa(1-\rho)).

Joint-cost expression. Combining (14) with the Stage-I per-iteration cost JI(Nz)=NzcIJ_{\mathrm{I}}(N_z)=N_zc_{\mathrm{I}} (Appendix E.3) and the Stage-II energy bound from Corollary 1, the joint cost as a function of V+∈(0,V0]V_+\in(0,V_0] is

Jtot(V+)≤cI(V01−ρ−V+1−ρ)ηκ(1−ρ)+cIIV+1+ρϵ(1+ρ),(15)J_{\mathrm{tot}}(V_+)\leq\frac{c_{\mathrm{I}}(V_0^{1-\rho}-V_+^{1-\rho})}{\eta\kappa(1-\rho)}+\frac{c_{\mathrm{II}}V_+^{1+\rho}}{\epsilon(1+\rho)}, \tag*{(15)}

the upper bound used in Theorem 2.

Convexity. Differentiating with respect to V+∈(0,V0]V_+\in(0,V_0],

dJtotdV+=−cIηκV+−ρ+cIIϵV+ρ.(16)\frac{\mathrm{d}J_{\mathrm{tot}}}{\mathrm{d}V_+}=-\frac{c_{\mathrm{I}}}{\eta\kappa}V_+^{-\rho}+\frac{c_{\mathrm{II}}}{\epsilon}V_+^\rho. \tag*{(16)}

The second derivative cIρV+−ρ−1/(ηκ)+cIIρV+ρ−1/ϵc_{\mathrm{I}}\rho V_+^{-\rho-1}/(\eta\kappa)+c_{\mathrm{II}}\rho V_+^{\rho-1}/\epsilon is strictly positive for V+>0V_+>0, so JtotJ_{\mathrm{tot}} is strictly convex on (0,V0](0,V_0].

Optimum. Setting (16) to zero,

cIIϵV+2ρ=cIηκ,⟹V+⋆=(cIϵηκcII)1/(2ρ),\frac{c_{\mathrm{II}}}{\epsilon}V_+^{2\rho}=\frac{c_{\mathrm{I}}}{\eta\kappa},\qquad\Longrightarrow\qquad V_+^\star=\left(\frac{c_{\mathrm{I}}\epsilon}{\eta\kappa c_{\mathrm{II}}}\right)^{1/(2\rho)},

the unique stationary point and, by strict convexity, the unique global minimum. The handoff iteration Nz⋆N_z^\star follows from the descent relation when V+⋆≤V0V_+^\star\leq V_0. If V+⋆>V0V_+^\star>V_0, dJtot/dV+<0\mathrm{d}J_{\mathrm{tot}}/\mathrm{d}V_+<0 on (0,V0](0,V_0], so JtotJ_{\mathrm{tot}} is strictly decreasing on (0,V0](0,V_0] and the constrained minimum is at V+=V0V_+=V_0, i.e., Nz⋆=0N_z^\star=0 and Stage I is skipped.

Algorithm 1 Latent Barrier Steering (LBS)
Require: PFM generator $G_\theta$, context $c$, barrier $b$, robustness margin $\delta$; hyperparameters $(\kappa,\rho,\eta,\gamma_z,\beta,N_z)$; latent clipping box $\Omega$
Ensure: Trajectory $\tau$ certified by Stage II (with optional residual-violation flag)
Stage I: latent barrier steering
1: $z \leftarrow \operatorname{encoder\_warm\_start}(c)$
2: for $i=1,\ldots,N_z$ do
3: $\tau \leftarrow G_\theta(c,z)$
4: $m_\beta \leftarrow -\beta^{-1}\log\sum_{k=0}^{H}\exp(-\beta(b(\tau^k)-\delta))$
5: $\widehat{\nabla}m_\beta \leftarrow \operatorname{zeroth\_order\_grad}(m_\beta,z)$ ▷ $2d_z$ central finite differences
6: $u_z^{\mathrm{ref}} \leftarrow -\gamma_z z$
7: $\psi \leftarrow \widehat{\nabla}m_\beta^\top u_z^{\mathrm{ref}}+\kappa\operatorname{sgn}(m_\beta)|m_\beta|^\rho$
8: if $\psi<0$ and $\|\widehat{\nabla}m_\beta\|_2^2>0$ then
9: $\lambda \leftarrow -\psi/\|\widehat{\nabla}m_\beta\|_2^2$
10: $u_z \leftarrow u_z^{\mathrm{ref}}+\lambda\widehat{\nabla}m_\beta$ ▷ closed-form QP {xref}`(8)`
11: else
12: $u_z \leftarrow u_z^{\mathrm{ref}}$
13: end if
14: $z \leftarrow \operatorname{clip}_\Omega(z+\eta u_z)$
15: end for
16: $\tau \leftarrow G_\theta(c,z)$
17: $m_\beta \leftarrow -\beta^{-1}\log\sum_{k=0}^{H}\exp(-\beta(b(\tau^k)-\delta))$
18: $\mathtt{residual\_violation}\leftarrow(m_\beta<0)$ ▷ flag only; Stage II runs in either case
Stage II: certified path-space correction
19: $\tau\leftarrow\operatorname{PathCorrector}(\tau,b,\delta)$ ▷ post-hoc path CBF-QP or SAFEFLOWMATCHER
20: return $\tau$, $\mathtt{residual\_violation}$

Remark 2 (Effect of margin transfer slack on V+V_+). The proof above absorbs the soft-min and predictor-sensitivity slack from Proposition 2 into the constant cIIc_{\mathrm{II}}. Retaining the slack explicitly replaces V+V_+ by V~+:=V++εsoft+Lbεˉpred\widetilde{V}_+ := V_+ + \varepsilon_{\mathrm{soft}} + L_b\bar{\varepsilon}_{\mathrm{pred}} in the Stage-II energy bound (Corollary 1), and the optimum V+∗V_+^* shifts upward by an amount that vanishes as β→∞\beta\to\infty and εpred→0\varepsilon_{\mathrm{pred}}\to0 (post-hoc corrector). The qualitative form of the stopping rule is unchanged.

Remark 3 (Discrete-time and inexact-gradient corrections). Theorem 2 uses the exact-gradient continuous-time descent law from Proposition 1. Replacing it with the discrete inexact-gradient analysis of Theorem 3 adds correction terms c1ηεg+c2η2c_1\eta\varepsilon_g+c_2\eta^2 per step, which propagate through (14) as a downward shift of the achievable V+V_+ floor. The optimum V+∗V_+^* in Theorem 2 remains valid above this floor; below it, the achievable V+V_+ is bounded by the equilibrium gap ε=O((εg+η)1/ρ)\varepsilon=O((\varepsilon_g+\eta)^{1/\rho}) from Theorem 3.

Algorithm and Implementation

This appendix gives the full LBS algorithm with implementation details: the pseudocode, the projected Euler update with finite-difference gradient estimation, the per-step and total Stage-I cost used by Theorem 2, and the hyperparameters used across all experiments.

Pseudocode

Stage I does not need to reach the safe-latent set ZδZ_\delta before handoff: increasing mβm_\beta already reduces the deficit Stage II must correct (§ 4.3). The flag residual_violation\mathtt{residual\_violation} records whether the Stage-I terminal margin was negative; the certified safe trajectory is always produced by Stage II.

Projected Euler and gradient estimation

Stage I is implemented with projected explicit Euler steps,

zi+1=ΠΩ(zi+η u~z(zi)),z_{i+1} = \Pi_{\Omega}\left(z_i + \eta\,\tilde{u}_z(z_i)\right),

where η>0\eta> 0 is the latent step size and ΠΩ\Pi_{\Omega} projects onto the latent clipping box Ω\Omega. The update direction u~z(zi)\tilde{u}_z(z_i) is the closed-form latent CBF projection (8) evaluated with an estimate ∇^mβ(zi)\widehat{\nabla}m_{\beta}(z_i) of the latent gradient. When backpropagation through the decoder is available, the gradient can be computed directly. Otherwise, we use central finite differences,

[∇^mβ(z)]i=mβ(z+hei)−mβ(z−hei)2h,i=1,…,dz,\left[\widehat{\nabla}m_{\beta}(z)\right]_i = \frac{m_{\beta}(z + h e_i) - m_{\beta}(z - h e_i)}{2h}, \qquad i = 1,\ldots,d_z,

which costs 2dz2d_z generator evaluations per latent step. Central differences have truncation error εg=O(h2)\varepsilon_g = O(h^2) for C3C^3 scalar fields. For larger dzd_z, SPSA-style random directional estimators [35] or a learned critic for mβm_{\beta} are natural replacements.

Cost accounting

Each Stage-I iteration consists of one rollout decode, one margin evaluation, 2dz2d_z additional generator calls for the central-difference gradient, one closed-form projection, and one Euler update. We summarize the dominant cost as a per-step constant cI>0c_I > 0 (in our setting, cIc_I is dominated by the 2dz2d_z generator calls, so each Stage-I iteration uses 2dz+12d_z + 1 generator evaluations). Over NzN_z Stage-I iterations, the total Stage-I cost is

JI(Nz)=NzcI,(17)J_I(N_z) = N_z c_I, \tag*{(17)}

which is balanced against the Stage-II correction energy in Theorem 2. The handoff iteration Nz⋆N_z^\star in Theorem 2 selects the smallest NzN_z for which the marginal Stage-I cost matches the marginal reduction in Stage-II correction energy. Stage II adds one decoded rollout and the cost of the chosen path-space corrector, so the total LBS cost is

CostLBS=Nz(2dz+1)Cgen+Cgen+CstageII.\mathrm{Cost}_{\mathrm{LBS}} = N_z(2d_z + 1) C_{\mathrm{gen}} + C_{\mathrm{gen}} + C_{\mathrm{stageII}}.

Per-step sampler-space methods such as SAFEDIFFUSER and SAFEFLOW instead solve CBF-QPs throughout the denoising or flow integration horizon. SAFEFLOWMATCHER solves QPs only during its correction phase, but without the Stage I semantic warm start.

Hyperparameters

All experiments use the same defaults, not per-domain tuned:

(κ,ρ,η,Nz,γz,β,δ,h)=(1.0,0.5,0.1,20,0.01,10,0.05,0.01),(\kappa,\rho,\eta,N_z,\gamma_z,\beta,\delta,h) = (1.0, 0.5, 0.1, 20, 0.01, 10, 0.05, 0.01),

with latent clipping box Ω=[−6,6]dz\Omega= [-6,6]^{d_z}.

Experimental Details

This appendix documents the three benchmark domains, their training data and per-domain backbone size, the three constraint setups used in each, and the evaluation protocol. Backbone training and inference hyperparameters are summarised in Appendix G and H, respectively, and we do not duplicate them here.

The three domains share a common evaluation template: each domain has a fixed start–goal pair, a multi-modal expert dataset, and three deliberately different constraint setups labelled mode-selection (S1), mode-interpolation (S2), and CBF-correction (S3). S1 admits at least one demonstration mode without modification; S2 blocks every demonstration mode but leaves a feasible path that requires latent interpolation between modes; S3 leaves every demonstration mode partially clipped, so a path-space CBF correction is required on top of the latent solution.

2D point-navigation

Dynamics. Single-integrator on R2\mathbb{R}^2, st+1=st+ats_{t+1} = s_t + a_t, with start s0=(0,0)s_0 = (0,0) and goal g=(10,0)g = (10,0), horizon H=50H = 50. State is (x,y)(x,y) and actions are (ax,ay)(a_x,a_y) with no per-step bound (training data dictates magnitude).

Training modes. Four sine-wave modes with peak amplitude ypeak∈{−3,−1,1,3}y_{\mathrm{peak}} \in\{-3,-1,1,3\}, 30 demonstrations per mode, additive state noise N(0,0.152)\mathcal{N}(0,0.15^2) at each step with endpoints clamped to start and goal. Each demonstration interpolates start and goal along xx and rides the sine in yy.

Backbone. The 2D backbone is intentionally small (see Appendix G): hidden width 256, four residual blocks, behavior latent dz=2d_z = 2. The encoder is a transformer trajectory VAE with sinusoidal positional encoding.

Constraint setups.

S1 (mode selection). A single rectangular hazard [3,7]×[−5,2][3,7] \times[-5,2]. Three modes (ypeak∈{−3,−1,1}y_{\mathrm{peak}} \in\{-3,-1,1\}) intersect the rectangle; the upper mode ypeak=3y_{\mathrm{peak}}=3 clears it. Latent recovery is sufficient: Stage I selects the upper mode and Stage II makes near-zero corrections.

S2 (mode interpolation). Two rectangles [3,7]×[0.5,6][3,7] \times[0.5,6] and [3,7]×[−6,−0.5][3,7] \times[-6,-0.5] form a horizontal corridor of width 1 at y∈[−0.5,0.5]y \in[-0.5,0.5] for x∈[3,7]x \in[3,7]. All four training modes are blocked, but the interior ypeak≈0y_{\mathrm{peak}} \approx0 region is open. Latent interpolation is required: Stage I drives zz to a peak amplitude not seen in training; Stage II remains nearly inactive.

S3 (CBF correction). A single thicker hazard [3,7]×[−3.5,3.5][3,7] \times[-3.5,3.5]. All four modes clip the band; the outer pair ypeak=±3y_{\mathrm{peak}} = \pm3 have moderate overlap. Stage I alone is insufficient: the latent solution rides the band edge but still violates at corners; Stage II’s path-space CBF closes the residual gap.

Franka 3D end-effector

Domain. 7-DoF Franka Panda arm in Cartesian end-effector planning mode. The trajectory variable is the EE position (x,y,z)∈R3(x,y,z) \in\mathbb{R}^3; we plan in EE space and project to joint space via the standard differential-IK controller used in the Franka stack. Start s0=(0.3,0.0,0.5)s_0 = (0.3,0.0,0.5) m, goal g=(0.7,0.0,0.3)g = (0.7,0.0,0.3) m, horizon H=50H = 50. Differentiable EE-position barriers are used by every method, matching SAFEFlow [8].

Training modes. Eight expert behaviors covering combinations of approach direction (up/down/left/right) and approach distance (near/far), 50 demonstrations per behavior. The behaviors are chosen so that each constraint setup eliminates a well-defined subset of them.

Backbone. Hidden width 256, four residual blocks, dz=4d_z = 4 (see Appendix G); zz-projection width 32; no auxiliary start–goal context (start/goal are fixed).

Constraint setups. All three setups place a thin wall at x∈[0.45,0.55]x \in[0.45,0.55] between start and goal:

S1 (mode selection). Lower wall blocks z<0.58z < 0.58; upper portion is solid except for a slot y∈[−0.08,0.08]y \in[-0.08,0.08], z∈[0.58,0.85]z \in[0.58,0.85]; a small sphere of radius 0.03 at (0.5,0,0.66)(0.5,0,0.66) sits inside the slot. Among the eight training modes only the up–far behavior threads the slot. Stage I selects up–far; Stage II edges around the sphere.

S2 (mode interpolation). Same wall structure, but the open region is a diagonal hole y∈[0.04,0.20]y \in[0.04,0.20], z∈[0.48,0.58]z \in[0.48,0.58] that lies between the up–near and right–near training behaviors. No single training mode threads the hole; latent interpolation produces an approach via ∼(0.5,0.12,0.53)\sim(0.5,0.12,0.53).

S3 (CBF correction). Same diagonal hole as S2, plus a small sphere of radius 0.03 at (0.5,0.12,0.53)(0.5,0.12,0.53) inside the hole. Stage I produces the interpolated approach; Stage II’s path-space CBF detours the EE around the sphere within the ∼0.16×0.10\sim0.16 \times0.10 m window.

Maze2D

Domain. D4RL maze2d-large layout [12]. The state is (x,y,x˙,y˙)(x,y,\dot{x},\dot{y}) and the action is the 2D velocity command; the planner outputs an action sequence and rolls it forward through the standard maze2d single-integrator dynamics. Horizon H=384H = 384, matching SAFEDIFFUSER [40]. Start s0=(1,3)s_0 = (1,3), goal g=(7,9)g = (7,9); eight start–goal context dimensions are fed to the backbone via FiLM (see Appendix G).

Training data. A custom 300-trajectory dataset on six distinct routes (50 demonstrations per route) collected by a dense-waypoint expert controller. The six routes are referenced in the setup descriptions below by their direction codes (e.g. “LD” = left then down). D4RL’s native maze2d-large replay buffer has narrow corridors with limited mode diversity, so a custom dataset is needed to make the mode-selection vs. interpolation distinction sharp.

Backbone. Hidden width 768, 20 residual blocks, zz-projection width 128, dz=4d_z = 4, encoder positional-encoding max length 1024. The deeper/wider model is needed for the longer horizon; see Appendix § 15.

Constraint setups. Each setup uses a small set of circular hazards plus a few axis-aligned rectangular wall extensions chosen to close five of the six demonstration routes:

S1 (mode selection, “LD” free). Six small circles (r=0.4r=0.4) and six wall rectangles fence off the entire right half of the maze, leaving only the LD route (down the left corridor and across the bottom row). Baselines without latent recovery default to the right-arc path and trap against the right-side fence.

S2 (mode interpolation, “RUR” partly free). Hazards block the L entrance, the D branch, and the UD branch. RUR is partly open but pinched by a small obstacle; latent interpolation is needed to bend RUR into the residual corridor.

S3 (CBF correction, “RD” partly free). Hazards block the L entrance and the U branch. RD is partly open but a small additional obstacle clips the natural rollout. Stage I selects the residual mode; Stage II’s path-space CBF deflects the rollout around the small obstacle.

Wall handling. Following the literature convention used by SAFEDIFFUSER, SAFEFLOW, and SAFEFLOWMATCHER, the CBF barrier and reported safety metric are defined over user-specified hazard obstacles only; the maze walls themselves are handled implicitly by the generator’s learned prior and, for executable rollout, by Liang–Barsky truncation against the wall set (so a rollout that would tunnel through a wall is clipped at the wall and the post-truncation goal-error is what we report).

Evaluation protocol

Episodes and seeds. Each method is evaluated on 50 episodes per setup with a single fixed seed (default 42). Episodes within a setup vary only in the diffusion / flow-matching latent noise; start, goal, and obstacle layout are fixed by definition of the setup.

Safety metric. Segment-based safety using Liang–Barsky segment / axis-aligned-box intersection for rectangle hazards and a closed-form segment / sphere test for sphere hazards. A trajectory is safe iff none of its HH piecewise-linear segments intersects any hazard. We report mean Safety as the fraction of safe episodes.

Reach metric. Goal-reach is determined by the post-truncation final-state distance to the goal: an episode counts as “reached” iff the truncated rollout ends within a domain-specific tolerance of the goal. The tolerance and other thresholds are fixed across methods per domain.

Other metrics. Beyond Safety and Reach, we report final goal distance (ED), CBF intervention energy, curvature smoothness (CS), and per-episode Stage-I/Stage-II wall-clock time. The full three-constraint results are reported in Appendix § 17.

Hardware. Wall-clock numbers are measured on a single CPU thread for the 2D domain and a single A100 GPU for Franka and Maze2D. The 2D backbone is small enough to time on CPU; Franka and Maze2D backbones use GPU at test time.

Baselines. The three CBF baselines (SAFEDIFFUSER, SAFEFLOW, SAFEFLOWMATCHER) are run from their reference open-source implementations with the same hazard set, start, goal, and horizon as our methods. We retrain each baseline’s backbone on our domain datasets so that the comparison isolates the safety wrapper rather than the prior. Their training and test-time hyperparameters follow the upstream defaults; we list only our method’s settings in Appendices G and H.

Backbone Training Hyperparameters

This appendix records the exact hyperparameters used to train the parameterised flow-matching backbone used by Latent Barrier Steering. We list only our method’s settings; baselines (SAFEDIFFUSER, SAFEFLOW, SAFEFLOWMATCHER) follow their respective open-source reference implementations and are not duplicated here.

The training pipeline has two stages per domain. We first train a Trajectory VAE encoder with a soft-DTW reconstruction term to produce the behavior latent zz; we then freeze the encoder and train the conditional flow-matching generator on top.

Trajectory VAE encoder

The encoder is a transformer-style trajectory VAE with sinusoidal positional encoding and FiLM-style decoding. Optimiser settings are shared across all three domains: AdamW with learning rate 10−410^{-4}, weight decay 10−510^{-5}, cosine-annealed to a minimum of 10−610^{-6} over the full schedule, batch size 32. The reconstruction term is soft-DTW [6] with smoothing γDTW=10−2\gamma_{\mathrm{DTW}} = 10^{-2}. The latent dimension dzd_z matches the value used by the LBS hyperparameter table in Appendix E.4.

2D point-navFranka 3D EEMaze2D
Hidden width128128128
Latent dim dzd_z244
OptimizerAdamWAdamWAdamW
Learning rate10−410^{-4}10−410^{-4}10−410^{-4}
Weight decay10−510^{-5}10−510^{-5}10−510^{-5}
LR schedulecosinecosinecosine
Batch size323232
Soft-DTW γDTW\gamma_{\mathrm{DTW}}10−210^{-2}10−210^{-2}10−210^{-2}

Table 4. Encoder hyperparameters.

Conditional flow-matching generator

The generator is a zz-conditioned flow-matching velocity predictor with the linear interpolant xt=(1−t)x0+tεx_t = (1-t)x_0 + t\varepsilon and an explicit-Euler ODE sampler. It uses FiLM injection of the encoder zz and (for Maze2D only) FiLM injection of an 8-dimensional start–goal context cc. We optimise with Adam, learning rate 10−410^{-4}, batch size 32.

2D point-navFranka 3D EEMaze2D
Hidden width256256768
Residual blocks4420
zz-projection width3232128
Start/goal conditioning dim——8
FM Euler steps505050
OptimizerAdamAdamAdam
Learning rate10−410^{-4}10−410^{-4}10−410^{-4}
Batch size323232

Table 5. Generator hyperparameters for the flow-matching backbone. Maze2D uses a wider/deeper backbone because of its longer horizon and start–goal conditioning. Sampling uses the listed number of explicit-Euler integration steps.

Notes on choices

The encoder and generator hyperparameters are not tuned per constraint regime; we use one set per domain and reuse the same checkpoints across all three constraint setups in the main results. The 2D and Franka backbones are deliberately small (∼0.4\sim0.4–0.60.6 M parameters) so that the central-difference cost of Stage I (Appendix § 13.§ 4) stays within a few seconds per call; Maze2D is wider/deeper to handle the longer horizon. Released checkpoints are the best-validation snapshots used in all main-text tables. Both backbones are trained on demonstrations alone, without reward labels [4, 43], and a new test-time constraint requires no retraining.

Inference Hyperparameters: Stage I and Stage II

This appendix lists the test-time hyperparameters of our method only (Latent Barrier Steering, Stage I + Stage II). Baseline test-time settings follow each baseline’s reference implementation and are not duplicated.

Stage I (Latent Barrier Steering)

Stage I solves the latent-side finite-time recovery flow of § 4. The same set of LBS hyperparameters is used across all three domains and all constraint setups; the values are listed in Appendix § 13.§ 4. For the reader’s convenience the operational parameters are:

  • Finite-time rate exponent ρ=0.5\rho= 0.5 and gain κ=1.0\kappa= 1.0 (linear-rate variant of the LBS QP).

  • Latent Euler step size η=0.1\eta= 0.1.

  • Latent iteration cap Nz=20N_z = 20, with early stopping as soon as the soft-min margin mβ(zi)≥0m_\beta(z_i) \ge0.

  • Reference drift γz=10−2\gamma_z = 10^{-2} (encoder-anchor contraction; reference uzref=−γz(z−z0)u_z^{\mathrm{ref}} = -\gamma_z(z-z_0)).

  • Soft-min sharpness β=10\beta= 10.

  • Margin slack δ=0.05\delta= 0.05.

  • Latent clip-box [−6,6]dz[-6,6]^{d_z} applied componentwise after every Euler step.

The same finite-difference estimator of ∇zmβ\nabla_z m_\beta is used in all domains. The full operational hyperparameter sextuplet (κ,ρ,η,Nz,γz,β,δ)(\kappa,\rho,\eta,N_z,\gamma_z,\beta,\delta) is reported as a single row in Appendix § 13.§ 4 and we do not duplicate it here.

Stage II (path-space CBF correction)

Stage II takes the Stage I-warm-started rollout and applies a per-step CBF QP along the executed trajectory. The corrector hyperparameters are fixed across domains and constraint setups: a fractional-power rate with tuple (ϵ,ρ,δ)=(0.3,0.5,0.05)(\epsilon,\rho,\delta) = (0.3, 0.5, 0.05), where ρ=0.5\rho= 0.5 is the fractional exponent (matching Stage I), ϵ\epsilon scales the fractional gain, and δ\delta is the same activation slack as in Stage I.

The corrector is solved as a small QP over the per-step action ata_t, with ∥at−atref∥2\lVert a_t-a_t^{\mathrm{ref}}\rVert^2 as the QP cost and the fractional-rate CBF constraint as the only inequality. We use the unconstrained atrefa_t^{\mathrm{ref}} produced by the parameterised generator at the Stage-I-warm-started latent.

Sampling/integration setup at test time

At test time we use the same sampler discretisation as during training: a 50-step explicit-Euler ODE for the flow-matching generator. Stage II runs along the entire executed horizon.

Full results across all three constraints

The main-text Table 1 reports Safety, Reach, and Energy. This appendix reports all metrics, including final goal distance, curvature smoothness, and per-episode Stage-I/Stage-II runtime, for all three constraints in each domain. Per-cell entries are means over 50 episodes (60 for Maze2D), aggregated under the same hyperparameters reported in Appendix § 13.§ 4 and the evaluation protocol of Appendix § 14.§ 4. The pretrained flow-matching planner is the same across all methods within a domain. ED is reported in task units; Franka ED is in metres.

References

  1. [1]Aaron D. Ames, Xiangru Xu, Jessy W. Grizzle, and Paulo Tabuada. Control barrier function based quadratic programs for safety critical systems. IEEE Transactions on Automatic Control, 62(8):3861–3876, 2017.DOI
  2. [2]Max Braun, Noémie Jaquier, Leonel Rozo, and Tamin Asfour. Riemannian flow matching policy for robot motion learning. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2024. arXiv:2403.10672.arxiv.org/abs/2403.10672
  3. [3]João Carvalho, An T. Le, Mark Baierl, Dorothea Koert, and Jan Peters. Motion planning diffusion: Learning and planning of robot motions with diffusion models. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2023.arxiv.org/abs/2308.01557
  4. [4]Shreyas Chaudhari, Renhao Zhang, Philip S. Thomas, and Bruno Castro da Silva. Data selection for reward labeling in limited-feedback reinforcement learning. Transactions on Machine Learning Research, 2026.
  5. [5]Cheng Chi, Siyuan Feng, Yilun Du, Zhenghao Xu, Eric Cousineau, Benjamin Burchfiel, and Shuran Song. Diffusion policy: Visuomotor policy learning via action diffusion. In Robotics: Science and Systems, 2023.
  6. [6]Marco Cuturi and Mathieu Blondel. Soft-DTW: a differentiable loss function for time-series. In International Conference on Machine Learning, 2017.arxiv.org/abs/1703.01541
  7. [7]Bruno C. Da Silva, George Konidaris, and Andrew G. Barto. Learning parameterized skills. In International Conference on Machine Learning, 2012.
  8. [8]Xiaobing Dai, Zewen Yang, Dian Yu, Fangzhou Liu, Hamid Sadeghian, Sami Haddadin, and Sandra Hirche. Safeflow: Safe robot motion planning with flow matching via control barrier functions. arXiv preprint arXiv:2504.08661, 2025.arxiv.org/abs/2504.08661
  9. [9]Murtaza Dalal, Deepak Pathak, and Ruslan Salakhutdinov. Accelerating robotic reinforcement learning via parameterized action primitives. In Advances in Neural Information Processing Systems, 2021.arxiv.org/abs/2110.15360
  10. [10]Prafula Dhariwal and Alexander Nichol. Diffusion models beat GANs on image synthesis. In Advances in Neural Information Processing Systems, 2021.
  11. [11]Haotian Fu, Sam Yu, Siddharth Tiwari, Michael L. Littman, and George Konidaris. Meta-learning parameterized skills. In International Conference on Machine Learning, 2023.arxiv.org/abs/2206.03597
  12. [12]Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4RL: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.arxiv.org/abs/2004.07219
  13. [13]Paul Glotfelter, Jorge Cortés, and Magnus Egerstedt. Nonsmooth barrier functions with applications to multi-robot systems. IEEE Control Systems Letters, 1(2):310–315, 2017.DOI
  14. [14]Vedant Gupta, Haotian Fu, Calvin Luo, Yiding Jiang, and George Konidaris. Learning parameterized skills from demonstrations. In Advances in Neural Information Processing Systems, 2025.
  15. [15]Matthew J. Hausknecht and Peter Stone. Deep reinforcement learning in parameterized action space. In International Conference on Learning Representations, 2016.arxiv.org/abs/1511.04143
  16. [16]Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 2020.arxiv.org/abs/2006.11239
  17. [17]Michael Janner, Yilun Du, Joshua B. Tenenbaum, and Sergey Levine. Planning with diffusion for flexible behavior synthesis. In International Conference on Machine Learning, 2022.arxiv.org/abs/2205.09991
  18. [18]Xiaogang Jia, Denis Blessing, Xinkai Jiang, Moritz Reuss, Atalay Donat, Rudolf Lioutikov, and Gerhard Neumann. Towards diverse behaviors: A benchmark for imitation learning with human demonstrations. In International Conference on Learning Representations, 2024.arxiv.org/abs/2402.14606
  19. [19]Hassan K. Khalil. Nonlinear Systems. Prentice Hall, 3rd edition, 2002.
  20. [20]George D. Konidaris and Andrew G. Barto. Skill discovery in continuous reinforcement learning domains using skill chaining. In Advances in Neural Information Processing Systems, 2009.
  21. [21]Seungjae Lee, Yibin Wang, Haritheja Etukuru, H. Jin Kim, Nur Muhammad Mahi Shafiullah, and Lerrel Pinto. Behavior generation with latent actions. In International Conference on Machine Learning, 2024.arxiv.org/abs/2403.03181
  22. [22]Mingzhe Li, Renhao Zhang, Zhiyang Wen, Siqi Pan, Bruno Castro da Silva, Juan Zhai, and Shiqing Ma. PROMPTMINER: Black-box prompt stealing against text-to-image generative models via reinforcement learning and VLM-guided optimization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 7795–7804, 2026.
  23. [23]Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. In International Conference on Learning Representations, 2023.arxiv.org/abs/2210.02747
  24. [24]Xingchao Liu, Chengyue Gong, and Qiang Liu. Flow straight and fast: Learning to generate and transfer data with rectified flow. In International Conference on Learning Representations, 2023.arxiv.org/abs/2209.03003
  25. [25]Ajay Mandlekar, Danfei Xu, Josiah Wong, Soroush Nasiriany, Chen Wang, Rohun Kulkarni, Li Fei-Fei, Silvio Savarese, Yuke Zhu, and Roberto Martín-Martín. What matters in learning from offline human demonstrations for robot manipulation. In Conference on Robot Learning, 2021.arxiv.org/abs/2108.03298
  26. [26]Warwick Masson, Pravesh Ranchod, and George Konidaris. Reinforcement learning with parameterized actions. Proceedings of the AAAI Conference on Artificial Intelligence, 2016.arxiv.org/abs/1509.01644
  27. [27]Quan Nguyen and Koushil Sreenath. Exponential control barrier functions for enforcing high relative-degree safety-critical constraints. In American Control Conference, pages 322–328. IEEE, 2016.
  28. [28]Scott Niekum, Sarah Osentoski, George Konidaris, Sachin Chitta, Bhaskara Marthi, and Andrew G. Barto. Learning grounded finite-state representations from unstructured demonstrations. The International Journal of Robotics Research, 34(2):131–157, 2015.DOI
  29. [29]Tim Pearce, Tabish Rashid, Anssi Kanervisto, Dave Bignell, Mingfei Sun, Raluca Georgescu, Sergio Valcarcel Macua, Shan Zheng Tan, Ida Momennejad, Katja Hofmann, and Sam Devlin. Imitating human behaviour with diffusion models. In International Conference on Learning Representations, 2023.arxiv.org/abs/2301.10677
  30. [30]Yuefeng Peng, Mingzhe Li, Kejing Xia, Renhao Zhang, and Amir Houmansadr. Membership inference attacks on vision-language-action models. arXiv preprint arXiv:2605.07088, 2026.arxiv.org/abs/2605.07088
  31. [31]Ruixi Qiao, Jie Cheng, Xingyuan Dai, Yonglin Tian, and Yisheng Lv. Offline reinforcement learning with discrete diffusion skills. arXiv preprint arXiv:2503.20176, 2025.arxiv.org/abs/2503.20176
  32. [32]Jeffrey F. Queisser and Jochen J. Steil. Bootstrapping of parameterized skills through hybrid optimization in task and policy spaces. Frontiers in Robotics and AI, 5:49, 2018.DOI
  33. [33]Nur Muhammad Mahi Shafiullah, Zichen Jeff Cui, Ariuntuya Altanzaya, and Lerrel Pinto. Behavior transformers: Cloning k modes with one stone. In Advances in Neural Information Processing Systems, 2022.arxiv.org/abs/2206.11251
  34. [34]Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021.
  35. [35]James C. Spall. Multivariate stochastic approximation using a simultaneous perturbation gradient approximation. IEEE Transactions on Automatic Control, 37(3):332–341, 1992.DOI
  36. [36]Richard S. Sutton, Doina Precup, and Satinder Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1–2):181–211, 1999.DOI
  37. [37]Zhendong Wang, Jonathan J. Hunt, and Mingyuan Zhou. Diffusion policies as an expressive policy class for offline reinforcement learning. In International Conference on Learning Representations, 2023.arxiv.org/abs/2208.06193
  38. [38]Kun Wu, Yichen Zhu, Jinming Li, Junjie Wen, Ning Liu, Zhiyuan Xu, and Jian Tang. Discrete policy: Learning disentangled action space for multi-task robotic manipulation. In IEEE International Conference on Robotics and Automation, 2025.arxiv.org/abs/2409.18707
  39. [39]Wei Xiao and Calin Belta. Control barrier functions for systems with high relative degree. In IEEE Conference on Decision and Control, pages 474–479. IEEE, 2019.arxiv.org/abs/1903.04706
  40. [40]Wei Xiao, Tsun-Hsuan Wang, Chuang Gan, Ramin Hasani, Mathias Lechner, and Daniela Rus. Safediffuser: Safe planning with diffusion probabilistic models. In International Conference on Learning Representations, 2025.
  41. [41]Jeongyong Yang, Seunghwan Jang, and SooJean Han. SafeFlowMatcher: Safe and fast planning using flow matching with control barrier functions. In International Conference on Learning Representations, 2026. arXiv:2509.24243.arxiv.org/abs/2509.24243
  42. [42]Renhao Zhang, Haotian Fu, Yilin Miao, and George Konidaris. Model-based reinforcement learning for parameterized action spaces. In International Conference on Machine Learning, 2024.arxiv.org/abs/2404.03037
  43. [43]Renhao Zhang, Shreyas Chaudhari, and Bruno Castro da Silva. Uncertainty-guided reward labeling for reinforcement learning under limited feedback. In Advances in Neural Information Processing Systems, 2026.arxiv.org/abs/2611.11091
  44. [44]Renhao Zhang, Haotian Fu, Mingxi Jia, George Konidaris, Yilun Du, and Bruno Castro da Silva. From noise to control: Parameterized diffusion policies. In International Conference on Machine Learning, 2026.arxiv.org/abs/2606.00336
  45. [45]Renhao Zhang, Mingzhe Li, Yuli Li, Jiayu Zheng, and Yilin Miao. Learning what to keep: Evidence-gated parameterized skills for frozen LLM agents. In NeurIPS 2026 Workshop on Towards Test-Time Continual Learning Agents, 2026.

Paper details

vlnc:W_gadrkm8f
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 12

downloads · 2

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents