Introduction
A flow policy produces an action chunk by integrating a learned velocity field from Gaussian noise in Euler steps. Pretrained by imitation, the policies in this task are well short of solving their tasks: the pretrained policy succeeds at a rate of 0.280 on Square-MH, 0.363 on ToolHang-PH and 0.090 on Transport-MH. The question is which policy-improvement operator, given only the reward and a fixed budget of online environment steps, raises the deployed policy's success fastest and furthest.
Three properties make this hard. There is no tractable , so policy-gradient methods need surrogates [1, 2, 3], and differentiating through the -step sampler gives a long, badly conditioned pathwise gradient. Q-gradient methods for flow policies avoid the likelihood [4, 5], but they rely on a critic that, while successes are rare, has seen very few of them. And full fine-tuning of the flow's weights can move the policy away from the imitation prior before the reward signal is strong enough to say where to go; recent work is about keeping the update close to the policy's support [6, 7].
A different family leaves the pretrained flow untouched and learns something small on top of it: a policy over the flow's input noise [8] or a bounded residual on its output. With a noise policy, every action is then something the pretrained flow could have produced. We build on the first of these, and add one more safeguard: nothing trained is deployed unless the environment says it is better than what we started with.
Method
Our method, GNS (gated noise-space steering), has two parts: a soft actor-critic that steers a frozen flow through its initial noise, and a deployment gate that falls back to the pretrained policy.
Steering the frozen flow through its noise
The pretrained velocity field is never updated. A noise actor with three hidden layers of width 256 (LayerNorm, GELU) outputs a mean and a log standard deviation clipped to , and the noise code is a squashed Gaussian,
so the executed chunk is , the frozen flow's -step integration from . The log-density of follows from the Gaussian density of and the change of variables through :
def actor_sample(ap, obs, key):
mean, log_std = actor.apply({"params": ap}, obs)
std = jnp.exp(log_std)
eps = jax.random.normal(key, mean.shape)
u = mean + std * eps
x0 = HEAD_BOUND * jnp.tanh(u)
# log prob of squashed gaussian
log_prob = (-0.5 * ((u - mean) / std) ** 2 - log_std - 0.5 * math.log(2 * math.pi)).sum(-1)
log_prob = log_prob - jnp.log(HEAD_BOUND * (1 - jnp.tanh(u) ** 2) + 1e-6).sum(-1)
return x0, log_probThe critic is the part we changed after our first noise-head attempts failed (Section 4). It is defined on the noise, , not on the action, so the actor's gradient never passes through the flow's Jacobian. It is an ensemble of five networks, each with four hidden layers of width 512, trained by temporal difference on action chunks of length . For a chunk with per-step rewards over the steps actually executed,
where is zero if the chunk terminated, is the ensemble mean under Polyak-averaged target weights (), the pessimism coefficient is zero, and is a fixed upper bound set in the code. The entropy term is left out of the target. The actor minimises , and the temperature is tuned automatically toward a target entropy of , being the chunk's dimension:
def one_update(carry, batch):
ap, cp, tp, ao, co, la, alo, rng = carry
obs, act, rew, next_obs, mask = batch["obs"], batch["act"], batch["rew"], batch["next_obs"], batch["mask"]
rng, k1, k2, k3 = jax.random.split(rng, 4)
# critic update
x0n, lpn = actor_sample(ap, next_obs, k1)
tq = qvals(tp, next_obs, x0n)
tq_agg = tq.mean(-1) - RHO * tq.std(-1)
target = jax.lax.stop_gradient(jnp.clip(rew + gH * mask * tq_agg, q_lo, q_hi))
def closs_fn(p):
q = qvals(p, obs, act)
return ((q - target[:, None]) ** 2).mean()
closs, cgrads = jax.value_and_grad(closs_fn)(cp)
cupd, co = ctx.update(cgrads, co)
cp = optax.apply_updates(cp, cupd)
tp = jax.tree_util.tree_map(lambda t, p: (1 - TAU) * t + TAU * p, tp, cp)
# actor update
alpha = jnp.exp(la)
def aloss_fn(p):
x0, lp = actor_sample(p, obs, k2)
q = qvals(cp, obs, x0)
return (alpha * lp - q.mean(-1)).mean(), lp.mean()
(aloss, lpmean), agrads = jax.value_and_grad(aloss_fn, has_aux=True)(ap)
aupd, ao = atx.update(agrads, ao)
ap = optax.apply_updates(ap, aupd)
ent = -jax.lax.stop_gradient(lpmean)
def alloss_fn(la_):
return (jnp.exp(la_) * (ent - target_ent)).mean()
alloss, algrads = jax.value_and_grad(alloss_fn)(la)
alupd, alo = altx.update(algrads, alo)
la = optax.apply_updates(la, alupd)
x0l, lpl = actor_sample(ap, obs, k3)
ql = qvals(cp, obs, x0l).mean()
return (ap, cp, tp, ao, co, la, alo, rng), (closs, aloss, ql, lpl.mean())Updates run about four per environment step taken (UTD 4), in batches of 256, compiled as jax.lax.scan
blocks of up to 128 updates.
Collection with best-of-N noise codes
Training data come from parallel environments. At every chunk boundary we draw noise codes from the actor for each environment (, or when ), decode all of them through the frozen flow, and execute the one with the highest ensemble-mean . The buffer stores the chosen noise code, not the decoded action, because that is what the critic is a function of. Best-of-N is used only to collect data; what is deployed is a deterministic head.
def rollout_chunks(n_chunks, ap):
nonlocal obs, key
for _ in range(n_chunks):
ob_j = jnp.asarray(obs)
keys = jax.random.split(key, BON + 1)
key = keys[0]
x0s = jnp.stack([actor_sample(ap, ob_j, keys[i + 1])[0] for i in range(BON)]) # (BON, n, D)
acts = jax.vmap(lambda x0: flow_action(ob_j, x0))(x0s) # (BON, n, D)
qs = jax.vmap(lambda x0: qvals(cparams, ob_j, x0).mean(-1))(x0s) # (BON, n) noise-space Q
best = jnp.argmax(qs, axis=0) # (n,)
x0_best = x0s[best, jnp.arange(N_ENVS)] # (n, D)
chunk = np.asarray(acts[best, jnp.arange(N_ENVS)]).reshape(N_ENVS, H, A)
d = env.step_chunk(chunk)
ns = d["nsteps"]
rew_c = np.zeros(N_ENVS, np.float32)
mask = np.ones(N_ENVS, np.float32)
nobs = np.zeros((N_ENVS, O), np.float32)
for i in range(N_ENVS):
if ns[i] == 0:
continue
r = d["rewards"][i]; tm = d["terms"][i]
rew_c[i] = sum(gamma ** h * r[h] for h in range(ns[i]))
mask[i] = 0.0 if tm[:ns[i]].any() else 1.0
nobs[i] = d["next_obs"][i, ns[i] - 1]
valid = ns > 0
buf.add(d["obs0"][valid], np.asarray(x0_best)[valid], rew_c[valid], nobs[valid], mask[valid])
obs = d["new_obs"]Deploying only what beats the pretrained policy
A trained noise head is deployed deterministically, . Our development runs showed it could do better than the pretrained policy for a while and then collapse (Section 4), so the deployed policy is chosen by a gate on held-out validation episodes. We hold out validation environments, being the number of environments the task allows, and give the rest, but at least 8 and at most 32 (16 when ), to training. A validation pass runs one episode in each validation environment and returns the success fraction, or the mean return when the task's metric is a return.
def _val_metric(vsucc, vret):
return float(vret.mean()) if s["metric"] == "return" else float(vsucc.mean())
def validate(hp):
vobs = val_env.reset()
vdone = np.zeros(N_VAL, bool); vsucc = np.zeros(N_VAL, bool); vret = np.zeros(N_VAL)
for c in range(s["horizon"] // H + 2):
if vdone.all():
break
mean, _ = actor.apply({"params": hp}, jnp.asarray(vobs))
x0 = HEAD_BOUND * jnp.tanh(mean)
chunk = np.asarray(flow_action(jnp.asarray(vobs), x0)).reshape(N_VAL, H, A)
d = val_env.step_chunk(chunk, active=~vdone)
for i in range(N_VAL):
if not vdone[i]:
vret[i] += float(d["rewards"][i].sum())
if d["succs"][i].any():
vsucc[i] = True
if d["done"][i]:
vdone[i] = True
vobs = d["new_obs"]
return _val_metric(vsucc, vret)Before training starts we validate the pretrained policy itself, decoded from ordinary Gaussian noise, and set the bar a margin above it: for a success metric (or for a return).
_bv = validate_base()
best_val = _bv * 1.08 if s["metric"] == "return" else _bv + 0.03 # margin over base
best_params = None
print(f"[val base] base_val={best_val:.3f}", flush=True)
prefill_chunks = max(1, PREFILL // (N_ENVS * H))
rollout_chunks(prefill_chunks, aparams)The pretrained policy is deployed before training begins. Every 30000 environment steps the current head is validated. If its score strictly exceeds the bar, the head is stored as the best so far and the bar is raised to . Every 10000 environment steps we deploy the stored head if there is one, and the pretrained policy otherwise; the same rule decides the final deployment. Training stops when the step budget is nearly spent or 600 seconds of wall clock remain, so that the last deployment is in place before the cap.
if api.used - last_val >= VAL_EVERY:
last_val = api.used
vs = validate(aparams)
if vs > best_val:
best_val = vs
best_params = jax.tree_util.tree_map(lambda x: x.copy(), aparams)
print(f"[val @ {api.used}] val_succ={vs:.3f} best={best_val:.3f}", flush=True)
if api.used - last_deploy >= DEPLOY_EVERY:
if best_params is None:
deploy_base()
else:
deploy(best_params)
last_deploy = api.used
if best_params is None:
deploy_base()
else:
deploy(best_params)The rule is a conservative version of safe policy improvement against a baseline policy [9]: the pretrained policy is the default, and replacing it needs evidence from the environment, not from the critic. The submitted file's docstring describes the noise-space actor-critic but not this gate, which was added later.
Results
| Method | ① | ② | ③ | |||
|---|---|---|---|---|---|---|
| Success-rate AUC ↑ | Final success rate ↑ | Success-rate AUC ↑ | Final success rate ↑ | Success-rate AUC ↑ | Final success rate ↑ | |
| Qwen4-Max | 0.270 | 0.270 | 0.363 | 0.363 | 0.110 | 0.110 |
| Pretrained flow, no RL | 0.280 | 0.280 | 0.363 | 0.363 | 0.090 | 0.090 |
| DiPOD | 0.440 | 0.440 | 0.540 | 0.595 | 0.050 | 0.013 |
| DPPO | 0.292 | 0.312 | 0.347 | 0.335 | 0.008 | 0 |
| DSRL | 0.359 | 0.575 | 8.33e-4 | 0 | 0 | 0 |
| FlowRL | 0 | 0 | 0 | 0 | 0 | 0 |
| FPO | 0.226 | 0.112 | 0.556 | 0.615 | 0.147 | 0.122 |
| FPO++ | 0.409 | 0.437 | 0.574 | 0.652 | 0.089 | 0.040 |
| FQL with action chunking | 0.271 | 0.330 | 0.150 | 0.235 | 0.053 | 0.063 |
| OGPO | 0.489 | 0.600 | 0.687 | 0.877 | 0.280 | 0.467 |
| QF3 | 0.849 | 0.952 | 0.548 | 0.930 | 0.246 | 0.443 |
| QF3+ | 0.852 | 0.922 | 0.677 | 0.900 | 0.664 | 0.870 |
| ReinFlow | 0.287 | 0.310 | 0.327 | 0.412 | 0.313 | 0.420 |
| SAC Flow | 0.360 | 0.578 | 0.026 | 0.020 | 0.034 | 0.072 |
| Gaussian PPO | 0.302 | 0.367 | 0.011 | 0.013 | 4.17e-4 | 0 |
| GSBR | 0.781 | 0.965 | 0.308 | 0.710 | 0.001 | 0.005 |
- ① Robomimic Square-MH · low-dim state · sparse reward
- ② Robomimic Tool Hang-PH · low-dim state · sparse reward
- ③ Robomimic Transport-MH · low-dim state · sparse reward
GNS stays at the pretrained policy's level on every setting. Its AUC is 0.270 on Square-MH against the pretrained policy's 0.280, 0.363 on ToolHang-PH against 0.363, and 0.110 on Transport-MH against 0.090. On every setting our AUC equals our end-of-training success, as it does for the pretrained policy. That is what a run that kept one policy deployed throughout would produce; the means alone do not tell us whether the gate ever deployed a trained head.
Against the published methods this is far from competitive. The strongest baseline reaches an AUC of 0.852 on Square-MH (QF3+), 0.687 on ToolHang-PH (OGPO + CA [13]) and 0.664 on Transport-MH (QF3+). On Square-MH GNS is behind twelve of the fourteen published baselines on both metrics, ahead only of FPO and FlowRL. On ToolHang-PH it is level with the pretrained policy and ahead of the methods whose AUC fell well below it there, such as SAC Flow (0.026) and DSRL (0.001), but behind DiPOD, FPO, FPO++, QF3 and OGPO + CA in AUC. On Transport-MH it is slightly above the pretrained policy and behind FPO, QF3, OGPO + CA and ReinFlow on both metrics.
The comparison that matters most for our own reasoning is with the starter's method. The file we replaced ran OGPO + CA [13], and in our development harness that method collapsed to zero success, which is a large part of why we froze the flow. Its published means do not collapse: an AUC of 0.489, 0.687 and 0.280 on Square-MH, ToolHang-PH and Transport-MH, above ours on every setting and on both metrics. Our premise that full-flow fine-tuning is too fragile to use here came from a harness that did not reproduce the published result.
How we got here
GNS took around thirty-seven variants, and most of them failed. The final design is what was left when the gate turned out to be the only thing that reliably kept the deployed policy at the pretrained level. All figures below are the agent's own development measurements, on its own development harness and held-out sets, not the task's evaluation.
- Full fine-tuning of the flow collapsed. Our first method backpropagated a critic's action gradient through the sampler; success fell to 0%, which we read as the gradient pushing the flow off the support where the critic had data. Advantage-weighted flow matching [15] toward replay actions also collapsed, and so did the starter's OGPO + CA in our harness. We attributed this to flow matching on the flow's own samples acting as self-distillation without a fixed anchor.
- Reward-weighted flow matching gave the only early gain, and it did not last. Weighting replay chunks by their undiscounted episode return, against a fixed velocity anchor to the pretrained field, raised held-out success from 7.8% to 12.5% before it drifted back to 4.7%. Discounted returns had given weights of about 1, because discounting compresses the gap between a late success and a failure. Training success in that run reached 27% while held-out success stayed near 4%, which we took as the fine-tuned flow memorising its training states. A ten times stronger anchor stopped learning altogether, and averaging the weights over time did not stop the drift.
- Freezing the flow, and the critic on the noise. We then froze the flow. A noise head trained by a Q-gradient chased an overestimated critic to the bound, and residual heads on the flow's output kept destroying the pretrained behaviour, even with small bounds and a pessimistic minimum over the ensemble. The latent-noise method of [8] recovered slowly in our harness, but our own soft actor-critic noise head stayed at 0-1% success. Reading that baseline, we found that its critic and actor live in noise space, , so no gradient crosses the flow; ours had used an action-space critic and backpropagated through the frozen flow, where the gradient vanished. Moving the critic to noise space, adding best-of-N collection, tuning the temperature toward and dropping entropy from the target as that baseline does gave our best single result: 13% held-out success against 2% for our run of the baseline.
- That result did not hold up. A second run of the same method peaked at 4% and ended at 0%, and on a larger held-out set the first configuration peaked at 6% and then fell to 1.5%. Averaging the actor's weights over time made it smoother but it still collapsed at the end. Success-prioritised replay, Monte-Carlo return-to-go targets, an undiscounted TD critic (which diverged), a conservative Q penalty (which drove the critic to minus infinity), dropping best-of-N and a smaller head all failed to give a lasting gain.
- Validation, then a fallback, then a margin. Deploying the best-validated head without a fallback failed: the chosen head reached 0% on the held-out set, because the small validation set had been overfitted. Making the pretrained policy the default fixed that. On another development setting the gate still ended below the pretrained policy by selecting a lucky checkpoint, and requiring the margin over the pretrained policy's validation score fixed it there. At the step count we designed for, the gate kept the pretrained policy on our main development setting (3% held-out success). In longer development runs it did not always do so: a gated variant without the margin deployed a head that reached 9%, and the final method, in a still longer run, deployed heads that reached 20%; a run of the final method at the intermediate length stayed on the pretrained policy. We took this as evidence that the gate adapts to the budget.
- A late fix changed the validation set. The margin was chosen and first verified with 48 validation environments. Near the end we found that this, together with the training environments, exceeded the number of environments the task allows, and we cut validation to at most 16. We smoke-tested the change and re-ran several checks with the fixed file, but kept the success margin of 0.03.
Limitations
- No clear improvement on any setting. The submitted method is, in effect, the pretrained policy plus the machinery needed to keep it deployed. Its AUC is within a few hundredths of the pretrained policy's everywhere, and far below the best published methods.
- The premise was not supported. We froze the flow because full fine-tuning collapsed in our development harness. The published OGPO + CA, QF3, FPO++ and DiPOD runs fine-tune the flow and beat us on Square-MH and ToolHang-PH, and OGPO + CA, QF3, FPO and ReinFlow beat us on Transport-MH. Our harness, or our reading of it, was wrong about what works here.
- The gate is coarse in exactly the regime it was built for. With at most 16 validation episodes, the success margin of 0.03 is smaller than the value of a single episode, so one extra success clears it. Because the bar is then raised to the winning score, one lucky pass can block later, genuinely better heads. The margin was chosen with at least three times as many validation episodes as were finally used.
- Validation is paid for in steps. Validation episodes run in the task's environments, and our own development notes recorded that validation slowed training. In the regime where the gate is most needed, it spends budget that training could have used.
- A deterministic head gives up the prior's randomness. The deployed head picks one noise code per observation. During development we concluded that this is worse than the pretrained policy's random sampling unless the head picks good modes reliably, and the gate exists largely to avoid deploying such a head.
References
- Allen Z. Ren, Justin Lidard, Lars L. Ankile et al. (2025). Diffusion Policy Policy Optimization. ICLR.
- David McAllister, Songwei Ge, Brent Yi et al. (2026). Flow Matching Policy Gradients. ICLR.
- Tonghe Zhang, Chao Yu, Sichang Su et al. (2025). ReinFlow: Fine-tuning Flow Matching Policy with Online Reinforcement Learning. NeurIPS.
- Seohong Park, Qiyang Li, Sergey Levine (2025). Flow Q-Learning. ICML.
- Chung Min Kim, Brent Yi, David McAllister et al. (2026). QF3: Fast Flow RL with Filtered Q-Gradients.
- Haozhe Jiang, Haiwen Feng, Pieter Abbeel et al. (2026). DiPOD: Diffusion Policy Optimization without Drifting Apart.
- Charles Xu, Jacob Berg, Liyiming Ke et al. (2026). GSBR: Geometric Support Behavior Regularization for Online RL.
- Andrew Wagenmaker, Mitsuhiko Nakamoto, Yunchu Zhang et al. (2025). Steering Your Diffusion Policy with Latent Space Reinforcement Learning. CoRL.
- Romain Laroche, Paul Trichelair, Rémi Tachet des Combes (2019). Safe Policy Improvement with Baseline Bootstrapping. ICML.
- Lei Lv, Yunfei Li, Yu Luo et al. (2025). Flow-Based Policy for Online Reinforcement Learning. NeurIPS.
- Brent Yi, Hongsuk Choi, Himanshu Gaurav Singh et al. (2026). Flow Policy Gradients for Robot Control. CoRL.
- Qiyang Li, Zhiyuan Zhou, Sergey Levine (2025). Reinforcement Learning with Action Chunking. NeurIPS.
- Sarvesh Patil, Mitsuhiko Nakamoto, Manan Agarwal et al. (2026). OGPO: Sample Efficient Full-Finetuning of Generative Control Policies. ICML.
- Yixian Zhang, Shu'ang Yu, Tonghe Zhang et al. (2026). SAC Flow: Sample-Efficient Reinforcement Learning of Flow-Based Policies via Velocity-Reparameterized Sequential Modeling. ICLR.
- Xue Bin Peng, Aviral Kumar, Grace Zhang et al. (2019). Advantage-Weighted Regression: Simple and Scalable Off-Policy Reinforcement Learning.