betaFeedback

WorksComputer Science

Hyperspherical Contrastive Representations Unlock Planning and Exploration

Abstract

We develop a self-supervised reinforcement learning algorithm that learns to build towers of up to eight cubes from scratch, without prior data, rewards, demonstrations, or pretrained models. Our method, Contrastive Planning via Spherical Linear Interpolation (C-Slerp), uses contrastive representations as reusable building blocks and repeatedly composes them to infer a sequence of intermediate waypoints. Under our hyperspherical parameterization, the learned representations allow intermediate waypoints to be inferred in closed form through spherical linear interpolation, without training a separate high-level policy or performing graph search. Importantly, the representation geometry also tells us how to adjust the number of waypoints based on the difficulty of each goal-reaching problem. Experiments show that our method succeeds on long-horizon navigation and robotic manipulation tasks, including settings where strong baselines fail to achieve a single success. Ablations further show that using a fixed number of waypoints substantially degrades performance, highlighting the importance of adapting the plan to task difficulty.

Project page: https://jonghaepark.github.io/c-slerp

Figure 1. Our paper studies long-horizon, sparse-reward tasks, including eight-cube stacking. Given only the current and goal states, the agent aims to manipulate the eight cubes into the goal state without receiving any external reward along the way. Strong exploration methods ([21, 4]) fail to discover a single successful state in one billion environment steps.

Introduction

Consider a robot asked either to place a single cube or to build an eight-cube tower. The former can be solved directly, whereas the latter may benefit from a plan with several intermediate stages. Too many stages needlessly complicate the single-cube task, while too few would leave the tower-building task too difficult to solve. The number of planning stages should therefore match the difficulty of the problem.

In goal-conditioned reinforcement learning ([12]), these stages can be defined by subgoals, or waypoints, that divide long-horizon tasks into shorter subproblems. However, existing hierarchical approaches often use a fixed number of waypoints ([19, 31]) or generate waypoints that are a fixed number of steps into the future ([17, 20]), rather than explicitly selecting how many stages to plan for each problem.

A natural way to plan over arbitrary distances is to define a reusable component and compose it as many times as needed. Contrastive reinforcement learning (CRL) [7] offers a promising foundation for this approach. CRL learns contrastive representations that encode temporal relationships between states under a single geometric distribution, providing natural building blocks for multi-stage planning. While these representations are primarily used to train goal-conditioned policies, we ask whether they can also be leveraged to infer an adaptive number of waypoints.

To this end, we introduce Contrastive Planning via Spherical Linear Interpolation (C-Slerp), a hierarchical approach where a high-level planner provides waypoints for a low-level policy to follow. Our main idea is to make this hierarchy adaptive by using contrastive representations as building blocks for each stage of a plan. By repeatedly composing these building blocks, we can score how well the state and goal are connected through different numbers of stages. Using these scores, we select an appropriate number of stages and infer the corresponding intermediate waypoints.

A key advantage of our contrastive representations is that their spherical geometry enables intermediate waypoints to be inferred in closed form without training a separate high-level policy or performing graph search. Specifically, our high-level policy introduces no additional network parameters — it simply performs spherical linear interpolation in the learned representation space.

In this paper, we show how choosing the correct amount of planning can unlock new capabilities for reinforcement learning. We evaluate our approach on long-horizon navigation and robotic manipulation tasks, including settings in which strong exploration methods never achieve a single success in one billion environment steps (Figure 1, Appendix § 10). Notably, our method successfully solves challenging benchmark tasks without a goal curriculum or explicit dense rewards, even where all baselines fail completely. Our ablations further show that hierarchy alone is insufficient: fixing the number of planning stages substantially degrades performance. Together, these results suggest that a key benefit of hierarchy for goal-reaching may lie in selecting an appropriate amount of planning for each problem rather than in making the policy more expressive.

Related Work

Hierarchical goal-conditioned reinforcement learning. Goal-conditioned reinforcement learning (GCRL) trains a single policy to reach diverse goals [23, 1]. Despite recent progress, reaching temporally distant goals remains a challenging problem. Hierarchical approaches [24, 13] address this challenge by decomposing long-horizon tasks into shorter subproblems. Existing methods learn high-level policies that generate subgoals for low-level controllers [17, 32, 20] or infer waypoints to guide policy learning or exploration [5, 31]. However, many of these approaches use a fixed number of waypoints or a fixed temporal horizon for subgoals, rather than explicitly selecting how many waypoints to plan for each state-goal pair. Graph-based methods offer an alternative by searching over observed states or learned landmarks to construct waypoint sequences [6, 30]. Although these methods generate a variable number of waypoints, they require additional computation for graph construction and depend on the coverage of states included in the graph.

Understanding the benefits of hierarchy. Prior work shows that hierarchy can improve exploration through temporally extended behavior [18] and improve statistical and computational efficiency by reusing solutions to repeated subproblems [27]. For policy learning, HIQL [20] shows that hierarchy provides clearer policy-learning signals, reducing sensitivity to value estimation errors. Further, SAW [33] brings the benefits of hierarchy to flat policies through bootstrapping, without a separate subgoal generator. These findings suggest that the benefits of hierarchy are closely tied to how it structures exploration and policy learning, rather than simply to the expressivity gained from a hierarchical policy structure.

Contrastive representations for goal-reaching. Contrastive reinforcement learning (CRL) [7] learns representations for goal-reaching in a self-supervised manner, without externally specified rewards. It formulates goal-conditioned RL as a contrastive learning problem, jointly learning policies and representations that encode temporal relationships between states. Subsequent work shows that CRL exhibits strong exploration capabilities even when data collection is directed toward a single fixed goal [14, 2], and that increasing the depth of actor and critic networks further improves its goal-reaching performance [25]. Despite these advances, it remains unclear whether exploration capability and network scaling alone are sufficient for CRL to solve substantially longer-horizon tasks. Beyond policy learning, Eysenbach et al. [8] derive closed-form distributions over waypoint representations using contrastive learning. However, their method learns representations from offline data without policy learning and requires a predefined number of waypoints, rather than adapting it to task difficulty.

Our method, C-Slerp, jointly learns contrastive representations and a goal-conditioned policy online. Using the learned representations, it adapts the number of waypoints to each state-goal pair and infers their representations in closed form, without a separate high-level policy or graph search. This allows us to examine how adapting the number of planning stages contributes to the benefits of hierarchy in long-horizon tasks.

Preliminaries

We focus on fully online RL without offline data, where the replay buffer is continually updated during policy training and the critic is trained with a self-supervised objective without external rewards.

Goal-conditioned reinforcement learning (GCRL). We consider a goal-conditioned Markov decision process Mg=(S,A,p,p0,γ,pg,rg)\mathcal{M}_g = (\mathcal{S}, \mathcal{A}, p, p_0, \gamma, p_g, r_g), where S\mathcal{S} and A\mathcal{A} denote the state and action spaces, p:S×A→Δ(S)p : \mathcal{S} \times\mathcal{A} \to\Delta(\mathcal{S}) is the transition kernel, p0∈Δ(S)p_0 \in\Delta(\mathcal{S}) is the initial-state distribution, and γ∈[0,1)\gamma\in[0, 1) is the discount factor. A goal gg is sampled from the distribution pg∈Δ(G)p_g \in\Delta(\mathcal{G}) over the goal space G\mathcal{G}, and a goal-conditioned policy π:S×G→Δ(A)\pi: \mathcal{S} \times\mathcal{G} \to\Delta(\mathcal{A}) selects an action a∼π(⋅∣s,g)a \sim\pi(\cdot\mid s, g) conditioned on the current state ss and desired goal gg. For the analysis, we define the goal-reaching reward as rg(st,at)≜(1−γ)p(st+1=g∣st,at)r_g(s_t, a_t) \triangleq(1-\gamma)p(s_{t+1}=g \mid s_t,a_t), and the corresponding Q-function is

Qgπ(s,a)≜Eπ(⋅∣⋅,g)[∑t′=t∞γt′−trg(st′,at′)∣st=s,at=a].(1)Q_g^\pi(s,a) \triangleq\mathbb{E}_{\pi(\cdot\mid\cdot,g)}\left[\sum_{t'=t}^{\infty}\gamma^{t'-t}r_g(s_{t'},a_{t'})\mid s_t=s,a_t=a\right]. \tag*{(1)}

Prior work [7] has shown that this Q-function can equivalently be expressed as the probability of reaching the goal under the discounted state occupancy measure: Qgπ(s,a)=pπ(⋅∣⋅,g)γ(s+=g∣s,a)Q_g^\pi(s,a)=p_{\pi(\cdot\mid\cdot,g)}^\gamma(s_+=g\mid s,a). Here, pπ(⋅∣⋅,g)γ(s+=g∣s,a)p_{\pi(\cdot\mid\cdot,g)}^\gamma(s_+=g\mid s,a) denotes the probability of reaching gg from (s,a)(s,a) at a temporal offset drawn from GEOM⁡(1−γ)\operatorname{GEOM}(1-\gamma) under the goal-conditioned policy π(⋅∣⋅,g)\pi(\cdot\mid\cdot,g).2

Contrastive reinforcement learning (CRL). Instead of relying on Bellman backups, CRL [7] learns a critic for the goal-conditioned Q-function Qgπ(s,a)Q_g^\pi(s,a) in a self-supervised manner. Given a batch B={(si,ai,gi)}i=1B\mathcal{B}=\{(s_i,a_i,g_i)\}_{i=1}^{B}, where the goal gig_i corresponds to the state Δi\Delta_i steps after sis_i and Δi∼GEOM⁡(1−γ)\Delta_i\sim\operatorname{GEOM}(1-\gamma), the critic fϕ,ψ(s,a,g)f_{\phi,\psi}(s,a,g) is trained using the InfoNCE objective

Lbackward(ϕ,ψ;B)=−1B∑i=1Blog⁡exp⁡(fϕ,ψ(si,ai,gi))∑j=1Bexp⁡(fϕ,ψ(sj,aj,gi)).(2)\mathcal{L}^{\mathit{backward}}(\phi,\psi;\mathcal{B})=-\frac{1}{B}\sum_{i=1}^{B}\log\frac{\exp(f_{\phi,\psi}(s_i,a_i,g_i))}{\sum_{j=1}^{B}\exp(f_{\phi,\psi}(s_j,a_j,g_i))}. \tag*{(2)}

Under the backward InfoNCE objective in Eq. (2), the Bayes-optimal critic can be expressed as

f∗(s,a,g)=log⁡pπγ(s+=g∣s,a)pπγ(g)C(g).(3)f^*(s,a,g)=\log\frac{p_\pi^\gamma(s_+=g\mid s,a)}{p_\pi^\gamma(g)C(g)}. \tag*{(3)}

where pπγ(g)p_\pi^\gamma(g) is the future-state marginal and C(g)>0C(g)>0 is a normalization term that depends only on the future state gg. Since the denominator is independent of the action, maximizing the critic f∗(s,a,g)f^*(s,a,g) over actions is equivalent to maximizing the discounted occupancy pπγ(s+=g∣s,a)p_\pi^\gamma(s_+=g\mid s,a). The policy πθ(a∣s,g)\pi_\theta(a\mid s,g) is therefore trained by maximizing the critic:

max⁡θ Es∼pD, g∼pDγ(⋅∣s)[fϕ,ψ(s,a,g)]a∼πθ(⋅∣s,g).(4)\max_\theta\ \mathbb{E}_{s\sim p_{\mathcal{D}},\,g\sim p_{\mathcal{D}}^\gamma(\cdot\mid s)}\left[f_{\phi,\psi}(s,a,g)\right]_{a\sim\pi_\theta(\cdot\mid s,g)}. \tag*{(4)}

where pDp_{\mathcal{D}} denotes the state distribution of the replay buffer and pDγ(⋅∣s)p_{\mathcal{D}}^\gamma(\cdot\mid s) the distribution of future goals from ss in the replay buffer, with temporal offsets drawn from GEOM⁡(1−γ)\operatorname{GEOM}(1-\gamma).

Hyperspherical Contrastive Representations for Planning

In this section, we look at planning a sequence of intermediate waypoints between a current state and a goal. We approach this as an inference problem and show how the waypoints can be obtained in closed form by repeatedly composing contrastive representations. We then extend this approach to planning over a variable number of waypoints, deriving a principled criterion for selecting an appropriate number of waypoints for each state-goal pair using the same learned representations.

Problem Formulation

Setup. We collect data online under a hierarchical goal-conditioned policy π^\hat{\pi} that combines a high-level planner with a policy πθ\pi_\theta. Every hh environment steps, the planner provides a waypoint representation zz as a subgoal to reach the final goal, and the policy πθ(a∣s,z)\pi_\theta(a \mid s,z) pursues it for the next hh steps. We alternate between collecting data under π^\hat{\pi} and updating the representations and policy.

We take a probabilistic approach to planning. Given a state ss and goal gg, we infer KK intermediate waypoints w1:K=(w1,…,wK)w_{1:K} = (w_1,\ldots,w_K) along trajectories generated by π^\hat{\pi} with goals drawn from pgp_g. For notational consistency, we set w0=sw_0 = s and wK+1=gw_{K+1} = g. We assume that consecutive waypoints wiw_i and wi+1w_{i+1} are separated by an interval Ti∼GEOM⁡(1−γ)T_i \sim\operatorname{GEOM}(1-\gamma), drawn independently for i=0,…,Ki = 0,\ldots,K.

Objective. Let pπ^γ,K(w1:K∣s,g)p_{\hat{\pi}}^{\gamma,K}(w_{1:K} \mid s,g) denote the distribution over KK intermediate waypoints given ss and gg under the data-generating process described above. We approximate this posterior with a tractable distribution q(w1:K∣s,g)q(w_{1:K} \mid s,g) by minimizing the following KL divergence:

q⋆=arg⁡min⁡q  DKL(q(⋅∣s,g)∥pπ^γ,K(⋅∣s,g)).(5)q^\star= \underset{q}{\arg\min}\; D_{\mathrm{KL}}\left(q(\cdot\mid s,g)\mathbin{\|}p_{\hat{\pi}}^{\gamma,K}(\cdot\mid s,g)\right). \tag*{(5)}

For now, we fix KK and derive the corresponding optimal waypoints. We then derive a criterion for adaptively selecting KK for each state-goal pair.

Hyperspherical Contrastive Representations

To make the planning objective in Eq. (5) tractable, we parameterize temporal relationships using contrastive representations that lie on the unit hypersphere Sd−1\mathbb{S}^{d-1}. Our approach learns a state-only representation ψ(s)∈Sd−1\psi(s) \in\mathbb{S}^{d-1}, a state-action representation ϕ(s,a)∈Sd−1\phi(s,a) \in\mathbb{S}^{d-1}, a rotation matrix RR, and a policy πθ(a∣s,z)\pi_\theta(a \mid s,z), where z∈Sd−1z \in\mathbb{S}^{d-1} is a representation of a goal. We use these representations to infer intermediate waypoints for the policy πθ\pi_\theta to pursue.

Parameterization. We use fH(s,s+)f_H(s,s^+) to score temporal relationships between states and fL(s,a,s+)f_L(s,a,s^+) to score future states given a current state-action pair. To infer consecutive waypoints in a common latent space, fHf_H uses the same encoder ψ\psi for both inputs. Following the inner-product form used in CRL, we could score state pairs using fH(u,v)=ψ(u)Tψ(v)f_H(u,v) = \psi(u)^\mathsf{T}\psi(v). However, since this inner product is symmetric in uu and vv, it cannot capture asymmetries in the dynamics. We thus introduce a learnable rotation matrix RR to model these asymmetries while preserving the hyperspherical geometry. Specifically, we parameterize fHf_H and fLf_L as

fH(s,s+)=ψ(s)TRψ(s+),fL(s,a,s+)=ϕ(s,a)Tψ(s+),(6)f_H(s,s^+) = \psi(s)^\mathsf{T}R\psi(s^+), \qquad f_L(s,a,s^+) = \phi(s,a)^\mathsf{T}\psi(s^+), \tag*{(6)}

where R∈Rd×dR \in\mathbb{R}^{d \times d} satisfies RTR=IR^\mathsf{T}R = I. This allows us to score an entire waypoint sequence by repeatedly applying a single fHf_H to consecutive waypoint pairs. For fLf_L, we follow the standard CRL parameterization and train the policy to maximize fL(s,a,s+)=ϕ(s,a)Tψ(s+)f_L(s,a,s^+) = \phi(s,a)^\mathsf{T}\psi(s^+) as in Eq. (4). The corresponding learning objectives are described in § 4.5.

Closed-Form Waypoint Inference

Key assumptions. Our derivation relies on the following assumptions, with theoretical justification based on prior work [26, 8] provided in Appendix § 8.§ 1:

Assumption 1 (Bayes optimality). The learned fHf_H under the symmetric InfoNCE objective has the following Bayes-optimal form:

fH(u,v)=log⁡pπγ(u+=v∣u)pπγ(v)C,(7)f_H(u,v)=\log\frac{p_{\pi}^{\gamma}(u^+=v\mid u)}{p_{\pi}^{\gamma}(v)C}, \tag*{(7)}

where π\pi is the data-collection policy and C>0C>0 is a constant independent of uu and vv.

Assumption 2 (Uniformity). The marginal distribution over the representations learned for fHf_H under the symmetric InfoNCE objective is uniform on the unit hypersphere Sd−1\mathbb{S}^{d-1}:

pπγ(ψ)≜∫pπγ(v) δ(ψ−ψ(v)) dv=Unif⁡(Sd−1).(8)p_{\pi}^{\gamma}(\psi)\triangleq\int p_{\pi}^{\gamma}(v)\,\delta(\psi-\psi(v))\,dv=\operatorname{Unif}(\mathbb{S}^{d-1}). \tag*{(8)}

Tractable reformulation. To obtain a tractable objective, we reformulate Eq. (5) in terms of the learned representations. We first factorize qq as q(w1:K∣s,g)=∏i=1Kqi(wi∣s,g)q(w_{1:K}\mid s,g)=\prod_{i=1}^{K}q_i(w_i\mid s,g), with one distribution qiq_i per waypoint wiw_i. This allows us to optimize qq for different KK within the same formulation below. Under Assumption 1 and the Markov assumption, the objective can be equivalently written as follows, with the derivation provided in Appendix § 8.§ 2:

q⋆=arg⁡min⁡qDKL(q(⋅∣s,g)∥pπγ,K(⋅∣s,g))=arg⁡max⁡Ew1:K∼q(⋅∣s,g)[∑i=0KfH(wi,wi+1)]−∑i=1KDKL(qi(⋅∣s,g)∥pπγ(⋅))(9)\begin{aligned} q^\star=\arg\min_q D_{\mathrm{KL}}\left(q(\cdot\mid s,g)\mathrel{\|}p_{\pi}^{\gamma,K}(\cdot\mid s,g)\right) \\ &=\arg\max\mathbb{E}_{w_{1:K}\sim q(\cdot\mid s,g)} \left[\sum_{i=0}^{K}f_H(w_i,w_{i+1})\right] -\sum_{i=1}^{K}D_{\mathrm{KL}}\left(q_i(\cdot\mid s,g)\mathrel{\|}p_{\pi}^{\gamma}(\cdot)\right) \tag*{(9)} \end{aligned}

This reformulation provides a natural interpretation of our objective in Eq. (5): it maximizes the expected sum of fHf_H, which scores temporal relationships between waypoints, while encouraging each waypoint distribution qiq_i to remain close to the marginal distribution of states visited under π^\hat{\pi}.

However, inferring waypoints directly in the high-dimensional state space is computationally challenging. Since the policy πθ(a∣s,z)\pi_{\theta}(a\mid s,z) depends on the waypoint ww only through its representation z=ψ(w)z=\psi(w), inferring its representation is sufficient to provide a subgoal to the policy. We therefore infer distributions qi(zi∣s,g)q_i(z_i\mid s,g) over representations zi=ψ(wi)z_i=\psi(w_i) rather than the raw states wiw_i. Assumption 2 and the parameterization of fHf_H then yield the tractable objective J(q)\mathcal{J}(q) to maximize:

J(q)=Ez1:K∼q(⋅∣s,g)[ψ(s)⊤Rz1+∑i=2Kzi−1⊤Rzi+zK⊤Rψ(g)]+∑i=1KH(qi(⋅∣s,g)),(10)\mathcal{J}(q)=\mathbb{E}_{z_{1:K}\sim q(\cdot\mid s,g)} \left[\psi(s)^{\top}Rz_1+\sum_{i=2}^{K}z_{i-1}^{\top}Rz_i+z_K^{\top}R\psi(g)\right] +\sum_{i=1}^{K}\mathcal{H}(q_i(\cdot\mid s,g)), \tag*{(10)}

where H\mathcal{H} denotes entropy. This objective links the current state ss to the goal gg by repeatedly aligning consecutive representations ziz_i through the rotation matrix RR, while the entropy term encourages stochasticity in the sequence of representations. The full derivation is provided in Appendix § 8.§ 2.

Closed-form solution. To model the stochasticity encouraged by J(q)\mathcal{J}(q), we parameterize each qi(⋅∣s,g)q_i(\cdot\mid s,g) as the distribution of a Gaussian sample normalized onto the unit hypersphere:

z~i∼N(μi(s,g),σi2(s,g)I),zi=z~i∥z~i∥2∼qi(⋅∣s,g),\tilde{z}_i\sim\mathcal{N}\left(\mu_i(s,g),\sigma_i^2(s,g)I\right),\qquad z_i=\frac{\tilde{z}_i}{\left\|\tilde{z}_i\right\|_2}\sim q_i(\cdot\mid s,g),

with ∥μi(s,g)∥2=1\left\|\mu_i(s,g)\right\|_2=1. As in SAC ([11]), we weight the entropy term in Eq. (10) by α>0\alpha>0 to control stochasticity, with α=1\alpha=1 recovering the original objective. Under a small-variance approximation, we obtain the following optimal solution for maximizing J(q)\mathcal{J}(q):

μi⋆(s,g)=(R⊤)islerp⁡(ψ(s),RK+1ψ(g),iK+1),σi⋆2(s,g)=α2cos⁡(θK+1),\begin{aligned} \mu_i^\star(s,g)&=(R^{\top})^i\operatorname{slerp}\left(\psi(s),R^{K+1}\psi(g),\frac{i}{K+1}\right),\\ \sigma_i^{\star2}(s,g)&=\frac{\alpha}{2\cos\left(\frac{\theta}{K+1}\right)}, \end{aligned}

for i=1,…,Ki=1,\ldots,K, {#eq:11}

where θ=arccos⁡(ψ(s)⊤RK+1ψ(g))\theta=\arccos\left(\psi(s)^{\top}R^{K+1}\psi(g)\right) and slerp denotes spherical linear interpolation. The derivation is provided in Appendix § 8.§ 3.

When R=IR=I, the solution places all means μi\mu_i evenly along the geodesic between ψ(s)\psi(s) and ψ(g)\psi(g) on the unit hypersphere. In contrast, our method accounts for temporal transitions encoded in RR by interpolating from ψ(s)\psi(s) toward the rotated goal RK+1ψ(g)R^{K+1}\psi(g) and mapping each interpolated point back using (R⊤)i(R^{\top})^i (see Figure 2 for a geometric interpretation). Importantly, these closed-form expressions allow us to infer distributions over waypoint representations directly from the learned contrastive representations without training an additional neural network.

Figure 2. Geometric interpretation of C-Slerp. The number of waypoints KK is selected using the alignment between (R⊤)k+1ψ(s)(R^{\top})^{k+1}\psi(s) and ψ(g)\psi(g). Given the selected KK, waypoint mean directions are obtained by spherical interpolation from ψ(s)\psi(s) to RK+1ψ(g)R^{K+1}\psi(g), followed by mapping back via (R⊤)i(R^{\top})^i. The policy then pursues the furthest waypoint whose alignment with ϕ(s,a)\phi(s,a) meets the threshold ϵ\epsilon.

How Many Waypoints Are Needed for Each State-Goal Pair?

Since the closed-form solution in Eq. (11) applies to any number of waypoints KK, we now consider how to select KK for each state-goal pair. Recall that fH(s,g)f_H(s,g) measures alignment between R⊤ψ(s)R^{\top}\psi(s) and ψ(g)\psi(g) to score a single geometric transition from ss to gg. Extending this to K+1K+1 geometric transitions, we define the following alignment score between (R⊤)K+1ψ(s)(R^{\top})^{K+1}\psi(s) and ψ(g)\psi(g):

ℓK(s,g)≜((R⊤)K+1ψ(s))⊤ψ(g)=ψ(s)⊤RK+1ψ(g).(11)\ell_K(s,g) \triangleq\left((R^{\top})^{K+1}\psi(s)\right)^{\top}\psi(g)=\psi(s)^{\top}R^{K+1}\psi(g). \tag*{(11)}

This score measures how well the goal representation aligns with the direction predicted from the current state after K+1K+1 geometric transitions under π^\hat{\pi}. A larger score indicates that the corresponding number of waypoints is more compatible with the state-goal pair. To infer KK probabilistically, we model ψ(g)\psi(g) with a von Mises–Fisher likelihood centered on the predicted direction (R⊤)K+1ψ(s)(R^{\top})^{K+1}\psi(s):

p(ψ(g)∣ψ(s),K)≜Cd(κ)exp⁡(κℓK(s,g)),(12)p(\psi(g)\mid\psi(s),K)\triangleq C_d(\kappa)\exp\left(\kappa\ell_K(s,g)\right), \tag*{(12)}

where κ>0\kappa>0 is the concentration parameter and Cd(κ)C_d(\kappa) is the normalizing constant. With a uniform prior over K∈{0,…,Kmax⁡}K\in\{0,\ldots,K_{\max}\}, Bayes’ rule yields

p(K∣ψ(s),ψ(g))=Softmax⁡K∈{0,…,Kmax⁡}(ℓK(s,g)η),(13)p(K\mid\psi(s),\psi(g))=\operatorname{Softmax}_{K\in\{0,\ldots,K_{\max}\}}\left(\frac{\ell_K(s,g)}{\eta}\right), \tag*{(13)}

where η=1/κ\eta=1/\kappa controls the sharpness of the distribution over KK. This allows us to infer the number of waypoints for each state-goal pair using only the learned contrastive representations. The theoretical justification for the alignment score ℓK\ell_K and the full derivation are provided in Appendix § 8.§ 4.

Which waypoint should the policy pursue? After selecting KK, we can sample waypoint representations z1:Kz_{1:K} from the closed-form distributions in Eq. (11). The remaining question is which waypoint representation ziz_i to provide to the policy, given its current goal-reaching capabilities.

Our learned fL(s,a,g)=ϕ(s,a)⊤ψ(g)f_L(s,a,g)=\phi(s,a)^{\top}\psi(g) provides a natural proxy for the goal-reaching capability of the current policy, based on its probabilistic interpretation in Eq. (3). Since ziz_i lies in the same space as ψ(g)\psi(g), we use its alignment with ϕ(s,a)\phi(s,a) to assess how likely the policy is to reach it. For each candidate ziz_i, including zK+1=ψ(g)z_{K+1}=\psi(g), we sample ai∼πθ(⋅∣s,zi)a_i\sim\pi_\theta(\cdot\mid s,z_i) and compute ρi=ϕ(s,ai)⊤zi\rho_i=\phi(s,a_i)^{\top}z_i. We select the waypoint with the largest index whose score meets a threshold ϵ∈[−1,1]\epsilon\in[-1,1]:

i∗=max⁡{i∈{1,…,K+1}:ρi≥ϵ}.(14)i^*=\max\{i\in\{1,\ldots,K+1\}:\rho_i\ge\epsilon\}. \tag*{(14)}

If no candidate meets the threshold, we set i∗=1i^*=1. This allows the policy πθ(a∣s,zi∗)\pi_\theta(a\mid s,z_{i^*}) to make progress toward the goal by pursuing the furthest waypoint estimated to be reachable, avoiding overly conservative subgoals. We provide a geometric interpretation of selecting KK and i∗i^* in Figure 2 and visualizations of the ρi\rho_i values in Figure 17.

Visualization of waypoint representations in maze environments

Figure 17. (c) Ant Extreme Maze. Visualization of waypoint representations in maze environments. We visualize the inferred latent waypoints z1:Kz_{1:K} and the corresponding score heatmaps. For each environment, the top row shows the (x,y)(x,y) positions corresponding to the inferred latent waypoints, where 🔵 denotes a candidate waypoint ziz_i, 🔴 highlights the selected waypoint zi∗z_i^*, and 🔵 represents the goal. The bottom row shows heatmaps of fL(s,a,s′)=ϕ(s,a)Tψ(s′)f_L(s,a,s') = \phi(s,a)^\mathsf{T}\psi(s'), with the current state marked by ⚫ and the goal indicated by ⭐.

Learning Objectives and Algorithm

Representation learning. To learn the representations used for planning, we sample a batch B={(si,ai,si+)}i=1B\mathcal{B}=\{(s_i,a_i,s_i^+)\}_{i=1}^{B} from the replay buffer, with the temporal interval between sis_i and si+s_i^+ drawn from Geom⁡(1−γ)\operatorname{Geom}(1-\gamma). Using this batch, we train fLf_L with the backward InfoNCE objective in Eq. (2) and fHf_H with the symmetric InfoNCE objective defined in Eq. (18). The total representation loss is

Lrepr=EB[Lbackward(ϕ,ψ;B)+λreprLsymmetric(R,ψ;B)],(15)\mathcal{L}_{\mathrm{repr}}=\mathbb{E}_{\mathcal{B}}\left[\mathcal{L}^{\mathrm{backward}}(\phi,\psi;\mathcal{B})+\lambda_{\mathrm{repr}}\mathcal{L}^{\mathrm{symmetric}}(R,\psi;\mathcal{B})\right], \tag*{(15)}

where the expectation is over batches B\mathcal{B} sampled as described above.

Policy learning. Following CRL, we train the policy πθ\pi_\theta to maximize fL(s,a,g)=ϕ(s,a)⊤ψ(g)f_L(s,a,g)=\phi(s,a)^\top\psi(g):

max⁡θ Es∼pD, g∼pD(⋅∣s), a∼πθ(⋅∣s,ψ(g))[ϕ(s,a)⊤ψ(g)].(16)\max_{\theta}\ \mathbb{E}_{s\sim p_D,\ g\sim p_D(\cdot\mid s),\ a\sim\pi_\theta(\cdot\mid s,\psi(g))}\left[\phi(s,a)^\top\psi(g)\right]. \tag*{(16)}

Specifically, the policy πθ(a∣s,ψ(g))\pi_\theta(a\mid s,\psi(g)) is conditioned on the goal representation ψ(g)\psi(g), enabling it to pursue waypoints zz inferred in the representation space induced by ψ\psi.

Algorithm. Every hh environment steps, the high-level planner determines the number of waypoints for the current state-goal pair and selects a waypoint as a subgoal for the policy. Algorithm 1 provides the full pseudocode, including data collection and policy and representation learning.

Experiments

Benchmarks. We evaluate C-Slerp on six locomotion tasks in JaxGCRL (Bortkiewicz et al., [3]) and six manipulation tasks in BuilderBench (Ghugare et al., [9]). The JaxGCRL tasks cover Ant and Humanoid locomotion, including navigation through mazes of varying sizes to test goal-reaching capability over different horizons. In BuilderBench, the agent arranges cubes into target configurations using a gripper or applying forces directly to the cubes (Yan et al., [28]). The number of cubes determines the difficulty of these tasks, with more cubes requiring longer horizons. Using a gripper extends these horizons further, as each placement requires additional interactions to grasp and release the cube. Further details on both benchmarks are provided in Appendix § 10.§ 1, with environment visualizations in Figure 18.

Figure 18. Visualization of benchmark environments. The top row shows the BuilderBench manipulation tasks, and the bottom row shows the JaxGCRL navigation tasks. The goal used for evaluation in each JaxGCRL environment is indicated by 🔵. We provide videos demonstrating C-Slerp on all benchmark tasks on our project page.

Baselines. We compare C-Slerp with five GCRL methods: As a baseline using contrastive representations, we include CRL (Eysenbach et al., [7]), which learns representations of state-action pairs and future states and trains a policy to maximize their alignment. To compare different uses of hierarchy, we include RIS (Chane-Sane et al., [5]) and Online HIQL (Park et al., [20]). RIS uses imagined subgoals to regularize a flat policy during training, whereas Online HIQL uses a high-level policy to produce latent subgoals that a low-level policy pursues. For this comparison, we adapt HIQL, originally designed for offline reinforcement learning, to the online setting. For graph-based planning, we include L3P (Zhang et al., [30]), which constructs a graph of latent landmarks connected by reachability estimates and searches it to plan waypoint sequences. Finally, SAC + HER (Haarnoja et al., [10]; Andrychowicz et al., [1]) is a standard GCRL baseline that relabels goals with achieved states to learn from unsuccessful trajectories. Implementation details and hyperparameter settings are provided in Appendix § 10.§ 2.

Experimental Results

Benchmark Performance. Figure 3 compares C-Slerp with five baselines across twelve benchmark tasks. C-Slerp achieves the highest success rates on most tasks across both benchmarks. In BuilderBench, the agent must learn to construct target structures without a goal curriculum or intermediate rewards. Building taller towers requires more placements, thus leading to longer horizons and making exploration more challenging. The results show that C-Slerp and CRL perform comparably on shorter-horizon tasks such as the 2-tower task, but the performance gap between C-Slerp and the baselines widens as the number of cubes increases or when a gripper is used. Notably, C-Slerp is the only method to succeed on all cube-stacking tasks with a gripper, while most baselines fail to achieve any success.

Figure 3. C-Slerp solves long-horizon tasks where baselines never achieve a single success. Learning curves show success rates on BuilderBench manipulation tasks (top) and JaxGCRL locomotion tasks (bottom). C-Slerp achieves the highest success rates on most tasks across both benchmarks and is the only method to succeed on all cube-stacking tasks with a gripper.

In navigation tasks, several baselines also perform comparably on shorter-horizon tasks such as Ant Big Maze and Humanoid. As the required horizon increases, however, C-Slerp achieves consistently higher success rates. These results suggest that C-Slerp not only enables long-horizon planning but also facilitates exploration, allowing the agent to discover successful behaviors more efficiently by decomposing challenging tasks into easier subproblems.

Is adaptive waypoint planning necessary for long-horizon tasks? We first examine whether adapting the number of waypoints KK (as described in Section 4.4) improves performance over using a fixed number. Figure 4 compares adaptive and fixed choices of KK on the 8-tower task and Ant U5 Maze. For each fixed-KK variant, the number of waypoints remains constant throughout the episode. For K=0K = 0, no intermediate waypoints are used, and thus the policy is always conditioned directly on the goal representation ψ(g)\psi(g). The results show that adaptive selection achieves the highest success rates in both environments. The fixed-KK variants make little progress on the 8-tower task and reach lower final performance on Ant U5 Maze. Furthermore, increasing the fixed number of waypoints does not consistently improve performance, suggesting that simply introducing more intermediate waypoints is insufficient.

Figure 4. Ablation on KK-selection

These results suggest that the number of waypoints should match the difficulty of the goal-reaching problem. Too few waypoints can make each subproblem too difficult for the policy to solve, whereas too many may slow progress toward the goal by introducing unnecessary planning stages. Moreover, the appropriate number of waypoints can also change within an episode as the agent approaches the goal (see Figure 13 and Figure 14). Consequently, a fixed number of waypoints that works well early in an episode may become unnecessarily large as the remaining task becomes easier. Adaptive selection accounts for this change by adjusting KK to the current state-goal pair, highlighting that the benefit of C-Slerp comes not only from introducing intermediate waypoints but also from adapting their number to the problem.

Figure 13. Evolution of KK and i∗i^{*} over time in JaxGCRL environments. We plot the mean and sampled values of K+1K + 1, together with the selected waypoint index i∗i^{*}, against environment steps. As the agent approaches the goal, the predicted number of waypoints decreases.

Figure 14. Evolution of KK and i∗i^{*} over time in BuilderBench environments. We plot the mean and sampled values of K+1K+1, together with the selected waypoint index i∗i^{*}, against environment steps. As the agent approaches the goal, the predicted number of waypoints decreases.

We next examine how to select the waypoint for the policy to pursue. Figure 5 compares adaptive waypoint selection with fixed choices of ii, while keeping the selection of KK adaptive. Among the fixed selection rules, i=1i = 1 and i=2i = 2 perform better on the 8-tower task, whereas i=⌈K/2⌉i = \lceil K/2 \rceil and i=3i = 3 perform better on Ant U5 Maze. Thus, a choice that works well in one environment may not be the best choice in another. Earlier waypoints (e.g., i=1i = 1) provide more conservative subgoals but may slow progress, whereas later waypoints can enable greater progress but may be too difficult for the current policy to reach. Adaptive selection uses the learned fLf_L to make this choice and achieves the best performance in both environments (see Figure 17 for a visualization of the selected waypoints). Together, these ablations show that adaptive selection of both KK and ii is needed to achieve the full performance of C-Slerp on long-horizon tasks.

Figure 5. Ablation on ii-selection

Exploration in single-goal settings. We further evaluate C-Slerp in a single-goal setting, where a single fixed goal is provided throughout training and evaluation, following the setting considered in prior work [14, 2]. As shown in Figure 6, we modify the goal distributions of Ant Big Maze and Ant U4 Maze by fixing the goal to the most distant location in each maze environment. C-Slerp achieves higher success rates than all baselines, with all baselines except CRL and L3P achieving zero success. These results suggest that C-Slerp can facilitate directed exploration by producing intermediate waypoints that guide the agent toward distant goals, even when only a single fixed goal is provided.

Single-goal environments and learning curves for Ant Big Maze and Ant U4 Maze

Figure 6. Evaluation of C-Slerp in single-goal environments. To assess exploration capability, we evaluate C-Slerp with a single fixed goal throughout training. The environments and their fixed goals are shown in (a), and success rates for C-Slerp and the baselines are presented in (b).

How do the inferred waypoints relate to task progress? Figure 7 shows successive states in the 5-tower task with a gripper, alongside projections of their representations and inferred waypoints. As the agent builds the tower, its state representation ψ(s)\psi(s) progresses along the latent trajectory toward the goal representation ψ(g)\psi(g). At each replanning step, C-Slerp updates the number of intermediate waypoints KK, infers their representations, and selects one for the policy to pursue. Notably, the selected waypoint is not always the first in the inferred plan, which is consistent with our adaptive waypoint selection strategy described in Section 4.4. We can also observe that fewer waypoints are used as the tower nears completion, suggesting that the selected number of waypoints KK reflects the remaining temporal distance to the goal. Together, these visualizations show how C-Slerp guides the policy toward the goal by adapting the number of waypoints and selecting a subgoal in the learned representation space. Additional rollout visualizations are provided in Appendix § 9.

Figure 7. Adaptive planning in C-Slerp. The top row shows successive states in the 5-tower task with a gripper. The bottom row shows spherical PCA [15] projections of the latent trajectory, inferred waypoints, and selected subgoal. As the agent approaches the goal, it replans by adjusting the number of waypoints and selecting a waypoint to pursue. We provide complete rollout visualizations in Figure 15 and Figure 16 and videos on our project page.

Conclusion

We introduce C-Slerp, an online goal-reaching method that uses hyperspherical contrastive representations for adaptive planning. These representations enable closed-form waypoint inference through spherical linear interpolation, without a separate high-level network or graph search. Experiments show that C-Slerp solves long-horizon navigation and manipulation tasks, including settings where none of the baselines achieve any success. Ablations further show that adaptively selecting both the number of waypoints and the waypoint for the policy to pursue improves performance over fixed choices. These results suggest that adapting task decomposition to the goal-reaching problem contributes to the benefits of hierarchy in goal-conditioned reinforcement learning.

Our approach has limitations. Like other self-supervised RL methods, C-Slerp requires extensive environment interaction for training, which can be costly to collect on real robots. This motivates extending C-Slerp to an offline RL setting, where it could learn from offline data without additional environment interaction. Also, our experiments use state observations in simulation, leaving learning from visual observations and deployment on real robots untested. Improving data efficiency and extending the method to pixel-based observations are important directions for future work.

Final remarks. In this paper, we show how choosing an appropriate amount of planning can unlock new capabilities for reinforcement learning. C-Slerp learns to stack five cubes with a gripper without a goal curriculum or dense rewards, while all evaluated baselines fail to achieve a single success. These findings suggest that adapting how tasks are decomposed is a promising direction for extending online goal-conditioned reinforcement learning to more challenging problems. Additionally, although C-Slerp can be viewed as a hierarchical goal-conditioned RL method, it achieves these benefits without a separate high-level policy network or a planning graph. Instead, planning follows directly from spherical linear interpolation in the learned representation space, showing that adaptive planning need not require a complex architecture.

Acknowledgments

We thank Mahsa Bastankhah and Royina Jayanth for their helpful feedback on the manuscript. We also thank members of the Lab for Autonomous Robotics Research (LARR) and the Princeton RL Lab for insightful discussions.

Theoretical Results

Justification of the key assumptions

Assumption 1 (Bayes optimality). The learned fHf_H under the symmetric InfoNCE objective has the following Bayes-optimal form:

fH(u,v)=log⁡pπγ(u+=v∣u)pπγ(v) C,(17)f_H(u,v)=\log\frac{p^\gamma_\pi(u^+=v\mid u)}{p^\gamma_\pi(v)\,C}, \tag*{(17)}

where π\pi is the data-collection policy and C>0C>0 is a constant independent of uu and $v.

The symmetric InfoNCE objective for a batch B={(si,ai,si+)}i=1B\mathcal{B}=\{(s_i,a_i,s_i^+)\}_{i=1}^{B} is defined as

Lsymmetric(R,ψ;B)≜−1B∑i=1B[log⁡exp⁡(fH(si,si+))∑j=1Bexp⁡(fH(si,sj+))+log⁡exp⁡(fH(si,si+))∑j=1Bexp⁡(fH(sj,si+))].(18)\mathcal{L}^{\mathrm{symmetric}}(R,\psi;\mathcal{B})\triangleq-\frac{1}{B}\sum_{i=1}^{B}\left[\log\frac{\exp(f_H(s_i,s_i^+))}{\sum_{j=1}^{B}\exp(f_H(s_i,s_j^+))}+\log\frac{\exp(f_H(s_i,s_i^+))}{\sum_{j=1}^{B}\exp(f_H(s_j,s_i^+))}\right]. \tag*{(18)}

The Bayes-optimal form in Eq. (17) follows directly from Lemma 5 of Eysenbach et al. [8]. Their formulation uses denominators without resubstitution [22, 29], excluding the positive pair from each denominator. Since ∣fH∣≤1\lvert f_H\rvert\leq1, including the positive pair changes the loss by at most 2log⁡(1+e2/(B−1))2\log(1+e^2/(B-1)), which vanishes as B→∞B\to\infty. The same limiting result therefore applies to Eq. (18). We assume that fHf_H attains this optimum in our analysis.

Assumption 2 (Uniformity). The marginal distribution over the representations learned for fHf_H under the symmetric InfoNCE objective is uniform on the unit hypersphere Sd−1\mathbb{S}^{d-1}:

pπγ(ψ)≜∫pπγ(v) δ(ψ−ψ(v)) dv=Unif⁡(Sd−1).(19)p^\gamma_\pi(\psi)\triangleq\int p^\gamma_\pi(v)\,\delta(\psi-\psi(v))\,\mathrm{d}v=\operatorname{Unif}(\mathbb{S}^{d-1}). \tag*{(19)}

Following Wang & Isola [26], we decompose the objective in Eq. (18) into alignment and uniformity terms corresponding to the numerators and denominators, respectively. We justify Assumption 2 using this decomposition and its entropy interpretation. Since RR is an orthogonal matrix and the representations ψ\psi have unit norm, we have

fH(si,si+)=ψ(si)⊤Rψ(si+)=1−12∥R⊤ψ(si)−ψ(si+)∥2.f_H(s_i,s_i^+)=\psi(s_i)^\top R\psi(s_i^+)=1-\frac{1}{2}\lVert R^\top\psi(s_i)-\psi(s_i^+)\rVert^2.

The alignment term therefore pulls R⊤ψ(si)R^\top\psi(s_i) toward ψ(si+)\psi(s_i^+) for each positive pair. For the uniformity term, we consider the log-denominator of the first term in Eq. (18). If positive pairs are sufficiently aligned, replacing R⊤ψ(si)R^\top\psi(s_i) with ψ(si+)\psi(s_i^+) in the von Mises–Fisher (vMF) log-density gives the approximation below. After subtracting the constant log⁡B\log B, this log-denominator can be written as

1B∑i=1Blog⁡(1B∑j=1Bexp⁡(fH(si,sj+)))=1B∑i=1Blog⁡(1B∑j=1Bexp⁡(ψ(si)⊤Rψ(sj+))ZvMF)+log⁡ZvMF=1B∑i=1Blog⁡p^vMF(R⊤ψ(si))+log⁡ZvMF≈1B∑i=1Blog⁡p^vMF(ψ(si+))+log⁡ZvMF=−H^(ψ)+log⁡ZvMF,(20)\begin{aligned} \frac{1}{B}\sum_{i=1}^{B}\log\left(\frac{1}{B}\sum_{j=1}^{B}\exp(f_H(s_i,s_j^+))\right) &=\frac{1}{B}\sum_{i=1}^{B}\log\left(\frac{1}{B}\sum_{j=1}^{B}\frac{\exp(\psi(s_i)^\top R\psi(s_j^+))}{Z_{\mathrm{vMF}}}\right)+\log Z_{\mathrm{vMF}}\\ &=\frac{1}{B}\sum_{i=1}^{B}\log\widehat{p}_{\mathrm{vMF}}(R^\top\psi(s_i))+\log Z_{\mathrm{vMF}}\\ &\approx\frac{1}{B}\sum_{i=1}^{B}\log\widehat{p}_{\mathrm{vMF}}(\psi(s_i^+))+\log Z_{\mathrm{vMF}}\\ &=-\widehat{H}(\psi)+\log Z_{\mathrm{vMF}}, \tag*{(20)} \end{aligned}

where p^vMF(u)=[∑jexp⁡(u⊤ψ(sj+))]/(BZvMF)\widehat{p}_{\mathrm{vMF}}(u)=\left[\sum_j\exp(u^\top\psi(s_j^+))\right]/(BZ_{\mathrm{vMF}}) is a vMF kernel density estimate, ZvMFZ_{\mathrm{vMF}} is its normalizing constant, and H^(ψ)=−[∑ilog⁡p^vMF(ψ(si+))]/B\widehat{H}(\psi)=-\left[\sum_i\log\widehat{p}_{\mathrm{vMF}}(\psi(s_i^+))\right]/B is the corresponding resubstitution entropy estimate. The entropy interpretation for the denominator of the second term in Eq. (18) can be derived in the same way.

Minimizing the term −H^(ψ)-\widehat{H}(\psi) in Eq. (20) maximizes the estimated marginal entropy of ψ\psi, encouraging representations to spread across the sphere. Since maximizing entropy on the unit sphere yields the uniform distribution on Sd−1\mathbb{S}^{d-1}, we assume a uniform marginal distribution for the learned representations ψ\psi in our analysis.

Derivation of the representation-space objective

In this section, we derive the objective in Eq. (10) from the posterior KL objective in Eq. (5). We fix the state-goal pair (s,g)(s,g), the number of intermediate waypoints K≥1K \ge1, and the data-collection policy π^\hat{\pi}. Following the setup in § 4.1, we set w0=sw_0=s and wK+1=gw_{K+1}=g and use the factorization q(w1:K∣s,g)=∏i=1Kqi(wi∣s,g)q(w_{1:K}\mid s,g)=\prod_{i=1}^{K}q_i(w_i\mid s,g).

Assuming that the waypoint sequence is a Markov chain, the posterior can be written as

pπ^γ,K(w1:K∣s,g)=pπ^γ,K(w1:K,g∣s)pπ^γ,K(g∣s)=∏i=0Kpπ^γ(wi+1∣w0:i)pπ^γ,K(g∣s)=∏i=0Kpπ^γ(wi+1∣wi)pπ^γ,K(g∣s).p_{\hat{\pi}}^{\gamma,K}(w_{1:K}\mid s,g)=\frac{p_{\hat{\pi}}^{\gamma,K}(w_{1:K},g\mid s)}{p_{\hat{\pi}}^{\gamma,K}(g\mid s)}=\frac{\prod_{i=0}^{K}p_{\hat{\pi}}^{\gamma}(w_{i+1}\mid w_{0:i})}{p_{\hat{\pi}}^{\gamma,K}(g\mid s)}=\frac{\prod_{i=0}^{K}p_{\hat{\pi}}^{\gamma}(w_{i+1}\mid w_i)}{p_{\hat{\pi}}^{\gamma,K}(g\mid s)}.

Expanding the KL divergence in Eq. (5) gives

−DKL(q(⋅∣s,g)∥pπ^γ,K(⋅∣s,g))=Ew1:K∼q(⋅∣s,g)[∑i=0Klog⁡pπ^γ(wi+1∣wi)−∑i=1Klog⁡qi(wi∣s,g)]−log⁡pπ^γ,K(g∣s).(21)\begin{aligned} -D_{\mathrm{KL}}\left(q(\cdot\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma,K}(\cdot\mid s,g)\right) \\ &=\mathbb{E}_{w_{1:K}\sim q(\cdot\mid s,g)}\left[\sum_{i=0}^{K}\log p_{\hat{\pi}}^{\gamma}(w_{i+1}\mid w_i)-\sum_{i=1}^{K}\log q_i(w_i\mid s,g)\right]-\log p_{\hat{\pi}}^{\gamma,K}(g\mid s). \tag*{(21)} \end{aligned}

Applying Assumption 1 with π=π^\pi=\hat{\pi}, we have

log⁡pπ^γ(wi+1∣wi)=fH(wi,wi+1)+log⁡pπ^γ(wi+1)+log⁡C.(22)\log p_{\hat{\pi}}^{\gamma}(w_{i+1}\mid w_i)=f_H(w_i,w_{i+1})+\log p_{\hat{\pi}}^{\gamma}(w_{i+1})+\log C. \tag*{(22)}

Substituting Eq. (22) into Eq. (21) yields

−DKL(q(⋅∣s,g)∥pπ^γ,K(⋅∣s,g))=Ew1:K∼q(⋅∣s,g)[∑i=0KfH(wi,wi+1)+∑i=1Klog⁡pπ^γ(wi)qi(wi∣s,g)]+const.=Ew1:K∼q(⋅∣s,g)[∑i=0KfH(wi,wi+1)]−∑i=1KDKL(qi(⋅∣s,g)∥pπ^γ(⋅))+const.(23)\begin{aligned} -D_{\mathrm{KL}}\left(q(\cdot\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma,K}(\cdot\mid s,g)\right) \\ &=\mathbb{E}_{w_{1:K}\sim q(\cdot\mid s,g)}\left[\sum_{i=0}^{K}f_H(w_i,w_{i+1})+\sum_{i=1}^{K}\log\frac{p_{\hat{\pi}}^{\gamma}(w_i)}{q_i(w_i\mid s,g)}\right]+\mathrm{const.} \\ &=\mathbb{E}_{w_{1:K}\sim q(\cdot\mid s,g)}\left[\sum_{i=0}^{K}f_H(w_i,w_{i+1})\right]-\sum_{i=1}^{K}D_{\mathrm{KL}}\left(q_i(\cdot\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(\cdot)\right)+\mathrm{const.} \tag*{(23)} \end{aligned}

Here, the constant is log⁡pπ^γ(g)+(K+1)log⁡C−log⁡pπ^γ,K(g∣s)\log p_{\hat{\pi}}^{\gamma}(g)+(K+1)\log C-\log p_{\hat{\pi}}^{\gamma,K}(g\mid s). It is independent of qq since (s,g)(s,g) and KK are fixed. Removing it gives the objective in Eq. (9).

We now express the objective in terms of zi=ψ(wi)z_i=\psi(w_i). Following the notation in § 4.3, let qi(zi∣s,g)q_i(z_i\mid s,g) denote the representation density induced by qi(wi∣s,g)q_i(w_i\mid s,g) through ψ\psi, and let pπ^γ(zi)p_{\hat{\pi}}^{\gamma}(z_i) denote the representation marginal density induced by pπ^γ(wi)p_{\hat{\pi}}^{\gamma}(w_i) through the same mapping. Also, the joint distribution remains factorized as q(z1:K∣s,g)=∏i=1Kqi(zi∣s,g)q(z_{1:K}\mid s,g)=\prod_{i=1}^{K}q_i(z_i\mid s,g).

By the chain rule, the KL divergence in Eq. (23) decomposes into a representation term and an expected conditional term over states:

DKL(qi(wi∣s,g)∥pπ^γ(wi))=DKL(qi(zi∣s,g)∥pπ^γ(zi))+Ezi∼qi(⋅∣s,g)[DKL(qi(wi∣zi,s,g)∥pπ^γ(wi∣zi))],≥DKL(qi(zi∣s,g)∥pπ^γ(zi)).(24)\begin{aligned} D_{\mathrm{KL}}\left(q_i(w_i\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(w_i)\right) =D_{\mathrm{KL}}\left(q_i(z_i\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(z_i)\right)+\mathbb{E}_{z_i\sim q_i(\cdot\mid s,g)}\left[D_{\mathrm{KL}}\left(q_i(w_i\mid z_i,s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(w_i\mid z_i)\right)\right], \\ &\ge D_{\mathrm{KL}}\left(q_i(z_i\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(z_i)\right). \tag*{(24)} \end{aligned}

For any qi(zi∣s,g)q_i(z_i\mid s,g) such that DKL(qi(zi∣s,g)∥pπ^γ(zi))<∞D_{\mathrm{KL}}(q_i(z_i\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(z_i))<\infty, the equality in Eq. (24) is always achievable with qi(wi∣zi,s,g)=pπ^γ(wi∣zi)q_i(w_i\mid z_i,s,g)=p_{\hat{\pi}}^{\gamma}(w_i\mid z_i). Thus, with this choice, minimizing the KL divergence over representations can lead to minimizing the KL divergence in Eq. (23).

Under Assumption 2, pπ^γ(ψ)p_{\hat{\pi}}^{\gamma}(\psi) is uniform on Sd−1\mathbb{S}^{d-1}, so log⁡pπ^γ(zi)\log p_{\hat{\pi}}^{\gamma}(z_i) is constant. Therefore, the KL divergence simplifies as follows:

−DKL(qi(zi∣s,g)∥pπ^γ(zi))=−Ezi∼qi(⋅∣s,g)[log⁡qi(zi∣s,g)]+const.=H(qi(⋅∣s,g))+const.,(25)\begin{aligned} -D_{\mathrm{KL}}\left(q_i(z_i\mid s,g)\mathbin\Vert p_{\hat{\pi}}^{\gamma}(z_i)\right)=-\mathbb{E}_{z_i\sim q_i(\cdot\mid s,g)}[\log q_i(z_i\mid s,g)]+\mathrm{const.} \\ &=\mathcal{H}(q_i(\cdot\mid s,g))+\mathrm{const.}, \tag*{(25)} \end{aligned}

where H\mathcal{H} denotes entropy with respect to the surface measure on Sd−1\mathbb{S}^{d-1}. Substituting fH(wi,wi+1)=ziTRzi+1f_H(w_i,w_{i+1})=z_i^{\mathsf{T}}Rz_{i+1} and Eq. (25) into Eq. (23) and dropping constants gives the objective in Eq. (10):

J(q)=Ez1:K∼q(⋅∣s,g)[ψ(s)TRz1+∑i=2Kzi−1TRzi+zKTRψ(g)]+∑i=1KH(qi(⋅∣s,g)).\mathcal{J}(q)=\mathbb{E}_{z_{1:K}\sim q(\cdot\mid s,g)}\left[\psi(s)^{\mathsf{T}}Rz_1+\sum_{i=2}^{K}z_{i-1}^{\mathsf{T}}Rz_i+z_K^{\mathsf{T}}R\psi(g)\right]+\sum_{i=1}^{K}\mathcal{H}(q_i(\cdot\mid s,g)).

Derivation of the closed-form solution

In this section, we derive the approximate solution in Eq. (11) for a fixed state-goal pair (s,g)(s,g) and K≥1K \ge1 intermediate waypoints. For simplicity, we suppress the dependence on (s,g)(s,g) and write q(z1:K)=∏i=1Kqi(zi)q(z_{1:K}) = \prod_{i=1}^{K} q_i(z_i), with z0=ψ(s)z_0 = \psi(s) and zK+1=ψ(g)z_{K+1} = \psi(g). To control the stochasticity of the waypoint representations, we introduce an entropy weight α>0\alpha> 0 into Eq. (10):

J(q)=Ez1:K∼q[∑i=0KziTRzi+1]+α∑i=1KH(qi).(26)J(q) = \mathbb{E}_{z_{1:K}\sim q}\left[\sum_{i=0}^{K} z_i^{\mathsf{T}}Rz_{i+1}\right] + \alpha\sum_{i=1}^{K} \mathcal{H}(q_i). \tag*{(26)}

As in the main text, each waypoint representation is obtained by normalizing a Gaussian sample:

z~i∼N(μi,σi2I),zi=z~i∥z~i∥2,∥μi∥2=1.\tilde{z}_i \sim\mathcal{N}(\mu_i,\sigma_i^2 I), \qquad z_i = \frac{\tilde{z}_i}{\|\tilde{z}_i\|_2}, \qquad\|\mu_i\|_2 = 1.

We use a small-variance approximation to obtain both mean directions μi\mu_i and variances σi2\sigma_i^2 in closed form. We first determine the mean directions, then use them to optimize the variances.

Mean directions of waypoint representations. With isotropic Gaussian covariance, the entropy H(qi)\mathcal{H}(q_i) in Eq. (26) depends only on the variances and is therefore constant when optimizing the mean directions. Under q(z1:K)=∏i=1Kqi(zi)q(z_{1:K}) = \prod_{i=1}^{K} q_i(z_i), each waypoint representation ziz_i is independent of the others, allowing us to express the objective in terms of their individual expectations:

J(q)=∑i=0KE[zi]TRE[zi+1]+const.,(27)J(q) = \sum_{i=0}^{K} \mathbb{E}[z_i]^{\mathsf{T}}R\mathbb{E}[z_{i+1}] + \mathrm{const.}, \tag*{(27)}

where the constant is independent of μ1,…,μK\mu_1,\ldots,\mu_K.

Since ziz_i is normalized to unit length, we approximate small deviations from μi\mu_i by the perpendicular component of the Gaussian perturbation, denoted by ξi\xi_i. Its d−1d-1 orthogonal coordinates each have variance σi2\sigma_i^2, so

E[∥ξi∥22]=(d−1)σi2.\mathbb{E}\left[\|\xi_i\|_2^2\right] = (d-1)\sigma_i^2.

For a small perturbation, ∥ξi∥2\|\xi_i\|_2 approximates the angular deviation from μi\mu_i. Thus, the small-variance assumption (d−1)σi2≪1(d-1)\sigma_i^2 \ll1 ensures that the representation remains concentrated around its mean direction μi\mu_i.

In the tangent-plane approximation, ξi⊥μi\xi_i \perp\mu_i and ∥μi∥2=1\|\mu_i\|_2 = 1 imply ∥μi+ξi∥2=1+∥ξi∥22\|\mu_i+\xi_i\|_2 = \sqrt{1+\|\xi_i\|_2^2}. We can therefore write

E[zi]≈E[μi1+∥ξi∥22]+E[ξi1+∥ξi∥22].\mathbb{E}[z_i] \approx\mathbb{E}\left[\frac{\mu_i}{\sqrt{1+\|\xi_i\|_2^2}}\right] + \mathbb{E}\left[\frac{\xi_i}{\sqrt{1+\|\xi_i\|_2^2}}\right].

The second term vanishes by symmetry since ξi\xi_i and −ξi-\xi_i have the same distribution and the denominator is unchanged under this sign reversal. Using (1+x)−1/2≈1−x/2(1+x)^{-1/2} \approx1-x/2, we obtain

E[zi]≈(1−12E[∥ξi∥22])μi=(1−d−12σi2)μi.\mathbb{E}[z_i] \approx\left(1-\frac{1}{2}\mathbb{E}\left[\|\xi_i\|_2^2\right]\right)\mu_i = \left(1-\frac{d-1}{2}\sigma_i^2\right)\mu_i.

Under the small-variance assumption, we use E[zi]≈μi\mathbb{E}[z_i] \approx\mu_i to optimize the mean directions independently of the variances. Setting vi=Riμiv_i = R^i\mu_i for i=1,…,Ki=1,\ldots,K, maximizing Eq. (27) under this approximation reduces to

max⁡v1,…,vK∈Sd−1∑i=0KviTvi+1,\max_{v_1,\ldots,v_K\in\mathbb{S}^{d-1}} \sum_{i=0}^{K} v_i^{\mathsf{T}}v_{i+1},

where v0=ψ(s)v_0 = \psi(s) and vK+1=RK+1ψ(g)v_{K+1} = R^{K+1}\psi(g). Let θ∈(0,π)\theta\in(0,\pi) denote the angle between v0v_0 and vK+1v_{K+1}. The sum is maximized by placing the directions at equal angular intervals Δ=θ/(K+1)\Delta= \theta/(K+1) along the shortest geodesic connecting them, yielding the spherical linear interpolation

vi∗=slerp⁡(v0,vK+1,iK+1).v_i^* = \operatorname{slerp}\left(v_0,v_{K+1},\frac{i}{K+1}\right).

Using μi=(RT)ivi\mu_i = (R^{\mathsf{T}})^i v_i, we obtain

μi∗(s,g)=(RT)islerp⁡(ψ(s),RK+1ψ(g),iK+1).(28)\mu_i^*(s,g) = (R^{\mathsf{T}})^i \operatorname{slerp}\left(\psi(s),R^{K+1}\psi(g),\frac{i}{K+1}\right). \tag*{(28)}

The case θ=0\theta= 0 follows by continuity, and we exclude θ=π\theta= \pi, where the shortest arc is not unique.

Variances of waypoint representations. We now optimize the variances in Eq. (26), with the mean directions fixed at μi∗\mu_i^* from Eq. (28). For each ii, we rewrite the objective to isolate its dependence on σi\sigma_i:

J(q)=(RTE[zi−1]+RE[zi+1])TE[zi]+αH(qi)+const.(29)\mathcal{J}(q) = \left(R^{\mathsf{T}}\mathbb{E}[z_{i-1}] + R\mathbb{E}[z_{i+1}]\right)^{\mathsf{T}}\mathbb{E}[z_i] + \alpha\mathcal{H}(q_i) + \mathrm{const.} \tag*{(29)}

where the constant is independent of σi\sigma_i. To optimize the variances, we retain the reduction in mean length derived above. A larger variance allows sampled waypoint sequences to cover a broader region of representation space, increasing entropy while reducing the expected inner products between neighboring representations. Using only E[zi]≈μi∗\mathbb{E}[z_i] \approx\mu_i^* makes the first term independent of the variances and fails to capture this tradeoff.

Set μ0∗=ψ(s)\mu_0^*=\psi(s), μK+1∗=ψ(g)\mu_{K+1}^*=\psi(g), and σ02=σK+12=0\sigma_0^2=\sigma_{K+1}^2=0 for the fixed endpoints. Substituting E[zj]≈(1−d−12σj2)μj∗\mathbb{E}[z_j] \approx\left(1-\frac{d-1}{2}\sigma_j^2\right)\mu_j^* for j=i, i+1j=i,\ i+1 into each neighboring inner product gives

E[zi]TRE[zi+1]≈[1−d−12(σi2+σi+12)](μi∗)TRμi+1∗,\mathbb{E}[z_i]^{\mathsf{T}}R\mathbb{E}[z_{i+1}] \approx\left[1-\frac{d-1}{2}\left(\sigma_i^2+\sigma_{i+1}^2\right)\right](\mu_i^*)^{\mathsf{T}}R\mu_{i+1}^*,

where we omit the products σi2σi+12\sigma_i^2\sigma_{i+1}^2 under the small-variance assumption. Applying this expansion to the two pairs (i−1,i)(i-1,i) and (i,i+1)(i,i+1) in Eq. (29), the terms proportional to σi2\sigma_i^2 are

−d−12σi2[(μi−1∗)TRμi∗+(μi∗)TRμi+1∗]=−(d−1)σi2cos⁡Δ.-\frac{d-1}{2}\sigma_i^2\left[(\mu_{i-1}^*)^{\mathsf{T}}R\mu_i^*+(\mu_i^*)^{\mathsf{T}}R\mu_{i+1}^*\right]=-(d-1)\sigma_i^2\cos\Delta.

Recall that consecutive transformed directions vj∗=Rjμj∗v_j^*=R^j\mu_j^* are separated by the angle Δ=θ/(K+1)\Delta=\theta/(K+1). Thus, each inner product satisfies

(μj∗)TRμj+1∗=(vj∗)Tvj+1∗=cos⁡Δ,j=i−1, i.(\mu_j^*)^{\mathsf{T}}R\mu_{j+1}^*=(v_j^*)^{\mathsf{T}}v_{j+1}^*=\cos\Delta,\qquad j=i-1,\ i.

Collecting the remaining terms independent of σi\sigma_i into a constant, we can therefore write

J(q)≈−(d−1)σi2cos⁡Δ+αH(qi)+const.(30)\mathcal{J}(q)\approx-(d-1)\sigma_i^2\cos\Delta+\alpha\mathcal{H}(q_i)+\mathrm{const.} \tag*{(30)}

Under the same small-variance assumption, we approximate H(qi)\mathcal{H}(q_i) by the entropy of an isotropic Gaussian in the (d−1)(d-1)-dimensional tangent plane. Each of its d−1d-1 independent coordinates follows X∼N(0,σi2)X\sim\mathcal{N}(0,\sigma_i^2), with density

pX(x)=12πσi2exp⁡(−x22σi2).p_X(x)=\frac{1}{\sqrt{2\pi\sigma_i^2}}\exp\left(-\frac{x^2}{2\sigma_i^2}\right).

Substituting this density into −E[log⁡pX(X)]-\mathbb{E}[\log p_X(X)] gives

−E[log⁡pX(X)]=12log⁡(2πσi2)+E[X2]2σi2=12log⁡(2πeσi2),-\mathbb{E}[\log p_X(X)]=\frac{1}{2}\log(2\pi\sigma_i^2)+\frac{\mathbb{E}[X^2]}{2\sigma_i^2}=\frac{1}{2}\log(2\pi e\sigma_i^2),

where E[X2]=σi2\mathbb{E}[X^2]=\sigma_i^2. Since these coordinates are independent, their entropies add, giving the following expression under the tangent-plane approximation:

H(qi)≈d−12log⁡(2πeσi2)=d−12(1+log⁡(2π))+(d−1)log⁡σi.\mathcal{H}(q_i)\approx\frac{d-1}{2}\log(2\pi e\sigma_i^2)=\frac{d-1}{2}(1+\log(2\pi))+(d-1)\log\sigma_i.

Substituting the entropy expression above into Eq. (30), and collecting terms independent of σi\sigma_i into a constant, we obtain

J(q)≈−(d−1)σi2cos⁡Δ+α(d−1)log⁡σi+const.(31)\mathcal{J}(q)\approx-(d-1)\sigma_i^2\cos\Delta+\alpha(d-1)\log\sigma_i+\mathrm{const.} \tag*{(31)}

Differentiating the right-hand side with respect to σi\sigma_i and setting the derivative to zero gives

−2(d−1)cos⁡Δ σi+α(d−1)σi=0.-2(d-1)\cos\Delta\,\sigma_i+\frac{\alpha(d-1)}{\sigma_i}=0.

Using Δ=θ/(K+1)\Delta=\theta/(K+1), we obtain

σi2∗(s,g)=α2cos⁡Δ=α2cos⁡(θ/(K+1)),i=1,…,K.(32)\sigma_i^{2*}(s,g)=\frac{\alpha}{2\cos\Delta}=\frac{\alpha}{2\cos(\theta/(K+1))},\qquad i=1,\ldots,K. \tag*{(32)}

For d≥2d\ge2 and α>0\alpha>0, the approximate objective in Eq. (31) is strictly concave in σi>0\sigma_i>0 since cos⁡Δ>0\cos\Delta>0, so the positive stationary point is its unique maximizer. Together, Eqs. (28) and (32) yield the approximate solution in Eq. (11) under the small-variance condition α(d−1)/(2cos⁡Δ)≪1\alpha(d-1)/(2\cos\Delta)\ll1.

Derivation of the distribution over the number of waypoints

In this section, we derive a distribution over the number of intermediate waypoints for a given state-goal pair. Following the setup in § 4.1, we use the notation

w1:K=(w1,…,wK),w0=s,wK+1=g.w_{1:K} = (w_1,\ldots,w_K), \quad w_0 = s, \quad w_{K+1} = g.

The KK intermediate waypoints divide the trajectory into K+1K+1 segments, where the temporal intervals are sampled independently from a geometric distribution. We define pπ^γ,K(g∣s)p_{\hat{\pi}}^{\gamma,K}(g \mid s) as the resulting distribution of gg under π^\hat{\pi} given the starting state ss. For K=0K = 0, this distribution reduces to pπ^γ(g∣s)p_{\hat{\pi}}^{\gamma}(g \mid s), with a time interval sampled from a single geometric distribution and no intermediate waypoints.

Recall that fHf_H is parameterized as

fH(s,s+)=ψ(s)⊤Rψ(s+)=(R⊤ψ(s))⊤ψ(s+),f_H(s,s^+) = \psi(s)^\top R\psi(s^+) = (R^\top\psi(s))^\top\psi(s^+),

where ψ(s)∈Sd−1\psi(s) \in\mathbb{S}^{d-1} and RR is orthogonal. Next, we relate R⊤ψ(s)R^\top\psi(s) to the expected representation of a future state sampled from pπ^γ(⋅∣s)p_{\hat{\pi}}^\gamma(\cdot\mid s).

Lemma 1 (Expected positive alignment). Assume that, at convergence, the contrastive representations are uniformly distributed on Sd−1\mathbb{S}^{d-1}, with d≫1d \gg1. The expected representation of a future state after a time interval sampled from a geometric distribution satisfies

Es+∼pπ^γ(⋅∣s)[ψ(s+)]≈ρR⊤ψ(s),\mathbb{E}_{s^+\sim p_{\hat{\pi}}^\gamma(\cdot\mid s)}[\psi(s^+)] \approx\rho R^\top\psi(s),

where ρ∈(0,1]\rho\in(0,1] is a coefficient shared across states.

Proof. The result follows directly from the proof of Lemma 2 in Appendix § 9.2.2 of Bastankhah et al. [2], with ϕ(s,a)\phi(s,a) replaced by R⊤ψ(s)R^\top\psi(s).

Lemma 1 identifies R⊤ψ(s)R^\top\psi(s) as the predicted direction after one geometric transition, while ρ\rho captures the contraction in the expected representation. The following result extends this relation to K+1K+1 geometric transitions.

Lemma 2 (Recursive composition of geometric transitions). Let s0=ss_0 = s and recursively sample si∼pπ^γ(⋅∣si−1)s_i \sim p_{\hat{\pi}}^\gamma(\cdot\mid s_{i-1}) for i=1,…,K+1i = 1,\ldots,K+1. Then the expected representation of sK+1s_{K+1} satisfies

EsK+1∼pπ^γ,K(⋅∣s)[ψ(sK+1)]≈ρK+1(R⊤)K+1ψ(s),\mathbb{E}_{s_{K+1}\sim p_{\hat{\pi}}^{\gamma,K}(\cdot\mid s)}[\psi(s_{K+1})] \approx\rho^{K+1}(R^\top)^{K+1}\psi(s),

where ρ\rho is the coefficient in Lemma 1.

Proof. By definition, sK+1∼pπ^γ,K(⋅∣s)s_{K+1} \sim p_{\hat{\pi}}^{\gamma,K}(\cdot\mid s). For the expected representation, the case K=0K = 0 follows directly from Lemma 1. Suppose that E[ψ(sK)∣s0=s]≈ρK(R⊤)Kψ(s)\mathbb{E}[\psi(s_K) \mid s_0 = s] \approx\rho^K(R^\top)^K\psi(s). Assuming that the process is Markov with transition kernel pπ^γp_{\hat{\pi}}^\gamma, the law of iterated expectations gives

E[ψ(sK+1)∣s0=s]=E[E[ψ(sK+1)∣sK]∣s0=s]≈E[ρR⊤ψ(sK)∣s0=s]=ρR⊤E[ψ(sK)∣s0=s]≈ρR⊤ρK(R⊤)Kψ(s)=ρK+1(R⊤)K+1ψ(s).\begin{aligned} \mathbb{E}[\psi(s_{K+1}) \mid s_0 = s] &= \mathbb{E}\left[\mathbb{E}[\psi(s_{K+1}) \mid s_K] \mid s_0 = s\right] \\ &\approx\mathbb{E}\left[\rho R^\top\psi(s_K) \mid s_0 = s\right] \\ &= \rho R^\top\mathbb{E}[\psi(s_K) \mid s_0 = s] \\ &\approx\rho R^\top\rho^K(R^\top)^K\psi(s) \\ &= \rho^{K+1}(R^\top)^{K+1}\psi(s). \end{aligned}

The stated approximation follows by induction.

By Lemma 2, the expected representation of sK+1s_{K+1} is approximated by ρK+1(R⊤)K+1ψ(s)\rho^{K+1}(R^\top)^{K+1}\psi(s). Since ψ(s)\psi(s) has unit norm and RR is orthogonal, this vector has norm ρK+1\rho^{K+1}. Normalizing it therefore gives the predicted direction

μK(s)≜(R⊤)K+1ψ(s).\mu_K(s) \triangleq(R^\top)^{K+1}\psi(s).

We define its alignment with the goal representation as

ℓK(s,g)≜μK(s)⊤ψ(g)=((R⊤)K+1ψ(s))⊤ψ(g)=ψ(s)⊤RK+1ψ(g).\ell_K(s,g) \triangleq\mu_K(s)^{\top}\psi(g) = ((R^{\top})^{K+1}\psi(s))^{\top}\psi(g) = \psi(s)^{\top}R^{K+1}\psi(g).

This recovers the score in Eq. (11), which measures how well the predicted direction for KK intermediate waypoints aligns with the goal representation.

We now convert this alignment score into a distribution over KK. Since μK(s)∈Sd−1\mu_K(s) \in\mathbb{S}^{d-1}, we model the goal representation with a von Mises–Fisher likelihood centered at μK(s)\mu_K(s):

p(ψ(g)∣ψ(s),K)≜Cd(κ)exp⁡(κμK(s)⊤ψ(g))=Cd(κ)exp⁡(κℓK(s,g)).p(\psi(g) \mid\psi(s), K) \triangleq C_d(\kappa)\exp(\kappa\mu_K(s)^{\top}\psi(g)) = C_d(\kappa)\exp(\kappa\ell_K(s,g)).

as in Eq. (12). Here, κ>0\kappa> 0 is a fixed concentration parameter. The normalizing constant Cd(κ)C_d(\kappa) depends only on dd and κ\kappa and is therefore independent of both ss and KK.

For a prior p(K)p(K) over {0,…,Kmax⁡}\{0,\ldots,K_{\max}\}, Bayes’ rule gives

p(K∣ψ(s),ψ(g))=p(ψ(g)∣ψ(s),K)p(K)∑J=0Kmax⁡p(ψ(g)∣ψ(s),J)p(J)=exp⁡(κℓK(s,g))p(K)∑J=0Kmax⁡exp⁡(κℓJ(s,g))p(J).p(K \mid\psi(s),\psi(g)) = \frac{p(\psi(g) \mid\psi(s),K)p(K)} {\sum_{J=0}^{K_{\max}}p(\psi(g) \mid\psi(s),J)p(J)} = \frac{\exp(\kappa\ell_K(s,g))p(K)} {\sum_{J=0}^{K_{\max}}\exp(\kappa\ell_J(s,g))p(J)}.

where the shared normalizing constant Cd(κ)C_d(\kappa) cancels.

With the uniform prior p(K)=1/(Kmax⁡+1)p(K)=1/(K_{\max}+1), this reduces to

p(K∣ψ(s),ψ(g))=Softmax⁡K∈{0,…,Kmax⁡}(ℓK(s,g)η),p(K \mid\psi(s),\psi(g)) = \operatorname{Softmax}_{K\in\{0,\ldots,K_{\max}\}} \left(\frac{\ell_K(s,g)}{\eta}\right),

where η=1/κ\eta=1/\kappa, yielding Eq. (13).

Additional Experimental Results

Ablation Study

Ablation on the threshold ϵ\epsilon. We investigate the effect of the threshold ϵ\epsilon used to select the waypoint index i∗i^*. As described in Eq. (14), a larger ϵ\epsilon favors earlier waypoints, leading to more conservative subgoal selection. Figure 8 shows that C-Slerp performs well across multiple threshold choices, although sensitivity varies across tasks. Performance is relatively robust across ϵ∈{0.2,0.3,0.4}\epsilon\in\{0.2, 0.3, 0.4\} in all evaluated environments except the 8-tower task. The 8-tower task is more sensitive to the threshold, with ϵ=0.4\epsilon= 0.4 achieving the highest success rate, whereas ϵ=0.2\epsilon= 0.2 and 0.30.3 perform better on Ant U5 Maze. We use ϵ=0.4\epsilon= 0.4 as the default configuration for our algorithm across all tasks.

Four line plots showing success rate versus environment steps for 3-tower (gripper), 8-tower, Ant U4 Maze, and Ant U5 Maze, with curves for $\epsilon=0.2$, $\epsilon=0.3$, $\epsilon=0.4$, and $\epsilon=0.5$.

Figure 8. Ablation on the threshold ϵ\epsilon.

Ablation on learning the rotation matrix RR. We investigate the role of learning the rotation matrix RR in fH(s,s+)=ψ(s)⊤Rψ(s+)f_H(s,s^+) = \psi(s)^\top R\psi(s^+) by comparing it with fixed alternatives. As described in § 4.2, we parameterize RR through the Cayley transform, where Ω=A−A⊤\Omega= A - A^\top and R=(I+Ω)−1(I−Ω)R = (I + \Omega)^{-1}(I - \Omega). Using this parameterization, we compare our default approach of learning AA with three fixed variants. The first sets A=0A = 0, yielding the identity matrix R=IR = I. The other two independently sample Aij∼N(0,σ2)A_{ij} \sim\mathcal{N}(0,\sigma^2) with σ∈{0.01,0.02}\sigma\in\{0.01, 0.02\}. In all three variants, we stop gradients to AA, keeping RR fixed throughout training. As shown in Figure 9, setting R=IR = I makes fHf_H symmetric and prevents successful learning in the evaluated tasks. In contrast, the two variants with randomly initialized, fixed RR introduce asymmetry and enable learning, but yield unstable performance. These results suggest that asymmetry alone is insufficient for stable performance, highlighting the benefit of learning RR to capture temporal relationships between states.

Figure 9. Ablation on learning the rotation matrix RR.

Figure 10. Ablation on network depth.

Ablation on network depth. Wang et al. [25] report that increasing network depth improves the goal-reaching performance of CRL. Since C-Slerp also uses contrastive representations, we examine whether it benefits similarly from increased network depth. The results show that deeper networks generally achieve higher success rates. On Ant U5 Maze, performance improves as depth increases, while on the 8-tower task, depths of 16 and 32 perform comparably and outperform shallower networks, suggesting that sufficient network depth is needed for this task.

Figure 11. Ablation on representation dimension dd.

Ablation on representation dimension. We investigate the effect of the representation dimension dd. Since the learned rotation matrix RR in fH(s,s+)=ψ(s)⊤Rψ(s+)f_H(s,s^+) = \psi(s)^\top R\psi(s^+) is a linear operator, we examine whether increasing the representation dimension dd provides greater expressive capacity and improves performance. The results show that performance is relatively robust once the representation dimension is sufficiently large, with further increases providing no consistent benefit. In particular, on the 8-tower task, only dimensions of d≥256d \ge256 achieve nonzero success among the tested values. We hypothesize that this limited benefit from further increasing dd arises because the encoder ψ\psi already provides sufficient nonlinear expressivity for the linear operator RR to model temporal relationships effectively.

CRL with larger discount factors

Comparison with CRL using larger discount factors γ\gamma. As discussed in § 3, CRL samples future states for contrastive learning using a temporal offset drawn from GEOM⁡(1−γ)\operatorname{GEOM}(1-\gamma). Thus, a natural approach for adapting CRL to long-horizon tasks is to increase the discount factor γ\gamma.

We investigate this approach by evaluating CRL across γ∈{0.99,0.995,0.999}\gamma\in\{0.99, 0.995, 0.999\} on long-horizon tasks within our benchmark, while C-Slerp uses γ=0.99\gamma= 0.99. As shown in Figure 12, CRL achieves low success rates across the evaluated tasks, and increasing γ\gamma does not close the performance gap with C-Slerp. One possible explanation is that a larger γ\gamma places more weight on temporally distant future states. This may make it harder for the network to distinguish temporally close and distant goals, limiting the effectiveness of the learned representations. These results suggest that simply extending the temporal horizon of contrastive learning does not offer the same benefits as planning with an appropriate number of waypoints.

Figure 12. Comparison with CRL with larger discount factors γ\gamma.

Visualizations

Evolution of KK and i∗i^* over time. Figure 13 and Figure 14 show the mean and sampled values of K+1K+1, together with the selected waypoint index i∗i^*, over a single episode in each environment. Since KK denotes the number of intermediate waypoints, K+1K+1 represents the total number of transition segments from the current state to the goal. We plot K+1K+1 to align with the waypoint indexing, where the goal has index K+1K+1, allowing direct comparison with the selected index i∗i^*.

In general, the mean value of K+1K+1 decreases as the agent approaches the goal, suggesting that the learned representation captures the remaining temporal distance to the goal. Notably, in Humanoid U Maze, the selected K+1K+1 values increase again after the humanoid reaches the goal, as it subsequently falls and cannot recover, causing its torso height to deviate from the target.

Visualizations of environment rollouts with corresponding representations. Figure 15 and Figure 16 visualize the environment rollouts together with spherical PCA ([15]) projections of the corresponding latent representations. Across the evaluated environments, these visualizations illustrate how C-Slerp adjusts the number of waypoints and selects a latent subgoal for the policy to pursue as it progresses toward the goal.

Figure 15. Visualization of C-Slerp rollouts and corresponding latent representations in JaxGCRL. For each environment, the top row shows successive states, and the bottom row shows spherical PCA [15] projections of the corresponding state representations and inferred waypoints.

Figure 16. Visualization of C-Slerp rollouts and corresponding latent representations in BuilderBench. For each environment, the top row shows successive states, and the bottom row shows spherical PCA [15] projections of the corresponding state representations and inferred waypoints.

Visualization of waypoint representations in maze environments. Figure 17 visualizes the inferred waypoints z1:Kz_{1:K} and the scores fLf_L over the maze. We first encode all (x,y)(x,y) positions on a grid with 0.2 m spacing using the state encoder ψ\psi. For each inferred waypoint ziz_i, we retrieve its nearest neighbor among these representations and plot the corresponding position in the maze. We also evaluate fL(s,a,s′)=ϕ(s,a)⊤ψ(s′)f_L(s,a,s') = \phi(s,a)^\top\psi(s') at every grid point and display the resulting scores as a heatmap, providing a proxy for how easily the current policy can reach each position. The visualizations indicate that, although the waypoints are generated entirely in the latent space, they correspond to intermediate (x,y)(x,y) positions along the path toward the goal.

Waypoint trajectories for Ant Big Maze, Ant U4 Maze, and Ant U5 Maze

Figure 1 (PDF p. 26). (a) Ant Big Maze; (b) Ant U4 Maze; (c) Ant U5 Maze. ψ(s)\psi(s); ψ(g)\psi(g); waypoint representations z1:Kz_{1:K}; selected waypoint zi∗z_i^*.

Ant Extreme Maze

Figure d. Ant Extreme Maze

Figure 19 (PDF p. 29). ψ(s)\psi(s); ψ(g)\psi(g); waypoint representations z1:Kz_{1:K}; selected waypoint zi∗z_{i^*}. (a) 2-tower. (b) 8-tower. (c) 3-tower (gripper).

Visualization of Ant Big Maze and Ant U5 Maze environments

Figure 20 (PDF p. 31).

Experimental Details

We implement C-Slerp on top of the publicly available JaxGCRL (Bortkiewicz et al., [3]) and BuilderBench (Ghugare et al., [9]) codebases. For baselines, we implement CRL (Eysenbach et al., [7]), RIS (Chane-Sane et al., [5]), an online version of HIQL (Park et al., [20]), L3P (Zhang et al., [30]), SAC+HER (Haarnoja et al., [10]; Andrychowicz et al., [1]) on the same codebase as C-Slerp. We run our experiments on a local machine consisting of A6000 GPUs, and each run in § 5 takes 12–72 hours depending on the environment. All training metric curves are averaged over 5 seeds, and the shaded region denotes one standard error. We provide the environment and evaluation details in Appendix § 10.§ 1, and the implementation details in Appendix § 10.§ 2.

Environments

JaxGCRL. We evaluate our method on goal-conditioned navigation tasks in JaxGCRL, including Humanoid, Humanoid U Maze, Ant Big Maze, Ant U4 Maze, and Ant U5 Maze. To extend our evaluation to substantially longer-horizon problems, we additionally design Ant Extreme Maze, inspired by Myers et al. [16].

The states consist of the torso’s global position and proprioceptive observations, including joint positions and velocities. The goals specify the desired torso position, and the actions correspond to joint-control commands. For Ant and Humanoid, respectively, the states have 29 and 268 dimensions, the goals indicate the desired global torso coordinates (x,y)(x, y) and (x,y,z)(x, y, z), and the actions have 8 and 17 dimensions. For the maze tasks, training goals are sampled uniformly from valid goal locations, whereas evaluation uses the goals shown as markers in Figure 18. The maximum episode length is 1,000 environment steps, except in Ant Extreme Maze, where the limit is 2,000 steps.

BuilderBench. We evaluate our method on gripper-based manipulation tasks with three to five cubes in BuilderBench. Each environment consists of NN cubes and a PD-controlled gripper. The gripper state consists of its 3-dimensional position, 4-dimensional orientation, 3-dimensional linear velocity, and 2 finger positions, giving 12 dimensions. Each cube contributes 13 dimensions consisting of its 3-dimensional position, 4-dimensional orientation, 3-dimensional linear velocity, and 3-dimensional angular velocity, yielding a (12+13N)(12 + 13N)-dimensional full state. Goals consist of the desired (x,y,z)(x, y, z) position of each cube and are 3N3N-dimensional. The action space has 5 dimensions, controlling gripper opening, Cartesian motion, and yaw. At each reset, the initial cube positions are randomized, and a randomly sampled (x,y)(x, y) offset is added to the desired position of the goal structure. To accommodate the longer manipulation sequences required as the number of cubes NN increases, we use 100+100N100 + 100N environment steps per episode during training and 200+200N200 + 200N environment steps per episode during evaluation.

Following Yan et al. [28], we additionally evaluate a modified BuilderBench environment in which the policy selects a cube and applies force and torque directly to it without using a gripper. Each cube has the same 13 pose and velocity components as in the gripper environment, and an additional scalar indicates the selected cube, yielding a (1+13N)(1+13N)-dimensional state. Goals specify the desired (x,y,z)(x,y,z) position of each cube and are 3N3N-dimensional. Each 5-dimensional action is represented as (fx,fy,fz,Tz,i)(f_x,f_y,f_z,T_z,i), where (fx,fy,fz)(f_x,f_y,f_z) denotes the applied force, TzT_z denotes the yaw torque, and ii identifies the cube receiving the actuation. As in the gripper environment, the initial cube positions are randomized, and the same randomly sampled (x,y)(x,y) offset is added to the desired position of the goal structure. To account for the longer manipulation sequences required as the number of cubes increases, we set the maximum episode length to 100+50N100+50N environment steps during both training and evaluation.

Metrics. For both JaxGCRL and BuilderBench, we report the fraction of evaluation episodes in which the agent meets the success criterion for each task. In JaxGCRL environments, success is achieved when the torso is within 0.5 m of the goal position. In BuilderBench environments, success requires all cubes to be within 0.01 m of their target heights and the structure to lie within 0.04 m of its target (x,y)(x,y) position. Each cube has an edge length of 0.04 m.

For the four-cube pyramid task, we also require the horizontal arrangement of the cubes to match the target structure. We measure each cube’s horizontal position relative to the center of the bottom layer and compare it with the corresponding position in the target structure. The allowed error is approximately 0.01 m for bottom-layer cubes and 0.03 m for upper-layer cubes. The center of the bottom layer must also be within 0.04 m of its target position.

Implementation details

During the learning process, we adjust the entropy coefficients α\alpha to match the target entropies using the automatic tuning procedure of SAC [10]. The number of waypoints KK is sampled from the softmax distribution in Eq. (13) with a temperature of η=0.1\eta=0.1 during both data collection and evaluation. Separately, to control the sharpness of the softmax distributions in the InfoNCE loss, fHf_H and fLf_L are divided by a temperature of τNCE=0.1\tau_{\mathrm{NCE}}=0.1 during training. We also adopt the sampling strategy of Ziarko et al. [34], which introduces in-trajectory negatives by sampling multiple positive pairs from each trajectory, with the number of pairs controlled by a repetition factor. For BuilderBench, we set the repetition factor to 12. For JaxGCRL, we use the default sampling strategy implemented in the codebase. We provide the hyperparameters of C-Slerp in Table 1 and the source code on our project page.

ParameterJaxGCRLBuilderBench
Actor learning rate10−410^{-4}10−410^{-4}
Representation learning rate10−410^{-4}10−410^{-4}
Actor entropy learning rate3×10−43 \times10^{-4}3×10−43 \times10^{-4}
Waypoint entropy learning rate3×10−33 \times10^{-3}3×10−33 \times10^{-3}
Batch size5121024
Representation dimension dd128512
Network depth816
Network width5121024
Discount factor γ\gamma0.990.99
InfoNCE temperature τNCE\tau_{\mathrm{NCE}}0.10.1
λrepr\lambda_{\mathrm{repr}}4.02.0
Control horizon hh1010
Maximum planning stages Kmax⁡+1K_{\max} + 15 (10 for Ant Extreme Maze)4
KK sampling temperature η\eta0.10.1
ii-selection threshold ϵ\epsilon0.40.4
In-trajectory repetition factor-12
Policy target entropy−∣A∣-\lvert A\rvert−2∣A∣-2\lvert A\rvert ( −∣A∣-\lvert A\rvert with gripper)
Waypoint target entropy−2.5(d−1)-2.5(d - 1)−3.5(d−1)-3.5(d - 1) ( −3.0(d−1)-3.0(d - 1) with gripper)

Table 1. Learning hyperparameters.

Algorithm 1 provides the full pseudocode for C-Slerp. Every hh environment steps, the high-level planner determines the number of waypoints and selects a subgoal for the low-level policy to pursue for the next hh steps. The resulting transitions are stored in the replay buffer and used to update the representations and policy.

Baseline methods. We implement all baselines within the same training and evaluation framework as our method. We closely follow each method’s original training objectives and algorithm-specific components while using shared infrastructure and matching the capacity of the main networks where appropriate.

For CRL [7], we closely follow the implementation provided in each benchmark’s codebase, retaining its network architecture and L2-based energy function, while tuning the learning rates.

For RIS [5], we follow the original diagonal Laplace subgoal parameterization and goal-relabeling scheme. We use the rollout goal, an achieved goal sampled independently from the replay buffer, and a future achieved goal from the same trajectory with probabilities 0.2, 0.4, and 0.4, respectively. Future achieved goals are sampled uniformly from later states within the same trajectory. We draw 10 samples from the imagined-subgoal prior and use the resulting subgoals only during training. At evaluation time, the policy is conditioned directly on the final task goal.

For HIQL [20], we adapt the original offline RL algorithm to our online setting by replacing the fixed offline dataset and pretraining stage with trajectories collected through online interaction and updates from the resulting replay buffer. We preserve the action-free expectile valuelearning objective, the high- and low-level advantage-weighted policy objectives, and the latent subgoal prediction used by the hierarchical policy. For value learning, we use the current state, a future achieved goal from the same trajectory, and an achieved goal sampled independently from the replay buffer with probabilities 0.2, 0.5, and 0.3, respectively. Future achieved goals are sampled from later states within the same trajectory according to a geometric distribution with parameter 1−γ1-\gamma. For the high-level objective, we sample an achieved goal either from the future of the same trajectory or independently from the replay buffer with probabilities 0.7 and 0.3, respectively. The target horizon KK determines how subgoals are selected during training. The low-level policy is trained to reach a state selected from the next KK steps of the same trajectory, while the high-level policy is trained to generate subgoals using targets selected within the same horizon. We set K=25K = 25 in JaxGCRL and K=10K = 10 in BuilderBench.

For SAC+HER ([10, 1]), goal relabeling uses a future achieved goal from the same trajectory with probability 0.8 and the original rollout goal with probability 0.2. Future achieved goals are sampled uniformly from later states within the same trajectory, and rewards are recomputed with respect to the resulting goal. Goal relabeling does not alter the original environment termination or discount signal.

For L3P ([30]), the training-time planning graph contains 50 learned landmarks and 150 additional replay-based landmarks, whereas evaluation uses only the 50 learned landmarks. Landmark pairs are scored using directed reachability estimates, so the retained graph topology depends on the learned values and the distance-clipping threshold rather than on a fixed edge set. L3P’s hindsight relabeling uses a uniformly sampled future achieved goal from the same trajectory with probability 0.85, with the future state restricted to at most 100 steps ahead. The graph is refreshed every 5×1055 \times10^{5} environment interactions, and planning during data collection is enabled after 5×1065 \times10^{6} interactions. To improve robustness in the online setting, each learned latent component is represented by a state selected from the replay buffer rather than directly by a decoded latent centroid. This ensures that planning landmarks correspond to states observed in the environment and avoids centroids that may fall in invalid or unreachable regions.

For model architecture, CRL, RIS, SAC+HER, and L3P use the same backbone as our method for their main policy and value-learning networks. For HIQL, we preserve its component-specific structure. The representation and value networks use three hidden layers, the high-level policy uses two hidden layers, and the low-level policy matches the number of hidden layers in the policy used by C-Slerp for each benchmark. To improve performance, both HIQL policies use half as many units per hidden layer as our method’s policy. HIQL uses a 10-dimensional latent subgoal representation, and L3P uses a 16-dimensional latent space. Unless otherwise specified, the baselines follow the same shared training settings as our method.

For baseline tuning, we use settings reported in the original papers and implementations as starting points and vary learning rates and method-specific parameters to identify the best-performing configuration for each baseline and benchmark. Table 2 summarizes the candidate values considered during tuning. Once selected, each configuration is fixed for all final evaluations. Table 3–Table 7 report the selected method-specific parameters used in our experiments.

MethodParameterSearch space
CRLActor learning rate{3×10−4,2×10−4,10−4}\{3 \times10^{-4}, 2 \times10^{-4}, 10^{-4}\}
Critic learning rate{3×10−4,2×10−4,10−4}\{3 \times10^{-4}, 2 \times10^{-4}, 10^{-4}\}
RISActor learning rate{3×10−5,10−4,3×10−4}\{3 \times10^{-5}, 10^{-4}, 3 \times10^{-4}\}
Critic learning rate{10−4,3×10−4,10−3}\{10^{-4}, 3 \times10^{-4}, 10^{-3}\}
KL coefficient{0.1,0.3}\{0.1, 0.3\}
Prior samples{3,10}\{3, 10\}
SAC+HERActor/critic learning rate{10−4,3×10−4}\{10^{-4}, 3 \times10^{-4}\}
Target entropy{−0.5∣A∣,−1∣A∣,−2∣A∣}\{-0.5\lvert A\rvert, -1\lvert A\rvert, -2\lvert A\rvert\}
Online HIQLLearning rate{10−4,2×10−4,3×10−4}\{10^{-4}, 2 \times10^{-4}, 3 \times10^{-4}\}
High-level coefficient βhigh\beta_{\mathrm{high}}{0.1,0.2,0.3,0.5,1.0}\{0.1, 0.2, 0.3, 0.5, 1.0\}
Low-level coefficient βlow\beta_{\mathrm{low}}{0.3,0.4,0.5,1,100}\{0.3, 0.4, 0.5, 1, 100\}
Target horizon KK{3,5,10,25}\{3, 5, 10, 25\}
Direct-goal bootstrap fraction{0,0.025}\{0, 0.025\}
Random-action warm-up{0,1000,2000}\{0, 1000, 2000\}
L3PActor/critic/value learning rate{10−4,2×10−4,3×10−4}\{10^{-4}, 2 \times10^{-4}, 3 \times10^{-4}\}
Discount factor γ\gamma{0.98,0.99}\{0.98, 0.99\}
Action regularization{0.05,0.1}\{0.05, 0.1\}
Learned landmarks{50,100}\{50, 100\}
Distance-clipping threshold{−20,−15}\{-20, -15\}
Graph refresh interval{105,5×105}\{10^{5}, 5 \times10^{5}\}
Exploration noise{0.1,0.2}\{0.1, 0.2\}
Random-action probability{0.05,0.2}\{0.05, 0.2\}

Table 2. Hyperparameter search spaces for baseline tuning.

ParameterJaxGCRLBuilderBench
Actor learning rate3×10−43 \times10^{-4}3×10−43 \times10^{-4}
Critic learning rate3×10−43 \times10^{-4}3×10−43 \times10^{-4}
Energy functionL2 normL2 norm

Table 3. CRL-specific parameters.

ParameterJaxGCRLBuilderBench
Actor/critic/value learning rate10−410^{-4}10−410^{-4}
Autoencoder/cluster learning rate3×10−43 \times10^{-4}3×10−43 \times10^{-4}
Target-network update period10 learner steps10 learner steps
Latent dimension1616
Action regularization0.050.05
Learned landmarks5050
Additional training landmarks150150
Graph refresh interval5×1055 \times10^{5}5×1055 \times10^{5}
Planning activation5×1065 \times10^{6}5×1065 \times10^{6}
Distance-clipping threshold−20-20−20-20
Soft-planning temperature1.11.1
Value-iteration steps2020
Local planning horizon1010
Exploration noise0.20.2
Random-action probability0.20.2

Table 7. L3P-specific parameters.

Algorithm 1 Contrastive Planning via Spherical Linear Interpolation (C-Slerp)

  1. Initialize policy πθ(a∣s,z)\pi_\theta(a \mid s,z), encoders ϕ(s,a)\phi(s,a) and ψ(s)\psi(s), rotation matrix RR, replay buffer D\mathcal{D}

  2. for each training epoch do // Data collection

  3. for each episode do

  4. t←0t \leftarrow0

  5. Sample an initial state s0∼p0s_0 \sim p_0 and a goal g∼pgg \sim p_g

  6. while the episode is not finished do

  7. if t%h=0t \mathbin{\%} h = 0 then // K-selection

  8. Sample KK for (st,g)(s_t,g) using Eq. (13)

  9. for i=1,…,Ki = 1,\ldots,K do

  10. Compute (μi∗,σi∗2)(\mu_i^*,\sigma_i^{*2}) using Eq. (11)

  11. Sample z~i∼N(μi∗,σi∗2I)\tilde{z}_i \sim\mathcal{N}(\mu_i^*,\sigma_i^{*2}I)

  12. Set zi=z~i/∥z~i∥2z_i = \tilde{z}_i/\lVert\tilde{z}_i\rVert_2

  13. end for

  14. Set zK+1=ψ(g)z_{K+1}=\psi(g) // i-selection

  15. for i=1,…,K+1i = 1,\ldots,K+1 do

  16. Sample a~i∼πθ(⋅∣st,zi)\tilde{a}_i \sim\pi_\theta(\cdot\mid s_t,z_i)

  17. Compute ρi=ϕ(st,a~i)⊤zi\rho_i = \phi(s_t,\tilde{a}_i)^\top z_i

  18. end for

  19. if max⁡i∈{1,…,K+1}ρi≥ϵ\max_{i\in\{1,\ldots,K+1\}}\rho_i \ge\epsilon then

  20. Select i∗i^* using Eq. (14)

  21. else

  22. Set i∗=1i^*=1

  23. end if

  24. Set the subgoal z=zi∗z=z_{i^*}

  25. end if // Policy rollout

  26. Sample at∼πθ(⋅∣st,z)a_t \sim\pi_\theta(\cdot\mid s_t,z)

  27. Execute ata_t and observe st+1s_{t+1}

  28. Store (st,at,st+1)(s_t,a_t,s_{t+1}) in D\mathcal{D}

  29. t←t+1t \leftarrow t+1

  30. end while

  31. end for // Representation and policy learning

  32. for each gradient step do

  33. Sample a batch B={(sj,aj,sj+)}j=1B\mathcal{B}=\{(s_j,a_j,s_j^+)\}_{j=1}^{B} from D\mathcal{D}

  34. Update ϕ,ψ,R\phi,\psi,R by minimizing Lrepr\mathcal{L}_{\mathrm{repr}} in Eq. (15)

  35. Update πθ\pi_\theta using Eq. (16)

  36. end for

  37. end for

ParameterJaxGCRLBuilderBench
Actor/subgoal learning rate10−410^{-4}10−410^{-4}
Critic learning rate10−410^{-4}10−310^{-3}
KL coefficient0.10.1
Bottleneck temperature0.10.1
Prior samples1010

Table 4. RIS-specific parameters.

ParameterJaxGCRLBuilderBench
Actor/critic learning rate10−410^{-4}10−410^{-4}
Entropy learning rate3×10−43 \times10^{-4}3×10−43 \times10^{-4}
HER probability0.80.8
Initial entropy coefficient1.00.01
Target entropy coefficient−0.5-0.5−1.0-1.0

Table 5. SAC+HER-specific parameters.

ParameterJaxGCRLBuilderBench
Learning rate3×10−43 \times10^{-4}10−410^{-4}
Expectile0.70.7
βhigh\beta_{\mathrm{high}}0.20.5
βlow\beta_{\mathrm{low}}0.3100
Target horizon KK2510
Direct-goal bootstrap fraction00
Random-action warm-up00
Representation dimension1010

Table 6. Online HIQL-specific parameters.

References

  1. [1]Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Feng, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. Advances in neural information processing systems, 30, 2017.arxiv.org/abs/1707.01495
  2. [2]Mahsa Bastankhah, Grace Liu, Dilip Arumugam, Thomas L Griffiths, and Benjamin Eysenbach. Demystifying the mechanisms behind emergent exploration in goal-conditioned rl. In International Conference on Learning Representations, volume 2026, pp. 125535–125575, 2026.arxiv.org/abs/2510.14129
  3. [3]Michał Bortkiewicz, Władysław Pałucki, Vivek Myers, Tadeusz Dziarmaga, Tomasz Arczewski, Łukasz Kuciński, and Benjamin Eysenbach. Accelerating goal-conditioned reinforcement learning algorithms and research. In International Conference on Learning Representations, volume 2025, pp. 15732–15754, 2025.arxiv.org/abs/2408.11052
  4. [4]Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018.arxiv.org/abs/1810.12894
  5. [5]Elliot Chane-Sane, Cordelia Schmid, and Ivan Laptev. Goal-conditioned reinforcement learning with imagined subgoals. In International Conference on Machine Learning, 2021.
  6. [6]Ben Eysenbach, Russ R Salakhutdinov, and Sergey Levine. Search on the replay buffer: Bridging planning and reinforcement learning. Advances in neural information processing systems, 32, 2019.arxiv.org/abs/1906.05253
  7. [7]Benjamin Eysenbach, Tianjun Zhang, Sergey Levine, and Russ R Salakhutdinov. Contrastive learning as goal-conditioned reinforcement learning. Advances in Neural Information Processing Systems, 35:35603–35620, 2022.arxiv.org/abs/2206.07568
  8. [8]Benjamin Eysenbach, Vivek Myers, Ruslan Salakhutdinov, and Sergey Levine. Inference via interpolation: Contrastive representations provably enable planning and inference. Advances in Neural Information Processing Systems, 37:58901–58928, 2024.arxiv.org/abs/2403.04082
  9. [9]Raj Ghugare, Roger Creus Castanyer, Catherine Ji, Kathryn Wantlin, Jin Schofield, Karthik Narasimhan, and Benjamin Eysenbach. Builderbench: The building blocks of intelligent agents. arXiv preprint arXiv:2510.06288, 2025.arxiv.org/abs/2510.06288
  10. [10]Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018a.arxiv.org/abs/1801.01290
  11. [11]Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018b.arxiv.org/abs/1812.05905
  12. [12]Leslie Pack Kaelbling. Learning to achieve goals. In International Joint Conference on Artificial Intelligence, 1993.
  13. [13]Andrew Levy, George Konidaris, Robert Platt, and Kate Saenko. Learning multi-level hierarchies with hindsight. arXiv preprint arXiv:1712.00948, 2017.arxiv.org/abs/1712.00948
  14. [14]Grace Liu, Michael Tang, and Benjamin Eysenbach. A single goal is all you need: Skills and exploration emerge from contrastive rl without rewards, demonstrations, or subgoals. In International Conference on Learning Representations, volume 2025, pp. 78599–78621, 2025.arxiv.org/abs/2408.05804
  15. [15]Kai Liu, Qiwei Li, Hua Wang, and Gongguo Tang. Spherical principal component analysis. In Proceedings of the 2019 SIAM international conference on data mining, pp. 387–395. SIAM, 2019.arxiv.org/abs/1903.06877
  16. [16]Vivek Myers, Catherine Ji, and Benjamin Eysenbach. Horizon generalization in reinforcement learning. In International Conference on Learning Representations, volume 2025, pp. 76302–76326, 2025.arxiv.org/abs/2501.02709
  17. [17]Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. Advances in neural information processing systems, 31, 2018.arxiv.org/abs/1805.08296
  18. [18]Ofir Nachum, Haoran Tang, Xingyu Lu, Shixiang Gu, Honglak Lee, and Sergey Levine. Why does hierarchy (sometimes) work so well in reinforcement learning? arXiv preprint arXiv:1909.10618, 2019.arxiv.org/abs/1909.10618
  19. [19]Soroush Nasiriany, Vitchry Pong, Steven Lin, and Sergey Levine. Planning with goal-conditioned policies. Advances in neural information processing systems, 32, 2019.arxiv.org/abs/1911.08453
  20. [20]Seohong Park, Dibya Ghosh, Benjamin Eysenbach, and Sergey Levine. HIQL: Offline goal-conditioned RL with latent states as actions. In Advances in Neural Information Processing Systems, 2023.arxiv.org/abs/2307.11949
  21. [21]Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In International conference on machine learning, pp. 2778–2787. PMLR, 2017.arxiv.org/abs/1705.05363
  22. [22]Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In International conference on machine learning, pp. 5171–5180. PMLR, 2019.arxiv.org/abs/1905.06922
  23. [23]Tom Schaul, Daniel Horgan, Karol Gregor, and David Silver. Universal value function approximators. In International conference on machine learning, pp. 1312–1320. PMLR, 2015.
  24. [24]Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In International conference on machine learning, pp. 3540–3549. PMLR, 2017.arxiv.org/abs/1703.01161
  25. [25]Kevin Wang, Ishaan Javali, Michał Bortkiewicz, Tomasz Trzcinski, and Benjamin Eysenbach. 1000 layer networks for self-supervised rl: Scaling depth can enable new goal-reaching capabilities. Advances in Neural Information Processing Systems, 38:157643–157670, 2026.arxiv.org/abs/2503.14858
  26. [26]Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In International conference on machine learning, pp. 9929–9939. PMLR, 2020.arxiv.org/abs/2005.10242
  27. [27]Zheng Wen, Doina Precup, Morteza Ibrahimi, Andre Barreto, Benjamin Van Roy, and Satinder Singh. On efficiency in hierarchical reinforcement learning. Advances in Neural Information Processing Systems, 33:6708–6718, 2020.
  28. [28]David Yan, Brandon Cho, Andrew Tu, Vedant Badoni, Zhechang Yang, Raj Ghugare, and Benjamin Eysenbach. Scaling the horizon of contrastive reinforcement learning. In Third Reinforcement Learning Beyond Rewards Workshop at the Reinforcement Learning Conference, 2026.
  29. [29]Chun-Hsiao Yeh, Cheng-Yao Hong, Yen-Chi Hsu, Tyng-Luh Liu, Yubei Chen, and Yann LeCun. De-coupled contrastive learning. In European conference on computer vision, pp. 668–684. Springer, 2022.
  30. [30]Lunjun Zhang, Ge Yang, and Bradly C. Stadie. World model as a graph: Learning latent landmarks for planning. In International Conference on Machine Learning, 2021a.arxiv.org/abs/2011.12491
  31. [31]Tianjun Zhang, Benjamin Eysenbach, Ruslan Salakhutdinov, Sergey Levine, and Joseph E Gonzalez. C-Planning: An automatic curriculum for learning goal-reaching tasks. arXiv preprint arXiv:2110.12080, 2021b.arxiv.org/abs/2110.12080
  32. [32]Tianren Zhang, Shangqi Guo, Tian Tan, Xiaolin Hu, and Feng Chen. Generating adjacency-constrained subgoals in hierarchical reinforcement learning. Advances in neural information processing systems, 33:21579–21590, 2020.arxiv.org/abs/2006.11485
  33. [33]John Zhou and Jonathan Kao. Flattening hierarchies with policy bootstrapping. Advances in Neural Information Processing Systems, 38:82975–83007, 2026.arxiv.org/abs/2505.14975
  34. [34]Alicja Ziarko, Michał Bortkiewicz, Michał Zawalski, Benjamin Eysenbach, and Piotr Miłos. Contrastive representations for temporal reasoning. Advances in Neural Information Processing Systems, 38:109229–109259, 2026.arxiv.org/abs/2508.13113

Paper details

vlnc:W_vwrd47tn
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents