OPI

Overview

Search with the learner and all oracles, update from replay

Method

Oracle-Aggregated Policy Improvement (OPI)

Setting

One learner, several oracles, each good in different states

Oracles (here: three driving experts) \( \Pi=\{\pi_1,\dots,\pi_K\} \) Black-box policies that we can only query for actions.
Value of a policy \( V^{\pi}(s)=\mathbb E_{\pi}\bigl[\textstyle\sum_{t}\gamma^t r_t\mid s_0=s\bigr] \) \( J(\pi)=\mathbb E_{s_0}\bigl[V^{\pi}(s_0)\bigr] \) How well \(\pi\) does from \(s\) on, with reward \(r_t\) and discount \(\gamma\); \(J\): its expected return.
Goal \( J(\pi_\theta)\ \ge\ \max_k J(\pi_k) \) A learner \(\pi_\theta\) that matches or beats every oracle in few environment steps.

Preliminaries

Three ways to compose oracles

Max-following hands each state to the best oracle. Max-aggregation instead takes the best action at each state, assuming that from the next state on we follow whichever oracle is best there. This criterion is the max-advantage \(A_{\max}\), defined next.

Foundation

From max-advantage to a tractable proxy

  1. Treat the learner and the oracles as actors.

    \( \Pi^{\dagger}=\{\pi_0,\pi_1,\dots,\pi_K\},\quad \pi_0:=\pi_\theta \)
  2. Baseline: the best actor's value at \(s\).

    \( V_{\max}(s)=\max_{k\in\{0,\dots,K\}}V^{\pi_k}(s) \)
  3. Max-advantage: the gain from taking \(a\), then following the best actor at the next state \(s'\).

    \( A_{\max}(s,a)=r(s,a)+\gamma\,\mathbb E_{s'}\bigl[V_{\max}(s')\bigr]-V_{\max}(s) \)
  4. \(\mathbb E_{s'}[V_{\max}(s')]\) is intractable. Instead, use the critic of each actor \(k\), \(Q^{\pi_k}(s,a)\): the value of taking \(a\), then following actor \(k\). Following one fixed actor is never better than following the best actor, so:

    \( A_{\max}(s,a)\ \ge\ \max_{k}Q^{\pi_k}(s,a)-V_{\max}(s)=:\tilde A_{\mathrm{proxy}}(s,a) \)
  5. Why maximize it: with exact critics, always taking \(a^*=\arg\max_a\tilde A_{\mathrm{proxy}}(s,a)\) is no worse than \(V_{\max}\).

Schematic · one state \(s\), one action \(a\)

Following one fixed actor after \(a\) (bars) never beats switching to the best actor at \(s'\) (outline), so \(\tilde A_{\mathrm{proxy}}\le A_{\max}\).

SearchOracle-guided behavior policy

Use the oracles to search for good actions

1 · Propose \( \mathcal C_t=\bigl\{(\pi_k,a^{k}_{t,j}) : a^{k}_{t,j}\sim\pi_k(\cdot\mid s_t)\bigr\}_{k=0..K,\ j=1..M} \) Every actor, learner included, proposes \(M\) actions.
2 · Source-aware score \( \widehat S^{(k)}(s,a)=\begin{cases}Q_k(s,a) & a\sim\pi_k\\ Q_k(s,a)-\alpha\,\sigma_k(s,a) & a\nsim\pi_k\end{cases} \) \(Q_k,\ \sigma_k\): mean and standard deviation of critic ensemble \(k\), which estimates \(Q^{\pi_k}\); \(a\sim\pi_k\): \(a\) was proposed by \(\pi_k\); \(\alpha\): penalty weight.
3 · Select \( \tilde A_{\mathrm{proxy}}(s,a)=\max_{k}\widehat S^{(k)}(s,a)-V_{\max}(s) \) \( \hat a_t\sim p_t(a)\propto\exp\!\bigl(\tilde A_{\mathrm{proxy}}(s_t,a)/\tau\bigr) \) For selection, the scores \(\widehat S^{(k)}\) replace \(Q^{\pi_k}\) in the proxy; \(\tau\): temperature. The selected action can come from any actor, so control can switch at every step.

At each state, the learner and every oracle propose actions, and we sample the action to execute by its \(\tilde A_{\mathrm{proxy}}\). A critic misjudges actions from other actors, so step 2 penalizes them.

Schematic · a city street
penalized: another actor's actionhighest score for that action; sets its selection probability

UpdateOracle-guided policy improvement

Use the oracles to update the learner

1 · Weight replayed actions by advantage \( w(s,a)=\exp\!\bigl(\tilde A_{\mathrm{proxy}}(s,a)/\eta\bigr) \) \(\eta\): temperature; \(\mathcal D\): replay buffer.
2 · Imitate with these weights (GABC) \( \mathcal L_{\mathrm{GABC}}(\theta)=\mathbb E_{(s,a)\sim\mathcal D}\bigl[w(s,a)\,\|a-\pi_\theta(s)\|^2\bigr] \) GABC: generalized advantage-weighted behavior cloning. Plain behavior cloning (BC) uses \(w=1\).
3 · Climb the learner's critic (DPG) \( \mathcal L_{\mathrm{RL}}(\theta)=-\mathbb E_{s\sim\mathcal D}\bigl[Q^{\pi_\theta}\bigl(s,\pi_\theta(s)\bigr)\bigr] \) DPG: deterministic policy gradient. \(Q^{\pi_\theta}=Q_0\), the learner's critic.
Training objective \( \mathcal L(\theta)=\mathcal L_{\mathrm{RL}}(\theta)+\lambda\,\mathcal L_{\mathrm{GABC}}(\theta) \) Both losses are minimized together on batches from \(\mathcal D\); \(\lambda\) balances imitation (GABC) and improvement (DPG).

The learner trains on the replay buffer \(\mathcal D\) with two losses: GABC imitates stored actions, weighting those with a higher \(\tilde A_{\mathrm{proxy}}\) more; DPG moves its actions toward a higher value of its own critic. The updated learner then joins the next search as \(\pi_0\).

Schematic · one state \(s\)
replayed action, colored by the actor that proposed it

Experiments

Environments, baselines and metrics

NAUC: normalized area under the learning curve \( \mathrm{NAUC}=\frac{1}{T}\int_0^T \mathrm{perf}(t)\,dt \) \(\mathrm{perf}(t)\): success rate (or return on Hopper-Hop and Quadruped-Run) after \(t\) environment steps; \(T\): step budget, the same for all methods. Higher NAUC means better sample efficiency.
Final performance \( \mathrm{perf}(T) \) Performance at the end of training.
Schematic

The gray learner reaches the same final performance but learns more slowly, so its NAUC is smaller.

Q1Sparse rewards

Does OPI learn faster when rewards are sparse?

Best NAUC and 100% final success on all four sparse tasks in Table 1.

Mean over 5 seeds, Table 1. Switch to Final for the final success rate.

Q2Dense rewards

And when rewards are dense?

Competitive on dense tasks, with the best NAUC on two of four.

Mean over 5 seeds, Table 2.

Q3Composition

Can OPI beat the best single oracle?

OPI beats the best single oracle.

Final success rate (%)

Oracles: Appendix A; OPI: Tables 1–2.

Q4Actor selection

Does the learner take over from the oracles?

Yes: OPI selects its own learner more and more often.

OPI: share of executed actions during training

Two sparse-reward tasks, Fig. 2.

Ablations

What each component contributes

A1Components

What if we remove source-aware scoring, DPG, or sampling (always executing the top-scoring candidate instead)?

Each removal lowers performance.

NAUC relative to full OPI (%)

8 tasks, 5 seeds, Table 3.

A2Exploration and GABC

Does oracle-guided search beat scheduled exploration? Is GABC needed?

Scheduled exploration often wastes samples on suboptimal oracles; GABC is key with sparse rewards.

Return / success rate (SR) during training

Fig. 3.

Quadruped-Run (OPI and w/o GABC overlap)
Quadruped-Run: OPI, w/o GABC and scheduled exploration learning curves.
Push-Wall-Sparse
Push-Wall-Sparse: OPI reaches 100% early; scheduled exploration is slower; w/o GABC stays at 0.
Assembly-Sparse
Assembly-Sparse: scheduled exploration is comparable to OPI; w/o GABC stays low.