Research
CS-Pi: Constraint-Satisfying Flow Policy Sampling
CS-Pi enforces unseen safety constraints at inference time for flow-matching policies without retraining, with a project page releasing the method.

- arXiv
- 2611.08654 · accepted · CORL
- Published
- 2026-11-05
- Authors
- Soumojit Bhattacharya, Oliver Kroemer, Shubham Tulsiani
In plain words
A flow-matching policy trained once on broad demonstrations will meet situations its training data never contained — for example, a wine glass placed beside the drawer it must open. Retraining for each new constraint is impractical, so the constraint (obstacle avoidance, joint limits, an orientation preference) must be enforced at inference time.
AI summary
Overview
Research area: Robot learning — training-free, inference-time constraint satisfaction for generative (flow-matching / diffusion) visuomotor policies, with evaluation on simulated manipulation and a real Franka arm.
Technical level: Intermediate. The paper assumes familiarity with flow-matching/diffusion sampling, ODE-based action generation, and action-chunk policies; the core idea itself is simple enough to explain without the math.
Scope (1 sentence): The paper proposes CS-Pi, a draw-project-renoise sampling loop that makes a pretrained flow-matching policy produce actions that satisfy a deployment-time constraint while remaining likely under the policy, and evaluates it across a 2D diagnostic, a 7-DoF shelf pick-and-place, an orientation-preference task, a 3D obstacle-avoidance benchmark, and a zero-shot Franka deployment with a π₀.₅ policy.
What This Paper Is About
A flow-matching policy trained once on broad demonstrations will meet situations its training data never contained — for example, a wine glass placed beside the drawer it must open. Retraining for each new constraint is impractical, so the constraint (obstacle avoidance, joint limits, an orientation preference) must be enforced at inference time.
The difficulty is that enforcing safety can break the policy: an action the policy would essentially never sample may clear the obstacle yet fail the task, or be jerky and kinematically infeasible. The goal is therefore to sample actions that are simultaneously safe (in the constraint's safe set) and plausible (likely under the unmodified policy), without retraining and without an auxiliary network.
Key Contributions
-
Diagnosis of why gradient guidance fails for deployment-time constraints. Guidance must evaluate its cost on a proxy — the policy's running estimate of the clean action — because the cost is only meaningful on clean actions. When the policy is uncertain between distinct modes (passing left or right of an obstacle), that proxy is their average and can pass straight through the obstacle, and the resulting gradient may point toward neither mode. Hard constraints also offer no gradient at all, since they are yes-or-no.
-
CS-Pi, a draw-project-renoise sampler. Each iteration projects the current draw onto the safe set, renoises the projection to a level set by how far the projection moved the draw, and re-runs the unmodified policy from there; the loop ends when a draw is itself safe. This combines projection's efficiency with rejection sampling's plausibility, using a single hyperparameter k that slides between the two extremes (k → 0 recovers rejection, k → ∞ recovers projection).
-
Extension to continuous costs by replacing only the projection step. A proximal operator trades reducing the cost against staying close to the current draw, and hard constraints and soft costs can be composed by applying them in sequence, with order encoding priority (e.g., orientation preference first, then obstacle projection so the constraint takes precedence).
-
A multi-setting evaluation against gradient guidance, Trust Sampling, rejection, projection, SafeDiffuser and SafeFlowMatcher, including a zero-shot hardware deployment on a Franka arm with a DROID-finetuned π₀.₅ policy where the safe set comes from vision-estimated obstacle bounding boxes.
Main Findings
-
Shelf pick-and-place (5 scenarios, 150 tasks): CS-Pi reaches 81.3% safe success versus 55.3% for projection, 32.0% for gradient guidance, 53.3% for Trust Sampling, 44.7% for SafeFlowMatcher and 34.7% for rejection. It is the only method whose actions score above the unconstrained policy in mean log-likelihood (17.96 vs 15.02), and its goal reaching (84.7%) exceeds even the unconstrained policy's (75.3%).
-
Zero-shot hardware (Franka FR3, π₀.₅, 10 trials per method per layout): CS-Pi averages 55% safe success (60% on layout 1, 50% on layout 2) against 40% for projection, 25% for gradient guidance, 20% for Trust Sampling and 10% for the unconstrained policy. Per-step latency is 0.143 s, close to gradient guidance (0.139 s) and Trust Sampling (0.135 s); projection is cheaper (0.099 s) but drops its log-likelihood below the unconstrained policy's (−473.2 vs −470.2), while CS-Pi stays close to it (−471.8).
-
2D Avoidance (six unseen-obstacle scenarios, 200 rollouts per cell): Three methods reach at least 99% safe success — SafeDiffuser (100.0%), projection (99.8%) and CS-Pi (99.0%) — but among them CS-Pi keeps the most rollouts fully inside the demonstration support (0.857) and has the highest log-likelihood (1.53), whereas projection's log-likelihood collapses to −85.89. Gradient guidance, Trust Sampling and rejection stay plausible but reach at most 79.4% safe success; rejection needs 73,921 network evaluations versus CS-Pi's 283.
-
3D-Orient (continuous cost, 90 rollouts per cell): CS-Pi is the only method that both achieves the top-down orientation preference and keeps the reach — 65.6% success with 98.9% goal reaching and a 0.07 m max end-effector step, matching the unconstrained policy. Gradient guidance reaches at most 6.7% success and Trust Sampling 1.1%. CS-Pi's lower log-likelihood (10.21 vs 13.46 unconstrained) is attributed to the cost of moving the gripper away from the policy's preferred orientations.
-
Sphere-Avoid (3D obstacle avoidance, 120 tasks): CS-Pi reaches 99.9% safe success on the 10-sphere layout and 91.8% on the 16-sphere layout, the highest in both, and degrades least between them (8.1 points, versus 26.1 for projection). Rejection has the highest log-likelihood (3.47 / 3.19) but far lower safe success (56.7% / 14.1%).
-
Composing a hard constraint with a soft preference: On the 2D environment with an added preference toward height y_ref = 0.7, only CS-Pi satisfies both the obstacle constraint and the preference; baselines must fold them into one weighted cost.
-
Compute cost stays modest: CS-Pi uses 271 NFE on the shelf (projection: 240; rejection: 8745), 283 in 2D, 210 on 3D-Orient (unconstrained: 138), and 20–26 on Sphere-Avoid.
Methodology in Plain English
The starting point is that a flow-matching policy builds an action by starting from pure Gaussian noise and repeatedly asking a learned network which way to move, until it lands on a clean action chunk after a fixed number of steps. Because that process is iterative, you can restart it partway through instead of only from scratch.
CS-Pi uses that restart capability in a loop:
- Draw a normal action from the policy.
- Project it onto the safe set — move it to the nearest action that satisfies the constraint. This projection is safe by construction and cheap to compute, but possibly an action the policy would never produce.
- Renoise the projection: add noise back, with the amount set by how far the projection had to move the draw. A small move means the projection is trustworthy, so add little noise and stay nearby; a large move means the projection may sit where the policy assigns almost no probability, so add more noise to give a different policy mode (say, passing on the other side of an obstacle) a chance to be found.
- Re-denoise by running the untouched policy from that noise level, producing the next draw. Repeat until a draw lands in the safe set, or until a cap of iterations is hit.
The only new hyperparameter is k, which sets how the noise level scales with the projection distance; the two extremes of k reproduce plain rejection sampling and plain projection. Critically, nothing is ever evaluated at a noisy intermediate state, so no constraint gradient is needed at any point — the method only needs a projection operator.
For soft preferences such as "keep the gripper near-vertical," the same loop runs with the projection replaced by a proximal operator that trades off lowering the cost against staying near the current draw. The authors apply the same proximal step (L-BFGS) inside both CS-Pi and the projection baseline so that any gap between them is attributable to the loop itself. If no draw is safe after the iteration cap, an optional terminal projection can be executed, trading plausibility for safety.
Why This Matters
The paper reframes deployment-time safety for generative robot policies as a sampling problem rather than a retraining or gradient-steering problem. That matters because the constraints that actually cause accidents are the ones nobody anticipated in the training set, and because a policy that satisfies a constraint while abandoning the behavior it learned is not useful. CS-Pi requires only a projection onto the safe set — no differentiable barrier, no learned dynamics model, no auxiliary network — which is what makes zero-shot use with an off-the-shelf π₀.₅ policy and vision-estimated obstacle boxes possible.
Real-world applications:
- Home robots avoiding fragile objects (the paper's motivating wine-glass-beside-a-drawer example) that were never in the demonstrations.
- Warehouse and shelf pick-and-place where clutter and obstacles change per shift, without retraining per layout.
- Task-specific preferences layered on generalist policies, such as holding a cup upright while carrying it, or keeping a tool at a fixed approach orientation.
- Deployment of vision-language-action models in shared human spaces, where obstacle bounding boxes can be supplied by an existing perception stack at run time.
Industry relevance: the method offers a drop-in inference-time safety layer that preserves the base policy's competence and adds only about one policy evaluation's worth of latency on hardware (0.143 s vs 0.069 s unconstrained), which is the regime fleet operators and integrators care about when shipping foundation-model policies into unstructured environments.
Future Directions
- Convergence guarantees for the loop. The authors state their theory characterizes only a single iteration — the distribution of the next draw given the current one — and do not prove that the loop converges, which is why the method must sometimes choose between an unsafe last draw and a less-plausible terminal projection.
- Cheaper and more general projection / proximal operators. The method is only as good as its projection; the obstacle and joint-limit sets used here admit closed-form or cheap iterative solutions, but more complex safe sets would need more complex solvers.
- Robust and dynamic constraints. On hardware the safe set is estimated from vision once per rollout in static scenes, so moving obstacles and errors from segmentation, depth or registration can misplace or mis-size the constraint.
- Beyond action chunks. Because CS-Pi operates on the fixed-length action chunks a policy predicts, it is myopic: if the policy commits to a mode that is safe for the current chunk but has no safe continuation, CS-Pi cannot recover. Trajectory-level planning is left out of scope.
Target Audience
Robotics researchers and practitioners working on safe robot learning, diffusion and flow-matching policies, and deployment of generalist or vision-language-action models. It is most valuable to readers who already understand how generative action policies are sampled and who are looking for a training-free way to enforce constraints at inference time; the paper is also a useful case study for engineers evaluating inference-time safety layers, since it reports latency, log-likelihood and network-evaluation counts alongside success rates, and includes a real-robot deployment rather than simulation alone.
Authors’ abstract
A flow-matching policy deployed in the field must often satisfy a constraint that was absent from its demonstrations, such as avoiding an obstacle it has never seen. Retraining for every new constraint is impractical, so the constraint must be enforced at inference time. Enforcing it must not discard what the policy learned: an action the policy would rarely sample may avoid the obstacle yet fail the task. We therefore want actions that are both safe, satisfying the…
The full abstract on arXivRelated papers
- $π\mathbf{R}^2$: Reactive Real-time Flow Policies 2026-07-28 · cs.RO · Also by Shubham Tulsiani
- Learning Adaptable Dexterous Skills via Hybrid Dexterous Mimicking 2026-10-20 · cs.RO · Also by Shubham Tulsiani
- Sample-Efficient Reinforcement Learning for Policy Improvement via Flow-Reversed Action Anchors 2026-10-16 · cs.RO · Key terms of the title in common
- An Empirical Study on What Matters for Viewpoint-Generalizable Policies in Visual Imitation Learning 2026-09-26 · cs.RO · Also by Shubham Tulsiani
- ActSafeGuard: Differentiable and Training-Aligned Constraint Enforcement for Flow-Matching Policies 2026-09-10 · cs.RO · Key terms of the title in common