← Haoran Xu

Reinforcement Learning via Value Gradient Flow

Haoran Xu*1, Kaiwen Hu*2, Somayeh Sojoudi2, Amy Zhang1

1UT Austin 2UC Berkeley/ICLR 2026/* equal contribution

VGF casts behavior-regularized RL as optimal transport from the reference distribution to the value-induced optimal policy. Particles drawn from the reference policy follow value gradients for a few steps, and the transport budget is the regularization: no explicit penalty, and no policy network to backpropagate through.

Two ways to stay close to the reference

Offline RL must stay near the dataset to avoid erroneous out-of-distribution extrapolation, and LLM RL finetuning must stay near the base model to avoid reward hacking. Both are instances of behavior-regularized RL with a reference distribution \(\mu\) and a differentiable value \(R\) (a Q-function or a reward model):

$$\pi^* = \arg\max_\pi\ \mathbb{E}_{s\sim\mathcal{D},\,a\sim\pi(\cdot|s)}\big[R(s,a)\big] \quad \text{s.t.}\quad \mathbb{E}_{s\sim\mathcal{D}}\big[M\big(\pi(\cdot|s),\mu(\cdot|s)\big)\big]\le\epsilon .$$

Existing methods solve this in one of two ways, and each has its own failure mode.

Penalties are hard to scale to generative policies, and rejection is stuck inside \(\mu\)'s support.

VGF: transport the reference toward the value

Adding an entropy term to the objective turns the greedy max into a softmax, so the target becomes the Boltzmann distribution of the value, \(\pi^*_R(a|s) \propto \exp\big(R(s,a)/\alpha\big)\). We view behavior-regularized RL as transporting probability mass from \(\mu\) to \(\pi^*_R\), and follow the Wasserstein gradient flow of \(\mathrm{KL}(q\,\|\,\pi^*_R)\) in its discrete (JKO) form:

$$q_{k+1} = \arg\min_q\ \mathrm{KL}\big(q\,\|\,\pi^*_R\big) + \frac{1}{2h}\,W_2^2\big(q, q_k\big).$$

We represent \(q_k\) by \(N\) particles in action space, initialized from \(\mu\), and restrict the velocity field to an RKHS. This gives a particle update in which value gradients do the work:

$$a_i^{(l+1)} = a_i^{(l)} + \epsilon\,\phi\big(a_i^{(l)}\big),\qquad \phi(x) = \frac1N\sum_{j=1}^N \Big[k(a_j,x)\,\nabla_{a_j}\log\pi^*_R(a_j|s) + \nabla_{a_j}k(a_j,x)\Big]$$ $$\xrightarrow{\ \text{w/o MaxEnt}\ }\ \ {\color{#5B2C8A}\frac1N\sum_{j=1}^N k(a_j,x)\,\nabla_{a_j}R(s,a_j)} .$$

The first term pushes particles toward high value; the second keeps them apart and preserves multiple modes. Dropping the entropy term (\(\alpha\to 0\), with \(\alpha\) absorbed into \(\epsilon\)) leaves a kernel-smoothed value-gradient step, which is what we use in practice.

VGF in offline RL
  1. Fit a generative behavior-cloning policy \(\hat\mu\) on the dataset.
  2. Sample \(N=5\) particles from \(\hat\mu(\cdot|s')\) and run \(L_{\text{train}}\) VGF steps with the current \(Q\).
  3. Train \(Q\) by TD learning, averaging the target over the transported particles.
  4. At test time, run \(L_{\text{test}}\) steps and execute the particle with the highest \(Q\).

The transport budget is the regularization

Four panels of the same 2-D landscape. With L equals 0 the particles are reference samples. With L equals 1, 3 and 6 they move progressively out of the reference distribution and into the high-value regions.

The budget controls how far the implicit policy \(\pi^L_N\) can move. If \(R\) is \(c\)-Lipschitz in the action, the distance from the reference grows at most linearly in the budget \(\epsilon L\):

$$\mathrm{MMD}^2\big(\mu,\pi^L_N\big) = \mathrm{MMD}^2\big(\pi^0_N,\pi^L_N\big) \;\le\; \frac{2\epsilon L}{\sigma\sqrt e}\Big(\frac{c}{\alpha}+\frac{1}{\sigma\sqrt e}\Big).$$

Unlike rejection sampling, this constraint bounds how far the policy moves rather than where it may put mass. As a result, the implicit policy is not confined to the reference support:

$$\mathrm{supp}_\epsilon\big(\pi^L_N(\cdot|s)\big)\ \not\subseteq\ \mathrm{supp}_\epsilon\big(\mu(\cdot|s)\big).$$

VGF finds the best policy within a fixed transport budget, instead of trading value against a penalty.

A toy bandit

A 2-D bandit with a bimodal reward, where the dataset covers the low-reward regions. All three methods share the same learned reward model and the same BC flow model.

Two heatmaps: ground-truth reward and learned reward over a 2-D action space, with dataset actions as gray dots. FlowQL's action and FlowBC best-of-N's action sit in the low-reward dataset region; VGF's particle paths move into the high-reward mode.

FlowQL (penalized policy gradient) is misled by errors of the learned reward. Best-of-\(N\) improves on the best dataset action but stays within the sub-optimal behavior support. VGF's particles move into the region with high ground-truth reward.

D4RL

Normalized scores at the end of training, 5 seeds. Standard deviations are in the paper.

VGF has the best mean score, 89 against 81 for Diffusion-QL. It is strongest on AntMaze, which requires stitching sub-optimal trajectories: on antmaze-m-p and antmaze-m-d it scores 89.4 and 86.7, while no baseline exceeds 82.

TD3+BCIQLIVRDiffusion-QLSfBCFQLVGF
MuJoCo 9 datasets75.377.883.387.975.666.888.7
AntMaze 6 datasets27.363.871.869.674.283.589.1
All 15 datasets56.172.278.780.675.073.588.9

OGBench

Four locomotion and five manipulation environments, success rate (%) averaged over 5 tasks each, 5 seeds.

Grouped bars of success rate for FQL and VGF on nine OGBench environments. VGF is higher on seven, tied on cube-single, and lower on antmaze-giant (3 vs 9); the largest gains are cube-double 29 to 70, puzzle-3x3 30 to 75 and puzzle-4x4 17 to 45.

VGF reaches a mean success rate of 55% against 40% for FQL, the strongest baseline. The gains concentrate on the hard tasks where FQL stays below 50%: cube-double (29 → 70), puzzle-3x3 (30 → 75) and puzzle-4x4 (17 → 45).

Against prior methods

BCIQLReBRACFBRACIDQLFQLVGF
antmaze-giant0 ±04 ±126 ±84 ±40 ±09 ±63 ±1
humanoidmaze-medium2 ±133 ±222 ±838 ±51 ±058 ±572 ±1
humanoidmaze-large1 ±02 ±12 ±12 ±01 ±04 ±215 ±2
antsoccer-arena1 ±08 ±20 ±016 ±112 ±460 ±263 ±4
cube-single5 ±183 ±391 ±279 ±795 ±296 ±196 ±1
cube-double2 ±17 ±112 ±115 ±315 ±629 ±270 ±8
scene5 ±128 ±141 ±345 ±546 ±356 ±260 ±1
puzzle-3x32 ±09 ±121 ±114 ±410 ±230 ±175 ±4
puzzle-4x40 ±07 ±114 ±113 ±129 ±317 ±245 ±4
mean2202525234055

Success rate (%), mean ± std over 5 seeds.

Offline-to-online

Ten learning curves of success rate over 2M steps for VGF and FQL; the first 1M steps are offline (shaded gray). VGF starts higher after offline training and ends higher on most tasks, for example humanoidmaze-medium, puzzle-3x3 and puzzle-4x4.
1M offline steps (shaded) followed by 1M online steps.

The same algorithm runs online without changes. VGF starts from a stronger offline initialization than FQL, adapts faster, and ends higher, e.g. on humanoidmaze-medium and both puzzle tasks.

Scaling the budget at test time

Four plots of score versus test-time flow steps from 0 to 3. Walker2d-m increases monotonically; halfcheetah-m-e, antmaze-m-d and puzzle-4x4 peak at one or two steps.

Because the policy is defined by the transport, we can change \(L_{\text{test}}\) without retraining. On walker2d-m the score keeps increasing with more steps; on puzzle-4x4 one step more than doubles the score of \(L_{\text{test}}=0\). When the value function extrapolates poorly, a small \(L_{\text{test}}\) is best, and \(L_{\text{test}}=0\) falls back to best-of-\(N\), which still improves on the reference policy because \(Q\) is trained by TD learning.

LLM RL finetuning

Tokens are discrete, so VGF runs in a continuous surrogate: a differentiable representation \(u\) of the whole response (token embeddings, or the latent of a flow or diffusion language model) that is decoded only after the last step. The reward gradient reaches \(u\) by the chain rule,

$$\nabla_{u_i}\log\pi^*_R\big(y_i|x\big) = \frac1\alpha\,J_i^\top\,\nabla_y R\big(x,y_i\big),\qquad J_i = \frac{\partial\,\mathrm{Dec}(u_i)}{\partial u_i}.$$

This steers the SFT model at inference with first-order reward gradients, without PPO-style optimization.

TL;DR vs. referenceAnthropic-HH vs. chosen
Pythia-SFT48.546.2
PPO57.345.5
DPO61.251.5
Best-of-N58.349.0
VGF68.159.0

GPT-4 win rate (%). Pythia-2.8B for both the SFT policy and the reward model.

VGF wins 68.1% of comparisons on TL;DR and 59.0% on Anthropic-HH, against 61.2% and 51.5% for DPO. Best-of-\(N\) reaches 58.3% and 49.0%.

Takeaways

  1. Behavior-regularized RL is a transport problem from the reference distribution to the Boltzmann distribution of the value.
  2. Value-gradient particles solve it with no explicit penalty and no policy to backpropagate through; the transport budget is the regularization.
  3. The budget can be rescaled at test time, and the same recipe applies to offline RL, offline-to-online RL and LLM finetuning.

BibTeX

@inproceedings{xu2026vgf,
  title     = {Reinforcement Learning via Value Gradient Flow},
  author    = {Xu, Haoran and Hu, Kaiwen and Sojoudi, Somayeh and Zhang, Amy},
  booktitle = {International Conference on Learning Representations},
  year      = {2026}
}

D4RL: Fu et al., 2020 · OGBench: Park et al., ICLR 2025 · FQL: Park et al., ICML 2025 · IVR: Xu et al., ICLR 2023 · IQL: Kostrikov et al., ICLR 2022 · Diffusion-QL: Wang et al., ICLR 2023 · SfBC: Chen et al., ICLR 2023 · IDQL: Hansen-Estruch et al., 2023 · ReBRAC: Tarasov et al., NeurIPS 2023 · JKO scheme: Jordan et al., 1998 · SVGD: Liu & Wang, NeurIPS 2016