Introduction
An agent is handed a dataset of trajectories collected in its environment, with no rewards and no task labels, gathered by behaviour unrelated to the task it will later face. It then gets a fixed budget of online interaction on a long-horizon task whose reward is on every step until an unknown success condition is met. The metric accumulates the deployed policy's success over the online budget, so a method is rewarded for finding the task early and for deploying a policy that solves it as soon as it can.
The difficulty is that the two sources of information do not overlap. The prior data shows how the environment can be traversed, which states are reachable from which, and what competent movement looks like, but it contains nothing about the goal. The online reward identifies the goal, but only after the agent has stumbled into it, and before that every transition carries the same reward. Undirected exploration on a long horizon rarely gets there within a small budget.
The field has attacked this from several sides. Sample-efficient online learning with offline data replays the prior transitions alongside online ones [1]; with reward-free data the prior transitions can be labelled pessimistically or optimistically [2], the latter with an exploration bonus such as random network distillation [3]. Skill-based methods pretrain a library of temporally extended behaviours on the prior data and learn online a high-level policy over them [4], with skills taken from trajectory segments or from a Hilbert representation of the state space [5], and with empowerment measured from offline data as an intrinsic signal [6]. A further line keeps a pretrained generative policy and steers it through its latent noise [7].
Our starting point, the task's starter method, replays prior data labelled with the minimum reward in every batch, without any exploration bonus. We take the opposite position: everything learnable from the prior data is learned before the first online step, and the online budget is spent only on deciding which goal a frozen controller should be asked to reach.
Method
Our method, which we call SAFE (success-anchored frontier exploration), has three parts: an offline phase that pretrains a hierarchical goal-conditioned value function and policy on the prior trajectories; an online exploration phase that tours landmark states with that controller until the first success; and a bandit phase that chooses, from the outcomes of real episodes, which goal prompt to collect data with and which to deploy. No network parameter changes after the offline phase.
Offline: a hierarchical goal-conditioned controller
From the prior trajectories we build a goal-reaching problem by relabelling. For a sampled state , a value goal is the current state with probability , a later state of the same trajectory (at a geometric offset) with probability , and a random dataset state with probability . The reward and continuation mask are
so that behaves like a discounted number of steps needed to reach from .
The goal enters through a learned representation of dimension , an MLP on the concatenated state and goal, normalised to a fixed length. Two value heads take and and are trained by expectile regression against target heads (Polyak rate ):
The discount is when the episode horizon is at least 2000 steps and otherwise.
The policy is split in two. A low-level actor is trained by advantage-weighted regression towards a subgoal steps ahead in the same trajectory (clipped at the trajectory's end), with the advantage given by the value's one-step improvement towards that subgoal and the subgoal's representation held fixed, so the actor does not shape . A high-level actor predicts, for a goal drawn uniformly from the rest of the trajectory, the representation of the state steps ahead (or if is nearer), weighted by the value's improvement towards over those steps. Both weights are .
def value_loss(self, batch, grad_params):
next_v1_t, next_v2_t = self.network.select('target_value')(batch['next_observations'], batch['value_goals'])
next_v_t = jnp.minimum(next_v1_t, next_v2_t)
q = batch['rewards'] + self.config['discount'] * batch['masks'] * next_v_t
v1_t, v2_t = self.network.select('target_value')(batch['observations'], batch['value_goals'])
v_t = (v1_t + v2_t) / 2
adv = q - v_t
q1 = batch['rewards'] + self.config['discount'] * batch['masks'] * next_v1_t
q2 = batch['rewards'] + self.config['discount'] * batch['masks'] * next_v2_t
v1, v2 = self.network.select('value')(batch['observations'], batch['value_goals'], params=grad_params)
value_loss1 = self.expectile_loss(adv, q1 - v1, self.config['expectile']).mean()
value_loss2 = self.expectile_loss(adv, q2 - v2, self.config['expectile']).mean()
return value_loss1 + value_loss2
def low_actor_loss(self, batch, grad_params):
v1, v2 = self.network.select('value')(batch['observations'], batch['low_actor_goals'])
nv1, nv2 = self.network.select('value')(batch['next_observations'], batch['low_actor_goals'])
adv = (nv1 + nv2 - v1 - v2) / 2
exp_a = jnp.minimum(jnp.exp(adv * self.config['low_alpha']), 100.0)
goal_reps = self.network.select('goal_rep')(
jnp.concatenate([batch['observations'], batch['low_actor_goals']], axis=-1), params=grad_params)
if not self.config['low_actor_rep_grad']:
goal_reps = jax.lax.stop_gradient(goal_reps)
dist = self.network.select('low_actor')(batch['observations'], goal_reps, goal_encoded=True, params=grad_params)
return -(exp_a * dist.log_prob(batch['actions'])).mean()To act, the high-level actor's mode is renormalised to length and handed to the low-level actor, whose mean action is clipped to unit magnitude in each coordinate; everywhere online the policy is used deterministically (temperature ). The subgoal step defaults to the episode horizon divided by 20, clipped to ; a small table keyed on the environment identifier overrides that default for some environments. Pretraining runs for up to steps of batch 1024 and stops early if the wall clock runs short.
Online, before the first success: a tour of landmarks
Before anything is rewarded, we use the value function as a map. The landmark set starts as 256 states sampled from the prior data and can grow to 512. Up to four parallel environments each pursue one landmark at a time. With read as a negative time-to-go, an environment at state is assigned
where counts earlier failures to reach landmark , so the closest landmark that has not been visited, is not cooling down and is not taken by another environment wins (if none qualifies, the visited and cooldown conditions are dropped), and repeated failures push a landmark back by steps each. When every landmark has been visited, the visited flags are cleared and the tour starts over. The pursuit gets a time limit of steps, with the episode horizon.
def choose(obs, i):
reach = values(obs, landmark_obs)
unavailable = assigned | (cooldown > api.used) | (~valid)
if not visited[:landmark_count].all():
unavailable |= visited
else:
visited[:landmark_count] = False
score = reach - failures * subgoal_steps
score[unavailable] = -np.inf
if not np.isfinite(score).any():
score = reach - failures * subgoal_steps
score[assigned | (~valid)] = -np.inf
idx = int(np.argmax(score))
assigned[idx] = True
targets[i] = idx
target_goals[i] = landmark_obs[idx]
target_steps[i] = 0
target_settle[i] = -1
target_limits[i] = int(np.clip(-5.0 * reach[idx] + 50, 100, api.spec['horizon']))At every step each environment checks its progress. Once the value says the landmark is within half a subgoal, , the environment does not switch at once: it keeps executing for the value-implied remaining time before marking the landmark visited and moving on, which, in the docstring's words, is "so the frontier is actually reached". If the time limit runs out first, the landmark's failure count is incremented, it is put on a cooldown, and the state the environment has actually reached is added as a new landmark if it is more than steps (by the value) from every existing one. The frontier thus extends itself from the places where the controller got stuck.
if not discovered:
for i in np.flatnonzero(active):
if i in ended:
continue
idx = targets[i]
reach = values(obs[i], landmark_obs[idx:idx + 1])[0]
if target_settle[i] >= 0:
if target_steps[i] >= target_settle[i]:
visited[idx] = True
assigned[idx] = False
choose(obs[i], i)
elif reach > -0.5 * subgoal_steps:
remaining = int(np.clip(np.ceil(-reach), 1, subgoal_steps))
target_settle[i] = target_steps[i] + remaining
elif target_steps[i] >= target_limits[i]:
failures[idx] += 1
visited[idx] = TrueAt the first success: two anchors
The first time any environment succeeds, we keep two goal prompts: the landmark that environment was pursuing, and the observation returned at the successful step. The first is credited with one success in one trial. Every environment is switched immediately to one of the two anchors, and the second, the state where success was actually observed, is deployed at once.
new_discovery = -1
if not discovered and success.any():
new_discovery = int(np.flatnonzero(success)[0])
discovered = True
anchor_goals[0] = target_goals[new_discovery]
anchor_goals[1] = nobs[new_discovery]
arm_success[0], arm_trials[0] = 1.0, 1.0
arms[:] = np.arange(count) % 2
arms[new_discovery] = 0
target_goals[:] = anchor_goals[arms]
ship_goal(anchor_goals[1])
next_ship = ((api.used // 5000) + 1) * 5000
print('[hiql-safe] success discovered', api.used, flush=True)After the first success: a bandit over goal prompts
From then on each finished episode is a Bernoulli trial for the prompt it was run with. Each prompt keeps a success count and a trial count , and collection uses Thompson sampling from , after a forced phase in which the less-tried anchor is run until both have five trials. Once both anchors have at least ten trials, we add up to eight candidate prompts: the prior landmarks from the initial sample closest to the reached-state anchor in Euclidean distance, with each coordinate scaled by its standard deviation over that sample. All environments are reset and each starts on a candidate in turn. While any candidate has fewer than three trials, each new episode runs, with probability one half, the least-tried candidate, and otherwise a Thompson draw between the anchors; after that, one Thompson draw covers every prompt.
if discovered and not candidate_mode and arm_trials[:2].min() >= 10:
candidate_mode = True
scale = np.maximum(initial_goals.std(axis=0), 1e-3)
distances = (((initial_goals - anchor_goals[1]) / scale) ** 2).sum(axis=1)
k = min(8, len(initial_goals))
nearest = np.argsort(distances)[:k]
anchor_goals[2:2 + k] = initial_goals[nearest]
n_arms = 2 + k
fresh = env.reset()
obs = np.stack([fresh[i] for i in range(count)]).astype(np.float32)
for i in range(count):
arms[i] = 2 + i % k
target_goals[i] = anchor_goals[arms[i]]
next_ship = api.used + 5000
print('[hiql-safe] testing local prior prompts', api.used, nearest.tolist(), flush=True)Deployment is more conservative than collection. Every 5000 environment steps, and at the end, we deploy the prompt with the highest posterior mean among the mature ones. A candidate is mature after at least five trials with at least one success; an anchor needs only five trials. Before the anchors have five trials each, the reached-state anchor is deployed.
def posterior_best():
if candidate_mode:
mature = (arm_trials[:n_arms] >= 5) & (arm_success[:n_arms] > 0)
mature[:2] = arm_trials[:2] >= 5
scores = (arm_success[:n_arms] + 1.0) / (arm_trials[:n_arms] + 2.0)
return int(np.argmax(np.where(mature, scores, -np.inf)))
if arm_trials[:2].min() < 5:
return 1
return int(np.argmax((arm_success[:2] + 1.0) / (arm_trials[:2] + 2.0)))
def sample_arm():
if candidate_mode:
if arm_trials[2:n_arms].min() < 3:
if gen.random() < 0.5:
draws = gen.beta(arm_success[:2] + 1.0, arm_trials[:2] - arm_success[:2] + 1.0)
return int(np.argmax(draws))
return 2 + int(np.argmin(arm_trials[2:n_arms]))
draws = gen.beta(arm_success[:n_arms] + 1.0,
arm_trials[:n_arms] - arm_success[:n_arms] + 1.0)
return int(np.argmax(draws))
if arm_trials[:2].min() < 5:
return int(np.argmin(arm_trials[:2]))
draws = gen.beta(arm_success[:2] + 1.0, arm_trials[:2] - arm_success[:2] + 1.0)
return int(np.argmax(draws))Until the first success, the deployed policy is the exploration controller itself, with goals taken evenly from the landmark list; it is deployed at the start and, if no success is ever found, again at the end. The online reward never enters a gradient. What the online phase optimises is the goal handed to the frozen long-horizon controller; the docstring puts it as online outcomes directly optimising "the goal representation used by the frozen long-horizon controller".
Results
| Method | ① | ② | ③ |
|---|---|---|---|
| Success AUC ↑ | Success AUC ↑ | Success AUC ↑ | |
| RLPD | 0 | 0.004 | 0 |
| RND | 0 | 0 | 0 |
| ExPLORe | 0 | 0.037 | 0 |
| Online with trajectory skills | 0.076 | 0.007 | 0.022 |
| HILP | 0.002 | 0.353 | 0.346 |
| SUPE | 0.691 | 0.254 | 0.329 |
| SUPE + HILP | 0.002 | 0.454 | 0.669 |
| SUPE + empowerment | 0.780 | 0.209 | 0.127 |
| DSRL | 0.011 | 0.022 | 0.789 |
- ① Humanoid maze · medium navigation
- ② Ant soccer · arena exploration
- ③ Manipulation scene · multi-stage task
For orientation only, the published baselines spread widely. The strongest is SUPE + empowerment [6] on HMaze-med (0.780), SUPE with HILP skills [5] on AntSoccer (0.454) and DSRL [7] on Scene (0.789), so no single published method leads everywhere. The starter's method, minimum-reward prior data replayed without an exploration bonus, reaches 0.000 on HMaze-med, 0.004 on AntSoccer and 0.000 on Scene.
How we got here
What follows is limited to what the submitted code and its docstring state.
- The starter was replaced, not extended. The starter file is a port of online learning with minimum-reward prior data, an online method that replays offline data [1] with the minimum-reward labelling used as a comparison for accelerated exploration [2]. None of it survives in the submission: there is no replay of prior transitions, no online critic and no reward model. The submission is a self-contained hierarchical goal-conditioned learner built on the importable dataset and training-state utilities, rather than on the library's skill-pretraining code.
- The controller is frozen by design. The docstring names the controller "frozen", and the code has no online update of any network. The choice to put all learning offline and to let online outcomes act only through goal selection is stated, not argued, in the code.
- The settling rule is explained in the docstring: on entering a landmark's learned neighbourhood the agent keeps going for the value-implied time-to-go "so the frontier is actually reached", rather than rotating to the next landmark at the edge of the neighbourhood.
- Two anchors rather than one are kept at the first success, the goal whose execution found it and the state actually reached, and the docstring states that only candidates with at least five trials and a measured success are deployed.
- The configuration carries unused fields. It has fields the code never reads (a dataset-class name, augmentation and frame-stacking options, an encoder slot). Beyond that, we cannot say from the code where it was taken from or what was changed along the way.
Limitations
- No online learning at all. The pretrained controller is never fine-tuned. If it cannot reach the rewarded state reliably from the task's initial states, no choice of goal prompt fixes that, and success can be no higher than the best prompt allows the frozen controller to achieve.
- Everything waits on a first success. Until the landmark tour happens to trigger the success condition, the deployed policy is the exploration controller, deployed once at the start and not refreshed, which has no reason to solve the task. Exploration is deterministic and directed only by goal choice, so whether the tour reaches the rewarded region depends on the landmark sample and on the value function's accuracy as a time-to-go.
- The value is read as a step count without calibration. The arrival test, the settling time, the time limit and the novelty test for new landmarks all treat as a number of steps; with discounting and approximation error this is only roughly true, and the constants around it (, a factor of 5 plus 50, ) are set by hand.
- The candidate prompts are a narrow set. They are drawn only from the initial prior sample, by a standardised Euclidean distance in raw observation space, not from landmarks added online and not by the learned value.
- Trial attribution is approximate. At the first success, episodes still running are switched to an anchor mid-episode and later counted as full trials for it; the switch to candidate prompts resets every environment and discards the episodes in progress.
- Some constants depend on the environment. The subgoal step has a table keyed on the environment identifier, so the method is not the same algorithm on every environment.
References
- Philip J. Ball, Laura Smith, Ilya Kostrikov et al. (2023). Efficient Online Reinforcement Learning with Offline Data. ICML.
- Qiyang Li, Jason Zhang, Dibya Ghosh et al. (2023). Accelerating Exploration with Unlabeled Prior Data. NeurIPS.
- Yuri Burda, Harrison Edwards, Amos Storkey et al. (2019). Exploration by Random Network Distillation. ICLR.
- Max Wilcoxson, Qiyang Li, Kevin Frans et al. (2025). Leveraging Skills from Unlabeled Prior Data for Efficient Online Exploration. ICML.
- Seohong Park, Tobias Kreiman, Sergey Levine (2024). Foundation Policies with Hilbert Representations. ICML.
- Ishir Garg, Vivek Myers, Qiyang Li et al. (2026). Measuring Empowerment from Offline Data for Intrinsically Motivated Exploration.
- Andrew Wagenmaker, Mitsuhiko Nakamoto, Yunchu Zhang et al. (2025). Steering Your Diffusion Policy with Latent Space Reinforcement Learning. CoRL.