Skip to content
Ahmed Haroon
← Reinforcement Learning

Skill Learning

From Exploration to Reusable Behavior

Action-level exploration is inefficient when useful behavior must persist for many individually unrewarded steps. Instead of perturbing every action independently, we can learn a repertoire of temporally extended behaviors before a downstream task is known.

Let zz denote a latent skill and let

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

A useful repertoire should be diverse, controllable, and reusable. Information-theoretic objectives make these requirements measurable: the chosen skill should predict the behavior that follows, while the resulting behavior should reveal which skill was chosen.

This chapter continues from exploration, replacing information-seeking actions with distinguishable skills and reachable goals.

Discovering Skills Without External Reward

Action-level exploration struggles when useful behavior must persist. Skill learning introduces a latent variable zz and a conditioned policy

z∼p(z),at∼πθ(at∣st,z).z\sim p(z), \qquad a_t\sim\pi_\theta(a_t\mid s_t,z).

Different skills should produce distinguishable state distributions

dπ(s∣z).d_\pi(s\mid z).

This can pretrain reusable behaviors before a downstream reward is known, supply options for hierarchical control, and explore the space of achievable behavior.

The ideal diversity objective is

I(Z;S)=H(Z)−H(Z∣S).\boxed{ I(Z;S)=\mathcal H(Z)-\mathcal H(Z\mid S) }.

With a fixed uniform skill prior, H(Z)\mathcal H(Z) is constant. The policy must make the selected skill identifiable from the states it visits.

The true posterior p(z∣s)p(z\mid s) is unavailable, so train a discriminator qϕ(z∣s)q_\phi(z\mid s). This produces the lower bound

I(Z;S)≥Ep(z,s)[log⁡qϕ(z∣s)−log⁡p(z)].\boxed{ I(Z;S) \ge \mathbb E_{p(z,s)} \left[ \log q_\phi(z\mid s)-\log p(z) \right] }.
See derivation

Start from

I(Z;S)=Ep(z,s)[log⁡p(z∣s)−log⁡p(z)].I(Z;S) =\mathbb E_{p(z,s)} [\log p(z\mid s)-\log p(z)].

Add and subtract log⁡qϕ(z∣s)\log q_\phi(z\mid s):

I(Z;S)=Ep(z,s)[log⁡qϕ(z∣s)−log⁡p(z)]+Ep(s)DKL(p(z∣s)∥qϕ(z∣s)).\begin{aligned} I(Z;S) &=\mathbb E_{p(z,s)} [\log q_\phi(z\mid s)-\log p(z)]\\ &\quad+ \mathbb E_{p(s)} D_{\mathrm{KL}} \left( p(z\mid s)\|q_\phi(z\mid s) \right). \end{aligned}

Dropping it gives the variational lower bound.

For a fixed uniform prior, −log⁡p(z)-\log p(z) is constant, so the policy can use

rint(s,z)=log⁡qϕ(z∣s).\boxed{ r_{\mathrm{int}}(s,z)=\log q_\phi(z\mid s) }.

If every skill visits the same states, then p(z∣s)≈p(z)p(z\mid s)\approx p(z) and I(Z;S)≈0I(Z;S)\approx0. The discriminator cannot identify the skill, so the policy receives little reward. Distinguishable behaviors increase the bound.

Discriminator-Based Skill Discovery\textbf{Discriminator-Based Skill Discovery}Initialize skill policy πθ and discriminator qϕ.Repeat:z∼p(z),roll out πθ(a∣s,z),ϕ←arg⁡max⁡ϕ∑tlog⁡qϕ(z∣st),rint(st,z)←log⁡qϕ(z∣st),update πθ with intrinsic return.\begin{aligned} &\text{Initialize skill policy }\pi_\theta \text{ and discriminator }q_\phi.\\[0.25em] &\text{Repeat:}\\[0.25em] &\qquad z\sim p(z),\\[0.25em] &\qquad \text{roll out }\pi_\theta(a\mid s,z),\\[0.25em] &\qquad \phi\leftarrow \arg\max_\phi\sum_t\log q_\phi(z\mid s_t),\\[0.25em] &\qquad r_{\mathrm{int}}(s_t,z) \leftarrow\log q_\phi(z\mid s_t),\\[0.25em] &\qquad \text{update }\pi_\theta\text{ with intrinsic return}. \end{aligned}

The discriminator may exploit irrelevant visual cues, and the environment may contain few independently controllable behaviors. Diversity in discriminator space is not automatically useful diversity.

Empowerment Measures Control Authority

Novelty rewards reaching unfamiliar states. Empowerment rewards being able to choose among reliably different futures.

One-step empowerment is

I(At;St+1)=H(St+1)−H(St+1∣At).\boxed{ I(A_t;S_{t+1}) =\mathcal H(S_{t+1}) -\mathcal H(S_{t+1}\mid A_t) }.

It is high when the agent can reach many future states and each action has a predictable, distinguishable consequence. Random environmental motion may increase state entropy, but it also increases conditional entropy and therefore does not imply control.

For temporally extended control, replace AtA_t with a skill ZZ and St+1S_{t+1} with St+HS_{t+H}:

I(Z;St+H).I(Z;S_{t+H}).

Skill discovery can thus be interpreted as learning a compact channel from chosen latent behaviors to reachable outcomes.

Goals Turn Diversity into Reachability

Replace the abstract skill with a goal gg:

at∼πθ(at∣st,g).a_t\sim\pi_\theta(a_t\mid s_t,g).

The same information objective is

I(G;S)=H(G)−H(G∣S).I(G;S)=\mathcal H(G)-\mathcal H(G\mid S).

The first term asks for diverse proposed goals. The second asks the achieved state to reveal which goal was intended. A learned discriminator may supply

r(s,g)=log⁡qϕ(g∣s),r(s,g)=\log q_\phi(g\mid s),

while explicit state goals may use

r(s,g)=1{∥s−g∥≤ε}.r(s,g)=\mathbf 1\{\|s-g\|\le\varepsilon\}.

Sampling goals only from common achieved states causes the agent to rehearse what it already knows. Skew-Fit reweights achieved goals by inverse density:

w(g)=pψ(g)α,α∈[−1,0),w(g)=p_\psi(g)^\alpha, \qquad \alpha\in[-1,0),

and fits

ψ←arg⁡max⁡ψEg∼pdata[w(g)log⁡pψ(g)].\psi\leftarrow\arg\max_\psi \mathbb E_{g\sim p_{\mathrm{data}}} [w(g)\log p_\psi(g)].

The implied target density is

qα(g)∝p(g)1+α.\boxed{ q_\alpha(g) \propto p(g)^{1+\alpha} }.
See derivation

Weighted samples from p(g)p(g) contribute density proportional to

p(g)w(g)=p(g)p(g)α=p(g)1+α.p(g)w(g) =p(g)p(g)^\alpha =p(g)^{1+\alpha}.

Since α∈[−1,0)\alpha\in[-1,0),

1+α∈[0,1).1+\alpha\in[0,1).

At α=−1\alpha=-1, the idealized target is uniform over represented support.

Skew-Fit Goal Exploration\textbf{Skew-Fit Goal Exploration}Fit a goal model pψ(g) to achieved states.Repeat:g∼pψ(g),attempt g with πθ(a∣s,g),update the goal-conditioned policy,w(gi)←pψ(gi)α,ψ←arg⁡max⁡ψ∑iw(gi)log⁡pψ(gi).\begin{aligned} &\text{Fit a goal model }p_\psi(g)\text{ to achieved states}.\\[0.25em] &\text{Repeat:}\\[0.25em] &\qquad g\sim p_\psi(g),\\[0.25em] &\qquad \text{attempt }g\text{ with }\pi_\theta(a\mid s,g),\\[0.25em] &\qquad \text{update the goal-conditioned policy},\\[0.25em] &\qquad w(g_i)\leftarrow p_\psi(g_i)^\alpha,\\[0.25em] &\qquad \psi\leftarrow \arg\max_\psi\sum_iw(g_i)\log p_\psi(g_i). \end{aligned}

Rare achieved states become more likely future goals, expanding coverage outward. The generator may still propose unreachable goals, and uniform state coverage may be irrelevant to downstream tasks. Goal quality depends on a representation whose distances and densities reflect controllable structure.

From Diversity to Downstream Control

Skill discovery, empowerment, and goal-conditioned learning emphasize different aspects of the same channel:

chosen latent or goal⟶temporally extended behavior⟶distinguishable reachable outcome.\boxed{ \text{chosen latent or goal} \longrightarrow \text{temporally extended behavior} \longrightarrow \text{distinguishable reachable outcome} }.

Use discriminator-based skills when broad behavioral diversity is valuable before the task is known. Use empowerment when controllability matters more than raw novelty. Use goal-conditioned policies when desired outcomes can be represented directly and practiced through relabeling or adaptive goal proposals.

These objectives remain representation dependent. A discriminator may exploit irrelevant cues, a goal model may propose unreachable states, and uniform coverage may not align with future usefulness. Learned diversity becomes valuable only when downstream control can compose, select, or fine-tune the resulting behaviors.