R EWARD U NCERTAINTY FOR E XPLORATION IN P REFERENCE - BASED R EINFORCEMENT L EARNING
A BSTRACT
Conveying complex objectives to reinforcement learning (RL) agents often requires meticulous reward engineering.
Preference-based RL methods are able to learn a more ﬂexible reward model based on human preferences by actively incorporating human feedback, i.e. teacher’s preferences between two clips of behaviors.
However, poor feedback-efﬁciency still remains a problem in current preference-based RL algorithms, as tailored human feedback is very expensive.
To handle this issue, previous methods have mainly focused on improving query selection and policy initialization.
At the same time, recent exploration methods have proven to be a recipe for improving sample-efﬁciency in RL.
We present an exploration method speciﬁcally for preference-based RL algorithms.
Our main idea is to design an intrinsic reward by measuring the novelty based on learned reward.
Speciﬁcally, we utilize disagreement across ensemble of learned reward models.
Our intuition is that disagreement in learned reward model reﬂects uncertainty in tailored human feedback and could be useful for exploration.
Our experiments show that exploration bonus from uncertainty in learned reward improves both feedback- and sample-efﬁciency of preference-based RL algorithms on complex robot manipulation tasks from MetaWorld benchmarks, compared with other existing exploration methods that measure the novelty of state visitation.
I NTRODUCTION
In reinforcement learning (RL) reward function speciﬁes correct objectives to RL agents.
However, it is difﬁcult and time-consuming to carefully design suitable reward functions for a variety of complex behaviors (e.g., cooking or book summarization (Wu et al., 2021)).
Furthermore, if there are complicated social norms we want RL agents to understand and follow, conveying a reliable reward function to include such information may remain to be an open problem (Amodei et al., 2016;
Hadﬁeld-Menell et al., 2017).
Overall, engineering reward functions purely by human efforts for all tasks remains to be a signiﬁcant challenge.
An alternative to resolve the challenge of reward engineering is preference-based RL (Christiano et al., 2017; Ibarz et al., 2018;
Lee et al., 2021b).
Compared to traditional RL setup, preferencebased RL algorithms are able to teach RL agents without the necessity of designing reward functions.
Instead, the agent uses feedback, usually in the form of (human) teacher preferences between two behaviors, to learn desired behaviors indicated by teacher.
Therefore, instead of using carefullydesigned rewards from the environment, the agent is able to learn a more ﬂexible reward function suitably aligned to teacher feedback.
However, preference-based RL usually requires a large amount of teacher feedback, which may be timely or sometimes infeasible to collect.
To improve feedback-efﬁciency, prior works have investigated several sampling strategies (Biyik & Sadigh, 2018;
Sadigh et al., 2017; Biyik et al., 2020; Lee et al., 2021c).
These methods aim to select more informative queries to improve the quality of the learned reward function while asking for fewer feedback from teacher.
Another line of works focus on policy initialization.
Ibarz et al.
(2018) initialized the agent’s policy with imitation learning from the expert demonstrations, and Lee et al.
(2021b) utilized unsupervised pre-training of RL agents before collecting for teacher preferences in the hope of learning diverse behaviors in a self-supervised way to reduce total amount of human feedback.
Exploration, in the context of standard RL, has addressed the problems of sample-efﬁciency (Stadie et al., 2015; Bellemare et al., 2016; Pathak et al., 2017; 2019; Liu & Abbeel, 2021; Seo et al., 2021b).
When extrinsic rewards from the environment is limited, exploration has been demonstrated to allow
RL agents to learn diverse behaviors.
However, limited previous works have studied the effects of exploration in preference-based RL.
Inspired by recent success of exploration methods, we present RUNE: R eward UN certainty for E xploration, a simple and efﬁcient exploration method speciﬁcally for preference-based RL algorithms.
Our main idea is to incorporate uncertainty from learned reward function as an exploration bonus.
Speciﬁcally, we capture the novelty of human feedback by measuring the reward uncertainty (e.g., variance in predictions of ensemble of reward functions).
Since reward functions is optimized and learned to align to human feedback, exploration based on reward uncertainty may also reﬂect high uncertainty in information from teacher feedback.
We hope that the proposed intrinsic reward contains information from teacher feedback and can guide exploration that better align to human preferences.
Our experiment results show that RUNE can improve both sample- and feedbackefﬁciency of preference-based RL algorithms (Lee et al., 2021b).
We highlight the main contributions of our paper below:
• We propose a new exploration method based on uncertainty in learned reward functions for preference-based RL algorithms.
• For the ﬁrst time, we show that exploration can improve the sample- and feedbackefﬁciency of preference-based RL algorithms.
R ELATED WORK
Human-in-the-loop reinforcement learning .
We mainly focus on one promising direction that utilizes the human preferences (Akrour et al., 2011; Christiano et al., 2017; Ibarz et al., 2018; Lee et al., 2021b; Leike et al., 2018; Pilarski et al., 2011; Wilson et al., 2012) to train RL agents.
Christiano et al.
(2017) scaled preference-based learning to utilize modern deep learning techniques, and Ibarz et al.
(2018) improved the efﬁciency of this method by introducing additional forms of feedback such as demonstrations.
Recently, Lee et al.
(2021b) proposed a feedback-efﬁcient RL algorithm by utilizing off-policy learning and pre-training.
To improve sample- and feedback-efﬁciency of human-in-the-loop RL, previous works (Christiano et al., 2017; Ibarz et al., 2018; Lee et al., 2021b; Leike et al., 2018) mainly focus on methods such as selecting more informative queries Christiano et al.
and pre-training of RL agents Ibarz et al.
; Lee et al.
(2021b).
We further investigate effects of different exploration methods in preference-based RL algorithm.
We follow a common approach of exploration methods in RL: generating intrinsic rewards as exploration bonus Pathak et al.
Instead of only using learned reward function from human feedback as RL training objective, we alter the reward function to include a combination of the extrinsic reward (the learned rewards) and an intrinsic reward (explo- ration bonus).
In particular, we present an exploration method with intrinsic reward that measures the disagreement from learned reward models.
Exploration in reinforcement learning.
The trade off between exploitation and exploration is a critical topic in RL.
If agents don’t explore enough, then they may learn sub optimal actions.
Exploration algorithms aim to encourage the RL agent to visit a wide range of states in the environment.
Thrun (1992) showed that exploration methods that utilize the agent’s history has been shown to perform much better than random exploration.
Hence, a common setup is to include an intrinsic reward as an exploration bonus.
The intrinsic reward can be deﬁned by Count-Based methods which keep count of previously visited states and rewards the agents for visiting new states Bellemare et al.
; Tang et al.
(2017); Ostrovski et al.
Another option is to use a curiosity bonus for the intrinsic reward Houthooft et al.
; Pathak et al.
(2017); Sekar et al.
Curiosity represents how expected and unfamiliar the state is.
One way to quantify curiosity is to predict the next state from current state and action Pathak et al.
(2017), then use prediction error as an estimate of curiosity.
If the error is high, that means the next state is unfamiliar and should be explored more.
Similarly, instead of predicting the next state, prediction errors from training a neural network to approximate a random function Burda et al.
(2018) can serve as a valid estimate of curiosity.
If there are multiple models, then curiosity can also be described as the disagreement between the models Pathak et al.
A high disagreement means that the models are unsure about the prediction and need to explore in that direction more.
A different approach maximizes the entropy of visited states by incorporating state entropy into the intrinsic reward.
State entropy can be estimated by approximating the state density distribution
Hazan et al.
; Lee et al.
(2019), approximating the k-nearest neighbor entropy of a randomly initialized encoder Seo et al.
(2021a), or using off-policy RL algorithms to maximize the k -nearest neighbor state entropy estimate in contrastive representation space for unsupervised pre-training
Srinivas et al.
; Liu & Abbeel (2021).
These methods encourage agents to explore diverse states.
Our approach adds an intrinsic reward that drives exploration to preference-based RL algorithms.
We take advantage of an ensemble of reward models in preference-based RL algorithms, which is not available in other traditional RL settings.
To estimate novelty of states and actions, we utilize the disagreement between reward models for our intrinsic reward, in hope of encouraging exploration aligned to directions of human preferences.
Trajectory generation in preference-based reinforcement learning.
Previous works in preference-based reinforcement learning have investigated several methods to better explore diverse trajectories but close to current optimal policy Wirth et al.
One line of works computes agent’s stochastic policies that are slightly deviated from optimal policies.
Christiano et al.
(2017) uses Trust Region Policy Optimization (TRPO) Schulman et al.
and synchronized A3C Mnih et al.
These RL algorithms deﬁne stochastic policies to ensure exploration of action space and deviations from optimal policies.
However, these exploration methods based on stochastic RL algorithms does not include information from human preferences to drive exploration.
Another line of works designs one or multiple criterion to select from multiple possible stochastic policy candidates.
Wilson et al.
(2012) proposes to sample several policies from posterior distribution of policy space after updating human preferences.
However, such methods come a the cost of requiring many samples collected beforehand.
While these methods similarly aims to reduce uncertainty in human preferences, RUNE uses a different metric to estimate such uncertainty through reward functions ensemble.
This is different from previous works and is simple, scalable, and easy to implement.
A different approach allows human to guide exploration by directly providing additional trajectories.
Zucker et al.
(2010) proposes a user-guided exploration method that shows samples of trajectories to human.
Human can provide additional feedback to guide exploration.
While this method receives exact information from human, it requires additional human labels, which are usually expensive and time-consuming to collect.
RUNE however tries to extract information from human feedback revealed in learned reward functions, which doesn’t require additional human input.
P RELIMINARIES
Preference-based reinforcement learning .
We consider an agent interacting with an environment in discrete time Sutton & Barto (2018).
At each timestep t , the agent receives a state s t from the environment and chooses an action a t based on its policy π .
In traditional reinforcement learning, the environment also returns a reward r ( s t , a t ) that evaluates the quality of agent’s behavior at timestep t .
The goal of agent is to maximize the discounted sum of rewards.
However, in the preference-based RL framework, we don’t have such a reward function returned from the environment.
Instead, a (human) teacher provides preferences between the agent’s behaviors and the agent learns its policy from feedbacks (Christiano et al., 2017; Ibarz et al., 2018;
Lee et al., 2021b; Leike et al., 2018).
Formally, a segment σ is a sequence of time-indexed observations and actions { ( s 1 , a 1 ) , ..., ( s H , a H ) } .
Given a pair of segments ( σ 0 , σ 1 ) that describe two behaviors, a teacher indicates which segment is preferred, i.e., y = ( σ 0 (cid:31) σ 1 ) or ( σ 1 (cid:31) σ 0 ) , that the two segments are equally preferred y =
( σ 1 = σ 0 ) , or that two segments are incomparable, i.e., discarding the query.
The goal of preference-based RL is to train an agent to perform behaviors desirable to a human teacher using as few feedback as possible.
In preference-based RL algorithms, a policy π φ and reward function (cid:98) r ψ are updated as follows:
• Step 1 (agent learning) :
The policy π φ interacts with environment to collect experiences and we update it using existing RL algorithms to maximize the sum of the learned rewards (cid:98) r ψ .
• Step 2 (reward learning) :
The reward function (cid:98) r ψ is optimized based on the feedback received from a teacher.
• Repeat Step 1 and Step 2 .
To incorporate human preferences into reward learning , we optimize reward function (cid:98) r ψ as follows.
Following the Bradley-Terry model (Bradley & Terry, 1952), we ﬁrst model preference predictor of a pair of segments based on reward function (cid:98) r ψ as follows:
[Equation]
where σ i (cid:31) σ j denotes the event that segment i is preferable to segment j .
Here, the intuition is that segments with more desirable behaviors should have higher predicted reward values from (cid:98) r ψ .
To align preference predictors of (cid:98) r ψ with labels received from human preferences, preference-based
RL algorithms translate updating reward function to a binary classiﬁcation problem.
Speciﬁcally, the reward function (cid:98) r ψ parametrized by ψ is updated to minimize the following cross-entropy loss:
[Equation]
where we are given a set D of segment pairs and corresponding human preferences.
Once reward function (cid:98) r ψ has been optimized from human preferences, preference-based RL algorithms train RL agents with any existing RL algorithms, treating predicted rewards from (cid:98) r ψ as reward function returned from the environment.
RUNE
In this section, we present RUNE: R eward UN certainty for E xploration (Figure 1), which encourages human-guided exploration for preference-based RL.
The key idea of RUNE is to incentivize exploration by providing an intrinsic reward based on reward uncertainty.
Our main hypothesis is that the reward uncertainty captures the novelty of human feedback, which can lead to useful behaviors for preference-based RL.
[Figure]
4. R EWARD UNCERTAINTY FOR EXPLORATION
In preference-based RL, capturing the novelty of human feedback can be crucial for efﬁcient reward learning.
To this end, we propose to utilize an intrinsic reward based on ensemble of reward functions.
Speciﬁcally, for each timestep, the intrinsic reward is deﬁned as follows:
[Equation]
where (cid:98) r std is the empirical standard deviation of all reward functions { (cid:98) r ψ i } Ni =1 .
We initialize the model parameters of all reward functions with random parameter values for inducing an initial diversity.
Here, our intuition is high variance of reward functions indicates high uncertainty from human preferences, which means we collected less teacher preferences on those states and actions.
Therefore, in order to generate more informative queries and improve conﬁdence in learned reward functions, we encourage our agent to visit more uncertain state-action pairs with respect to the learned reward functions.
We remark that exploration based on ensembles has been studied in the literature (Osband et al., 2016; Chen et al., 2017; Pathak et al., 2019; Lee et al., 2021a).
For example, Chen et al.
(2017) proposed an exploration strategy that considers both best estimates (i.e., mean) and uncertainty (i.e., variance) of Q-functions and Pathak et al.
(2019) utilized the disagreement between forward dynamics models.
However, our method is different in that we propose an alternative intrinsic reward based on reward ensembles, which can capture the uncertainty from human preferences.
4. T RAINING OBJECTIVE BASED ON INTRINSIC REWARDS
Once we learn reward functions { (cid:98) r ψ i } Ni =1 from human preferences, agent is usually trained with RL algorithm guided by extrinsic [Equation]
[Equation]
where (cid:98) r mean is the empirical mean of all reward functions { (cid:98) r ψ i } Ni =1 .
To encourage exploration, we train a policy to maximize the sum of both extrinsic reward and intrinsic reward in equation 3:
[Equation]
where β t ≥ 0 is a hyperparameter that determines the trade off between exploration and exploitation at training time step t .
Similar to Seo et al.
(2021b), we use an exponential decay schedule for β t throughout training to encourage the agent to focus more on extrinsic reward from learned reward function predictions as training proceeds, i.e., β t = β 0 (1 − ρ ) t , where ρ is a decay rate.
While the proposed intrinsic reward would converge to 0 as more feedback queries are collected during training, we believe our learned reward functions improve over training as we collect more feedback queries from teacher preferences.
The full procedure of RUNE is summarized in Algorithm 1.
E XPERIMENTS
We designed our experiments to answer the following questions:
• Can exploration methods improve the sample- and feedback-efﬁciency of preference-based RL algorithms?
[Figure]
• How does RUNE compare to other exploration schemes in preference-based RL setting?
• How does RUNE inﬂuence reward learning in preference-based RL?
5. S ETUP
In order to verify the efﬁcacy of exploration in preference-based RL
[Figure]
we focus on having an agent solve a range of complex robotic manipulation skills from Meta-World (Yu et al., 2020)
(see Figure 2).
Similar to prior works (Christiano et al., 2017; Lee et al., 2021b;c), the agent learns to perform a task only by getting feedback from an oracle scripted teacher that provides clean preferences between trajectory segments according to the sum of ground truth reward values for each trajectory segment.
Because the simulated human teacher’s preferences are generated by a ground truth reward values, we measure the true average return of trained agents as evaluation metric.
We consider a combination of RUNE and PEBBLE (Lee et al., 2021b), an off-policy preference-based RL algorithm that utilizes unsupervised pre-training and soft actor-critic (SAC) method (Haarnoja et al., 2018)
(see Appendix A for more details about algorithm procedure and
Appendix B for more experimental details).
To address the issue that there can be multiple reward functions that align to the same set of teacher preferences, we bound all predicted reward values to a normalized range of (-1, 1) by adding tanh activation function after the output layer in network architectures.
For all experiments including PEBBLE and RUNE, we train an ensemble of 3 reward functions according to Equation 2. Speciﬁcally, we use different random initialization for each network in the ensemble. We use the same set of training data, i.e. sampled set of feedback queries, but different random batches to train each network in the ensemble.
Parameters of each network are independently optimized to minimize the cross entropy loss of their respective batch of training data according to Equation 2.
In addition, we use original hyperparameters of preference-based RL algorithm, which are speciﬁed in Appendix B and report mean and standard deviations across 5 runs respectively.
5. I MPROVING SAMPLE - EFFICIENCY
To evaluate sample-efﬁciency of our method, we compare to the following exploration methods:
• State entropy maximization (StateEnt; Mutti et al. 2021; Liu & Abbeel 2021):
Maximizing the entropy of state visitation distribution H ( s ) .
We utilize a particle estimator (Singh et al., 2003), which approximates the entropy by measuring the distance between k-nearest neighbors ( k -NN) for each state.
• Disagreement Pathak et al.
(2019): Maximizing disagreement proportional to variance in predictions from ensembles V ar { g i ( s t
+1 | s t , a t ) } N i =1 .
We train an en- semble of forward dynamics models to predict ground truth next state from current state and action g i ( s t +1 | s t , a t ) by minimizing sum of prediction errors, i.e. (cid:80) Ni =1 |
[Equation] g i [-=
-]( s
[Equation]
+
[Equation]
s t , [Equation] t ) [-− s t +
-][Equation]
2 . • ICM Pathak et al.
(2017): Maximizing intrinsic reward proportional to prediction error
||
g
( s t +1 | s t , a t ) − s t +
|| 2 .
We train a single dynamics model to predict ground truth next state from current state and action g ( s t +1 | s t , a t ) via regression.
For all methods we consider, we carefully tune a range of hyperparameters and report the best results.
In particular, we consider β 0 = 0 .
05 and ρ ∈ { 0 .
001 , 0 . 0001 , 0 . 00001 } for all exploration methods, and k ∈ { 5 , 10 } for state entropy based exploration.
We provide more details about training and implementation in Appendix B.
Figure 3 shows the learning curves of PEBBLE with various exploration methods.
First, we remark that previous exploration methods (i.e., StateEnt, Disagree and ICM), which encourage agents to visit novel states, consistently improve sample-efﬁciency of PEBBLE on various tasks.
This shows the potential and efﬁcacy of exploration methods to further improve sample-efﬁciency of preferencebased RL algorithms.
In particular, in Figure 3, compared to existing previous exploration methods, RUNE consistently exhibits superior sample efﬁciency in all tasks we consider.
This suggests that exploration based on reward uncertainty is suitable for preference-based RL algorithms, as such it encourages visitations to states and actions that are uncertain with respect to human feedback and thus can capture the novelty in a distinctive perspective.
We provide additional experiment results about better sampleefﬁciency in Figure 9(a) of Appendix C.
We also emphasize the simplicity and efﬁciency of RUNE compared to other existing schemes (such as ICM and Disagree) because our method does not introduce additional model architectures (e.g., ensemble of forward dynamics models) to compute exploration bonus as intrinsic rewards.
5. I MPROVING FEEDBACK - EFFICIENCY
In this section, we also verify whether our proposed exploration method can improve the feedbackefﬁciency of both off-policy and on-policy preference-based RL algorithms.
We consider PEBBLE Lee et al.
(2021b), an off-policy preference-based RL algorithm that utilizes unsupervised pretraining and soft actor-critic (SAC) method (Haarnoja et al., 2018), and PrefPPO Lee et al.
(2021c), an on-policy preference-based RL algorithm that utilizes unsupervised pre-training and proximal policy gradient (PPO) method (Schulman et al., 2017), respectively.
As shown in Table 1, we compare performance of PEBBLE and PrefPPO with and without RUNE respectively using different budgets of feedback queries during training.
With fewer total queries, we stop asking for human preferences earlier in the middle of training.
We use asymptotic success rate converged at the end of training steps as evaluation metric.
Table 1 suggests that RUNE achieves consistently better asymptotic performance using fewer number of human feedback; additionally
RUNE shows more robust performance with respect to different budgets of available human feedbacks.
This shows potential of exploration in scaling preference-based RL to real world scenarios where human feedback are usually expensive and time-consuming to obtain.
We report corresponding learning curves to show better sample efﬁciency of RUNE compared to
PEBBLE or PrefPPO under wide variety of tasks environments in Figure 6, 7, 8, 5 of Appendix C.
5. A BLATION STUDY
Ensemble size.
As intrinsic rewards of RUNE only depend on learned reward functions, we investigate the effects of different number of reward function ensembles.
In particular, we consider { 3 , 5 , 7 } number of reward function ensembles.
In Figure 4(a), sample-efﬁciency of RUNE remains robust and stable with different number in the ensemble of reward functions. Additionally, RUNE can achieve better sample-efﬁciency in preference-based RL while requiring fewer number of reward functions ensembles.
This shows potentials of RUNE speciﬁcally suitable for preference-based RL in improving compute efﬁciency, as it reduces the necessity of training additional reward functions architectures and still achieves comparable performance. T ASK F EEDBACK Q UERIES M ETHOD
[Table]
D RAWER O PEN
[Table] [Table] S WEEP I NTO [Table]
[Table]
D OOR U NLOCK
[Table]
[Table]
D OOR O PEN
[Table]
[Table]
D OOR C LOSE
[Table]
[Table]
W INDOW C LOSE
[Table]
[Table]
B UTTON P RESS
[Table]
[Table]
Number of queries per feedback session.
Human preferences are usually expensive and timeconsuming to collect.
As shown in Table 1, RUNE is able to achieve better asymptotic performance under different budgets of total human preferences.
We further investigate the effects of different queries in each feedback session on performance of PEBBLE and RUNE.
In particular, we consider { 10 , 50 } number of queries per feedback session equally spread out throughout training.
In Figure 4(b), we indicate asymptotic performance of PEBBLE baseline by dotted horizontal lines. It shows that as 80% of feedbacks are eliminated, asymptotic success rate of PEBBLE baseline largely drops, while in contrast RUNE remains superior performance in both sample-efﬁciency and asymptotic success.
Thus RUNE is robust to different number of available feedback queries constraints and thus a suitable exploration method speciﬁcally beneﬁcial for preference-based RL.
Quality of learned reward functions.
We use Equivalent-Policy Invariant Comparison (EPIC) distance Gleave et al.
(2020) between learned reward functions and ground truth reward values as evaluation metrics.
Gleave et al.
(2020) suggests that EPIC distance is robust to coverage distributions of states and actions and is thus a reliable metric to quantify distance between different reward functions under the same transition dynamics. We generate ( s , a ) from each task uniformly and independently at random in order to obtain a wide coverage of state distributions.
As in Figure 4(c), compared to PEBBLE, reward functions learned from RUNE are closer to ground truth reward evaluated based on EPIC distance and converges faster during training. We provide additional analysis on different task environments in Figure 9(b) and 9(c) of Appendix C.
[Figure] We further analyze quality of reward functions learned by RUNE compared to true reward in Figure 10 of Appendix C. Learned rewards optimized by RUNE is well-aligned to true reward, as it can capture diverse patterns of true reward values from the environment.
D ISCUSSION
In this paper, we present RUNE, a simple and efﬁcient exploration method for preference-based
RL algorithms.
To improve sample- and feedback-efﬁciency of preference-based RL, different from previous works, we investigate the beneﬁts of exploration methods in preference-based RL.
We show the signiﬁcant potential of incorporating intrinsic rewards to drive exploration because it improves sample-efﬁciency of preference-based RL.
For our proposed exploration scheme RUNE, we show that it is useful for preference-based RL because it showcases consistently superior performance in both sample- and feedback-efﬁciency compared to other existing exploration methods.
Here we emphasize that RUNE takes advantage of information in reward functions learned from human feedback, to measure the novelty of states and actions for exploration.
This is different from existing estimates of uncertainty for exploration, as our method in particular encourages exploration aligned to teacher preferences.
In conclusion, we hope that our work could demonstrate the potential of exploration to improve sample- and feedback-efﬁciency of preference-based RL, and to encourage future works to develop novel exploration methods guided by human feedback. A CKNOWLEDGEMENTS
This research is supported in part by Open Philanthropy.
We thank anonymous reviewers for critically reading the manuscript and suggesting substantial improvements.
A A LGORITHM D ETAILS
RUNE.
We provide the full procedure for RUNE with PEBBLE Lee et al.
(2021b), an off-policy preference-based RL algorithm, in Algorithm 1.
1: Initialize
2: Initialize replay B 3: // U NSUPERVISED P RE - TRAINING 4: Maximize the state entropy H ( s ) = − E s ∼ p ( s )
[log p ( s )] 5: // P OLICY LEARNING 6: for each training step t do 7: //
R EWARD LEARNING 8: if iteration % K == [-
-]0 then 9:
Generate queries from replay buffer { ( σ 0 , σ 1 ) } N query i = ∼ B and corresponding human feedback ( y i ) N query i = 10:
Update reward model (cid:98) r ψ according to equation11: //
R ELABEL BOTH EXTRINSIC AND INTRINSIC REWARD 12:
Relabel entire replay buffer B using (cid:98) r ψ 13:
Relabel extrinsic reward r ext ψ ( s j , a j ) =
ˆ r mean ( s j , a j ) 14:
Relabel intrinsic reward r int ψ ( s j , a j ) =
ˆ r std ( s j , a j ) 15: end if 16: // U PDATE POLICY 17: for each gradient step do 18:
Sample minibatch from replay buffer { ( s j , a j , s j +1 , r ext ψ ( s j , a j ) , r int ψ ( s j , a j ) }
Bj =1 ∼ B 19:
Update β t ← β 0 (1 − ρ ) t 20:
Let r total j ← r ext j + β t · r int j 21:
Update φ with transitions { ( s j , a j , s j +1 , r total ψ ( s j , a j ) } Bj = 22: end for 23: // I NTERACTION WITH [Table] [Table] for each timestep t do
[Table]
Collect s t +1 by taking a t ∼ π φ ( a t
| s t ) [Table]
Store transitions B ← B ∪ { ( s t , a t , s t +1 , (cid:98) r ψ ( s t , a t )) } 27: end for 28: end for
[Table]
[Table]
B E XPERIMENTAL D ETAILS B. T RAINING D ETAILS
For our method, we use the publicly released implementation repository of the PEBBLE algorithm ( https://github.com/pokaxpoka/B_Pref ) with the full list of hyperparameters speciﬁed in Table 2 and the SAC algorithm ( https://github.com/denisyarats/pytorch_sac ) with the full list of hyperparameters speciﬁed in Table 3.
B. I MPLEMENTATION D ETAILS OF E XPLORATION M ETHODS
For all exploration methods, we follow implementation of the publicly release repository of RE ( https://github.com/younggyoseo/RE3 ) to update policy with r total =
r ext + β t · r int .
RUNE.
We emphasize one simplicity in the implementation of RUNE.
Following relabeling technique in Lee et al.
(2021b), after each update in reward learning step, we relabel the entire replay buffer B to store both predicted reward functions learned from human feedback (extrinsic rewards r ext ), and uncertainty in updated reward functions (intrinsic rewards r int in RUNE).
This is because our learned reward functions parameters remain unchanged during RL training or agent interaction with the environment between subsequent feedback sessions.
Thus, in RL training, r total = r ext + β t
r int can be directly taken from replay buffer.
As for hyperparameter related to exploration, we consider β 0 = 0 .
05 , ρ ∈ { 0 .
State Entropy Maximization.
Seo et al.
(2021b)
We use intrinsic reward r int ( s t )
=
|| s
t − s k -NN t ||followed Seo et al.
(2021b)
and Liu & Abbeel (2021).
We use raw state space to compute entropy values as intrinsic rewards.
We use code for unsupervised pre-training from the publicly release implementation repository of PEBBLE algorithm ( https://github.com/pokaxpoka/B_
Pref ) to compute k -NN and estimate state entropy.
As the size of replay buffer grows significantly as training time increases, we sample a random mini-batch B (cid:48) from replay buffer B and compute k -NN with respect to random mini-batch.
We use minibatch size 512 , which is reported as a default hyperparameter in Seo et al.
(2021b).
As for hyperparameters related to exploration, we consider β 0 = 0 .
05 , ρ ∈ { 0 .
001 , 0 . 0001 , 0 . 00001 } , and k ∈ { 5 , 10 } .
Disagreement.
Pathak et al.
We train an ensemble of 5 forward dynamics model g i , following original results in Pathak et al.
These dynamics models are trained to predict next state s t +1 based on current state and action ( s t , a t ) , i.e. minimize (cid:80) 5 i =
||
g
i
( s t +1 | s t , a t ) − s t +
|| 2 .
We use intrinsic reward proportional to variance in ensemble of predictions r int ( s t , a t ) =
V ar { g i ( s t +1 | s t , a t ) } Ni =1 .
For consistency we use same neural network architecture and optimization hyperparameters as reward functions speciﬁed in Table 2.
We follow implementation of Disagreement agent in publicly released repository URLB ( https://anonymous.4open.
science/r/urlb ).
As for hyperparameter related to exploration, we consider β 0 = 0 .
05 , ρ ∈ { 0 .
ICM.
Pathak et al.
We train a single forward dynamics model g to predict next state s t +1 based on current state and action ( s t , a t ) , i.e. minimize || g
( s t +1 | s t , a t ) − s t +
|| 2 .
We use intrinsic reward proportional to prediction error of trained dynamics model, i.e. r int ( s t , a t ) =
|| g ( s t +1 | s t , a t ) − s t +
|| 2 .
For consistency we use same neural network architecture and optimization hyperparameters as reward functions speciﬁed in Table 2.
We follow implementation of ICM agent
[Figure]
[Figure]
1.0 Environment Steps (×10 6 )
S u cc e ss
R a t e ( % )
[Figure]
in publicly released repository URLB ( https://anonymous.4open.science/r/urlb ).
As for hyperparameter related to exploration, we consider β 0 = 0 .
05 , ρ ∈ { 0 .
C A DDITIONAL E XPERIMENT R ESULTS
Improving Feedback-Efﬁciency.
We provide additional experimental results on various tasks from
Meta-World benchmark Yu et al.
(2020) using different budgets of feedback queries during training.
We report asymptotic evaluation success rate at the end of training in Table 1.
Here we report corresponding learning curves and additional results of wider choices of total feedback queries.
We observe RUNE performs consistently at least same or better than PEBBLE baseline in different tasks with different budgets of feedback queries.
Improving Sample-Efﬁciency.
As shown in Figure 9(a), RUNE outperforms other existing exploration baselines measured on the episode return of Pick Place.
This shows applicability of our method on harder tasks.
Reward Functions Learned by RUNE.
We provide additional analysis of reward functions learned by RUNE, compared to true reward function deﬁned by Meta-World environments.
Figuredemonstrates in all tasks we consider, learned reward functions optimized by RUNE is well-aligned to true reward from teacher feedback, because it can capture diverse patterns of true reward values from the environment.
[Figure]
[Figure]
[Figure]
[Figure] [Figure]