← Paper Digest

CS-Pi: Constraint-Satisfying Flow Policy Sampling

Soumojit Bhattacharya, Oliver Kroemer, Shubham Tulsiani

November 2026

CS-Pi on the Franka, a successful apple pick-and-place with the obstacle constraint enforced.

TL;DR CS-Pi enforces obstacle constraints that a pretrained flow-matching policy never saw in training by repeatedly projecting a draw onto the safe set, adding noise back and re-running the policy. It reaches 81% safe success on a simulated shelf pick-and-place and 55% zero-shot with pi0.5 on a Franka, against 55% and 40% for projection.

What they do

A flow-matching policy deployed in the field often meets a constraint its demonstrations never contained, such as an obstacle next to the target. CS-Pi enforces the constraint at inference time without retraining, and aims for actions that are both safe (satisfy the constraint) and plausible (likely under the policy). It combines rejection sampling, which is plausible but slow when safe actions are rare, with projection, which is fast but can produce jerky or task-irrelevant actions.

How it works

  • Draw an action chunk from the policy and project it onto the safe set.
  • Instead of executing the projection, add noise back to it. How much noise depends on how far the projection moved the draw: large moves add more noise, so the policy can switch modes, for example passing right of the obstacle instead of left.
  • Re-run the unmodified policy from that noise level and repeat until a draw is within a tolerance of the safe set. If none is after a fixed number of iterations, project the last draw. A single hyperparameter k slides between rejection and projection.
  • Continuous costs, such as keeping the gripper top-down, replace the projection with a proximal step, and the operators are applied in priority order.

Results

  • Shelf pick-and-place with unseen obstacles (7-DoF Franka, simulation): 81.3% safe success, against 55% for projection and 32% for gradient guidance. Goal reaching is 84.7%, above the unconstrained policy’s 75.3%.
  • 2D avoidance: at least 99% safe success, like projection, but with log-likelihood 1.53 against -85.89 for projection.
  • Orientation preference: 65.6% success with 98.9% goal reaching. Gradient guidance stays below 7% and Trust Sampling reaches 1.1%.
  • Zero-shot on a Franka with a DROID-finetuned pi0.5 and obstacle boxes from vision (two layouts, 10 trials each): 55% safe success, against 40% for projection, 25% for gradient guidance and 10% unconstrained, at 0.143 s per step.

Limitations

There is no convergence proof for the loop, and when no draw becomes safe it must choose between an unsafe draw and a less plausible projection. It needs a cheap projection onto the safe set. On hardware the safe set is estimated once from vision in static scenes, and the trial counts are small. Working on action chunks, it cannot recover once the policy commits to a mode with no safe continuation.

Videos

The same pi0.5 policy run unconstrained, at 1x speed.
A failed rollout with the projection baseline.

Figures

From Figure 1: The policy denoises Gaussian noise into an action chunk. Its draws are multimodal, three ways to reach...
From Figure 1: The policy denoises Gaussian noise into an action chunk. Its draws are multimodal, three ways to reach the apple, and the most likely passes through the obstacle. Constraints such as obstacle avoidance are supplied only at deployment and define a safe set. CS-Pi targets the policy restricted to the safe set: the unsafe mode is removed and the others keep their shape.
From Figure 2: Gradient guidance steers each denoising step with a cost gradient evaluated at a proxy and can still v...
From Figure 2: Gradient guidance steers each denoising step with a cost gradient evaluated at a proxy and can still violate the constraint. Projection moves the draw to the safe set, yielding an action the policy would rarely sample. Rejection sampling redraws from pure noise until a draw is safe. CS-Pi projects the draw, renoises the projection by an amount set by how far the projection moved it, and re-runs the policy until a draw is safe and plausible.
From Figure 3: 2D Avoidance, 20 rollouts per method overlaid on the demonstration support (shaded), obstacles outline...
From Figure 3: 2D Avoidance, 20 rollouts per method overlaid on the demonstration support (shaded), obstacles outlined. Gradient guidance and Trust Sampling leave the support or cut through the obstacle; rejection stays on-support but only a few draws survive; CS-Pi keeps every trajectory in-distribution while routing around the obstacle.
From Figure 4: Hardware rollout in layout 1, frames running left to right. CS-Pi enforces the deployment-time obstacl...
From Figure 4: Hardware rollout in layout 1, frames running left to right. CS-Pi enforces the deployment-time obstacle constraint, grasps the apple and places it.
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 constraint, and plausible, remaining likely under the policy. Gradient guidance, the most common approach, steers noisy states, so it must evaluate its cost on the policy's running estimate of the clean action; when the policy is uncertain between passing left or right of an obstacle, this estimate is their average and can pass straight through it. We instead build on rejection and projection. Rejection redraws actions until one is safe: every output is plausible, but the wait is intractable when safe actions are rare. Projection moves an action to the nearest safe one: it is efficient, but the result need not be plausible. Our key insight is that flow-matching sampling lets us combine the two, keeping projection's efficiency and rejection's plausibility. CS-Pi, our draw-project-renoise sampler, projects each draw to the nearest safe action, adds noise back scaled to how far the projection moved it, and re-runs the unmodified policy until a draw is safe. Replacing only the projection step extends CS-Pi to continuous costs. Across a 2D diagnostic, a 7-DoF shelf pick-and-place, an orientation preference, and a zero-shot Franka deployment, CS-Pi reaches 81% safe success on the shelf and 55% on hardware, against 55% and 40% for projection, while staying plausible.

Summaries are written automatically from each paper's text. Figures and videos come from the paper and its project page; all credit goes to the authors.