Paper · 2026-01-15 · cs.LG
DeFlow: Decoupling Behavior-Prior Modeling and Value Maximization for Offline Policy Extraction
DeFlow keeps a multi-step flow-matching policy as a fixed behavior prior and trains a small residual MLP to shift each sampled action toward higher critic value. An adaptive Lagrangian penalty keeps the mean squared shift near a per-task budget, so no gradient passes through the ODE solver. Author-reported: 40 vs 29 (FQL) on OGBench cube-double, 43 vs 30 on puzzle-3x3; SORL leads on navigation.
Offline reinforcement learningFlow matchingResidual learningoffline-rlflow-matchingresidual-policytrust-regionogbenchgenerative-policy
arXivPDFCodeMarkdown19 min read
AI-compiled by claude-haiku-5-5 on 2026-10-24, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
A robot or game agent learns from a fixed log of past play, and it has to pick actions the log actually supports. Modern generative models are good at copying a varied set of past moves, but turning such a model into a policy that also chases a reward is slow and awkward. The usual route runs the reward signal back through every step of the generator, which is costly and unstable.
DeFlow splits the job in two. One part is the generator itself, which is trained only to copy the logged behaviour and is then left alone. The other part is a small add-on network that looks at a move the generator proposed and nudges it a little toward moves that score better. A penalty keeps those nudges small, which is the authors' stand-in for staying near moves the log showed; it is a soft rule, not a hard guarantee. Because the generator never has to be trained through its own step-by-step process, the setup stays simpler. The authors report that it is competitive with recent methods, strongest on some multi-step manipulation tasks and when the agent keeps learning online after the offline phase.
TL;DR
- Offline RL with a multi-step flow-matching policy: the flow is trained only on logged actions and kept as a behaviour prior §3.2.
- A small residual MLP
f_phi(s, a_base)adds a correction to each sampled action and is trained by DDPG-style Q-ascent with a stopped-gradient base action §3.2 alg. 1. - A log-space dual update on a penalty weight keeps the mean squared correction near a per-task budget delta; no gradient flows through the ODE solver §3.2 app. B.1.
- Author-reported: highest of the listed methods on cube-double (40, vs 29 for FQL and 25 for SORL) and puzzle-3x3 (43, vs 30 for FQL); SORL is stronger on antmaze-large, humanoidmaze-medium, antsoccer and scene tab. 1 §4.2.
- The official code differs from the paper in defaults and in one puzzle budget; see Paper vs code before reproducing.
Problem
Offline RL has to improve a policy without trusting actions the dataset barely covers §1 §2.1. On multimodal benchmarks such as OGBench, unimodal actors cannot represent the behaviour distribution, while flow-matching and diffusion policies can §1.
The paper calls the difficulty an expressivity-optimizability dilemma. Differentiating a Q-objective through an iterative generator needs backpropagation through the solver §1 §3.1. Shortcut methods such as FQL and SORL avoid that cost by distilling or parameterising a one-step or few-step policy, but the authors argue that this can compress a multimodal flow and makes a scalar BC weight a sensitive trade-off §1 §3.1 §5.
The question the paper asks is whether the multi-step prior can stay intact while a small local module does the value improvement §1.
Method
Policy structure
The action is the sum of a fixed base proposal and a learned residual. The base is a flow sample, with the gradient stopped, and the residual is an MLP that sees the state and that base action §3.2:
a = \text{sg}[\mu_\psi(s, z)] + f_\phi\big(s,\ \text{sg}[\mu_\psi(s, z)]\big), \quad z \sim \mathcal{N}(0, I) §3.2
Here sg is stop-gradient, mu_psi is the Euler-integrated flow, and the displayed action is taken before clipping to the action bounds §3.2. The flow is trained only by flow matching, so Q-learning gradients never change the prior §3.2. The residual is conditioned on the sampled action itself, not only on the state, so two proposals from the same state can receive different corrections §3.2 §5.
Flow prior
The flow uses the conditional flow-matching regression with a straight path between a noise sample and a logged action, and it is integrated with an Euler scheme §2.2 app. B alg. 1. The residual has the same architecture as the flow, a four-layer MLP with width 512 app. B.
Trust-region objective
The refinement is posed as a maximisation of Q over the residual, with a budget on the mean squared residual per action coordinate, where d is the action dimension §3.2:
\max_{f_\phi}\ \mathbb{E}_{s,z}\big[Q(s,\ a_{\text{flow}} + \Delta a)\big] \quad \text{s.t.}\quad \mathbb{E}_{s,z}\big[\lVert \Delta a \rVert_2^2 / d\big] \le \delta §3.2
The paper stresses that delta is a squared-displacement budget on average, not a per-action radius §3.2.
Lagrangian and dual update
To solve the constrained problem, the Q term is divided by the stopped batch mean of |Q| (Q-normalisation) and the penalty weight alpha is written as exp(eta). The refiner minimises the normalised negative Q plus sg[alpha] * ||Delta a||^2 / d, and eta is updated by a surrogate dual step that increases alpha when the measured residual exceeds delta §3.2 app. B.1.
The paper describes this as a surrogate dual update, not an exact solution of the non-convex problem, and it notes that minibatch regularisation gives no hard pointwise bound §3.2. Its appendix gives a Wasserstein-2 bound between the refined and base distributions for a fixed state, W_2^2 <= E||f||^2, and the average over states is only bounded when the population constraint holds app. A.
Algorithm
The paper's Algorithm 1 is a loop over minibatches. The steps are the Bellman update for the critic, the flow-matching update, then the residual and dual updates, as written below alg. 1 §3.2.
# DeFlow update [alg. 1]
# Input: minibatch (s, a, r, s', mask) from D; flow v_psi; residual f_phi
# Output: updated Q_xi, v_psi, f_phi and penalty exponent eta
def deflow_update(batch):
# 1. Critic target uses the refined policy at s' [alg. 1] [§2.1]
next_actions = act(batch.next_states) # (B, d), clipped
next_values = target_q(batch.next_states, next_actions) # ensemble
target = batch.rewards + discount * batch.mask * next_values
update(critic, squared_error(critic(batch.states, batch.actions), target))
# 2. Flow prior learns only from logged actions [alg. 1] [§2.2]
noise = sample_normal(batch.size, action_dim) # (B, d)
time = sample_uniform(batch.size, 1) # (B, 1)
point = (1 - time) * noise + time * batch.actions # straight path
update(flow, squared_error(flow(batch.states, point, time),
batch.actions - noise))
# 3. Base proposal from the flow, with no gradient [alg. 1] [§3.2]
base = stop_gradient(sample_flow(batch.states)) # (B, d)
# 4. Residual and its squared size [alg. 1] [§3.2]
shift = residual(batch.states, base) # (B, d)
penalty = mean(square(shift)) # scalar
# 5. Q term, normalised by the stopped batch mean of |Q| [§3.2] [app. B]
action = clip(base + shift, -1, 1) # (B, d)
q = critic_mean(batch.states, action) # (B,)
q_loss = -mean(q) / stop_gradient(mean(abs(q)))
# 6. Residual update with a penalty weight alpha = exp(eta) [§3.2]
alpha = stop_gradient(exp(eta))
update(residual, q_loss + alpha * penalty)
# 7. Dual step on eta: grow alpha while the shift exceeds the budget [§3.2]
dual_loss = eta * (budget - stop_gradient(penalty))
update(eta, dual_loss)The sample_flow step is Euler integration with M steps, with the final clip the paper applies to the base proposal alg. 1 app. B.
# Base proposal from the flow [alg. 1] [§3.2]
# Input: states (B, obs); Output: actions (B, d)
def sample_flow(states):
# Start from Gaussian noise [alg. 1]
actions = sample_normal(states.size, action_dim) # (B, d)
# Euler steps from t=0 to t=1 [alg. 1] [§2.2]
for step in range(flow_steps): # M steps
time = step / flow_steps
actions = actions + flow(states, actions, time) / flow_steps
return clip(actions, -1, 1)At evaluation the agent calls act, which is sample_flow followed by the residual and a clip, so the executed action is clip(base + residual(base)) alg. 1 deflow.py.
Hyperparameters
Task-specific values come from the paper's appendix table. The table lists FQL's BC coefficient alpha next to DeFlow's budget delta for each task, which is the one place where the paper gives per-task settings app. B.1. Values below are grouped by task family, one row per family, with all five or six tasks sharing a value unless noted app. B.1.
| Task family (task count) | FQL alpha | DeFlow delta | Where |
|---|---|---|---|
| antmaze-large-navigate (5) | 10 | 0.01 | app. B.1 |
| antmaze-giant-navigate (5) | 10 | 0.01 | app. B.1 |
| humanoidmaze-medium-navigate (5) | 30 | 0.001 | app. B.1 |
| humanoidmaze-large-navigate (5) | 30 | 0.001 | app. B.1 |
| antsoccer-arena-navigate (5) | 10 | 0.01 | app. B.1 |
| cube-single-play (5) | 300 | 0.001 | app. B.1 |
| cube-double-play (5) | 300 | 0.001 | app. B.1 |
| scene-play (5) | 300 | 0.001 | app. B.1 |
| puzzle-3x3-play (5) | 1000 | 0.0005 | app. B.1; README differs, see Paper vs code |
| puzzle-4x4-play (5) | 1000 | 0.0005 | app. B.1; README differs, see Paper vs code |
| D4RL antmaze umaze, umaze-diverse, medium-play, medium-diverse (4) | 10 | 0.015 | app. B.1 |
| D4RL antmaze large-play, large-diverse (2) | 3 | 0.015 | app. B.1 |
| D4RL pen human, cloned, expert (3) | 10000, 10000, 3000 | 0.01 | app. B.1 |
| D4RL door human, cloned, expert | 30000, 30000, 30000 | 0.001 | app. B.1 |
| D4RL hammer human, cloned, expert | 30000, 10000, 30000 | 0.001 | app. B.1 |
| D4RL relocate human, cloned, expert | 10000, 30000, 30000 | 0.001 | app. B.1 |
| visual cube-single (1) | 300 | 0.001 | app. B.1 |
| visual cube-double (1) | 100 | 0.001 | app. B.1 |
| visual scene (1) | 100 | 0.001 | app. B.1 |
| visual puzzle-3x3 (1) | 300 | 0.0005 | app. B.1 |
| visual puzzle-4x4 (1) | 300 | 0.0005 | app. B.1 |
The paper states that IAV (intrinsic action variance) is only a rough guide to delta, not a validated predictor, and that the per-task table overrides the generic heuristic app. B.1.
General settings, with the source of each:
| Name | Value | Where | Notes |
|---|---|---|---|
| Flow and residual width | 4 hidden layers, width 512 | app. B | Same architecture for both app. B |
| Critic | 4 hidden layers, width 512, LayerNorm | not stated in paper | deflow.py deflow.py |
| Critic ensemble | 2 members, actor uses their mean | not stated in paper | deflow.py deflow.py |
| Optimizer | Adam, lr 3e-4, shared with eta | app. B | deflow.py deflow.py |
| Batch size | 256 | app. D | deflow.py |
| Discount | 0.99 (code default); 0.995 for some tasks | not stated in main text | deflow.py app. C.4 |
| Target update tau | 0.005 | not stated in paper | deflow.py |
| Target Q aggregation | mean (default); min for some tasks | app. C.4 for antmaze-large and pen-cloned | deflow.py |
| Flow Euler steps M | 10 (code default) | app. C.4 for capacity runs | deflow.py |
| Q-normalisation | on in all paper results | §3.2 | code default is off, see Paper vs code |
| eta initial value | 1.0, so alpha = e ≈ 2.72 | app. B.1 | deflow.py |
| Offline steps | 1,000,000 (OGBench in capacity runs); 500,000 for pen-cloned | app. D | Main-table steps not stated; README uses 500,000 for D4RL and visual |
| Seeds | 8 for state tasks, 4 for pixel tasks | §4.1 | |
| Evaluation episodes | 50 per evaluation (code default) | app. C.4 for capacity runs | main.py |
Results
Author-reported. Setup: OGBench primary benchmark (50 state-based single-task tasks and 5 visual tasks) and 18 D4RL tasks, 73 offline tasks in total, averaged over 8 seeds for state tasks and 4 for pixel tasks, following the OGBench protocol with a fixed number of gradient steps §4.1. Baselines are BC, IQL, ReBRAC, FAWAC, FBRAC, IFQL, FQL and SORL (where aligned OGBench numbers exist). The paper flags that SORL is not compute-matched §4.1 §4.3. Bold means within 95% of the row's best §4.1 tab. 1.
Table 1: offline results (score, mean ± std) tab. 1
| Task category | BC | IQL | ReBRAC | FAWAC | FBRAC | IFQL | SORL | FQL | DeFlow |
|---|---|---|---|---|---|---|---|---|---|
| antmaze-large (5) | 11 ± 1 | 53 ± 3 | 81 ± 5 | 6 ± 1 | 60 ± 6 | 28 ± 5 | 89 ± 2 | 79 ± 3 | 81 ± 3 |
| antmaze-giant (5) | 0 ± 0 | 4 ± 1 | 26 ± 8 | 0 ± 0 | 4 ± 4 | 3 ± 2 | 9 ± 6 | 9 ± 6 | 12 ± 5 |
| humanoidmaze-medium (5) | 2 ± 1 | 33 ± 2 | 22 ± 8 | 19 ± 1 | 38 ± 5 | 60 ± 14 | 64 ± 4 | 58 ± 5 | 48 ± 4 |
| humanoidmaze-large (5) | 1 ± 0 | 2 ± 1 | 2 ± 1 | 0 ± 0 | 2 ± 0 | 11 ± 2 | 5 ± 2 | 4 ± 2 | 5 ± 2 |
| antsoccer-arena (5) | 1 ± 0 | 8 ± 2 | 0 ± 0 | 12 ± 0 | 16 ± 1 | 33 ± 6 | 69 ± 2 | 60 ± 2 | 67 ± 3 |
| cube-single (5) | 5 ± 1 | 83 ± 3 | 91 ± 2 | 81 ± 4 | 79 ± 7 | 79 ± 2 | 97 ± 1 | 96 ± 1 | 96 ± 2 |
| cube-double (5) | 2 ± 1 | 7 ± 1 | 12 ± 1 | 5 ± 2 | 15 ± 3 | 14 ± 3 | 25 ± 3 | 29 ± 2 | 40 ± 5 |
| scene (5) | 5 ± 1 | 28 ± 1 | 41 ± 3 | 30 ± 3 | 45 ± 5 | 30 ± 3 | 57 ± 2 | 56 ± 2 | 51 ± 3 |
| puzzle-3x3 (5) | 2 ± 0 | 9 ± 1 | 21 ± 1 | 6 ± 2 | 14 ± 4 | 19 ± 1 | – | 30 ± 1 | 43 ± 4 |
| puzzle-4x4 (5) | 0 ± 0 | 7 ± 1 | 14 ± 1 | 1 ± 0 | 13 ± 1 | 25 ± 5 | – | 17 ± 2 | 11 ± 2 |
| D4RL antmaze (6) | 17 | 57 | 78 | 44 ± 3 | 64 ± 7 | 65 ± 7 | – | 84 ± 3 | 83 ± 2 |
| D4RL adroit (12) | 48 | 53 | 59 | 48 ± 1 | 50 ± 2 | 52 ± 1 | – | 52 ± 1 | 52 ± 1 |
| Visual manipulation (5) | – | 42 ± 4 | 60 ± 2 | – | 22 ± 2 | 50 ± 5 | – | 65 ± 2 | 69 ± 2 |
Source: tab. 1 §4.2. The "–" entries mean the SORL number is not reported for that row, and they are not used when picking the row best tab. 1. The paper's appendix gives the task-level version of the non-SORL baselines app. C.
Table 2: offline-to-online results (offline → online) tab. 2
Baselines are IQL, ReBRAC, Cal-QL, RLPD, IFQL and FQL; DeFlow reuses the offline configuration and appends online transitions to its replay §4.1 tab. 2.
| Task | IQL | ReBRAC | Cal-QL | RLPD | IFQL | FQL | DeFlow |
|---|---|---|---|---|---|---|---|
| humanoidmaze-medium | 21 ± 13 → 16 ± 8 | 16 ± 20 → 1 ± 1 | 0 ± 0 → 0 ± 0 | 0 ± 0 → 8 ± 10 | 56 ± 35 → 82 ± 20 | 12 ± 7 → 22 ± 12 | 13 ± 5 → 65 ± 12 |
| antsoccer-arena | 2 ± 1 → 0 ± 0 | 0 ± 0 → 0 ± 0 | 0 ± 0 → 0 ± 0 | 0 ± 0 → 0 ± 0 | 26 ± 15 → 39 ± 10 | 28 ± 8 → 86 ± 5 | 44 ± 8 → 86 ± 3 |
| cube-double | 0 ± 1 → 0 ± 0 | 6 ± 5 → 28 ± 28 | 0 ± 0 → 0 ± 0 | 0 ± 0 → 0 ± 0 | 12 ± 9 → 40 ± 5 | 40 ± 11 → 92 ± 3 | 48 ± 13 → 93 ± 4 |
| scene | 14 ± 11 → 10 ± 9 | 55 ± 10 → 100 ± 0 | 1 ± 2 → 50 ± 53 | 0 ± 0 → 100 ± 0 | 0 ± 1 → 60 ± 39 | 82 ± 11 → 100 ± 1 | 58 ± 14 → 100 ± 1 |
| puzzle-4x4 | 5 ± 2 → 1 ± 1 | 8 ± 4 → 14 ± 35 | 0 ± 0 → 0 ± 0 | 0 ± 0 → 100 ± 1 | 23 ± 6 → 19 ± 33 | 8 ± 3 → 38 ± 52 | 4 ± 4 → 100 ± 0 |
| antmaze-umaze-v2 | 77 → 96 | 98 → 75 | 77 → 100 | 0 ± 0 → 98 ± 3 | 94 ± 5 → 96 ± 2 | 97 ± 2 → 99 ± 1 | 96 ± 3 → 99 ± 2 |
| antmaze-umaze-diverse-v2 | 60 → 64 | 74 → 98 | 32 → 98 | 0 ± 0 → 94 ± 5 | 69 ± 20 → 93 ± 5 | 79 ± 16 → 100 ± 1 | 87 ± 6 → 99 ± 1 |
| antmaze-medium-play-v2 | 72 → 90 | 88 → 98 | 72 → 99 | 0 ± 0 → 98 ± 2 | 52 ± 19 → 93 ± 2 | 77 ± 7 → 97 ± 2 | 76 ± 5 → 97 ± 2 |
| antmaze-medium-diverse-v2 | 64 → 92 | 85 → 99 | 62 → 98 | 0 ± 0 → 97 ± 2 | 44 ± 26 → 89 ± 4 | 55 ± 19 → 97 ± 3 | 61 ± 9 → 98 ± 2 |
| antmaze-large-play-v2 | 38 → 64 | 68 → 32 | 32 → 97 | 0 ± 0 → 93 ± 5 | 64 ± 14 → 80 ± 5 | 66 ± 40 → 84 ± 30 | 76 ± 6 → 95 ± 4 |
| antmaze-large-diverse-v2 | 27 → 64 | 67 → 72 | 44 → 92 | 0 ± 0 → 94 ± 3 | 69 ± 6 → 86 ± 5 | 75 ± 24 → 94 ± 3 | 76 ± 9 → 96 ± 2 |
| pen-cloned-v1 | 84 → 102 | 74 → 138 | -3 → -3 | 3 ± 2 → 120 ± 10 | 77 ± 7 → 107 ± 10 | 53 ± 14 → 149 ± 6 | 64 ± 13 → 142 ± 7 |
| door-cloned-v1 | 1 → 20 | 0 → 102 | -0 → -0 | 0 ± 0 → 102 ± 7 | 3 ± 2 → 50 ± 15 | 0 ± 0 → 102 ± 5 | 0 ± 0 → 99 ± 2 |
| hammer-cloned-v1 | 1 → 57 | 7 → 125 | 0 → 0 | 0 ± 0 → 128 ± 29 | 4 ± 2 → 60 ± 14 | 0 ± 0 → 127 ± 17 | 7 ± 3 → 106 ± 10 |
| relocate-cloned-v1 | 0 → 0 | 1 → 7 | -0 → -0 | 0 ± 0 → 2 ± 2 | -0 ± 0 → 5 ± 3 | 0 ± 1 → 62 ± 8 | 1 ± 0 → 35 ± 8 |
Source: tab. 2 §4.2. Figure 3 plots the aggregated O2O results over 8 seeds fig. 3; its numbers are not given in text beyond the table.
The paper reports that DeFlow is competitive with FQL on many O2O tasks and is strongest on cube-double and puzzle-4x4, and weaker on some cloned Adroit tasks §4.2.
Table 3: compute trade-offs tab. 3
| Family | Gradient reaches | Cost per action | Role of the proposal |
|---|---|---|---|
| Iterative BPTT | through the solver, plus critic | M C_v | the generator is itself updated |
| Shortcut / FQL | a one-step network, plus critic | 1 to a few network calls | the actor is compressed |
| SORL-style | a shortcut network, plus critic | k calls, optionally with ranking | inference compute is scaled |
| DeFlow | the residual, plus critic | M C_v + C_f | a local residual on top |
Here M is the number of flow-solver steps, and C_v, C_f, C_Q are the costs of one vector-field call, the residual module and one critic call §4.4 tab. 3.
Table 4: timing in ms per step on an NVIDIA RTX 3090 tab. 4
| Method | Offline train | Online train | Inference |
|---|---|---|---|
| FQL | 2.2 ± 1.0 | 5.1 ± 0.5 | 4.2 ± 0.7 |
| DeFlow | 2.4 ± 1.0 | 5.3 ± 0.4 | 4.5 ± 0.5 |
| DeFlow (frozen prior) | – | 5.2 ± 0.5 | – |
Source: tab. 4 §4.4 app. D. The paper says these timings describe this implementation only; they are not a speed claim against SORL or a scaling law §4.4.
Diagnostics (not headline results). These come from the appendix and are single-setting probes, not benchmark claims §4.2 app. C:
- Residual attribution, same checkpoints, 50 episodes each: cube-double task1, base flow only 10 ± 2 vs 62 ± 12 with the residual; puzzle-3x3 task2, 0.5 ± 0.9 vs 35 ± 11 app. C.3.
- Mixed human/expert dataset: FQL 21 ± 3, DeFlow 37 ± 5. Removing action conditioning from the residual drops the score from 40 ± 5 to 5 ± 3 app. C.1.
- Residual budget sweep on a manipulation diagnostic: delta 0.0005 gives 55 ± 8; 0.001 gives 50 ± 7; 0.005 gives 27 ± 4; 0.01 gives 8 ± 5; 0.02 gives 4 ± 2 app. C.1.
- Combining DeFlow with floq's value function: cube-double-play 58 ± 5 (DeFlow + floq) vs 40 ± 5 (DeFlow); puzzle-3x3-play 50 ± 3 vs 43 ± 4 app. C.1.
- Residual depth, four seeds: cube-double task1 gives 81 ± 9 (one layer), 74 ± 23 (two layers), 69 ± 10 (four); puzzle-3x3 task2 gives 6 ± 3, 55 ± 7, 38 ± 11; scene task2 gives 52 ± 12, 70 ± 13, 59 ± 17. The paper does not claim a monotone depth effect app. C.4.
Paper vs code
The official repository is github.com/muzhancun/DeFlow at commit 7c4b9f1ff41b91a3e166c0d98a8338587cc45dec. The paper's project page links it, and its owner is the first author. The repository has no LICENSE file, so cite it by path and line only and do not reproduce code.
The code is built on FQL and floq README.md app. B. The main agent is agents/deflow.py; the floq combination is agents/deflowvf.py, which this card did not review in detail deflow.py.
Discrepancies, each with both sides:
- Q-normalisation is off by default in the code. The paper applies Q-normalisation to the refinement loss §3.2. The code's default is
normalize_q_loss=Falsedeflow.py, but every README command for the main results passes--agent.normalize_q_loss=TrueREADME.md README.md. A run with default flags is not the paper's setup. - Puzzle budget differs. The paper's appendix table gives delta = 0.0005 for puzzle-3x3-play and puzzle-4x4-play app. B.1 and the capacity table uses 0.0005 for puzzle-3x3 app. C.4. The README commands use
--agent.target_divergence=0.005for both README.md README.md. The discrepancy is about a factor of ten. This card follows the paper; check with the authors before reproducing the puzzle numbers. - Discount is not in the paper's main text. The code default is 0.99 deflow.py. The README sets 0.995 for antmaze-giant, humanoidmaze and antsoccer README.md README.md README.md. The paper's appendix capacity table also lists 0.995 for humanoidmaze-medium and antsoccer-arena app. C.4.
- Target aggregation. The code default is mean deflow.py. The README uses min for antmaze-large, antmaze-giant and the pen, door, hammer and relocate D4RL tasks README.md README.md. The paper's capacity table lists min for antmaze-large and pen-cloned app. C.4.
- Offline step counts. The code default is 1,000,000 main.py deflow.py. The README uses 500,000 for D4RL and visual tasks README.md. The paper states 1,000,000 for OGBench capacity runs and 500,000 for pen-cloned app. D. It does not state the step count for the main table.
- Initial penalty. The code comment next to the Lagrange setup says the initial value 2.3 gives alpha ≈ 10 deflow.py. The code then sets
init_value=1.0deflow.py. The paper says eta starts at 1 app. B.1. The code matches the paper; the comment is stale. - Flow steps. The code default is 10 Euler steps deflow.py. The paper's main text does not state the step count; its capacity runs use ten app. C.4.
- Items in code, not in paper. The critic has two ensemble members with LayerNorm deflow.py deflow.py. The target update is
tau = 0.005deflow.py. The paper mentions a target network but gives no coefficient §2.1. - Test-time scaling variants exist but are not in the main results. The code has
sample_actions_max_qandsample_actions_iterative_refinementdeflow.py. The paper says the main results use no candidate ranking §4.4 app. B.1. The evaluation path for the main results callssample_actionsevaluation.py. Note thatsample_actions_max_qpicksargminof the mean critic value deflow.py. For a best-of-N selection that looks like the lowest-value candidate, so do not reuse that function without checking. - Clipping of alpha is disabled. The code's clip on alpha is commented out deflow.py. The paper does not describe a clip.
- Fixed-penalty branch doubles the coefficient. The paper notes that the fixed-coefficient code path multiplies the configured coefficient twice, giving c² app. C.2. The code confirms this:
distill_lossalready includesalphadeflow.py, and the actor loss multiplies byalphaagain deflow.py. The main results use the adaptive branch, which is the default deflow.py.
Pitfalls
- delta is a mean squared budget per coordinate. It is not a radius, and its scale depends on the action units and dimension. The code's penalty is the mean over batch and action dimensions, so it is already divided by
ddeflow.py §3.2. Do not change the normalisation without rescaling delta. - Q-normalisation changes what alpha means. The Q term is divided by the stopped batch mean of |Q| §3.2 deflow.py. Without it, the same delta gives a different balance between value and penalty. All reported runs use it §3.2 app. B.1.
- The dual step is an Adam update, not a plain gradient step. eta uses the shared Adam learning rate of 3e-4 app. B.1 deflow.py. Its initial value is 1, so alpha starts near 2.72 app. B.1. alpha has no upper or lower clip in the code deflow.py.
- The budget is enforced on minibatches only. The paper states that minibatch regularisation gives no hard pointwise bound and no guarantee of support membership §3.2. The W2 bound in the appendix holds for a fixed state; the bound averaged over states,
E_s W_2^2 <= d * delta, needs the population constraint to hold and is not a per-state guarantee app. A. - The penalty is measured before clipping, the action is clipped after. The paper's appendix argues that projecting the refined action onto the action box cannot increase its distance to the base proposal, so the bound survives clipping app. A alg. 1.
- Stochastic base action. Each call to
actsamples new flow noise, so the critic target and the actor gradient each see a different base action deflow.py deflow.py. - Hidden costs. Sampling still costs
Mvector-field evaluations per action, so the flow is not one-step. The residual addsC_fper evaluation §4.4 tab. 3. - The SORL comparison is not compute-matched. SORL can use shortcut step counts and critic ranking at test time, and DeFlow here does not §4.1 §4.3. The paper's wins on cube-double and puzzle are not a general claim.
- Several headline wins depend on the penalty. The paper's own ablation shows that the fixed-coefficient sweep fails at some settings in both the offline and online phases app. C.2. The adaptive penalty removes some tuning but not the choice of delta §3.2 §6.
- Attribution is conditional on the trained prior. The residual-off comparison uses the same trained checkpoints and does not vary prior quality app. C.3.
- The floq combination is a diagnostic. The paper calls the DeFlow + floq numbers a diagnostic, and the implementation is in
agents/deflowvf.py, which is not reviewed here app. C.1 deflowvf.py. - Budget selection history is not recorded. The paper says the records do not give a complete count of candidate trials, so the reported configuration is reproducible but not an audit of selection cost app. B.1.
Lineage
- Builds on: flow matching for the prior §2.2 and DDPG-style deterministic policy gradients for the refiner §1. The code is built on FQL and floq README.md app. B. The paper's bibliography gives floq as arXiv:2509.06863.
- Compared against: BC, IQL, ReBRAC, FAWAC, FBRAC, IFQL, FQL, SORL, Cal-QL and RLPD §4.1 tab. 1 tab. 2.
- Related designs: residual policy learning §5, decoupled large policies with small RL heads §1, Q-score matching §5, and value-gradient methods that backpropagate through sampling §5.
- Superseded by: not known from the content of this wiki.
Source and license
Adapted from “DeFlow: Decoupling Behavior-Prior Modeling and Value Maximization for Offline Policy Extraction” by Zhancun Mu, Chi Zhang (arXiv:2601.10471), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/muzhancun/DeFlow at commit 7c4b9f1ff41b (none (no LICENSE file in repository)). Any quoted code is shown under that license.