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 to 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 denote the waypoint space, and let denote a planning trajectory over horizon under context . Flow matching learns a time-dependent vector field whose ODE transports a simple prior to the demonstration distribution [23, 24]: , with and . Following conditional flow matching, a standard objective samples , , , sets , and regresses the optimal-transport velocity:
To expose a controllable behavior coordinate, we follow parameterized diffusion policies and learn a trajectory encoder for a low-dimensional latent [44]:
where is the deterministic code used for conditioning. The generator produces , with stochastic seed or deterministic decode . With latent prior and nonnegative weights , we write a generic parameterized flow-matching objective as
where the geometry loss aligns trajectory and latent distances. For a sampled pair , PDP computes a trajectory distance between behavior–trace feature sequences and using soft-DTW [6], and a latent distance . It then penalizes , with scale . This geometry term encourages 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 with state and input , and a barrier , a control barrier function defines safety as and enforces forward invariance through the inequality , where are Lie derivatives and is a class- rate [1, 13]. Given a nominal input , the standard CBF-QP chooses the closest safe input:
For states that may start outside , fractional-power rates with rate constant and fractional-power exponent give finite-time convergence into [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 , for corrected waypoint (waypoint of the path at time ) and correction input ,
where is the convergence rate, is the same fractional-power exponent as in (4), is the robustness margin, and is a vanishing weight schedule paired with a per-waypoint slack variable that together deactivate after switch time . The corrector enters within correction time
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 , each latent decodes to a rollout
We use a deterministic decode 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 , Stage I restricts steering to a compact region 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 , 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 and ,
This local geometry is the condition that makes latent-space safety steering meaningful: a controlled update in produces a controlled change in the decoded rollout.
We now define the latent safety objective. Using the barrier and robustness margin from § 3.2, Stage I assigns each latent a differentiable approximation to the worst shifted waypoint margin of its decoded rollout:
This soft-min margin satisfies
so is the only gap between and the true worst-waypoint margin; see Appendix § 10.§ 1. Combining this construction with the local geometry above gives
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 , 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 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 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 from § 4.1 as a barrier over the behavior latent. Rather than modifying waypoints independently, it updates so that the pretrained decoder produces a rollout with larger safety margin before path-space correction. We model latent steering as and choose the smallest modification to a reference latent update . In our implementation, with , which mildly contracts the latent toward the prior center and discourages off-support drift. At each latent , LBS solves
where and are the CBF rate and exponent. Because Eq. (7) has one affine constraint, it is the projection of onto a half-space. Let . Then, whenever ,
Thus, Stage I follows the reference update when it already satisfies the latent barrier condition, and otherwise adds the minimum correction along ; the derivation is in Appendix § 11.§ 1.
Proposition 1 (Latent margin decrease). Let . Along the Stage I flow , whenever and ,
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 , the same fractional-power rate gives finite-time recovery.
Theorem 1 (Finite-time Stage-I recovery). Suppose the latent flow remains in before reaching , and suppose there exists such that for all with . Then, for any with , for . Moreover, 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 ; implementation details and generator-call cost are given in Appendix § 13.
Stage II Correction and Handoff
Stage I returns a steered latent and decoded rollout . 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 actually reduces the path-space violation.
Let denote the shifted path margin at the start of hard correction, where 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 . For a post-hoc corrector applied directly to , .
Proposition 2 (Latent-to-path margin transfer). Under the local regularity condition in § 4.1, for all ,
Proposition 2 is the formal handoff from latent steering to path correction: increasing 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 be the initial Stage-II barrier deficit. With Stage-II CBF rate and exponent , the path-space corrector satisfies
If the squared intervention magnitude is bounded by during correction, then
Corollary 1 shows why the latent stage is useful even when it does not reach : by decreasing , 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 , where . Combining this decrease with a per-step Stage-I cost 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 , the resulting upper bound on total cost is minimized at . The corresponding handoff iteration is when ; 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.

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.
| Constraint | Method | 2D Safety↑ | 2D Reach↑ | 2D Energy↓ | Franka Safety↑ | Franka Reach↑ | Franka Energy↓ | Maze2D Safety↑ | Maze2D Reach↑ | Maze2D Energy↓ |
| I | Vanilla FM | 12% | 100% | – | 12% | 100% | – | 0% | 50% | – |
| I | SAFE DIFFUSER | 100% | 10% | 1.226 | 100% | 0% | 0.0023 | 100% | 0% | 0.0288 |
| I | SAFE FLOW | 100% | 18% | 1.077 | 100% | 16% | 0.0020 | 100% | 0% | 0.1208 |
| I | SAFE FLOW MATCHER | 100% | 18% | 1.166 | 100% | 14% | 0.0075 | 100% | 0% | 0.2668 |
| I | Full LBS | 100% | 100% | 0.037 | 100% | 100% | 0.0004 | 100% | 95% | 0.010 |
| II | Vanilla FM | 0% | 100% | – | 0% | 100% | – | 38% | 50% | – |
| II | SAFE DIFFUSER | 100% | 34% | 0.728 | 100% | 0% | 0.0023 | 100% | 7% | 0.0010 |
| II | SAFE FLOW | 100% | 20% | 0.976 | 100% | 0% | 0.0023 | 100% | 25% | 0.0624 |
| II | SAFE FLOW MATCHER | 100% | 22% | 1.051 | 100% | 0% | 0.0086 | 98% | 18% | 0.1404 |
| II | Full LBS | 100% | 90% | 0.160 | 100% | 100% | 0.0004 | 100% | 90% | 0.009 |
| III | Vanilla FM | 0% | 100% | – | 0% | 100% | – | 28% | 50% | – |
| III | SAFE DIFFUSER | 100% | 0% | 1.321 | 100% | 0% | 0.0023 | 100% | 7% | 0.0072 |
| III | SAFE FLOW | 100% | 4% | 1.262 | 100% | 0% | 0.0023 | 100% | 38% | 0.0345 |
| III | SAFE FLOW MATCHER | 100% | 4% | 1.366 | 100% | 0% | 0.0086 | 100% | 53% | 0.0740 |
| III | Full LBS | 100% | 82% | 0.303 | 100% | 98% | 0.0028 | 100% | 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.
| Domain | Constraint | Method | Safety↑ | Reach↑ | ED↓ | Energy↓ | CS↓ | T-I (s)↓ | T-II (s)↓ |
| 2D | I | Vanilla FM | 12% | 100% | 0.21 | – | 0.88 | – | 0.09 |
| 2D | I | SafeDiffuser | 100% | 10% | 6.38 | 1.226 | 1.56 | – | 0.11 |
| 2D | I | SafeFlow | 100% | 18% | 5.57 | 1.077 | 1.42 | – | 0.10 |
| 2D | I | SafeFlowMatcher | 100% | 18% | 5.61 | 1.166 | 1.56 | – | 0.10 |
| 2D | I | Full LBS | 100% | 100% | 0.23 | 0.037 | 0.87 | 0.35 | 0.10 |
| 2D | II | Vanilla FM | 0% | 100% | 0.21 | – | 0.88 | – | 0.09 |
| 2D | II | SafeDiffuser | 100% | 34% | 3.75 | 0.728 | 1.24 | – | 0.12 |
| 2D | II | SafeFlow | 100% | 20% | 4.90 | 0.976 | 1.31 | – | 0.11 |
| 2D | II | SafeFlowMatcher | 100% | 22% | 4.99 | 1.051 | 1.44 | – | 0.11 |
| 2D | II | Full LBS | 100% | 90% | 0.89 | 0.160 | 1.03 | 0.65 | 0.11 |
| 2D | III | Vanilla FM | 0% | 100% | 0.21 | – | 0.88 | – | 0.10 |
| 2D | III | SafeDiffuser | 100% | 0% | 6.83 | 1.321 | 1.61 | – | 0.12 |
| 2D | III | SafeFlow | 100% | 4% | 6.44 | 1.262 | 1.48 | – | 0.10 |
| 2D | III | SafeFlowMatcher | 100% | 4% | 6.52 | 1.366 | 1.66 | – | 0.10 |
| 2D | III | Full LBS | 100% | 82% | 0.97 | 0.303 | 0.82 | 1.80 | 0.11 |
| Franka | I | Vanilla FM | 12% | 100% | 0.002 | – | 0.14 | – | 0.08 |
| Franka | I | SafeDiffuser | 100% | 0% | 0.250 | 0.0023 | 0.18 | – | 0.09 |
| Franka | I | SafeFlow | 100% | 16% | 0.214 | 0.0020 | 0.17 | – | 0.08 |
| Franka | I | SafeFlowMatcher | 100% | 14% | 0.241 | 0.0075 | 0.79 | – | 0.08 |
| Franka | I | Full LBS | 100% | 100% | 0.016 | 0.0004 | 0.28 | 0.80 | 0.09 |
| Franka | II | Vanilla FM | 0% | 100% | 0.002 | – | 0.14 | – | 0.08 |
| Franka | II | SafeDiffuser | 100% | 0% | 0.250 | 0.0023 | 0.18 | – | 0.10 |
| Franka | II | SafeFlow | 100% | 0% | 0.251 | 0.0023 | 0.17 | – | 0.09 |
| Franka | II | SafeFlowMatcher | 100% | 0% | 0.276 | 0.0086 | 0.87 | – | 0.09 |
| Franka | II | Full LBS | 100% | 100% | 0.017 | 0.0004 | 0.34 | 1.10 | 0.09 |
| Franka | III | Vanilla FM | 0% | 100% | 0.002 | – | 0.14 | – | 0.09 |
| Franka | III | SafeDiffuser | 100% | 0% | 0.250 | 0.0023 | 0.18 | – | 0.11 |
| Franka | III | SafeFlow | 100% | 0% | 0.251 | 0.0023 | 0.17 | – | 0.10 |
| Franka | III | SafeFlowMatcher | 100% | 0% | 0.276 | 0.0086 | 0.87 | – | 0.10 |
| Franka | III | Full LBS | 100% | 98% | 0.042 | 0.0028 | 0.50 | 1.55 | 0.10 |
| Maze2D | I | Vanilla FM | 0% | 50% | 2.69 | – | 0.17 | – | 0.44 |
| Maze2D | I | SafeDiffuser | 100% | 0% | 5.13 | 0.0288 | 0.11 | – | 0.63 |
| Maze2D | I | SafeFlow | 100% | 0% | 4.97 | 0.1208 | 0.21 | – | 0.84 |
| Maze2D | I | SafeFlowMatcher | 100% | 0% | 4.83 | 0.2668 | 0.63 | – | 0.84 |
| Maze2D | I | Full LBS | 100% | 95% | 0.71 | 0.010 | 0.15 | 4.50 | 0.68 |
| Maze2D | II | Vanilla FM | 38% | 50% | 2.69 | – | 0.17 | – | 0.42 |
| Maze2D | II | SafeDiffuser | 100% | 7% | 6.38 | 0.0010 | 0.10 | – | 0.50 |
| Maze2D | II | SafeFlow | 100% | 25% | 3.31 | 0.0624 | 0.20 | – | 0.70 |
| Maze2D | II | SafeFlowMatcher | 98% | 18% | 3.76 | 0.1404 | 0.42 | – | 0.68 |
| Maze2D | II | Full LBS | 100% | 90% | 0.87 | 0.009 | 0.16 | 3.80 | 0.58 |
| Maze2D | III | Vanilla FM | 28% | 50% | 2.69 | – | 0.17 | – | 0.43 |
| Maze2D | III | SafeDiffuser | 100% | 7% | 6.37 | 0.0072 | 0.10 | – | 0.49 |
| Maze2D | III | SafeFlow | 100% | 38% | 2.43 | 0.0345 | 0.19 | – | 0.69 |
| Maze2D | III | SafeFlowMatcher | 100% | 53% | 2.08 | 0.0740 | 0.30 | – | 0.69 |
| Maze2D | III | Full LBS | 100% | 93% | 0.27 | 0.004 | 0.29 | 4.10 | 0.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 (Appendix § 13.§ 3), which is set by the number of demonstrated behavior modes rather than by the horizon or robot degrees of freedom ( 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 , and the identical Stage-II corrector:
Best-of- (BoN): sample latents from the prior and select the decoded rollout with the largest . We report (BoN-).
Plain latent gradient ascent (PLGA): directly ascend , with the best step size per domain from .
PLGA and LBS share the same initial latent, gradient estimator, clipping region , 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:
| Method | 2D Safety↑ | 2D Reach↑ | Franka Safety↑ | Franka Reach↑ | Maze2D Safety↑ | Maze2D Reach↑ |
| Stage II only (SAFEFLOWMATCHER) | 100% | 4% | 100% | 0% | 100% | 53% |
| Stage I only | 10% | 100% | 10% | 100% | 20% | 95% |
| BoN-1 + Stage II | 100% | 0% | 100% | 0% | 100% | 0% |
| BoN-4 + Stage II | 100% | 0% | 100% | 0% | 90% | 48% |
| BoN-16 + Stage II | 100% | 0% | 100% | 32% | 100% | 5% |
| BoN-64 + Stage II | 100% | 0% | 100% | 36% | 98% | 0% |
| PLGA + Stage II | 100% | 76% | 100% | 92% | 100% | 68% |
| Full LBS | 100% | 82% | 100% | 98% | 100% | 93% |
Table 2. Alternatives to Stage I (Constraint III). All methods share the pretrained generator, the safety margin , 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 does not recover goal reaching. BoN reaches the goal in at most 48% of episodes for any , and Reach is non-monotonic in (in Maze2D, 48% at but 0% at ). 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 , 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 whenever it already satisfies the prescribed margin-improvement condition, and otherwise adds only the smallest correction along 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.
| Domain | Initial terminal | Clip frequency | Terminal | |
| 2D | 0.46 | 100% | 90% | |
| Franka | 0.09 | 8% | 84% | |
| Maze2D | 0.18 | 22% | 88% |
Table 3. Stage-I diagnostics for Constraint III in each domain. Initial terminal : median buffered latent margin before and after Stage I. : median norm of the estimated pulled-back gradient along the Stage-I iterates. Clip frequency: fraction of episodes in which the projection onto activates at least once. Terminal : 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
: latent space; : compact region of validity for the latent CBF analysis.
: rollout at latent with context and noise fixed or averaged out.
: per-waypoint shifted barrier; : softmin margin.
: robust safe latent set.
: locally bounded reference update; : solution of (7).
: Jacobian of at ; : Hessian tensor.
, applied componentwise on vectors.
, , .
is the non-degeneracy lower bound on on the unsafe set (hypothesis of Theorem 1); , are the Lipschitz constants of the barrier and decoder from Section 4.1; is the resulting Lipschitz constant of (Appendix B.2); is the Lipschitz constant of 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 in main-text eq. (4.1) sandwiches the true worst-waypoint margin: for any and any finite collection ,
This is the bound stated in main-text eq. (4.1); the soft-min gap is .
Proof. Let . Since , applying (which reverses inequalities) gives , which is (9).
The soft-min gradient is the softmax distribution: with . Hence is 1-Lipschitz in under , since by Hölder’s inequality.
Lipschitz latent margin
This subsection derives main-text eq. (4.1): the Lipschitz constant for .
Derivation of eq. (4.1). Write and . By main-text eq. (4.1), each is -Lipschitz on :
Combined with the 1-Lipschitzness of in under (Section B.1),
The constant does not depend on : 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 apart and is -Lipschitz. We show
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 and . The two distances and sum to , so at least one is . Calling the corresponding waypoint , -Lipschitzness of gives
by hypothesis. Thus for every on every inter-waypoint segment.
The factor of comes entirely from the geometric step “the nearer endpoint is within ”; without it the buffer would have to be . Choosing 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 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 , LBS decodes , evaluates the trajectory-space barriers , and updates through the pulled-back gradient , so the update is determined by the safety of the decoded trajectory. Accordingly, the forward invariance of in Theorem 1 refers to the latent flow , 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 around the prior center and rely on the local condition only inside .
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 .
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 as defined in the main text, (7) has a single linear inequality constraint, so its solution is the Euclidean projection of onto a closed half-space.
Derivation of (8). Form the Lagrangian
Stationarity gives , i.e., with . If , the reference is feasible and complementary slackness gives . If , the constraint binds at the optimum, so , giving . Combining the two cases yields and (8).
The projection has no free parameter: once and the CBF rate are fixed, is uniquely determined wherever .
Proof of Proposition 1: latent margin decrease
Let . We show that whenever the CBF constraint in (7) is satisfied at with , the latent flow produces .
Proof of Proposition 1. On , and . The CBF constraint in (7) becomes . Since on this set, . Combining,
Proof of Theorem 1: finite-time recovery
Theorem 1 adds a non-degeneracy hypothesis 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 , the closed-form solution in (8) is locally bounded and locally Lipschitz on . Hence admits a unique Carathéodory solution from any until it enters or exits .
Proof. On , the denominator is bounded below by . Since , , and are locally Lipschitz on , and is 1-Lipschitz, (8) is a rational function of locally Lipschitz quantities with bounded-below denominator, so is locally Lipschitz. Picard–Lindelöf applies on .
Proof of Theorem 1. On and under non-degeneracy, Proposition 1 gives the strict descent
The scalar comparison ODE with separates as and integrates to , vanishing at . By the comparison lemma [19 Lemma 3.4], on , so for . Forward invariance of follows because at any boundary point and by (11), interpreted as zero at .
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 used by Taylor’s theorem along the Euler step.
Lemma 2 (Lipschitz gradient of ). If, in addition to the conditions of § 4.1, is on with , , and is -Lipschitz, then is Lipschitz on with
Proof. Writing with , we bound the two factors separately. Each is -Lipschitz by adding/subtracting . The softmax has Jacobian with operator norm (a covariance with eigenvalues bounded by , since for unit , with equality at two-point uniform ). Combined with and Cauchy–Schwarz, . Combining (with ),
giving (12).
Theorem 3 (Inexact-gradient discrete-time recovery). Let with , and let be the closed-form solution (8) using in place of . Suppose Lemmas 1–2 hold and the Euler iterate remains in . Then
*with structural constants depending on , , and the bounds in § 4.1. For any with , the iterates enter in iterations, with equilibrium gap .
Proof. Step 1 bounds the perturbed barrier rate. Let , so . A direct expansion of using and the closed-form yields, on , , where absorbs and the 1-Lipschitz dependence of on . Step 2 applies Taylor’s theorem to along the Euler step using Lemma 2: , and substituting Step 1 plus gives (13). Step 3: whenever , , so (13) bounds with . Discrete fractional-power decay yields the bound; balancing 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 into a soft-min gap and a predictor gap.
Soft-min gap. By the soft-min sandwich (Section B.1) applied to , with , .
Predictor gap. By Lipschitzness of and the definition of ,
Subtracting and taking minima over (using ) gives .
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 -Lipschitz in state, standard ODE sensitivity gives , where controls initial perturbation and the integral captures the soft-slack term in (5). For a post-hoc path-space CBF-QP applied directly to , 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 and exponent enforces on , parallel to (11). Integrating yields for , so
For the energy bound, . Substituting and the change of variables gives
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 for (same scalar argument as in Section C.3). Identifying in the exact-gradient limit gives the discrete decay law
so the number of Stage-I iterations needed to reach a given terminal deficit is .
Joint-cost expression. Combining (14) with the Stage-I per-iteration cost (Appendix E.3) and the Stage-II energy bound from Corollary 1, the joint cost as a function of is
the upper bound used in Theorem 2.
Convexity. Differentiating with respect to ,
The second derivative is strictly positive for , so is strictly convex on .
Optimum. Setting (16) to zero,
the unique stationary point and, by strict convexity, the unique global minimum. The handoff iteration follows from the descent relation when . If , on , so is strictly decreasing on and the constrained minimum is at , i.e., 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 ). The proof above absorbs the soft-min and predictor-sensitivity slack from Proposition 2 into the constant . Retaining the slack explicitly replaces by in the Stage-II energy bound (Corollary 1), and the optimum shifts upward by an amount that vanishes as and (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 per step, which propagate through (14) as a downward shift of the achievable floor. The optimum in Theorem 2 remains valid above this floor; below it, the achievable is bounded by the equilibrium gap 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 before handoff: increasing already reduces the deficit Stage II must correct (§ 4.3). The flag 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,
where is the latent step size and projects onto the latent clipping box . The update direction is the closed-form latent CBF projection (8) evaluated with an estimate of the latent gradient. When backpropagation through the decoder is available, the gradient can be computed directly. Otherwise, we use central finite differences,
which costs generator evaluations per latent step. Central differences have truncation error for scalar fields. For larger , SPSA-style random directional estimators [35] or a learned critic for are natural replacements.
Cost accounting
Each Stage-I iteration consists of one rollout decode, one margin evaluation, 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 (in our setting, is dominated by the generator calls, so each Stage-I iteration uses generator evaluations). Over Stage-I iterations, the total Stage-I cost is
which is balanced against the Stage-II correction energy in Theorem 2. The handoff iteration in Theorem 2 selects the smallest 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
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:
with latent clipping box .
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 , , with start and goal , horizon . State is and actions are with no per-step bound (training data dictates magnitude).
Training modes. Four sine-wave modes with peak amplitude , 30 demonstrations per mode, additive state noise at each step with endpoints clamped to start and goal. Each demonstration interpolates start and goal along and rides the sine in .
Backbone. The 2D backbone is intentionally small (see Appendix G): hidden width 256, four residual blocks, behavior latent . The encoder is a transformer trajectory VAE with sinusoidal positional encoding.
Constraint setups.
S1 (mode selection). A single rectangular hazard . Three modes () intersect the rectangle; the upper mode clears it. Latent recovery is sufficient: Stage I selects the upper mode and Stage II makes near-zero corrections.
S2 (mode interpolation). Two rectangles and form a horizontal corridor of width 1 at for . All four training modes are blocked, but the interior region is open. Latent interpolation is required: Stage I drives to a peak amplitude not seen in training; Stage II remains nearly inactive.
S3 (CBF correction). A single thicker hazard . All four modes clip the band; the outer pair 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 ; we plan in EE space and project to joint space via the standard differential-IK controller used in the Franka stack. Start m, goal m, horizon . 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, (see Appendix G); -projection width 32; no auxiliary start–goal context (start/goal are fixed).
Constraint setups. All three setups place a thin wall at between start and goal:
S1 (mode selection). Lower wall blocks ; upper portion is solid except for a slot , ; a small sphere of radius 0.03 at 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 , that lies between the up–near and right–near training behaviors. No single training mode threads the hole; latent interpolation produces an approach via .
S3 (CBF correction). Same diagonal hole as S2, plus a small sphere of radius 0.03 at inside the hole. Stage I produces the interpolated approach; Stage II’s path-space CBF detours the EE around the sphere within the m window.
Maze2D
Domain. D4RL maze2d-large layout [12]. The state is 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 , matching SAFEDIFFUSER [40]. Start , goal ; 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, -projection width 128, , 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 () 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 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 ; 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 , weight decay , cosine-annealed to a minimum of over the full schedule, batch size 32. The reconstruction term is soft-DTW [6] with smoothing . The latent dimension matches the value used by the LBS hyperparameter table in Appendix E.4.
| 2D point-nav | Franka 3D EE | Maze2D | |
| Hidden width | 128 | 128 | 128 |
| Latent dim | 2 | 4 | 4 |
| Optimizer | AdamW | AdamW | AdamW |
| Learning rate | |||
| Weight decay | |||
| LR schedule | cosine | cosine | cosine |
| Batch size | 32 | 32 | 32 |
| Soft-DTW |
Table 4. Encoder hyperparameters.
Conditional flow-matching generator
The generator is a -conditioned flow-matching velocity predictor with the linear interpolant and an explicit-Euler ODE sampler. It uses FiLM injection of the encoder and (for Maze2D only) FiLM injection of an 8-dimensional start–goal context . We optimise with Adam, learning rate , batch size 32.
| 2D point-nav | Franka 3D EE | Maze2D | |
| Hidden width | 256 | 256 | 768 |
| Residual blocks | 4 | 4 | 20 |
| -projection width | 32 | 32 | 128 |
| Start/goal conditioning dim | — | — | 8 |
| FM Euler steps | 50 | 50 | 50 |
| Optimizer | Adam | Adam | Adam |
| Learning rate | |||
| Batch size | 32 | 32 | 32 |
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 (– 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 and gain (linear-rate variant of the LBS QP).
Latent Euler step size .
Latent iteration cap , with early stopping as soon as the soft-min margin .
Reference drift (encoder-anchor contraction; reference ).
Soft-min sharpness .
Margin slack .
Latent clip-box applied componentwise after every Euler step.
The same finite-difference estimator of is used in all domains. The full operational hyperparameter sextuplet 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 , where is the fractional exponent (matching Stage I), scales the fractional gain, and is the same activation slack as in Stage I.
The corrector is solved as a small QP over the per-step action , with as the QP cost and the fractional-rate CBF constraint as the only inequality. We use the unconstrained 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]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]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]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]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]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]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]Bruno C. Da Silva, George Konidaris, and Andrew G. Barto. Learning parameterized skills. In International Conference on Machine Learning, 2012.
- [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]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]Prafula Dhariwal and Alexander Nichol. Diffusion models beat GANs on image synthesis. In Advances in Neural Information Processing Systems, 2021.
- [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]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]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]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]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]Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 2020.arxiv.org/abs/2006.11239
- [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]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]Hassan K. Khalil. Nonlinear Systems. Prentice Hall, 3rd edition, 2002.
- [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]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]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]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]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]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]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]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]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]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]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]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]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]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]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]James C. Spall. Multivariate stochastic approximation using a simultaneous perturbation gradient approximation. IEEE Transactions on Automatic Control, 37(3):332–341, 1992.DOI
- [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]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]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]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]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]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]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]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]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]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.

