A robot arm has a recording of a million moves, most of them poor. Copying them is safe but never better than the recording. Advantage Guidance steers the copy toward the good moves, and solves 79.3% of Puzzle 3×3 where the best earlier method solves 63.8%.
Pick the third policy, then drag the guidance weight w. Watch 600 sampled actions slide away from the recorded data toward better actions. Then we build, piece by piece, how a policy learns to follow a score for how good an action is.
You need what a policy is and a rough idea of reward. We build the rest from zero. Paper by Zhiyuan Zhou and Sergey Levine, UC Berkeley, arXiv 2610.19783.
Copying the data gives actions that are, on average, no better than the data.
Illustrative toy, not the paper's benchmark: one state, one action number, a made-up advantage curve, and the exact flow fields computed on a grid in your browser. The guidance weight only acts in the third mode. The paper's real results are in Chapter 9 (Table 5).
Chapter 0
See why a policy that copies its data is stable but capped, and why a policy that improves on the data is strong but fragile
Picture a robot arm and a puzzle on a 3 by 3 grid. Nobody told the arm how to solve it. Instead, a script moved the arm toward random goals and recorded everything: what the camera saw, what the arm did, and whether the puzzle ended up solved. You now hold a million recorded moments. You must build a controller from them, and you may not run the arm again.
The controller is a policy: a function that looks at the situation, called the state, and picks what to do, called the action. The recording is a dataset of states and actions. Learning a policy from a fixed dataset, with no new experience, is called offline reinforcement learning.
The first recipe is behavior cloning, also called imitation learning. Train the policy to predict the recorded action from the recorded state. This is ordinary supervised learning, the same kind used to train an image classifier. It is stable and it scales. Modern versions use generative models, such as diffusion or flow matching, because those can copy messy behavior that has many sides.
The limit of copying is built in. A clone of a random script is a random script. If the recording rarely solves the puzzle, the clone rarely solves it either. The policy can never be better than the data it copies.
The second recipe is reinforcement learning (RL). Train a second network, the critic, to score how good each action is. Then change the policy so that it picks high-scoring actions. This can beat the data. The paper cites theory showing that RL can outperform imitation under the right conditions.
But RL is fragile. The critic learns from its own guesses, so its mistakes feed back into itself. When the policy hunts for the top score, it finds those mistakes and exploits them. Results also swing with small changes to hyperparameters, which are the numbers you choose before training, such as a learning rate. The authors cite several studies of this instability, and it is worst for offline data.
So we face a trade. Copying is stable and capped. Improving is strong and fragile. The paper asks whether we can get both: learn with something as simple and stable as imitation, and still be as strong as RL.
There is a known trick. During training, tell the policy how good each recorded action was, as an extra input. At test time, ask for a very good action. The number we hand in is the advantage, and the method is called advantage conditioning. Chapter 1 defines the advantage exactly. For now, read it as how much better an action is than the policy's usual choice.
This trick keeps the supervised loss, so it keeps the stability. Yet it underperforms real RL. The paper gives two reasons. First, a policy asked for one advantage learns to match that one number, so it never pushes beyond it. Second, the policy often ignores the number. It falls back to plain copying. The authors name this second failure the advantage alignment problem.
Advantage Guidance repairs both faults. A new sampling rule fixes the first one (Chapters 3 and 4). A new training recipe fixes the second one (Chapters 5 to 7). Before we build them, look at the gap the paper attacks.
Each bar is a method's average success rate over the paper's 26 tasks. Pick a family to light it up. Methods that only use a supervised loss sit low. Full RL sits higher.
Numbers are our own arithmetic on the paper's Table 5: the plain mean of the 26 task averages (20 OGBench tasks and 6 OCBench tasks, 10 seeds each). The paper's Figure 1 plots an aggregate too, and its weighting may differ from ours. Families follow the paper's Section 7: actor-critic (EDP, FQL), supervised (CRR, FAWR, RCP-A, RCP-R), diffusion guidance (QGF, CFGRL).
Notice what the bars show. The supervised family, which uses the same kind of loss as Advantage Guidance, tops out at 49 percent (RCP-A). The best actor-critic method, EDP, reaches 62. Advantage Guidance, a supervised method, ends above them all. The rest of this lesson explains how.
We start with the target we want, then build the two tools (flow policies and guidance), then the paper's three moves, then the evidence.
If policies or critics are new, our policy gradients, actor-critic and offline RL lessons give the longer story. You do not need them to follow this page.
Chapter 1
Define the advantage, then derive the best policy that still stays close to the data
The arm hovers over the puzzle. Three moves are possible: call them left, up and push. The recorded data shows the arm picking left half the time, up 30 percent of the time, and push 20 percent of the time. Which move is best? To answer, we need a number for how good each move is. That number has a name, and it needs three small ideas first.
The reward is a score the world gives after each step. In the paper's puzzles the reward is sparse: it is zero almost everywhere, and positive only when the task is done. The return is the sum of future rewards. A discount factor γ (the paper uses 0.99 or 0.999) makes a reward now worth slightly more than the same reward later.
Now ask: if the arm takes action a in state s, and then keeps following the policy, what return should it expect? That expectation is the Q-value, written Q(s, a). Next, average the Q-values over the policy's own choices. That average is the value of the state, V(s). It says how good the state is when the policy acts as usual.
The advantage is the difference between the two:
Take our three moves. Suppose the Q-values are 0.20 for left, 0.50 for up and 0.80 for push (illustrative numbers). The value is V = 0.5 × 0.20 + 0.3 × 0.50 + 0.2 × 0.80 = 0.41. So the advantages are −0.21 for left, +0.09 for up and +0.39 for push. Push is the best move, yet the data picks it only one time in five.
Check the average advantage under the policy: 0.5 × (−0.21) + 0.3 × 0.09 + 0.2 × 0.39 = 0. It is always zero. The advantage measures each action against the average, so the average must sit at the origin. The paper learns Q and V with a method called IQL (we meet it in Chapter 8). Everything else in this lesson takes the advantage as given.
Now we want a policy that favors high-advantage actions. The naive goal is to pick the single best action every time. That is risky. The critic learned from the dataset, so it is only reliable for actions the dataset contains. Far from the data, its guesses are noise, and a policy that chases the highest guess will find the biggest error.
So the paper asks for a policy that gains advantage and also stays near the data policy, which it calls the reference policy π̂. The distance between two policies is the KL divergence. It sums p log(p/q) over all actions: zero when the two policies match, larger as they drift apart. We measure it in nats, the unit that comes from the natural logarithm. The goal becomes:
This problem has an exact answer, and we can derive it in three lines. Write the policy as p(a) for short. Add a term that forces the probabilities to sum to 1. Then ask where the objective stops rising when we nudge the probability of one action. That is the usual calculus test: set the slope to zero. The condition for the maximum is:
A(a) − β · ( log( p(a) / π̂(a) ) + 1 ) − λ = 0
Here λ is the multiplier for the sum-to-one rule. Solve for p(a). The log becomes an exponential, and every term that does not depend on a folds into one constant:
The paper says this shape is well known and cites earlier work. We call it an exponential tilt: the data distribution, tipped toward high-advantage actions. Two facts matter. First, the tilt never creates an action the data does not show, because zero times anything is zero. Second, β is a dial between two ends. A huge β leaves the data untouched. A tiny β piles all the probability on the best action the data contains.
Use the three moves, with β = 0.2. The weights are the data probability times exp(A/β). Left: 0.5 × exp(−1.05) = 0.175. Up: 0.3 × exp(0.45) = 0.470. Push: 0.2 × exp(1.95) = 1.406. They add to 2.051. Divide each by that sum: the tilted policy picks left 8.5 percent, up 22.9 percent and push 68.6 percent of the time. Its average advantage is 0.27, up from 0. At β = 2 the same steps give 44.7, 31.2 and 24.1 percent: almost the data again, with an average advantage of 0.03.
Now try the dial on a smoother toy, where the action is one number and the data has two humps.
Blue is the data policy. The dashed warm line is the advantage. Yellow is the tilted target. Drag β from small (a loose leash) on the left to large (a tight leash) on the right, and watch the yellow hill slide back onto the blue one.
Illustrative toy: one state, an action number from −2.5 to 2.5, a two-hump data policy, and a made-up advantage curve standardized so the data's own advantage has mean 0 and spread 1. The tilt, the average advantage and the KL are computed exactly on a grid. β runs from 0.05 to 5 on a log scale.
At the tight end, the yellow hill hugs the blue one and the average advantage is near zero. At the loose end, the yellow hill climbs to the peak of the advantage line, but it still lives inside the data's reach. The KL grows as it moves. That growth is the price, in nats, of every bit of advantage gained.
Chapter 2
Learn how a policy draws an action from noise, and how a sampler gets steered while it draws
A robot must get past a tree. Some demonstrators went left and some went right. A policy that predicts the average action steers straight into the trunk. The data has two sides, and a single guess cannot hold both. So modern robot policies do not output one action. They output a distribution over actions and draw one sample from it. Diffusion and flow matching are the tools that make such a distribution easy to learn. Our Diffusion Policy lesson shows the idea in robots. Here we need the flow version.
Start with noise: a draw ε from a bell curve, shaped like an action. The paper's actions are action chunks, a short run of H future steps sent to the robot together (H = 5 on the OGBench tasks, H = 3 on OCBench). So ε has the same shape as a chunk. We want to carry that noise to a real action a.
The simplest path is a straight line. At time t, which runs from 0 to 1, the point sits at
Along this line, the point moves at constant speed. Its velocity is a − ε. A flow policy is a network v(xt, t, s) that predicts that velocity from the partly noised action, the time, and the state s. Its input is a tensor of shape [B, H, d], where B is the batch and d is the size of one action step. Its output has the same shape. The training loss is a plain squared error, the same loss as any regression:
L = E ‖ v(xt, t, s) − (a − ε) ‖2
There is a catch. At one point xt many different (a, ε) pairs could have produced it. The network sees only xt, so it learns the average velocity over all of them. That average is exactly the field that carries the whole noise cloud onto the data distribution. This is why the loss works, and why it is stable: it is supervised regression.
To sample, draw noise and walk. Split time into T steps and take an Euler step, which means move the point by its current velocity times the step size: x ← x + v / T. The paper uses T = 10. Press play and watch it in a toy where the data has two humps.
Each thin line is one noise draw. Time runs down. Press Run, or drag the step slider. The histogram at the bottom shows where the draws are now, against the data in blue.
Illustrative toy. The flow field is the exact field of the toy's two-hump data policy, computed on a grid, so the walk is the real flow-matching sampler. A trained network only approximates this field. 200 noise draws, fixed seed.
Two steps give a rough, lumpy answer. Ten steps give a clean copy of the data: about 60 percent of the draws end in the left hump, which is the data's own share.
In code, the whole idea is two short functions. Training is one regression. Sampling is a loop.
pythondef flow_loss(v_net, s, a): # s: [B, d_s] state, a: [B, H, d] clean action chunk eps = torch.randn_like(a) # noise, same shape as a t = torch.rand(a.shape[0], 1, 1) # one noise scale per sample x_t = (1 - t) * eps + t * a # a point on the straight path return ((v_net(x_t, t, s) - (a - eps)) ** 2).mean() def sample(v_net, s, T=10): # the paper uses T = 10 Euler steps x = torch.randn(s.shape[0], H, d) # start from noise for n in range(T): t = torch.full((s.shape[0], 1, 1), n / T) x = x + v_net(x, t, s) / T # one Euler step return x # [B, H, d] action chunk
The velocity is linked to another object, the score. The score is the gradient of the log probability, ∇x log p(x): an arrow at every point that shows which way the density rises fastest. The paper notes that diffusion models learn the score directly, and flow models recover it under a change of variables. So changing the velocity during sampling is the same kind of act as changing the score. That is how we steer.
Classifier-free guidance (CFG) is the standard way to steer. Train one model that sometimes sees a label y, such as a class or a text prompt, and sometimes does not. It then knows two scores: the plain one, ∇ log p(x), and the conditional one, ∇ log p(x | y). At sample time, push beyond the plain score along their difference:
The equality holds because of Bayes' rule. It says the chance of x given the label is proportional to two things multiplied: how common x is, and how well x predicts the label. The difference between the two scores is exactly ∇ log p(y | x), the gradient of "how well does x match the label". So CFG tilts the distribution toward p(y | x)w. Our score matching and guidance lesson develops this in full, and flow matching covers the path above.
Work a small case. The plain model picks left 60 percent and right 40 percent. The label "good" fits left with probability 0.2 and right with probability 0.8 (illustrative numbers). At w = 1, the tilted weights are 0.6 × 0.2 = 0.12 and 0.4 × 0.8 = 0.32, which rescale to 27 and 73 percent. At w = 2, they are 0.6 × 0.04 = 0.024 and 0.4 × 0.64 = 0.256, which rescale to 9 and 91 percent. A bigger w trusts the label more.
For a policy, x is the action and y is a label that depends on how good the action is. Earlier work by Frans and colleagues (the paper's CFGRL baseline) used a yes-or-no label: is this action better than average? That works, and it throws away how much better. The paper uses the advantage itself as a continuous label. Whether CFG then hits the target of Chapter 1 is the next question.
Chapter 3
Derive what classifier-free guidance does on an advantage label, and see why it matches a number instead of maximizing it
You ask a waiter for "a dish rated seven out of ten". He brings one. You never get the nine, because you did not ask for it. Worse, if the kitchen has a ten-out-of-ten dish, a waiter who follows your words exactly passes it over, since ten is not seven. Asking for a number gets you that number. It does not get you the best.
An advantage-conditioned policy behaves like this waiter. This chapter proves it. The proof is short, and it shows exactly what to change.
Training an advantage-conditioned policy works like this. For every recorded pair (s, a), compute its advantage A(s, a). Feed that number to the policy as an input y, and train it to predict the recorded action. Then at test time, set y to a high value and ask for an action. The input y is the query, written Aquery when we mean the value we ask for at test time.
To reason about this, the paper treats the label as a noisy reading of the true advantage. It writes Y | s, a ~ N(A(s, a), σy²): the label is a bell curve centered on the true advantage, with a small spread σy. The log of this likelihood is
log p(y | A) = −(y − A)² / (2σy²) + constant
By Bayes' rule, a policy trained this way learns the data policy reweighted by how well each action's advantage fits the label:
The bump is symmetric. An action whose advantage is a little above y is penalized exactly as much as one a little below. The paper's Section 3 states the same fact with a sharp window: the policy keeps only actions with |A − Aquery| < ε, and it discourages every action with A > Aquery.
Now apply CFG with weight w to this conditional policy. Call the conditional score gy = ∇a log π(a | s, y) and the plain score g = ∇a log π̂(a | s). Chapter 2 showed that their difference is the gradient of the log label likelihood. So
gy − g = ∇a [ −(y − A(s, a))² / 2σy² ]
and the CFG score is
Read the result. CFG samples from the data policy times a narrower bump around y. A bigger w does not mean "better". It means "match y more tightly". The paper puts it plainly: CFG favors actions that match the target advantage and penalizes deviations above and below it, and "higher CFG weights more strongly favor matching the target advantage".
Compare it with the target of Chapter 1, π̂ · exp(A / β). That function rises with A without limit. The CFG result rises, peaks at y, then falls. One is a ramp. The other is a hill. Here are numbers. Take y = 1 and σy = 0.5 (illustrative) at w = 1. An action with A = 1 gets a weight of exp(0) = 1. An action with A = 2, which is better than we asked for, gets exp(−(1)² / 0.5) = exp(−2) = 0.135. The tilt at β = 0.5 does the reverse: A = 1 gets exp(1 / 0.5) = 7.4, and A = 2 gets exp(2 / 0.5) = 54.6. The target prefers the better action 7.4 times more. CFG prefers it 0.135 times as much.
The code is one line. The guided velocity is the plain velocity plus w times the conditional push:
pythondef cfg_velocity(v_plain, v_cond, w): return v_plain + w * (v_cond - v_plain) # same shape as v_plain: [B, H, d]
Now try it. Pick a query y and a weight w. The purple hill is the CFG policy. The yellow hill is the target of Chapter 1.
Move the query y and the weight w. The purple policy peaks where the advantage equals y. The yellow target keeps rising with advantage. Watch what happens to the best action when you ask for less than the best.
Illustrative toy with an ideal conditional policy: label spread σy = 0.5, the target's β fixed at 0.5. Densities are computed exactly on a grid from the formulas above. A trained network would only approximate the purple curve.
Set y to 1.0 and leave w at 1. The purple hill sits over the actions whose advantage is about 1. The best action, at the far right, is almost ignored, while the yellow target piles onto it. Raise w and the purple hill gets sharper but stays put. To make it chase better actions you must raise y. And there is the second trap: raise y past what the data has ever shown, and the network has never seen that label. Chapter 10 shows what happens then.
Chapter 4
Subtract the score of a bad label from the score of a good label, and watch the sampler climb the advantage
Two critics taste the same soup. One has been told the soup should score nine. The other has been told it should score one. Each pushes you toward what they were told. Do not listen to either alone. Listen to the difference between them. That difference points from "bad soup" to "good soup", and that is the direction of better, whatever the soup is now.
This is the paper's key idea, and the algebra is short. We want a sampler that follows the ramp π̂ · exp(A / β) from Chapter 1. Chapter 3 showed that one label gives a hill. Two labels give a ramp.
Use two labels, a high one y+ and a low one y−, with y+ > y−. The label likelihood is the same bell curve as before, so
log p(y | A) = −(y − A)² / 2σ² + const = ( 2yA − A² − y² ) / 2σ² + const
Subtract the log likelihood of the low label from that of the high label. The A² terms are identical, so they cancel. What is left is linear in A:
log p(y+ | A) − log p(y− | A) = (y+ − y−) A / σ² + const
Take the gradient with respect to the action. The constant disappears. By Bayes' rule from Chapter 2, the left side is the difference of the two conditional scores. So
Add this difference, scaled by w, to the plain score. The sampling score becomes
The right side is the score of π̂(a | s) · exp(A / β). That is exactly the target of Chapter 1. The contrastive guidance rule, so named because it contrasts a pair of labels, produces the KL-regularized optimal policy. The leash follows directly:
β = σ² / ( w · (y+ − y−) )
If w > 0 and y+ > y−, then β is positive, and the target maximizes advantage under the KL leash (the paper's Remark 2). A larger w, or a wider gap between the labels, means a smaller β: a looser leash and a stronger push. The paper proves this for a wider family of label noise in its Appendix A.1. We used the Gaussian case, which is the one the paper runs.
The identity is exact for the score of the clean action. At the noisy steps of the sampler it is an approximation. The paper says it extends the rule to intermediate denoising steps "following standard classifier free guidance". We can test how well this works, because our toy has exact fields. In the sampler, each step is:
pythondef contrastive_velocity(v_plain, v_cond, x, t, s, w, y_pos, y_neg): # v_plain: [B, H, d] field of the data policy; v_cond(..., y) is the label-conditioned field return v_plain + w * (v_cond(x, t, s, y_pos) - v_cond(x, t, s, y_neg))
Choose a pair and a weight below. The yellow line is the exact target. The teal bars are the actions the Euler sampler really draws.
Pick a pair and a weight w. The yellow dashed line is the exact target for the β these numbers imply. The teal bars are 400 actions drawn by the 10-step sampler. Try the three presets: they share one product w × (y+ − y−).
Illustrative toy with ideal conditional fields and label spread σy = 0.5. β = σ² / (w (y+ − y−)) is the paper's formula. At small w the sampler lags the exact target: the identity is exact only for the clean-action score, and the paper applies it at every noisy step as an approximation.
Three things show up. First, the three presets give nearly the same bars, because only the product w × (y+ − y−) sets β. The paper finds the same in its Figure 11, and it fixes y+ = 1 and y− = −1 and tunes only w. Second, at small w the sampler falls short of the target, and at larger w they agree. Third, make y+ smaller than y− and the push flips: the sampler walks away from advantage. The sign of the product is the sign of the push.
Now a real number. On OGBench the paper uses σy = 0.1, y+ = 1 and y− = −1 (its Table 2), and a tuned w of 1 on Cube Single (Table 3). That gives β = 0.01 / (1 × 2) = 0.005. With w = 2.5 on Puzzle 3×3 it is 0.002. These are our own arithmetic, not numbers the paper prints. Advantages there are standardized to spread 1 per state, so such a small β means a near-hard maximum. The sampler's approximation, and the fact that the network only knows its data, soften it in practice.
Chapter 5
Measure whether a trained policy listens to its label, and see why the usual one barely does
Imagine a thermostat whose dial is not wired to anything. You turn it up. The room stays the same. The dial looks fine and the display says 25 degrees, but the dial is a decoration. Chapter 4 built a sampler that assumes the policy's label dial is wired. This chapter asks whether it is.
The paper defines advantage alignment as the extent to which the advantage a policy's action actually achieves matches the advantage used to query it. Ask for Aquery. Compute the true advantage A(s, a) of the action you get back. If the two numbers track each other, the policy is aligned. If you get the same actions whatever you ask, it is not.
The authors measured this on 20 OGBench tasks. They normalized each state's advantages by the mean and spread of 32 actions drawn at that state (so values are comparable across states). The naive advantage-conditioned policy, built the way RCP-A does it, "responds very weakly to advantage inputs". Asked for a high advantage, it often returns actions below what you asked. This is the paper's Figure 2. The hard, long-horizon tasks are the worst.
One more test removes any doubt. In the paper's Appendix A.3, RCP-A is queried at the dataset mean plus k standard deviations, for k from 0.5 up to 3. The success rate stays flat across all those k. Turning the dial changes nothing. Appendix A.4 tries a bigger network (a transformer with about 3.23 million parameters, against 1.39 million for the usual one). It does not help. The paper says there is "no free lunch": a larger network does not fix the problem.
The paper opens the box with two measurements (its Figure 3), both averaged over 20 tasks.
The first looks at the training gradient. Compute the gradient of the loss once with the true advantage label and once with a random label. Then take the cosine similarity of the two gradients, a number that is 1 when they point the same way and 0 when they are unrelated. For the naive policy it is close to 1. That means the loss does not care what label it is given. The network can lower its loss while ignoring the label, and so it does.
The second measurement compares two sizes of change. Hold the noise fixed and change only the label from the 10th to the 90th percentile advantage at that state. Measure how far the action moves. Then hold the label fixed and change only the starting noise. Measure how far the action moves. Take the ratio:
For the naive policy, R is below one half. Changing the label from poor to excellent moves the action by less than half as much as re-rolling the dice. For Advantage Guidance, R is above 1. The paper's text gives these two facts, not exact values.
In code the measurement is three calls to the policy:
pythondef response_ratio(policy, s, eps, eps2, y10, y50, y90): d_label = (policy(s, eps, y90) - policy(s, eps, y10)).norm() # same noise, label moves d_noise = (policy(s, eps, y50) - policy(s, eps2, y50)).norm() # same label, noise moves return d_label / d_noise # above 1: the label matters
The paper's reading is this. The policy minimizes its loss for the conditional policy by learning to minimize the loss for the unconditional one. In a continuous state space a dataset usually has only one action for each state. Given the state, the network can already guess that single action. The label, which is a function of that same state and action, adds nothing it needs. So the network leans on the state and the noise, and the label gets little weight. The signal that would teach it "this label means a better action" simply is not in the data, because there is never a second action at the same state to contrast with. We return to this in Chapter 7.
Try the thermostat. The slider scales how much the toy network respects its label. At 1 it is the ideal conditional policy of Chapter 3. At small values, its output barely depends on the label.
The x axis is the advantage you ask for. The y axis is the advantage you get. The dashed line is a perfectly aligned policy. Drag the label weight and watch the teal line flatten or steepen.
Illustrative toy. "Label weight" scales the label term in the toy policy's likelihood, from 0.01 to 1 on a log scale; it is not a quantity from the paper. Each point averages 100 actions sampled with the exact 10-step flow. The response ratio R uses the 10th, 50th and 90th percentile advantage of the data at this state, and 100 noise pairs.
At weight 1 the teal line climbs steadily with the request and lands close to the diagonal at the top: ask for 2.0 and get about 1.9. At weight 0.05 the line is nearly flat: ask for 2.0 and get about 0.35. The ratio R reads the same story in one number, and it crosses 1 at a weight near 0.1.
Chapter 6
Split the policy into a base field and a small correction, so the correction can only earn its keep by reading the label
A cook keeps one master recipe for soup. Each day the head chef hands over a note: "for a guest who wants it spicier, add a little chili." The note does not repeat the whole recipe. It holds only the change. Now suppose you grade the cook by how close each bowl is to the guest's wish. If the note is empty, the bowl is still the master recipe. The only way to score better is to write something useful in the note.
The paper builds its policy the same way. This is the first of its two training fixes for the alignment problem of Chapter 5.
Both the base policy and the label-conditioned policy are flow networks from Chapter 2. The paper writes the conditional velocity as a sum:
Training uses the same squared error as before, but the target is the full path velocity a − ε and the prediction is the sum:
Here Daug is the dataset with extra "imagined" actions, which Chapter 7 explains. Here, read it as the dataset. The path point is xt = (1 − t)ε + t a, as before.
Here is our reading of why this works, a fact about averages. The reference field vπ̂ already equals the average velocity at each (xt, t, s), because that is what its loss teaches it. So the leftover target, (a − ε) − vπ̂, averages to zero at every such point. If the residual network ignores y, its best answer is therefore zero: it has nothing left to explain. The only way it can lower the loss is to use y to tell apart the different actions that share a state and a noise level. The paper says the reference takes the advantage-independent part of the loss, which leaves the residual to focus on the conditional input y.
Compare the plain conditional network of Chapter 5. It had one job: predict the full velocity. It could earn almost all of its loss reduction from the state and the noise, which are the easy parts, and leave the label unused. The residual form removes the easy part from its job. The easy part is already paid for.
One more consequence matters for guidance. The conditional fields at two labels differ by exactly the residuals, since the base field is shared:
vπ(y+) − vπ(y−) = vθ(y+) − vθ(y−)
So the contrastive velocity of Chapter 4 becomes vπ̂ + w [ vθ(y+) − vθ(y−) ]. This is the exact form in the paper's Algorithm 1. Sampling needs the base network once and the residual network twice.
Every network takes the partly noised action chunk xt of shape [B, H, d], the time t of shape [B, 1] and the state s. The residual also takes the label y, a single number per sample, of shape [B]. The paper feeds the label in through AdaLN, adaptive layer normalization. At each layer, a small network turns the label into a scale and a shift, and applies them to that layer's hidden features. The label therefore reaches every layer, and it cannot be drowned out by the other inputs. The comparison baseline, RCP-A, uses a similar scale-and-shift idea called FiLM. On OGBench the actor has four hidden layers of 512 units (the paper's Table 1).
pythonclass AdvantageGuidancePolicy(nn.Module): def __init__(self, ref_net, res_net): super().__init__(); self.ref, self.res = ref_net, res_net # both flow networks def velocity(self, x_t, t, s, y): return self.ref(x_t, t, s).detach() + self.res(x_t, t, s, y) # [B, H, d]; gradient reaches res only def residual_loss(policy, s, a, y): eps, t = torch.randn_like(a), torch.rand(a.shape[0], 1, 1) x_t = (1 - t) * eps + t * a return ((policy.velocity(x_t, t, s, y) - (a - eps)) ** 2).mean()
Now see the three fields side by side. The blue line is the base velocity. The teal line is the contrastive push, w times the difference of the two residuals. The yellow line is their sum, the field the sampler actually follows.
The x axis is the partly noised action at one moment of sampling. Slide the time t from noisy (0) to nearly clean (0.90), and change w. The dotted line marks where the teal push is largest.
Illustrative toy with exact ideal fields on a grid (label spread σy = 0.5, y+ = 1, y− = −1). In a real run, the base and residual are trained networks, and their output is a velocity for a whole action chunk, not one number.
At every time, the teal push is positive across most of the range. It nudges each point toward the better actions on the right. Where the push peaks moves as t grows: at w = 1 it sits near x = −1.3 at t = 0.3, near −0.5 at t = 0.5, and near 1.15 at t = 0.9. The read-out names the peak for your settings. At w = 0 the yellow line sits exactly on the blue one: no guidance, plain copying.
Chapter 7
Give every state several actions with their advantages, and scale the labels state by state, so the label has something to teach
A teacher marks homework. For each question, she has exactly one answer from one student, and a grade on it. Could she learn what a better answer looks like? Not from that. To see "better", she needs two or more answers to the same question, with different grades. One answer per question teaches only "this is what a student wrote".
The policy has the same problem. The paper points out that in a continuous state space, the dataset typically holds a single action for any given state. The label on that one action cannot teach how actions should change as the label changes. The policy gets, in the paper's words, "little direct supervision on how actions should change as requested advantages vary". Chapter 6 made the network read its label. This chapter gives the label something to say.
Action imagination adds the missing second answer. For each recorded pair (s, ad), draw K extra actions at the same state from a proposal policy. The paper's simple choice is the reference policy π̂ itself. Then score every one of them with the critic. The enlarged training set is
Now the policy sees one state with several actions and several different labels. It can finally learn "a higher label means this part of the action space". The paper adds a second benefit: the policy trains on a broader action distribution at each state than the recorded one. In its experiments, K = 3 hurts and larger K helps, but the gain levels off at about K = 7 (Figure 9). The paper uses K = 7, so eight actions per state.
Think about what a label means now. At one state, with one noise level, the network sees eight different target velocities. One label is −1.3 and sits on an action the critic dislikes. Another is +1.5 and sits on an action it likes. Nothing but the label can explain why the targets differ. That is the supervision the recorded data could not give. The imagined actions come from the reference policy, so they stay near what the data covers, which is where the critic's scores are most trustworthy. The price is more work per step: K + 1 times as many action terms as plain imitation. That work is critic passes and reference samples. It never needs the robot.
Raw advantages are awkward as labels. In one state, every move costs about the same. In another, one slip drops the cube. The raw numbers in the first state are tiny and the numbers in the second are huge. A single policy would have to read both scales with the same label input. So the paper standardizes the advantages within each state, over its K + 1 actions:
The training label is then a noisy copy: yi ~ N(Ãi, σy²), with σy = 0.1 on OGBench and 0.01 on OCBench (the paper's Table 2). Chapter 4's contrastive labels, y+ = 1 and y− = −1, are therefore "one standard deviation better than this state's usual" and "one worse".
Work a state with K = 3. The four raw advantages are 0.10 (the recorded action), −0.30, 0.50 and 0.00 (illustrative). The mean is 0.075. The deviations are 0.025, −0.375, 0.425 and −0.075. Their squares add to 0.3275, so the variance is 0.0819 and the spread is 0.286. The normalized labels are 0.09, −1.31, 1.49 and −0.26. They have mean 0 and spread 1 by construction. Now set K = 0: one action, whose deviation from its own mean is zero. Its label is 0 whatever the critic says. The label carries no information at all.
The paper tests the normalization choice (Figure 10). It compares per-state, per-minibatch and whole-dataset statistics, all with K = 31. Per-state scaling "offers a big advantage over other normalization schemes". The device below shows why.
pythondef make_labels(critic, ref_policy, s, a_data, K=7, sigma_y=0.1, delta=1e-6): a_img = ref_policy.sample(s, K) # [B, K, H, d] imagined actions acts = torch.cat([a_data[:, None], a_img], dim=1) # [B, K+1, H, d] A = critic.q(s, acts) - critic.v(s)[:, None] # [B, K+1] advantages mu, var = A.mean(1, keepdim=True), A.var(1, unbiased=False, keepdim=True) A_norm = (A - mu) / torch.sqrt(var + delta) # per-state standardization return acts, A_norm + sigma_y * torch.randn_like(A_norm) # labels y_i ~ N(A_norm, sigma_y^2)
Each dot is one action at one state. Blue ring: the recorded action. Teal dots: imagined actions. The height of a dot is its label. Choose K, choose how much this state matters, then switch the scaling.
Illustrative toy. "Stakes" multiplies the toy's raw advantages (1.00 is the toy's usual scale). The whole-dataset mode divides by the dataset's own spread at stakes 1.00 and does not adapt to this state. The label spread is judged against the paper's OGBench label noise, σy = 0.1. Imagined actions are drawn from the toy's data policy with a fixed seed.
Leave the scaling on "Per state" and slide the stakes down to 0.05. The dots barely move: the best and worst actions still sit a few units apart in label. Switch to "Whole dataset" and the dots collapse onto the floor. The read-out counts the gap in units of the label noise. Per state, the labels of the best and worst imagined action stay many noise widths apart. Dataset-wide, a low-stakes state gives labels that the noise swamps. The network cannot learn from labels that blur together.
Chapter 8
Follow one training step and one sampling pass, with every tensor shape, and read the code that does both
A bakery has two shifts. The night shift makes dough: it measures, mixes, and shapes loaves. The day shift bakes and sells. They use the same dough, but the jobs do not overlap. Advantage Guidance has the same two shifts. Training builds two networks. Sampling uses them to produce one action chunk for the robot. The paper's Algorithm 1 shows both, side by side. We walk through each, then read the code.
Advantage Guidance needs advantages, so a critic must exist. The paper says the method is "agnostic to how the advantage estimates are derived". For simplicity, it trains value functions with IQL, implicit Q-learning. We can describe it in three sentences. The critic Q(s, a) learns to predict the discounted return of an action chunk. The value V(s) learns an expectile of Q over the dataset's own actions. An expectile loss weights errors above and below differently, so V climbs toward the best Q seen in the data. It never asks Q about an action the dataset lacks. The advantage is A(s, a) = Q(s, a) − V(s). On OGBench the expectile is 0.9, and on OCBench it is 0.5. Both use two Q networks and take the smaller output, and target networks are averaged with a rate of 0.005 (the paper's Appendix A.7 and Table 1).
Training runs both networks in one loop. The reference network trains on the dataset action alone with the plain flow-matching loss of Chapter 2. The residual network trains on the enlarged set of Chapter 7. Walk through the lane below, one step at a time. The shapes assume a batch of 256 states, K = 7 imagined actions, an action chunk of H = 5 steps and d action numbers per step (OGBench settings).
Sampling uses no critic and no imagination. Start from noise of shape [B, H, d]. At each of T = 10 Euler steps, call the reference network once and the residual network twice, once with the good label y+ = 1 and once with the bad label y− = −1. Combine them as Chapter 6 showed, and step. After ten steps, the result is the action chunk. The same trained networks serve every value of the guidance weight w, which you set at the moment you sample. That is also what the paper tunes: one number per domain on OGBench, and one per task on OCBench.
Count the work. One training step imagines 7 chunks for each of 256 states. Each imagined chunk takes 10 reference calls, so that is 256 × 7 × 10 = 17,920 reference passes, plus 2,048 critic scores. Sampling is cheaper: 10 Euler steps × 3 network calls = 30 forward passes per action chunk, against 10 for plain imitation. The two residual calls can share one batch. Our arithmetic, from the settings in the paper's Tables 1 and 2.
Choose a lane, then press Next step. The highlighted box is the step that runs now. Shapes are in teal. Steps already done stay filled.
Shapes follow the paper's Algorithm 1 and Tables 1 and 2. They use batch 256, K = 7, chunk length H = 5, 10 flow steps and label spread 0.1 (OGBench). The number d of action numbers per step depends on the task. The text we used does not give it. Counting 2,048 labelled actions per step is our reading of the algorithm: 256 states times K + 1 = 8 actions.
Here are both lanes as code. It condenses Algorithm 1, using the helper from Chapter 7 for labels and the two networks of Chapter 6.
python# ── training: one iteration ─────────────────────────────────────────────── s, a = dataset.sample(B) # s: [B, d_s] a: [B, H, d] loss_ref = flow_loss(ref_net, s, a) # plain flow matching, dataset action only acts, y = make_labels(critic, ref_net, s, a, K=7) # acts: [B, K+1, H, d] y: [B, K+1] eps = torch.randn_like(acts) # noise, one per action t = torch.rand(B, K + 1, 1, 1) x_t = (1 - t) * eps + t * acts # [B, K+1, H, d] v = ref_net(x_t, t, s).detach() + res_net(x_t, t, s, y) # base + residual loss_res = ((v - (acts - eps)) ** 2).mean() # gradient reaches res_net only (loss_ref + loss_res).backward(); opt.step() # ── sampling: one action chunk ──────────────────────────────────────────── def act(s, w, y_pos=1.0, y_neg=-1.0, T=10): x = torch.randn(s.shape[0], H, d) # start from noise for n in range(T): t = torch.full((s.shape[0], 1, 1), n / T) v = ref_net(x, t, s) + w * (res_net(x, t, s, y_pos) - res_net(x, t, s, y_neg)) x = x + v / T # Euler step return x # [B, H, d] chunk for the robot
Each design choice has a reason. The reference is trained alone, on the plain loss, so it stays the average field that Chapter 6 needs. The reference is detached in the residual loss, so the residual cannot pull it off that average. The residual is trained on imagined actions, so the label has contrast to learn from. The guidance weight lives at sampling time, so one trained pair serves every setting of the leash. And the two labels sit at plus and minus one standard deviation, so neither is out of range.
Most of the settings are shared with the baselines. The batch is 256 on OGBench and 1,024 on OCBench. The discount is 0.99 and 0.999. The optimizer is Adam, with a learning rate of 3×10−4 and 1×10−4. Training runs for 500,000 steps on OGBench and 1,000,000 on OCBench (100,000 for Advantage Guidance on Block Single). The actor has four hidden layers of 512 units on OGBench, and eight of 1,024 on OCBench.
Advantage Guidance fixes its own knobs once: y+ = 1, y− = −1, K = 7, and σy = 0.1 (OGBench) or 0.01 (OCBench). It tunes only the guidance weight w: one value per domain on OGBench, and one per task on OCBench. On OGBench, tuning used tasks 2 and 4 of each domain with 4 seeds; the final scores then came from 10 fresh seeds. Table 3 lists the chosen w: 1 on Cube Single, 1.5 on Cube Double, 1 on Scene and 2.5 on Puzzle 3×3. This is why the method calls itself simple: one number to tune, and it is a sampling-time number.
Chapter 9
Read the paper's main table task by task, see where Advantage Guidance wins by a wide margin, and see where it loses
A tournament is only as good as its rules. Before the scores, three questions. What are the games? Who plays? How was each player tuned? This chapter answers them from the paper, then reads the scores the way a careful referee would: win by win, and loss by loss.
All tasks are robot manipulation with sparse reward and long horizons. The paper runs OGBench, 20 tasks in four domains (Cube Single, Cube Double, Scene, Puzzle 3×3), five tasks each of rising difficulty. Its datasets are play-style: a script moved the robot toward random goals, so most recorded behavior is poor for any one task. Each dataset has 1 million transitions.
It also runs OCBench, 6 tasks in three domains (Block Single, Block Double, Chamber Easy). Its datasets are demonstrations from near-expert policies, designed to match the statistics of real human demonstrations. These data are narrow: they cover few states and mostly good actions. That makes offline RL harder, because errors outside the data are harder to avoid. They are also small: 10,000 transitions for Block Single and Chamber Easy, 30,000 for Block Double, and a small share of the demonstrations fail.
Nine methods compete, all rebuilt as flow policies with action chunking. Two are actor-critic: FQL distills a multi-step flow policy into a one-step policy to avoid backpropagating through the denoising steps, and EDP approximates the whole denoising path with one large Euler step. Four are supervised: CRR clones only the positive-advantage data, FAWR weights the flow loss by exp(A / β) (clipped at 100), and RCP-R and RCP-A condition on return and advantage. Two use guidance: QGF steers sampling with the critic's gradient, and CFGRL runs classifier-free guidance on a yes-or-no "better than average" label. Advantage Guidance (AG) is the ninth.
The rules are fair in the ways that matter. Every method uses the same IQL critic. Each tunes its own domain-specific setting (Table 3 lists them). Tuning uses 4 seeds, then the final scores come from 10 fresh seeds. Each OGBench task is judged over 30 evaluation episodes, and each OCBench task over 500. Error bars are 95 percent confidence intervals.
Table 5 holds the numbers, one row per task. Look at Puzzle 3×3 first. AG scores 98.7, 93.7, 69.3, 63.0 and 72.0 on tasks 1 to 5, an average of 79.3 (± 2.9). EDP, the best baseline there, scores 98.0, 75.0, 48.0, 46.7 and 51.3, an average of 63.8 (± 2.6). All four supervised baselines and CFGRL score under 3 percent. They fail: on a long task, a policy that only copies filtered data, or follows a weak label, never solves the puzzle. Two methods are called different when their intervals do not overlap.
Pick a domain, or an aggregate. Bars show the average success rate over its tasks. Whiskers are the paper's 95 percent intervals. The marker shows the best baseline.
Domain numbers are the "Avg" rows of the paper's Table 5 (mean ± 95% CI, 10 seeds). The last three chips are our own arithmetic: plain means of task averages (OGBench 20 tasks, OCBench 6 tasks, all 26), with no interval. The paper's Figure 4 plots the same domains.
Run through the chips. AG leads in five of the seven domains. The margins are largest where the horizon is longest: Block Single 95.9 against 81.8 (QGF), Block Double 91.4 against 84.0 (EDP), Puzzle 79.3 against 63.8. On OCBench overall, AG reaches 83.1 against 69.4 for CFGRL, the strongest baseline on that benchmark. The paper reads this as a benefit of using continuous advantage values, which give denser supervision than CFGRL's binary label, and of aiming at the KL-regularized optimum. Against QGF, the paper credits AG for not needing explicit critic gradients in high-dimensional action spaces, which "can be unstable or inaccurate".
The paper's claim is that AG "significantly outperforms" prior methods overall. The table also shows exceptions, and a careful reader should see them.
On Cube Single, EDP scores 99.0 and AG 94.9 (the intervals do not overlap), though all of the top methods are close to ceiling. On Scene, CFGRL scores 92.9, RCP-A 91.5 and CRR 89.9, all above AG's 86.0 (± 2.0). Inside Scene, AG's task 3 stands out as weak: 38.0 ± 9.6, while CRR reaches 85.0. On Cube Double every method stays below 10 percent on average, and AG's 7.9 is the highest, with a note: its task 5 (24.7) is far above the next best (8.7). The paper's Appendix A.11 finds that a higher discount, 0.999 in place of 0.99, helps all agents on Cube Double, and QGF and AG most.
Counting by task, we find that AG has the highest mean on 17 of the 26 tasks (our count from Table 5, where ties count for each tied method). That is a strong majority, and it is not a sweep.
Chapter 10
Remove each piece to see what it buys, price the method against best-of-N sampling, and find where it breaks
To learn what a machine needs, take parts out one at a time and watch what fails. The paper does this for each of its three ideas. It also asks two fair questions a skeptic would ask. Could simply spending more compute at test time do as well? And where does the method break? We take them in order.
The residual flow and action imagination both aim at advantage alignment (Chapters 5 to 7). The paper measures that alignment with the two tests from Chapter 5, and then measures performance. In its Figure 6, removing the residual form, or removing imagination, makes the policy less responsive to its label: the gradient similarity rises toward the naive policy's, and the response ratio falls. Using both is best. Figure 7 shows the same order in success rate, on both OGBench and OCBench. The exact bars are in plots without printed numbers, so we report only the ordering the paper states: each piece helps, and the pair helps most.
Two smaller ablations tune the design. Figure 9 varies K, the number of imagined actions. K = 3 hurts. More imagined actions help, but the gain plateaus after about K = 7, which is the value used. Figure 10 compares three ways to normalize advantages, all with K = 31. Per-state normalization, the choice in Chapter 7, offers "a big advantage" over per-minibatch and whole-dataset normalization. A final check (Appendix A.4) swaps the network for a transformer with more than twice the parameters. Alignment barely moves and performance does not improve. Only the training scheme fixes the problem.
Figure 8 samples one trained Advantage Guidance policy in three ways: plain conditional (query one high label), CFG, and contrastive. On OGBench the three do about the same. On OCBench, contrastive guidance is clearly better. The paper's explanation is a point about data. OGBench's play-style data covers a wide range of advantages, so a high query still lands inside what the network has seen. OCBench's demonstrations are narrow, so a high advantage query falls outside the training range, and the network answers it badly. Figure 15 shows the plain conditional policy dropping sharply at high queries on every OCBench task, and on the long Puzzle 3×3 task, whose state-action coverage is relatively smaller for the same number of transitions. Contrastive guidance avoids the problem because its labels stay at ±1. The paper also notes that all three samplers work well only when the conditional policy is aligned. An unaligned policy such as RCP-A "leads to substantially worse performance".
Break it yourself. The toy network below answers labels inside its training range correctly. Past the edge of that range, it blurs, answering with a broad spread of actions. Slide the query up, and narrow the range.
Purple outline: actions from one high query. Teal bars: contrastive guidance with labels ±1. Narrow the label range the network was trained on, then raise the query above it.
Illustrative toy, not the paper's networks. The toy network is exact for labels up to the edge, then blends toward a broad blur (a normal curve of spread 1.4) over one unit of label, a stand-in for an untrained extrapolation. Contrastive guidance uses the toy's w = 1 and labels ±1. 300 sampled actions, 10 flow steps.
With the edge at 1.2 and the query at 1.0, both methods work. Raise the query to 2.5. The purple outline smears across the whole axis: the network was never taught that label, so it guesses. The teal bars stay on the good actions, because the pair ±1 is inside the range. The purple average falls from 1.1 to about 0. Now pull the edge down to 0.6. Even ±1 begins to leave the range, and the teal average eases from 2.0 to about 1.75. It stays far above the purple. The paper's narrow demonstration data is the toy's narrow edge.
A simple rival is best-of-N. Sample N actions from the plain reference policy, score each with the critic's Q, and keep the best. It needs no new training. The paper compares it with AG in Figure 5. On OGBench, AG beats best-of-N at small N and slightly trails it at large N. On OCBench, AG is clearly better even against large N. The paper's reading is that best-of-N is effective on play-style data and less competitive on realistic demonstrations.
Cost is the other axis. Best-of-N must run the reference sampler N times, plus N critic calls. Figure 23 counts compute per primitive action in the action chunk, averaged over both benchmarks. Pick an N to price it.
Bars show compute per primitive action, in billions of floating-point operations (GFLOPs). Choose the N of best-of-N sampling to compare it with Advantage Guidance.
Numbers are the bar labels of the paper's Figure 23: Advantage Guidance 0.0638, best-of-N 0.0711 (N = 2), 0.1423 (4), 0.2846 (8), 0.5691 (16) and 1.1383 (32) GFLOPs per primitive action, averaged over OGBench and OCBench environments. The ratios are our arithmetic.
The paper's own Discussion lists three. First, the advantages come from a plain IQL estimate. How well the method holds up when advantage estimates are noisy is open. Second, "too large a guidance weight usually lead to a decline in performance". A stable way to use bigger weights could help. Third, everything here is offline. Offline-to-online use is untested. We add one plain observation. All 26 tasks come from two benchmarks, and the tuned weight differs by domain (Table 3), so a new domain needs its own sweep of w.
Chapter 11
Keep the numbers, the core code, the map of related work, and the paper's citation in one place
The story in five sentences. Copying data is stable but capped, and RL is strong but fragile. The target is the data policy tilted by exp(A / β). One label gives a hill, but two labels give a ramp, so contrastive guidance reaches the target. Ordinary training ignores its label, so a residual flow and imagined actions make it listen. The result beats strong RL on most of 26 sparse-reward tasks, with one number to tune.
| Quantity | Value | Source |
|---|---|---|
| Puzzle 3×3, average success | 79.3 (EDP, best baseline: 63.8) | Table 5 |
| Block Single, Block Double, Chamber Easy | 95.9, 91.4, 73.3 (best baseline 81.8, 84.0, 61.8) | Table 5 |
| Cube Single, Scene (AG trails) | 94.9 against 99.0 (EDP); 86.0 against 92.9 (CFGRL) | Table 5 |
| Mean over the 26 task averages | AG 70.8, EDP 62.4, QGF 58.3 | our arithmetic on Table 5 |
| Tasks where AG has the top mean | 17 of 26 | our count on Table 5 |
| Imagined actions per state, K | 7 (gain levels off after 7; K = 3 hurts) | Table 2, Figure 9 |
| Contrastive labels y+, y− | +1 and −1 | Table 2 |
| Label spread σy | 0.1 (OGBench), 0.01 (OCBench) | Table 2 |
| Tuned guidance weight w | 1 to 4 across domains (e.g. 1 Cube Single, 2.5 Puzzle 3×3) | Table 3 |
| Implied leash β = σ² / (w (y+ − y−)) | 0.005 for σ = 0.1, w = 1 | our arithmetic |
| Flow steps at sampling | 10 | Table 1 |
| Compute per primitive action | AG 0.0638; best-of-N 0.0711 (N = 2) to 1.1383 (N = 32) GFLOPs | Figure 23 |
| Benchmarks | OGBench (20 tasks, 1M-transition play data), OCBench (6 tasks, 10k to 30k demonstrations) | Section 7, A.9 |
| Term | Plain meaning |
|---|---|
| Advantage A(s, a) | How much better action a is than the policy's usual action at state s: Q minus V. |
| Reference policy π̂ | The data policy, learned by plain flow matching. |
| KL-optimal policy π*KL | π̂ tilted by exp(A / β). The target. |
| Advantage alignment | Whether the achieved advantage follows the requested one. |
| Contrastive guidance | Reference field plus w times the difference of two label-conditioned fields. |
| Residual flow vθ | The label-reading correction added to the reference field. |
| Action imagination | K extra actions per state from the reference, each scored by the critic. |
| Per-state normalization | Standardize advantages over the K + 1 actions at one state. |
python# the three equations that matter, in the order the lesson derived them target = ref_density * torch.exp(A / beta); target /= target.sum() # Ch 1: the KL-optimal tilt beta = sigma_y**2 / (w * (y_pos - y_neg)) # Ch 4: the leash that w and the labels imply v = v_ref + w * (v_res(x, t, s, y_pos) - v_res(x, t, s, y_neg)) # Ch 4+6: the field the sampler follows # training: reference on the data, residual on imagined actions (Ch 6 and 7) loss_ref = flow_loss(ref_net, s, a) acts, y = make_labels(critic, ref_net, s, a, K=7, sigma_y=0.1) loss_res = ((ref_net(x_t, t, s).detach() + res_net(x_t, t, s, y) - (acts - eps))**2).mean()
Advantage Guidance joins three families. Among advantage and return conditioning methods, it builds on reward-conditioned policies (Kumar et al. 2019) and Decision Transformer-style return conditioning. The paper also lists π0.6* (arXiv 2511.14759) among the methods that condition on advantage. Among diffusion guidance for RL, the closest is CFGRL (Frans et al. 2025), which guides with a yes-or-no label, and QGF (Zhou et al. 2026), which guides with critic gradients. Among actor-critic flow policies, FQL (Park et al. 2025) and EDP are the strong baselines. For the critic, the paper uses IQL (Kostrikov et al. 2021), and its benchmarks are OGBench (arXiv 2410.20092) and OCBench (arXiv 2610.07056).
Source and credit. Zhiyuan Zhou and Sergey Levine (UC Berkeley), "Reinforcement Learning via Advantage Guidance", arXiv:2610.19783 (abstract), version 2, 19 October 2026. Code: github.com/zhouzypaul/advantage-guidance. All numbers marked with a table or figure come from that paper. Toy numbers on this page are illustrative and say so. Anything marked "our arithmetic" is ours, computed from the paper's tables.