Introduction
Offline goal-conditioned RL learns, from unlabelled trajectories, a policy that should reach any goal state [1]. In this task the policy class, the goal relabelling for the actor and the extraction rule are fixed. A Gaussian actor is trained by DDPG+BC on whatever signal the value-learning rule exposes, normalised by . The only thing left to design is how the value function is learned: its parameterisation, what it is trained on, and its losses and targets.
Two properties make this hard. First, the horizon: a one-step temporal-difference backup, as in the expectile-based starter [2], moves information one transition per update, so values for goals thousands of steps away are learned slowly and noisily. Second, composition across trajectories: the dataset may contain no single trajectory from to , and the value has to be assembled from pieces of different trajectories. The field attacks these from two directions. Transitive, divide-and-conquer value learning composes values through intermediate waypoints, , so that the effective backup depth grows logarithmically with the horizon [3]. Quasimetric methods instead learn a distance that satisfies the triangle inequality by construction, so that composition across trajectories is built into the architecture [4, 5, 6]. Contrastive and representation-based methods learn values by contrastive learning [7] or through learned goal representations [8].
Each has a known weakness. Waypoint composition inside a trajectory only ever sees in-trajectory waypoints, so it cannot compose across trajectories by itself. A quasimetric is constrained in what it can represent, and the actor's gradient through a 1-Lipschitz distance is small compared with an unconstrained critic's. Our method uses both: a recursive critic trained by waypoint composition, whose cross-trajectory backups are lower-bounded by a quasimetric, and an actor signal that blends the two.
Method
A critic of discounted reachability, composed through waypoints
We parameterise both the value and the critic as discounted reachability probabilities, and , read as for a step distance . Each is a two-member ensemble with a Polyak target (), and , denote the minimum over the target members. Distances add when reachabilities multiply, so a waypoint between and gives the composition target
where the first factor is when is the next state and otherwise. The upper clip at encodes that at least one action is needed to reach any goal other than the current state. The second factor depends on where the goal came from:
with the dataset action at . On the in-trajectory branch the factor is when is one step from . On the other branch it is when . The second line is the grounding step. A random goal, which in general lies on another trajectory, has no in-trajectory path to bootstrap from, so its backup is allowed to take the larger of the learned value and the reachability implied by a quasimetric (Section 2.3). That quasimetric is measured in units of per step, so is a step count and converts it to the critic's own discount. Taking the maximum over the two members of makes the grounding pessimistic.
The critic is fitted to with a binary cross-entropy on its logit, weighted by an expectile and by a distance weight:
where if and otherwise, with . The exponent is a per-setting constant between 0 and 0.5 that down-weights distant, noisier targets. The value is fitted to , clipped to , by the same expectile-weighted cross-entropy with a larger expectile (0.75 to 0.85, per setting). It also gets a self-goal anchor: for the first 128 states of the batch the goal is the state itself and the target is .
# Single fused target_critic forward pass over [obs->goals, obs->w, w->goals] (3*B)
tc_obs = jnp.concatenate([obs, obs, w_obs], axis=0)
tc_goals = jnp.concatenate([goals, w_obs, goals], axis=0)
tc_act = jnp.concatenate([act, act, batch['w_act']], axis=0)
tc_min = jnp.minimum(*jax.nn.sigmoid(network.select('target_critic')(tc_obs, tc_goals, tc_act)))
q_bar = jnp.clip(tc_min[:bsz], 1e-6, self.discount)
qw = tc_min[bsz:2 * bsz]
qw_to_g = tc_min[2 * bsz:]
# 1. Contracting Expectile Value V(s, g) with Explicit Self-Goal Boundary Anchor
v_obs = jnp.concatenate([obs, obs[:n_self]], axis=0)
v_goals = jnp.concatenate([goals, obs[:n_self]], axis=0)
v_targets = jnp.concatenate([q_bar, jnp.full((n_self,), self_target, dtype=q_bar.dtype)], axis=0)
v_logits = network.select('value')(v_obs, v_goals, params=grad_params)
v_probs = jax.nn.sigmoid(v_logits)
v_weight = jnp.where(v_targets[None, :] >= jax.lax.stop_gradient(v_probs),
self.v_expectile, 1.0 - self.v_expectile)
value_loss = (v_weight * self.bce_loss(v_logits, v_targets[None, :])).mean()
q_to_w = jnp.where(batch['w_off'] <= 1.0, self.discount, qw)
vw_to_g = jnp.minimum(*jax.nn.sigmoid(network.select('target_value')(w_obs, goals)))
mid_from_w = jnp.where(batch['w_rem'] <= 1.0, self.discount, jnp.maximum(qw_to_g, vw_to_g)) # 3. Quasimetric-Grounded Multistep Bridge + Recursive Q-Update
d_bridge_max = jax.lax.stop_gradient(jnp.maximum(*self.mrn_distance(psi_w_all, psi_val_g)))
v_qm_w = jnp.exp((d_bridge_max / qm_step_cost) * jnp.log(self.discount))
bridge_from_w = jnp.where(batch['w_eq_g'] > 0.5, 1.0, jnp.maximum(vw_to_g, v_qm_w))
from_w = jnp.where(batch['use_mid'] > 0.5, mid_from_w, bridge_from_w)
target = jnp.where(batch['is_one_step'] > 0.5, self.discount, q_to_w * from_w)
target = jax.lax.stop_gradient(jnp.clip(target, 1e-6, self.discount))
dist_steps = jnp.maximum(0.0, jnp.log(target) / jnp.log(self.discount) - 1.0)
dist_weight = (1.0 / (1.0 + dist_steps)) ** self.lam
q_logits = network.select('critic')(obs, goals, act, params=grad_params)
q_probs = jax.nn.sigmoid(q_logits)
q_weight = jnp.where(target[None, :] >= jax.lax.stop_gradient(q_probs),
self.q_expectile, 1.0 - self.q_expectile)
q_loss = (q_weight * dist_weight[None, :] * self.bce_loss(q_logits, target[None, :])).mean()Where the waypoints come from
The relabelling decides what the composition sees. With probability (0.25 to 0.50, per setting) the goal is a random dataset state. Otherwise it is a later state of the same trajectory, at an offset that is uniform over the rest of the trajectory with probability and geometric with parameter otherwise. For an in-trajectory goal at offset at least 2, the waypoint is the next state with probability 0.2 and otherwise uniform over every intermediate offset . Waypoints are therefore not restricted to midpoints, and long segments are split anywhere. For random goals the waypoint is the next state with probability 0.2 and otherwise a geometric number of steps ahead with parameter 0.04, about 25 steps on average, capped at the trajectory end. That is a multistep bridge along the current trajectory, followed by the grounded jump to the foreign goal.
def make_batch(self, data, idxs):
n = len(idxs)
ends = self._get_ends(data, idxs)
rem = ends - idxs
geom_off = np.minimum(np.random.geometric(p=1.0 - self.discount, size=n), rem)
unif_off = np.maximum(1, np.ceil(np.random.rand(n) * rem).astype(np.int64))
traj_off = np.where(np.random.rand(n) < self.p_unif, unif_off, geom_off)
traj_goal_idxs = idxs + traj_off
rand_goal_idxs = np.random.randint(0, data.size, size=n)
rand_goal_idxs = np.where(rand_goal_idxs == idxs, np.minimum(idxs + 1, ends), rand_goal_idxs)
is_rand = np.random.rand(n) < self.p_rand
goal_idxs = np.where(is_rand, rand_goal_idxs, traj_goal_idxs)
is_in_traj = (~is_rand) & (goal_idxs <= ends)
offsets = goal_idxs - idxs
span_m1 = np.maximum(offsets - 1, 1)
unif_mid = np.clip(1 + np.floor(np.random.rand(n) * span_m1).astype(np.int64), 1, span_m1)
in_traj_w_off = np.where(np.random.rand(n) < 0.20, 1, unif_mid)
bridge_geom = np.minimum(np.random.geometric(p=0.04, size=n), rem)
bridge_w_off = np.where(np.random.rand(n) < 0.20, 1, bridge_geom)
use_mid = is_in_traj & (offsets >= 2)
w_off = np.where(use_mid, in_traj_w_off, bridge_w_off)
w_idxs = idxs + w_off
w_act_idxs = np.minimum(w_idxs, ends - 1)A residual multistep quasimetric
The quasimetric uses the MRN form of the multistep quasimetric baseline [6]. A state embedding , an ensemble of two MLPs, is split into eight blocks; in each block half of the coordinates contribute an asymmetric term and half a Euclidean term, and the distance averages over blocks:
The embedding is trained on all pairs of a 256-state sub-batch against a multistep triangle bound. For a state with an in-trajectory goal and an intermediate state that is steps ahead, every column goal gets the target . On the diagonal, the term is zeroed. is an upper bound on by the triangle inequality. The loss pushing toward is a scaled LINEX,
whose gradient vanishes at . It pushes up toward with at most unit
slope from below and penalises overshoot exponentially, so the fixed point behaves like a soft
minimum over the available bounds. Beyond the exponential is replaced by its
tangent slope , which caps the gradient. A per-setting constant diag_backup sets how much
of the loss sits on the diagonal (positive) pairs against the off-diagonal pairs. Pushing an
off-diagonal distance up to its triangle bound repels unrelated states, and the constant controls how
hard (0.35 to 0.96 across the settings).
The state-action embedding is a residual on the state embedding, , whose last layer is initialised at scale . It is anchored in both directions to the next state's embedding, , with a small penalty on . It also gets its own LINEX loss against the action-conditioned bound . A gauge term (means over members , coordinates and batch ) fixes the translation freedom of the embedding.
@staticmethod
def mrn_distance(x, y):
k = 8
d = x.shape[-1] // k
half = d // 2
xs = jnp.reshape(x, (*x.shape[:-1], k, d))
ys = jnp.reshape(y, (*y.shape[:-1], k, d))
max_c = jax.nn.relu(jnp.max(xs[..., :half] - ys[..., :half], axis=-1))
l2_c = jnp.sqrt(jnp.sum(jnp.square(xs[..., half:] - ys[..., half:]), axis=-1) + 1e-8)
return jnp.mean(max_c + l2_c, axis=-1) / jnp.sqrt(x.shape[-1])
@staticmethod
def bce_loss(pred_logit, target):
log_pred = jax.nn.log_sigmoid(pred_logit)
log_not_pred = jax.nn.log_sigmoid(-pred_logit)
return -(log_pred * target + log_not_pred * (1.0 - target))
def _beta_linex(self, pred, target):
u = pred - target
bu = self.beta * u
slope = jnp.exp(self.t) - 1.0
div = jnp.where(bu > self.t, slope * pred, jnp.exp(jnp.minimum(bu, self.t)) / self.beta - pred)
dw = self.diag_backup
diag = jnp.diagonal(div, axis1=-2, axis2=-1)[..., None] * dw
return jnp.mean(div * (1.0 - dw) + diag) psi_qm_g_sg = jax.lax.stop_gradient(psi_qm_g)
d_v = self.mrn_distance(psi_s_qm[:, :, None, :], psi_qm_g[:, None, :, :])
d_mid_raw = self.mrn_distance(psi_mid_qm[:, :, None, :], psi_qm_g_sg[:, None, :, :])
d_mid = jax.lax.stop_gradient(d_mid_raw * (1.0 - eye * batch['qm_mid_eq_g'][:, None])[None, :, :])
y_v = jnp.minimum(self.d_max, batch['qm_mid_off'][None, :, None] * qm_step_cost + d_mid)
qm_v_loss = self._beta_linex(d_v, y_v)
gauge_loss = (
1e-2 * jnp.mean(jnp.square(jnp.mean(psi_grad, axis=1)))
+ 2e-4 * jnp.mean(jnp.square(psi_grad))
)
psi_s_sg = jnp.concatenate([jax.lax.stop_gradient(psi_s_qm), psi_s_tail], axis=1)
delta_all = network.select('delta_phi')(obs, act, params=grad_params)
phi_all = psi_s_sg + delta_all
step_fwd = self.mrn_distance(phi_all, psi_next_all)
step_bwd = self.mrn_distance(psi_next_all, phi_all)
step_loss = (
0.5 * jnp.mean(jnp.square(step_fwd) + jnp.square(step_bwd))
+ 1e-4 * jnp.mean(jnp.square(delta_all))
)
d_q = self.mrn_distance(phi_all[:, :QM_BATCH, None, :], psi_qm_g_sg[:, None, :, :])
y_q = jnp.minimum(
self.d_max - qm_step_cost,
jnp.maximum(0.0, batch['qm_mid_off'][None, :, None] - 1.0) * qm_step_cost + d_mid,
)
qm_q_loss = self._beta_linex(d_q, y_q)The signal the actor sees
The actor maximises a blend of the two heads:
The shift by matters. Unshifted, saturates where , that is at , which for a discount of 0.99 lies dozens of steps from the goal. Inside that radius its gradient, which is multiplied by , falls below half and toward near the goal, and the actor loses its signal exactly where precise final actions matter. Shifted, the knee sits at , one step from the goal. The term stays strictly negative, which keeps the harness's normalisation free of sign cancellation. The factor 0.12 matches the scale of the two heads. The weight is a per-setting constant between 0.08 and 1.00. Where it is 1.00 the quasimetric is neither trained nor used, and the rule reduces to the recursive critic.
def actor_q(self, network, observations, actions, goals):
ell = jnp.minimum(*network.select('critic')(observations, goals, actions))
q_lat = 0.12 * jax.nn.log_sigmoid(ell - self.logit_ceil)
if self.eta >= 1.0:
return q_lat
psi_s = network.select('psi')(observations)
psi_g = network.select('psi')(goals)
phi = psi_s + network.select('delta_phi')(observations, actions)
q_qm = jnp.minimum(*(-self.mrn_distance(phi, psi_g)))
return (1.0 - self.eta) * q_qm + self.eta * q_latConfiguration
The rule uses no goal encoder for the actor, a batch of 512, hidden width throughout,
and eleven per-setting constants (, , the two expectiles, ,
, , diag_backup, , , ), with a fallback for ids that
are not listed, keyed on the id string.
Results
| Method | ① | ② | ③ |
|---|---|---|---|
| Success rate ↑ | Success rate ↑ | Success rate ↑ | |
| Gemini 4 Carbon | 35.60 | 41.07 | 27.47 |
| GCBC | 0.267 | 2.533 | 4.756 |
| GCIQL | 0.356 | 6.356 | 51.47 |
| QRL | 0.578 | 20.27 | 6.000 |
| CRL | 4.800 | 13.91 | 20.53 |
| Temporal Metric Distillation | 0.178 | 14.36 | 3.333 |
| MQE | 48.27 | 66.27 | 56.62 |
| TRL | 0.889 | 6.400 | 38.89 |
| Dual CRL | 0.711 | 19.47 | 42.18 |
- ① humanoidmaze-giant-navigate · long-horizon navigation
- ② antmaze-large-stitch · trajectory stitching
- ③ scene-play · multi-stage manipulation
On HMaze-giant and AMaze-stitch QG-RQL is far ahead of the starter: 35.60 against 0.356 on HMaze-giant, and 41.07 against 6.356 on AMaze-stitch. It is also ahead of the transitive baseline (0.889 and 6.400) and of every other published baseline except one. The exception is the strongest baseline on both settings, MQE [6], which reaches 48.27 on HMaze-giant and 66.27 on AMaze-stitch. Our quasimetric uses the same MRN form as that baseline, and we stay well behind it on both settings. The gap to the third-placed method is large: on HMaze-giant the next baseline after the leader is contrastive RL at 4.800, and on AMaze-stitch it is quasimetric RL at 20.27.
On Scene-play the picture reverses. QG-RQL reaches 27.47, below the starter (51.47), the transitive baseline (38.89), contrastive RL on dual goal representations (42.18) and the leader (56.62, MQE [6]). It is ahead of the other four baselines. On this setting the combination of components does worse than the one-step expectile critic it replaced. From the results alone we cannot say which component is responsible.
How we got here
QG-RQL was version 15, in the run's own numbering, of a rule that was rebuilt several times. Most of its components are answers to specific failures we saw in development. Our development runs were single runs, one per configuration, so the figures below are the agent's own development measurements and are not comparable to the published means.
- Reading first. Before writing code we read the baselines' implementations and a body of recent papers on divide-and-conquer value learning and quasimetrics. Two recent papers, one grounding divide-and-conquer value learning with temporal-difference targets [9] and one on recursive value learning for long-horizon offline goal-conditioned RL [10], shaped the first hypothesis: compose through waypoints, but use the learned value at the waypoint rather than only the logged action's critic. We also ran a subset of the baselines ourselves and logged the critic's gradient norm separately for short, long and cross-trajectory goals, which became our main diagnostic.
- A hard maximum with the one-step target stopped the values from contracting. Our first recursive critics took . In development the mean critic value froze near 0.58 to 0.62. Our diagnosis was that whenever , so the one-step branch always won the maximum and the composition never pulled values down, while an optimistic expectile added a steady upward drift. We replaced the maximum by a single multiplicative composition and lowered the value expectile. In the agent's smoke test the mean target then dropped from 0.396 to 0.212 at the first step.
- A non-residual action embedding copied the state. An action embedding learned from scratch and tied to the next state in both directions spent its capacity reproducing the state embedding. In short development probes, the residual form gave a higher rank correlation between learned and true distances (0.884 against 0.753 on one setting), so it was kept.
- The unshifted log-sigmoid starved short horizons. With as the actor signal, the agent reported short-horizon critic gradients in development 27 to 153 times smaller than those of the starter or the transitive baseline. The agent traced this to the saturation knee at , which it computed at 69 steps for a discount of 0.99. The ceiling shift by came out of that.
- A learned goal encoder appeared to hurt. The interface allows a goal encoder for the actor, and we first used the quasimetric's own state embedding for it. Its unnormalised scale drifted (the agent recorded a latent mean of about 10 and spread of about 16) and swamped the actor's input layer. On one development setting, a version with a 128-dimensional encoder reached 2.00% where the version the agent compared it with, without an encoder, reached 90.00%, and the agent attributed the drop to the encoder. The final rule has no goal encoder.
- Aligning the quasimetric to the value fought the triangle inequality. One version regressed the quasimetric onto the learned value for random goals, and that pulled distances toward the cap . We removed the alignment, widened the state embedding to a two-member, 256-dimensional ensemble, and let the quasimetric learn from its own triangle targets only.
- A one-step bridge appeared too short, and strong off-diagonal repulsion appeared harmful. Version 14
made several changes at once, among them replacing the multistep bridge for random goals by a
one-step backup. On one development setting success fell from 46.67% under version 13 to 20.33%,
and the cross-trajectory gradient norm fell from 0.058 to 0.011; the agent attributed this to the
one-step bridge. The same version set
diag_backupto 0.50 with on some settings. The agent's comparison with the multistep quasimetric baseline showed much more negative cross-trajectory values there, which it read as unrelated states being pushed apart. Version 15 restored the multistep bridge with its quasimetric grounding, raiseddiag_backupto 0.92 to 0.96 with a smaller on those settings, and re-set and per setting, among other changes, all at once. On that setting development success rose to 34.67%, and the agent's average over the settings it tracked rose from 31.42% to 32.33%. The gain belongs to the set of changes, not to any one of them.
In those development runs the multistep quasimetric baseline averaged 17.00% over the tracked settings, behind our 32.33%. The published means order the two the other way on every setting.
Limitations
- Behind the multistep quasimetric baseline everywhere. On every setting the strongest baseline is ahead of QG-RQL, by a wide margin. Our distance is that baseline's MRN form, and adding a recursive critic, grounding and a blended actor signal did not beat it. Our development comparison suggested the opposite, and it was misleading.
- Below the starter on Scene-play. QG-RQL reaches 27.47 there against the starter's 51.47. The method can do clear harm, and we did not identify the responsible component.
- Heavily configured. The rule has eleven constants per setting, several mixture probabilities and
six networks. Many constants, in particular
diag_backup, and , were set from development runs, one per configuration. The lookup also falls back on keywords of the setting id for ids it does not list. This is closer to a tuned system than to a single modular change, and how much each component contributes was never established by a clean ablation. - Heuristic pieces without derivation. The 0.12 head-matching factor, the self-goal target , the gauge weights and the LINEX cap are engineering choices. The maximum in the grounding step is optimistic with respect to the learned value, which the pessimistic ensemble maximum over only partly offsets.
- Cost. The quasimetric branch adds two embedding ensembles and all-pairs losses over a 256-state sub-batch on top of the recursive critic. The agent checked in development that the rule trained faster than the slowest reference method, but it is markedly heavier than the starter.
References
- Seohong Park, Kevin Frans, Benjamin Eysenbach et al. (2025). OGBench: Benchmarking Offline Goal-Conditioned RL. ICLR.
- Ilya Kostrikov, Ashvin Nair, Sergey Levine (2022). Offline Reinforcement Learning with Implicit Q-Learning. ICLR.
- Seohong Park, Aditya Oberai, Pranav Atreya et al. (2026). Transitive RL: Value Learning via Divide and Conquer. ICLR.
- Tongzhou Wang, Antonio Torralba, Phillip Isola et al. (2023). Optimal Goal-Reaching Reinforcement Learning via Quasimetric Learning. ICML.
- Vivek Myers, Bill Chunyuan Zheng, Benjamin Eysenbach et al. (2025). Offline Goal-conditioned Reinforcement Learning with Quasimetric Representations. NeurIPS.
- Bill Chunyuan Zheng, Vivek Myers, Benjamin Eysenbach et al. (2026). Scaling Goal-conditioned Reinforcement Learning with Multistep Quasimetric Distances. ICLR.
- Benjamin Eysenbach, Tianjun Zhang, Sergey Levine et al. (2022). Contrastive Learning as Goal-Conditioned Reinforcement Learning. NeurIPS.
- Seohong Park, Deepinder Mann, Sergey Levine (2026). Dual Goal Representations. ICLR.
- Abdul Monaf Chowdhury, MD Sameer Iqbal Chowdhury, Shifat E Arman et al. (2026). GTRL: Grounding Divide-and-Conquer Value Learning with Temporal Differences.
- Hyeonseong Jeon, Youngwoon Lee (2026). Recursive Value Learning for Long-Horizon Offline Goal-Conditioned RL.