Provably Feedback-Efficient Reinforcement Learning via Active Reward Learning
Abstract
An appropriate reward function is of paramount importance in specifying a task in reinforcement learning (RL).
Yet, it is known to be extremely challenging in practice to design a correct reward function for even simple tasks.
Human-in-theloop (HiL) RL allows humans to communicate complex goals to the RL agent by providing various types of feedback.
However, despite achieving great empirical successes, HiL RL usually requires too much feedback from a human teacher and also suffers from insufficient theoretical understanding.
In this paper, we focus on addressing this issue from a theoretical perspective, aiming to provide provably feedback-efficient algorithmic frameworks that take human-in-the-loop to specify rewards of given tasks.
We provide an active-learning -based RL algorithm that first explores the environment without specifying a reward function and then asks a human teacher for only a few queries about the rewards of a task at some stateaction pairs.
After that, the algorithm guarantees to provide a nearly optimal policy for the task with high probability.
We show that, even with the presence of random noise in the feedback, the algorithm only takes (cid:101)
O
( H dim 2 R ) queries on the reward function to provide an ε -optimal policy for any ε > 0 .
Here H is the horizon of the RL environment, and dim R specifies the complexity of the function class representing the reward function.
In contrast, standard RL algorithms require to query the reward function for at least Ω(poly
( d, 1 /ε )) state-action pairs where d depends on the complexity of the environmental transition.
Introduction
A suitable reward function is essential for specifying a reinforcement learning (RL) agent to perform a complex task.
Yet obvious approaches such as hand-designed reward is not scalable for large number of tasks, especially in the multitask settings [Wilson et al., 2007, Brunskill and Li, 2013,
Yu et al., 2020, Sodhani et al., 2021], and can also be extremely challenging (e.g., [Ng et al., 1999,
Marthi, 2007] shows even intuitive reward shaping can lead to undesired side effects).
Recently, a popular framework called Human-in-the-loop (HiL) RL [Knox and Stone, 2009, Christiano et al., 2017, MacGlashan et al., 2017, Ibarz et al., 2018, Lee et al., 2021, Wang et al., 2022] gains more interests as it allows humans to communicate complex goals to the RL agent directly by providing various types of feedback.
In this sense, a reward function can be learned automatically and can also be corrected at proper times if unwanted behavior is happening.
Despite its promising empirical performance, HiL algorithms still suffer from insufficient theoretical understanding and possess drawbacks Arakawa et al.
[2018], e.g., it assumes humans can give precise numerical rewards and do so without delay and at every time step, which are usually not true.
Moreover, these approaches usually train on every new task separately and cannot incorporate exiting experiences.
In this paper, we attempt to address the above issues of incorporating humans’ feedback in RL from a theoretical perspective.
In particular, we would like to address (1) the high feedback complexity issue – i.e., the algorithms in practice usually require large amount feedback from humans to be accurate; (2) feedback from humans can be noisy and non-numerical; (3) in need for support of multiple tasks.
In particular we consider a fixed unknown RL environment, and formulate a task as an unknown but fixed reward function.
A human who wants the agent to accomplish the task needs to communicate the reward to the agent.
It is not possible to directly specify the parameters of the reward function as the human may not know it exactly as well, but is able to specify good actions at any given state.
To capture the non-numerical feedback issue, we assume that the feedback we can get for an action is only binary – whether an action is “good” or “bad”.
We further assume that the feedback is noisy in the sense that the feedback is only correct with certain probability.
Lastly, we require that the algorithm, after some initial exploration phase, should be able to accomplish multiple tasks by only querying the reward rather than the environment again.
In the supervised learning setting, if we only aim to learn a reward function, the feedback complexity can be well-addressed by the active learning framework Settles [2009], Hanneke et al.
[2014] – an algorithm only queries a few samples of the reward entries and then provide a good estimator.
Yet this become challenging in the RL setting as it is a sequential decision making problem – state-action pairs that are important in the supervised learning setting may not be accessible in the RL setting.
Therefore, to apply similar ideas in RL, we need a way to explore the environment and collect samples that are important for reward learning.
Fortunately, there were a number of recent works focusing “reward-free” exploration Jin et al.
[2020a], Wang et al.
[2020a] on the environment.
Hence, applying such an algorithm would not affect the feedback complexity.
Additionally it is possible for us to reuse the collected data for multiple tasks.
Our proposed theoretical framework is a non-trivial integration of reward-free reinforcement learning and active learning.
The algorithm possesses two phases: in phase I, it performs reward-free RL to explore the environment and collect the small but necessary amount of the information about the environment; in phase II, the algorithm performs active learning to query the human for the reward at only a few state-action pairs and then provide a near optimal policy for the tasks with high probability.
The algorithm is guaranteed to work even the feedback is noisy and binary and can solve multiple tasks in phase II.
Below we summarize our contributions:
We propose a theoretical framework for incorporating humans’ feedback in RL.
The framework contains two phases: an unsupervised exploration and an active reward learning phase.
Since the two phases are separated, our framework is suitable for multi-task RL.
Our framework deals with a general and realistic case where the human feedback is stochastic and binary-i.e., we only ask the human teacher to specify whether an action is “good” or “bad”.
We design an efficient active learning algorithm for learning the reward function from this kind of feedback.
Our query complexity is minimal because it is independent of both the environmental complexity d and target policy accuracy ε .
In contrast, standard RL algorithms require query the reward function for at least Ω(poly
( d, 1 /ε )) state-action pairs.
Thus our work provides a theoretical validation for the recent empirical HiL RL works where the number of queries is significantly smaller than the number of environmental steps. 4.
Moreover, we shows the efficacy of our framework in the offline RL setting, where the environmental transition dataset is given beforehand.
1.1 Related Work
Sample Complexity of Tabular and Linear MDP.
There is a long line of theoretical work on the sample complexity and regret bound for tabular MDP.
See, e.g., [Kearns and Singh, 2002, Jaksch et al., 2010, Azar et al., 2017, Jin et al., 2018, Zanette and Brunskill, 2019, Agarwal et al., 2020b, Wang et al., 2020b, Li et al., 2022]. The linear MDP is first studied in Yang and Wang [2019]. See, e.g., [Yang and Wang, 2020, Jin et al., 2020b, Zanette et al., 2020a,
Unsupervised Exploration for RL. The reward-free exploration setting is first studied in Jin et al.
[2020a]. This setting is later studied under different function approximation scheme: tabular [Kauf- mann et al., 2021, Ménard et al., 2021, Wu et al., 2022], linear function approximation [Wang et al., 2020a, Zanette et al., 2020b, Zhang et al., 2021, Huang et al., 2022, Wagenmaker et al., 2022, Agarwal et al., 2020a, Modi et al., 2021], and general function approximation [Qiu et al., 2021, Kong et al., 2021, Chen et al., 2022]. Besides, Zhang et al. [2020], Yin and Wang [2021] study task-agnostic RL, which is a variety of reward-free RL.
Wu et al.
[2021] studies multi-objective RL in the reward-free setting. Bai and Jin [2020], Liu et al. [2021] studies reward-free exploration in Markov games. Active Learning.
Active learning is relatively well-studied in the context of unsupervised learning. See, e.g., Dasgupta et al. [2007], Balcan et al. [2009], Settles [2009], Hanneke et al.
[2014] and the references therein.
Our active reward learning algorithm is inspired by a line of works [Cesa-Bianchi et al., 2009, Dekel et al., 2010, Agarwal, 2013] considering online classification problem where they assume the response model P ( y | x ) is linear parameterized.
However, their works can not directly apply to the RL setting and also the non-linear case.
There are also many empirical study-focused paper on active reward learning.
See, e.g., [Daniel et al., 2015, Christiano et al., 2017, Sadigh et al., 2017, Bıyık et al., 2019, 2020, Wilde et al., 2020, Lindner et al., 2021, Lee et al., 2021].
Many of them share similar algorithmic components with ours, like information gain-based active query and unsupervised pre-training.
But they do not provide finite query complexity bounds.
Preliminaries 2.1 Episodic Markov Decision Process
In this paper, we consider the finite-horizon Markov decision process (MDP) M =
( S , A , P, r, H, s 1 ) , where S is the state space, A is the action space, P
=
{ P h } Hh =1 where P h : S ×
A → △ ( S ) are the transition operators, r = { r h } Hh =1 where r h : S
×
A → { 0 , 1 } are the deterministic binary reward functions, and H is the planning horizon.
Without loss of generality, we assume that the initial state sis fixed.
1 In RL, an agent interacts with the environment episodically.
Each episode consists of H time steps.
A deterministic policy π chooses an action a ∈ A based on the current state s ∈ S at each time step h ∈
[ H ] .
Formally, π = { π h } Hh =1 where for each h ∈
[ H ] , π h : S
→ A maps a given state to an action.
In each episode, the policy π induces a trajectory s 1 , a 1 , r 1 , s 2 , a 2 , r 2 , ..., s H , a H , r H , s H + where s 1 is fixed, a 1 = π 1 ( s 1 ) , r 1 = r 1 ( s 1 , a 1 ) , s 2 ∼ P 1 ( ·| s 1 , a 1 ) , a 2 =
π 2 ( s 2 ) , etc.
We use Q-function and V-function to evaluate the long-term expected cumulative reward in terms of the current state (state-action pair), and the policy deployed.
Concretely, the Q-function and
V-function are defined as: Q πh ( s, a ) = E (cid:2) (cid:80)
Hh ′ =
h r h ′
( s h ′ , a h ′ ) | s h
= s, a h
= a, π (cid:3) and V πh ( s ) =
E (cid:2) (cid:80)
Hh ′ =
h r h ′
( s h ′ , a h ′ ) | s h
= s, π (cid:3) .
We denote the optimal policy as π ∗ =
{ π ∗ h } h ∈ [ H ] , optimal values as Q ∗ h ( s, a ) and V ∗ h ( s ) .
Sometimes it is convenient to consider the Q-function and V-function where the true reward function is replaced by a estimated one ˆ r = {
ˆ r h } h ∈
[ H ] .
We denote them as Q πh ( s, a, ˆ r ) and V πh ( s, ˆ r ) .
We also denote the corresponding optimal policy and value as π ∗ (ˆ r ) ,
Q ∗ h ( s, a, ˆ r ) and V ∗ h ( s, ˆ r ) .
Additional Notations.
We define the infinity-norm of function f : S ×
A → R as ∥ f ∥ ∞ = sup ( s,a ) ∈S×A | f
( s, a ) | .
For a set of state-action pairs Z ⊆ S
× A and a function f : S ×
A → R , we define ∥ f ∥
Z = (cid:16)(cid:80) ( s,a ) ∈Z f
( s, a ) 2 (cid:17) 1 / 2 .
Technical Overview
In this section we give a overview of our learning scenario and notations, as well as the main techniques.
The learning process divides into two phases.
3.1 Phase 1: Unsupervised Exploration
The first step is to explore the environment without reward signals.
Then we can query the human teacher about the reward function in the explored region.
We adopt the reward-free exploration technique developed in Jin et al.
[2020a], Wang et al.
[2020a].
The agent is encouraged to do exploration by maximizing the cumulative exploration bonus .
Concretely, we gather K trajectories
D = { ( s kh , a kh ) } ( h,k ) ∈
[ H ] ×
[ K ] by interacting with the environment.
We can strategically choose which policy to use.
At the beginning of the k -th episode, we calculate a policy π k based on the history of the first k − 1 episodes and use π k to induce a trajectory { ( s kh , a kh ) } h ∈ [ H ] .
A similar approach called unsupervised pre-training [Sharma et al., 2020, Liu and Abbeel, 2021] has been successfully used in practice.
Concretely, in unsupervised pre-training agents are encouraged to do exploration by maximizing various intrinsic rewards , such as prediction errors [Houthooft et al., 2016] and count-based state-novelty [Tang et al., 2017].
3.2 Phase 2: Active Reward Learning
The second step is to learn a proper reward function from human feedback.
Our work assumes that the underlying valid reward is 1-0 binary, which is interpreted as good action and bad action.
We remark that RL problems with binary rewards represent a large group of RL problems that are suitable and relatively easy for having human-in-the-loop.
A representative group of problems is the binary judgments: For example, suppose we want a robot to learn to do a backflip.
A human teacher will judge whether a flip is successful and assign a reward of 1 for success and 0 for failure.
Furthermore, our framework can also be generalized to RL problems with n -uniform discrete rewards.
The detailed discussion is defered to Appendix E.2 due to space limit.
Concretely, consider a fixed stage
h ∈
[ H ] , and we are trying to learn r h from the human response.
Each time we can query a datum z
=
( s, a ) and receive an independent random response Y ∈ { 0 , 1 } from the human expert, with distribution:
[Equation]
Here f ∗ h is the human response model and needs to be learned from data.
We assume that the underlying valid reward of z can be determined by f ∗ h [Equation] z ) in the following manner:
[Equation]
Note that the query returns 1 with a probability greater than 12 if and only if the underlying valid reward is 1.
To make the number of queries as small as possible, we choose a small subset of informative data to query the human.
We adopt ideas in the pool-based active learning literature and select informative queries greedily.
We show that only (cid:101) O
( H dim 2 R ) queries need to be answered by the human teacher.
The active query method is widely used in human-involved reward learning in practice and shows superior performance than uniform sampling Christiano et al.
[2017], Ibarz et al. [2018], Lee et al.
After we learn a proper reward function ˆ r , we use past experience D and ˆ r to plan for a good policy.
Note that in this phase we are not allowed for further interaction with the environment.
In the multi-task RL setting, we can run Phase 2 for multiple times and reuse the data collected in Phase 1.
Now we discuss the efficacy of our framework.
A naive approach for reward learning via human feedback is asking the human teacher to evaluate the reward function in each round.
This approach results in equal environmental steps and number of queries.
This high query frequency is unacceptable for large-scale problems.
For example, in Lee et al.
[2021] the agent learns complex tasks with very few queries ( ∼ 10 2 to 10 3 queries) to the human compared to the number of environmental steps ( ∼ 10 6 steps) by utilizing active query technique.
From the theoretical perspective, usual RL sample complexity bound scales with ∝ poly( d, 1 ε ) , where d is the complexity measure of the environmental transition and ε is the target policy accuracy.
This quantity can be huge when the environment is complex (i.e., d is large) or with small target accuracy.
Our query complexity is desirable since it is independent of both d and 1 /ε .
Pool-Based Active Reward Learning
In this section we formally introduce our algorithm for active reward learning.
We consider a fixed stage h and learn r h by querying a small subset of Z h
= { ( s kh , a kh ) } k ∈
[ K ] .
We omit the subscript h in this section, i.e., we use Z , z k , r, f ∗ to denote Z h , z kh , r h , f ∗ h in this section.
Since Z is given before the learning process starts, we refer to this learning scenario as pool-based active learning.
Our purpose is to learn a reward function
ˆ r ( · ) such that r ( z ) =
ˆ r ( z ) for most of z in Z .
At the same time, we hope the number of queries can be as small as possible.
We assume F is a pre-specified function class to learn f ∗ from, and F is known as a prior.
We assume that F has enough expressive power to represent the human response.
Concretely, we assume the following realizability .
Assumption 1 (Realizability) .
f ∗ ∈ F .
The learning problem can be arbitrarily difficult, especially when f ∗ ( z ) is close to 12 , in which case it will be difficult to determine the true value of r ( z ) .
To give a problem-dependent bound, we assume the following bounded noise assumption.
In the literature on statistical learning, this assumption is also referred to as Massart noise [Massart and Nédélec, 2006, Giné and Koltchinskii, 2006, Hanneke et al., 2014].
Our framework can also work under the low noise assumption - due to space limit, we defer the discussion to Appendix E.3.
Assumption 2 (Bounded Noise) .
There exists ∆ > 0 , such that for all z ∈ S × A , | f ∗ ( z ) − 12 | > ∆ .
The value of the margin ∆ depends on the intrinsic difficulty of the reward learning problem and the capacity of the human teacher.
For example, if the reward is rather easy to specify and the human teacher is a field expert, and can always give the right answer with a probability of at least 80%, then ∆ will be 0.3.
But if the learning problem is hard or the human teacher is unfamiliar with the problem and can only give near-random answers, then ∆ will be very small.
But in that case, we won’t hope the human teacher can help us in the first place.
So a typical good value for ∆ should be a constant.
Examples We give two examples of F that is frequently studied in the active learning literature.
In the linear model, the function class F consists of f in the following form: f ( z ) =
⟨ ϕ ( z ) ,w ⟩ +1.
In the logistic model, the function class F consists of f in the following form: f ( z ) = exp ⟨ ϕ ( z ) ,w ⟩ 1+exp ⟨ ϕ
( z ) ,w ⟩ .
Here ϕ : S ×
A → R d is a fixed and known feature extractor, and w ∈ R d .
The complexity of F essentially depends on the learning complexity of the human response model.
We use the following Eluder dimension [Russo and Van Roy, 2014] to characterize the complexity of
F .
The eluder dimension serves as a common complexity measure of a general non-linear function class in both reinforcement learning literature [Osband and Van Roy, 2014, Ayoub et al., 2020, Wang et al., 2020c, Jin et al., 2021a] and active learning literature [Chen et al., 2021].
Definition 1 (Eluder Dimension) .
Let ε ≥ 0 and Z
= { ( s i , a i ) } ni
=1 ⊆ S ×
A be a sequence of state-action pairs.
(1) A state-action pair ( s, a ) ∈ S
× A is ε -dependent on Z with respect to F if any f, f ′ ∈ F satisfying ∥
f − f ′
∥
Z ≤ ε also satisfies | f ( s, a )
− f ′ ( s, a ) | ≤ ε .
(2) An ( s, a ) is ε -independent of Z with respect to F if ( s, a ) is not ε -dependent on Z .
The ε -eluder dimension dim E ( F , ε ) of a function class F is the length of the longest sequence of elements in S ×
A such that, for some ε ′ ≥ ε , every element is ε ′ -independent of its predecessors.
The eluder dimension of a function class F is defined as dim E ( F ) :
=
lim sup α ↓ 0 dim E ( F ,α ) log(1 /α ) .
We remark that a wide range of function classes, including linear functions, generalized linear functions and bounded degree polynomials, have bounded eluder dimension.
Definition 2 (Covering Number and Kolmogorov Dimension) .
For any ε > 0 , there exists an ε -cover C ( F , ε ) ⊆
F with size |C ( F , ε ) | ≤ N ( F , ε ) , such that for any f ∈ F , there exists f ′ ∈ C ( F , ε ) with ∥
f − f ′ ∥ ∞ ≤ ε .
The Kolmogorov dimension of F is defined as: dim K ( F ) :=
lim sup α ↓ 0 log( N ( F ,α )) log(1 /α ) .
The Kolmogorov dimension is also bounded by O ( d ) for linear/generalized linear function class.
Throughout this paper, we denote dim( F ) :
= max { dim E ( F ) , dim K ( F ) } as the complexity measure of F .
When F is the class of d -dimensional linear/generalized linear functions, dim( F ) is bounded by O ( d ) .
4.1 Algorithm
We describe our algorithm for learning the human response model and the underlying reward function.
We sequentially choose which data points to query.
Denote Z k the first k points that we decide to query and initial Z 0 to be an empty set.
For each z ∈ Z , we use the following bonus function to measure the information gain of querying z , i.e., how much new information z contains compared to
Z k − 1 :
[Equation]
We then simply choose z k to be arg max z ∈Z b k ( z ) .
After the N query points are determined, we query their labels from a human.
The human response model is then learned by solving a least-squares regression:
[Equation]
The human response model is used for estimating the underlying reward function.
We round (cid:101) f to the cover C ( F , ∆ / 2) to ensure that there are a finite number of possibilities of such functions – this gives us the convenience of applying union bound in our analysis.
Indeed, we believe a more refined analysis would remove the requirement of rounding but will make the analysis much more involved.
The whole algorithm is presented in Algorithm 1.
Note that such an interactive mode with the human teacher is non-adaptive since all queries are given to the human teacher in one batch.
This property makes our algorithm desirable in practice.
Here we assume the value of ∆ is known as a prior.
We can extend our results to the case where ∆ is unknown.
Due to space limit, we defer the discussion to
Appendix E.1.
Algorithm
Input: Data Pool Z = { z i } i ∈
[ T ] , margin ∆ , failure probability δ ∈ (0 , 1)
Z 0 ← {} //Query
Dataset
Set N ← C 1 · (dim 2 ( F )+dim( F ) · log(1 /δ ))
· (log 2 (dim( F )))
∆for k = 1 , 2 , ..., N do β ← C 2 · (cid:112) log(1 /δ )
+ log N · dim( F )
Set the bonus function: b k ( · ) ← sup f,f ′ ∈F , ∥ f − f ′ ∥
Z k − 1 ≤ β | f ( · ) − f ′ ( · ) | z k ← arg max z ∈Z b k ( z )
Z k ← Z k − 1 ∪ { z k } end for for z ∈ Z N do
Ask the human expert for a label l ( z ) ∈ { 0 , 1 } end for
Estimate the human model as (cid:101) f = arg min f ∈F (cid:80) z ∈Z N ( f ( z ) − l ( z ))
Let ˆ f ∈ C ( F , ∆ / 2) such that ∥ ˆ f − (cid:101) f ∥ ∞ ≤ ∆ /
Estimate the underlying true reward: ˆ r ( · ) =
(cid:40) 1 , ˆ f ( · ) > 1 /0 , ˆ f ( · ) ≤ 1 /return:
The estimated reward function ˆ r .
4.2 Theoretical Guarantee
Theorem 1.
With probability at least 1 − δ , for all z ∈ Z , we have, ˆ r ( z ) =
r ( z ) .
The total number of queries is bounded by O (cid:16) (dim 2 ( F )+dim( F ) · log(1 /δ )) · (log 2 (dim( F )))
∆(cid:17) .
Proof Sketch The first step is to show that the sum of bonus functions (cid:80)
Kk
=
b k ( z k ) is bounded by O ( d √ K ) using ideas in Russo and Van Roy [2014].
Note that the bonus function b k ( · ) is nonincreasing.
Thus we can show that after selecting N = (cid:101) O
( d 2 ∆ 2 ) points, for all z ∈ Z , the bonus function of z does not exceed ∆ .
By the bounded-noise assumption, we know that the reward label for z is correct for all z .
Online RL with Active Reward Learning
In this section we consider how to apply active reward learning method in the online RL setting.
In this setting the agent is allowed to actively explore the environment without reward signal in the exploration phase.
We consider both tabular MDP and linear MDP cases.
5.1 Linear MDP with Positive Features
The linear MDP assumption was first studied in Yang and Wang [2019] and then applied in the online setting Jin et al.
[2020b].
It is assumed that the agent is given a feature extractor ϕ : S ×
A → R d and the transition model can be predicted by linear functions of the give feature extractor.
In our work, we additionally assume that the coordinates of ϕ are all positive .
This assumption essentially reduce the linear MDP model to the soft state aggregation model [Singh et al., 1994, Duan et al., 2019].
As will be seen later, the latent state structure helps the learned reward function to generalize.
Assumption 3 (Linear MDP with Non-Negative Features) .
For all h ∈ [ H ] , we assume that there exists a function µ h : S → R d such that P h ( s ′ | s, a ) =
⟨ µ h ( s ′ ) , ϕ ( s, a ) ⟩ .
Moreover, for all ( s, a ) ∈ S × A , the coordinates of ϕ ( s, a ) and µ h ( s, a ) are all non-negative.
5.2 Exploration Phase
In the exploration phase, inspired by former works on reward-free RL, we use optimistic least-squares value iteration (LSVI) based algorithm with zero reward.
In the linear case, for any V : S → R , we estimate P h V in the following manner
[Equation]
w
[Equation]
For the tabular case, we simply use the empirical estimation of P h :
[Equation]
and define (cid:98) P kh V in the conventional manner.
Here N kh
( s, a, s ′ )
= (cid:80) k − 1 τ =1 1 { ( s τh , a τh , s τh +1 ) =
( s, a, s ′ ) } and N kh ( s, a )
= (cid:80) k − 1 τ =1 1 { ( s τh , a τh ) =
( s, a ) } are the numbers of visit time.
The following optimism bonus Γ kh ( · , · ) is sufficient to guarantee optimism in standard regret minimization RL algorithms.
(The choices of β tbl and β lin is specified in the appendix)
[Equation]
In our setting we enlarge the optimism bonus to the following exploration bonus .
[Equation]
We then set the optimistic Q-function as
[Equation]
and define the exploration policy as the greedy policy with respect to Q kh .
5.3 Reward Learning & Planning Phase
After the exploration phase, we run the active reward learning algorithm introduced before on the collected dataset.
In the linear setting, we replace the original action with uniform random action.
We then use the learned reward function to plan for a near-optimal policy.
We still add optimism bonus to guarantee optimism.
The whole algorithm is presented in Algorithm 5.4 Theoretical Guarantee Theorem 2. In the linear case, our algorithm can find an ε -optimal policy with probability at least 1 − δ , with at most
O (cid:16)
[Equation]
Algorithm for k = 1 , 2 , ..., K do
V kH +1 ← 0 , Q kH +1 ←for h
= H, H − 1 , ..., 1 do
Estimate (cid:98) P
kh
V
kh
+
( · , · ) using (1) or (2)
Set the optimism bonus Γ kh ( · , · ) using (3)
Set the exploration bonus b kh ( · , · ) using (4).
Set the optimistic Q-function Q kh ( · , · ) ← Π [0 ,H − h +1]
[ (cid:98) P kh V kh +1 ( · , · ) + b kh ( · , · )] π kh ( · ) ← arg max a ∈A Q kh ( · , a )
V kh ( · ) ← max a ∈A Q kh ( · , a ) end for
Execute policy π k = { π kh } h ∈
[ H ] to induce a trajectory s k 1 , a k 1 , ..., s kH , a kH , s kH +1 .
end for return: Dataset D = { ( s kh , a kh ) }
( h,k ) ∈
[ H ] ×
[ K ]
[-The whole algorithm is presented in Algorithm 
-]
Input: Dataset D = { ( s kh , a kh ) } ( h,k ) ∈
[ H ] ×
[ K ] for h = 1 , 2 , ..., H do if Linear Case then (cid:101)
Z h ← { ( s kh , (cid:101) a kh ) } k ∈ [ K ] , where { (cid:101) a kh } k ∈
[ K ] are sampled i.i.d.
from Unif( A )
ˆ r h ← Active Reward Learning ( (cid:101)
Z h , ∆ , δ/ (2 H )) .
else if Tabular Case then
Z h ← { ( s kh , a kh ) } k ∈
[ K ] ˆ r h ← Active Reward Learning ( Z h , ∆ , δ/ (2 H )) .
end if end for for k = 1 , 2 , ...,
K do
V kH +1 ← 0 , Q kH +1 ← 0 for h = H, H − 1 , ..., 1 do
Estimate (cid:98) P
kh
V
kh
+
( · , · ) using (1) or (2)
Set the optimism bonus Γ kh ( · , · ) using (3)
Set the optimistic Q-function Q kh ( · , · ) ← Π [0 ,H − h +1]
[ˆ r h ( · , · ) + (cid:98) P
kh V kh +
+ Γ kh ( · , · )]
ˆ π kh ( · ) ← arg max a ∈A Q kh ( · , a )
V kh ( · ) ← max a ∈A Q kh ( · , a ) end for end for return: ˆ π drawn uniformly from { ˆ π k } Kk =1 where
ˆ
π
k
=
ˆ π kh } h ∈ [ H ] episodes.
In the tabular case, our algorithm can find an ε -optimal policy with probability at least 1 − δ , with at most O
[Equation]
episodes.
In both cases, the total number of queries to the reward is bounded by (cid:101)
O
( H · dim 2 ( F ) / ∆ 2 ) .
Remark 1.
Theorem 2 readily extends to multi-task RL setting by replacing δ with δ/N and applying a union bound over all tasks, where N is the number of tasks.
The corresponding sample complexity bound only increase by a factor of poly log( N ) .
Remark 2.
Standard RL algorithms require to query the reward function for at least Ω( max { dim R , dim P } 2 ε) times, where dim R and dim P stand for the complexity of the reward/transition function.
See, e.g., Jin et al.
[2020b], Zanette et al.
[2020a], Wang et al.
[2020c] for the derivation of this bound.
Compared to this bound, our feedback complexity bound has two merits:
In practice the transition function is generally more complex than the reward function , thus max { dim R , dim P } ≫ dim R ; 2) Our bound is independent of ε - note that ε can be arbitrarily small, whereas ∆ is a constant.
Proof Sketch The suboptimality of the policy ˆ π can be decomposed into two parts:
[Equation]
where (i) correspond to the planning error in the planning phase (Algorithm 3) and (ii) correspond to the estimation error of the reward ˆ r .
By standard techniques from the reward-free RL, (i) can be upper bounded by the expected summation of the exploration bonuses in the exploration phase.
In order to bound (ii), we need the learned reward function to be universally correct, not just on the explored region.
We show that the dataset collected in the exploration phase essentially cover the state space (tabular case) or the latent state space.
Since the reward function class has bounded complexity ( log |R| is bounded due to the bounded covering number of F ), the reward function learned from the exploratory dataset can generalized to a distribution induced by any policy.
Offline RL with Active Reward Learning
In this section we consider the offline RL setting, where the dataset D is provided beforehand.
We show that our active reward learning algorithm can still work well in this setting.
In order to give meaningful result, we assume the following compliance property of D with respect to the underlying
MDP.
This assumption is firstly introduced in Jin et al.
[2021b].
Unlike many literature for offline
RL, we do not require strong coverage assumptions, e.g., concentratability [Szepesvári and Munos, 2005, Antos et al., 2008, Chen and Jiang, 2019].
Definition 3 (Compliance) .
For a dataset D = { ( s kh , a kh ) } ( h,k ) ∈
[ H ] ×
[ K ] , let P D be the joint dis- tribution of the data collecting process.
We say D is compliant with the underlying MDP if
P D ( s kh +
=
s |{ ( s jh , a jh ) } kj =1 , { s jh +1 } k − 1 j =1 ) =
P h ( s | s kh , a kh ) holds for all h ∈
[ H ] , k ∈
[ K ] , s ∈ S .
6.1 Algorithm and Theoretical Guarantee
At the beginning of the algorithm we call the active reward learning algorithm to estimate the reward function.
Inspired by Jin et al.
[2021b], we estimated the optimal Q-value Q k using pessimistic value iteration with empirical transition and learned reward function.
The policy is defined as the greedy policy with respect to Q k .
The full algorithm and theoretical guarantee is stated below.
Algorithm 4 LCBVI-Tabular-Offline
Input: Dataset D = { ( s kh , a kh ) } ( h,k ) ∈
[ H ] ×
[ K ] for h = 1 , 2 , ..., H do
Z h ← { ( s kh , a kh ) } k ∈ [ K ] ˆ r h ← Active Reward Learning ( Z h , ∆ , δ/ (2 H )) . end for (cid:98) V H +1 ← 0 .
for h = H, H − 1 , ..., 1 do Γ h ( · , · ) ← β ′ tbl · ( N h ( · , · ) + 1) − 1 /
Q h ( · , · ) ← Π [0 ,H − h +1]
[ˆ r h ( · , · ) + (cid:98) P h (cid:98) V
h
+1 ( · , · ) − 2Γ h ( · , · )]
ˆ π h ( · ) ← arg max a ∈A Q h ( · , a )
V h ( · ) ← max a ∈A Q h ( · , a ) end for return: ˆ π = { ˆ π h } h ∈
[ H ]
Theorem 3.
With probability at least 1 − δ , the sub-optimal gap of ˆ π is bounded by V
[Equation]
And the total number of queries is bounded by (cid:101)
O ( H · dim 2 ( F ) / ∆ 2 ) .
The proof of Theorem 3 is deferred to the appendix.
Numerical Simulations
We run a few experiments to test the efficacy of our algorithmic framework and verify our theory.
We consider a tabular MDP with linear reward.
The details of the experiments are deferred to Appendix A. Here we highlight three main points derived from the experiment. • Active learning helps to reduce feedback complexity compared to passive learning. For instance, to learn a 0 .
02 -optimal policy, the active learning-based algorithm only needs ∼queries to the human teacher, while the passive learning-based algorithm requires ∼queries.
(Figure 1, left panel) • The noise parameter ∆ plays an essential role in the feedback complexity, which is consistent with our bound.
For instance, with fixed number of queries, the average error of the learned policy is 0 .
005 for ∆ = 0 .
(Figure 1, right panel) • When ∆ is relatively large (which indicates that the reward learning problem is not inherently difficult for the human teacher), we can learn an accurate policy with much fewer queries to the human teacher compared to the number of environmental steps.
For instance, for ∆ = 0 . 05 , to learn a 0 .
01 -optimal policy, our algorithm requires ∼ 2000 environmental steps but only requires ∼ 150 queries.
(Figure 1, left panel)
Conclusions and Discussions
In this work, we provide a provably feedback-efficient algorithmic framework that takes human-in-theloop to specify rewards of given tasks.
Our proposed framework theoretically addresses several issues of incorporating humans’ feedback in RL, such as noisy, non-numerical feedback and high feedback complexity.
Technically, our work integrates reward-free RL and active learning in a non-trivial way.
The current framework is limited to information gain-based active learning, and an interesting future direction is incorporating different active learning methods, such as disagreement-based active learning, into our framework.
From a broad perspective, our work is a theoretical validation of recent empirical successes in HiL
RL.
Our results also brings new ideas to practice: it provides a new type of selection criterion that can be used in active queries; it suggests that one can use recently developed reward-free RL algorithms for unsupervised pre-training.
These ideas can be combined with existing deep RL frameworks to be scalable.
A limitation of the current work is that it mainly focus on theory, and we leave the empirical test of these ideas in real-world deep RL as future work.
Acknowledgement
DK is partially supported by the elite undergraduate training program of School of Mathematical
Sciences in Peking University.
LY is supported in part by DARPA grant HR00112190130, NSF
Award 2221871.
A Numerical Simulations
We run a few experiments to test the efficacy of our algorithmic framework and verify our theory.
We simulate a random two-stage ( H = 2 ) tabular MDP with S = 20 , A = 10 (stage 1) or 3 (stage 2).
We consider the linear response model
[Equation]
where ϕ ( z ) , w ∈ R d and d = 5 .
We fix the environmental steps in the exploration phase to be
K = 2000 .
In our environment, the noise margin parameter ∆ (defined in Assumption 2) can be adjusted by removing states that do not satisfy the assumption.
The error is defined as
[Equation]
where ˆ π is the learned policy and s 1 is the fixed initial state.
Active Learning v.s. Passive Learning.
The left panal of Figure 1 shows a comparison between the algorithm with active reward learning (our Algorithm 1) and the algorithm with passive learning.
The only difference is that instead of actively choosing queries, the passive learning algorithm uniformly samples queries from the dataset collected in the exploration phase.
The left panel of Figure 1 shows that the active reward learning method significantly reduces the number of queries needed to achieve a target policy accuracy.
In this experiment, the noise margin parameter is ∆ = 0 . 05 .
The Effect of the Noise Margin ∆ .
Theorem 1 suggests that the noise margin ∆ will significantly influence the difficulty of the reward learning problem.
The right panel of Figure 1 verifies this effect when the number of queries is fixed to N = 100 .
Moreover, we also compare between active learning and passive learning in this setting.
Implementation Details.
The transition probabilities of the MDP are generated uniformly from the
S -dimensional probability simplex.
The features in the response model are generated from a uniform ball distribution with random scaling.
Results in Figure 1 are averaged over 100 trials.
We use a few MATLAB package that are listed below.
The source code is given is the supplementary material.
One may run Figure1.m and Figure2.m to reproduce the results in Figure
Dahua
Retrieved May 26, 2022.
Retrieved May 26, 2022.
Retrieved May 26, 2022.
B Proof of Theorem
The next lemma bound the error of the regression.
Lemma 1.
With probability at least 1 − δ ,
[Equation]
Proof.
For any f ∈ F and z ∈ Z N , [-considerξ ( z, f ) = 
-]consider
[Equation]
where l ( z ) is the response from the human expert.
Note that
[Equation]
By Hoeffding’s inequality, for a fixed f ∈ F , we have that
[Equation]
Let
[Equation]
We have that with probability at least 1 − δ , for all f ∈ N ( F , 1 /N ) , [Equation] z ∈Z N
[Equation]
Condition on the above event for the rest of the proof.
Consider any f ∈ F , there exists g ∈
N ( F , 1 /N ) such that ∥ g − f ∥ ∞ ≤ 1 /N .
Thus we have that
[Equation]
In particular
[Equation]
On the other hand,
[Equation]
Thus we have
[Equation]
which implies
[Equation]
as desired.
Following the analysis in Russo and Van Roy [2014], we can bound the sum of bonuses in terms of the eluder dimension of F .
Lemma 2.
[Equation]
) · N log N · β )
Proof.
For k ∈ [ K ] , denote Z k
= { z τ } k − 1 τ =1 .
For any given ε > 0 and h ∈ [ H ] , let L =
z k | k ∈ [ N ] , b k ( z k ) > ε } with |L| =
L .
We will show that there exists z k ∈ L such that z k is ε -dependent on at least L/ dim E ( F , ε ) − 1 disjoint subsequences in Z k ∩ L .
Denote N = L/ dim E ( F , ε ) − 1 .
We decompose L into N +1 disjoint subsets, L = ∪ N +1 j =1 L j by the following procedure.
We initialize
L j = {} for all j ∈ [ N + 1] and consider each z k ∈ L sequentially.
For each z k ∈ L , we find the smallest 1 ≤ j ≤ N such that z k is ε -independent on L j with respect to F .
We set j = N + 1 if such j does not exist.
We add z k into L j afterwards.
When the decomposition of L is finished, L N + must be nonempty since L j contains at most dim E ( F , ε ) elements for j ∈ [ N ] .
For any z k ∈ L N +1 , z k is ε -dependent on at least L/ dim E ( F , ε ) − 1 disjoint subsequences in Z k ∩ L .
On the other hand, there exist f 1 , f 2 ∈ F such that | f 1 ( z k ) − f 2 ( z k ) | > ε and ∥ f 1 − f 2 ∥ 2 Z k ≤ β 2 .
By the definition of ε -dependent we have
[Equation]
which implies
[Equation]
Let b 1 ≥ b 2 ≥ ...
≥ b N be a permutation of { b k ( z k ) } k ∈ [ N ] .
For any b k ≥ 1 /N , we have
[Equation]
which implies
[Equation]
Moreover, we have b k ≤ 1 .
Therefore,
N
[Equation]
as desired.
Proof of Theorem 1.
Note that the preference functions { b k ( · ) } are non-increasing.
Thus by Lemma [Equation] we have that
[Equation]
Substituting the value of N and β , with a proper choice of C 1 , we conclude that
[Equation]
Combining the above result with Lemma [Equation] we have for all z ∈ Z ,
[Equation]
which further implies
[Equation]
Thus by the hard margin assumption of f ∗ [Equation] we complete the proof.
C Proof of TheoremC.1 Proof for the Linear Case
We choose β lin to be:
[Equation]
Throughout the proof, we denote ϕ kh
= ϕ
( s kh , a kh ) for all ( h, k ) ∈
[ H ] ×
[ K ] .
We further denote Λ
[Equation]
=
[Equation]
We denote
[Equation]
and thus (cid:98) P kh V kh +1 ( · , · ) =
ϕ ( · , · ) T w kh .
Similarly,
[Equation]
and (cid:98) P kh V kh +1 ( · , · ) =
ϕ ( · , · ) T w kh .
We have the following lemma on the norm of w kh and w kh :
Lemma 3.
For all ( h, k ) ∈ [ H ] × [ K ] ,
[Equation]
Proof.
The proof is identical to Lemma B.2 in Jin et al.
[2020b].
C.1.1 Analysis of the Planning Error
Analysis in this section utilizes techniques from Jin et al.
[2020b], Wang et al.
[2020a].
Denote all candidate reward function as R , which contains all functions in the from:
[Equation] [Equation] where f ∈ C ( F , ∆ / 2) .
Clearly we have for all h ∈
[ H ] , the estimated reward function ˆ r h ∈ R .
Note that the size of R is bounded by N ( F , ∆ / 2) .
Now we state the standard concentration bound for the linear MDP firstly introduced in Jin et al. [2020b].
Lemma 4.
With probability at least 1 − δ , for all h ∈
[ H ] and k ∈
[ K ] ,
[Equation]
Proof.
Note that the value function V kh +1 is of the form:
[Equation]
where ∥ w ∥ 2 ≤ 2 H √ dK , Λ ⪰ I , and r ∈ R .
Consider a fixed r ∈ R .
Identical to Lemma D.4 of Jin et al.
[2020b], we have that: with probability at least 1 − δ , for all V ( · ) in the above form (5) (with that fixed r ),
[Equation]
By replacing δ with δ/ |R| and applying a union bound over all r ∈ R , we have that with probability at least 1 − δ ,
[Equation]
for all V ( · ) in the above form (5) (for all r ∈ R ).
And we are done.
The next lemma bound the single-step planning error.
Lemma 5 (Single-Step Planning Error) .
In Algorithm 2 and Algorithm 3, with probability at least 1 − δ , for any h ∈ [ H ] , k ∈ [ K ] and ( s, a ) ∈ S × A [-,| (cid:98) P kh V kh +
-], |
[Equation]
and
[Equation]
Proof.
We provide the proof for the first inequality and that for the second inequality is identical.
Note that
[Equation]
We denote (cid:101)
[Equation]
[-kh +
-]
, thus P h V
kh +
( s, a ) =
ϕ ( s, a ) T (cid:101) w kh .
By ∥ µ h ( S ) ∥ 2 ≤ √ d , we have ∥ (cid:101) w kh ∥ 2 ≤ H √ d .
Note that
[Equation]
Thus
[Equation]
where the last inequality is obtained by plugging in the bound for ∥ (cid:101) w kh ∥ 2 and (cid:13)(cid:13)(cid:13)(cid:80)
[Equation]
The next lemma guarantees optimism in the planning phase.
Lemma 6 (Optimism) .
For Algorithm 3, with probability at least 1 − δ , for any h ∈ [ H +1] , k ∈
[ K ] and ( s, a ) ∈ S × A ,
[Equation]
Proof.
We condition on the event defined in Lemma 5.
The proof is by induction on h .
The result for h = H + 1 clearly holds.
Suppose the result for h + 1 holds.
Note that for all ( s, a ) ∈ S × A and k ∈
[ K ] ,
[Equation]
In the above proof we assume Q kh ( s, a ) ≤ H − h +1 , since we always have Q ∗ h ( s, a, ˆ r ) ≤
H − h +1 .
Moreover,
[Equation]
and we are done.
The next lemma bound the regret in the planning phase in terms of the expected sum of exploration bonuses.
Lemma 7 (Regret Decomposition) .
With probability at least 1 − δ , for any h ∈ [ H + 1] , k ∈ [ K ] , s ∈ S ,
[Equation]
Proof.
We prove the lemma by induction on h .
The conclusion clearly holds for h = H + 1 .
Assume that the conclusion holds for h + 1 , i.e., for any k ∈ [ K ] and s ∈ S ,
[Equation]
Consider the case for h .
Denote a = ˆ π kh ( s ) =
arg max a ∈A Q kh ( · , a ) for the rest of the proof.
We have
[Equation]
[Equation]
] and
[Equation]
Thus we have
[Equation]
as desired.
Lemma 8.
With probability at least 1 − δ ,
[Equation]
Proof.
Note that Algorithm 2 in the linear case is identical to the Algorithm 1 (LSVI-UCB) in Jin et al.
[2020b] with zero reward, except for a enlarged bonus.
(cid:80) K k
=1 V k 1 ( s 1 ) corresponds to the regret and can be estimated using standard techniques.
We omit the proof for brevity
[Equation]
Lemma 9.
With probability at least 1 − δ ,
[Equation]
K
Proof.
We condition on the event defined in Lemma 7 and Lemma 8.
Note that
[Equation]
We complete the proof by plugging in the bound given in Lemma 8.
C.1.2 Latent State Representation
Our purpose is to show that ˆ r will not incur much error under any policy.
We need to exploit the latent state structure of the MDP to bound the generalization error of ˆ r .
Firstly we need to derive the latent state model (a.k.a, soft state aggregation model) from the non-negative feature model.
Note that for all ( s, a ) ∈ S × A , (cid:80) s ′
∈S P h
( s ′ | s, a ) = 1 , thus we have
[Equation]
Denote µ h := (cid:80) s ′ ∈S µ h ( s ′ ) .
We define a latent state space X
= { 1 , 2 , ..., d } .
Let each state-action pair induces a posterior distribution over X :
[Equation] ∆( X ) , where ψ h ( s, a )[ x ] = ϕ
( s, a )[ x ] · µ h [ x ] .
Since ⟨ ϕ ( s, a ) , µ h ⟩ = 1 , ψ ( · ) is a probability distribution.
For each latent variable induces a emission distribution over S [Equation] ( S ) , where ν h ( x )[ s ′ ]
= µ h ( s ′ )
[ x ] /µ h
[ x ] .
ν h ( · ) is also a probability distribution by definition.
In stage h we sample x h ∼ ψ ( s h , a h ) and s h +1 ∼ ν h ( x h ) .
The trajectory can be amplified as: [Equation]
It suffice to check the transition probability is maintained:
[Equation]
and we are done.
C.1.3 Analysis of the Reward Error
The error can be decomposed in the following manner.
Lemma 10.
For any policy π , we have that
[Equation]
From now on we fix a stage
h ∈
[ H − 1] , and try to analyze the error of the learned reward function in stage h + 1 .
We leverage the latent variable structure to analyze the error of ˆ r .
For j ∈ [ d ] , denote c j the number of times we visit the j -th latent state in stage h during K episodes.
[Equation]
We define the error of ˆ r starting from the j -th latent state as:
[Equation]
where ν h denotes the emission probability.
Thus we can further define the error vector of ˆ r as
[Equation]
Denoting ϕ π = E π ϕ
( s h , a h ) .
The next key lemma bound the error induced by the reward function.
The proof of Lemma 11 is defered to the next section.
Lemma 11.
With probability at least 1 − δ , for any policy π , E π
[Equation]
Lemma 12.
With probability at least
[Equation]
[Equation]
K
Proof.
Similar to Lemma 3.2 of Wang et al.
[2020a], with probability at least 1 − δ , for any policy π , we have that (we treat Γ Kh ( · , · ) /H as a reward function) [Equation] K
[Equation]
where Γ Kh ( s h , a h ) = min { β lin (cid:113) ϕ ( s h , a h ) T (Λ Kh ) − 1 ϕ
( s h , a h ) , H } .
We condition on this event for the rest of the proof.
Note that
[Equation]
Thus we have
[Equation]
K
Note that by Jensen’s inequality,
[Equation]
and we are done.
For a distribution λ ∈ ∆( S × A ) , denote the population risk of an estimated reward function ˆ r in the ( h + 1) -th stage as
[Equation]
For j ∈ [ d ] , denote λ j the distribution starting from the j -th hidden state and take random action, i.e., λ j
= ν
h
( j ) × Unif( A ) .
Then the error vector can be represented as
[Equation]
Note that every time we arrive at j -th hidden state, i.e., x kh =
j , it indicates that ( s kh +1 , (cid:101) a kh +1 ) is a random sample from λ j .
Denote the empirical risk of ˆ r for the first m samples from λ j as err ν j ,m (ˆ r ) .
Classic supervised learning theory gives us the following bound.
Lemma 13.
With probability at least 1 − δ , for all m ∈ [ K ] and reward function r ∈ R consistent with the first m samples from ν j ,
[Equation]
We conclude that with probability at least 1 − δ , for any policy π ,
H (cid:88)
[Equation]
K
By the above results we conclude the following lemma.
Lemma 14.
With probability at least 1 − δ ,
[Equation]
Proof of Theorem 2 in the Linear Case.
Note that
[Equation]
Combing Lemma 9 and Lemma 14 completes the proof
[Equation]
C.1.4 Proof of Lemma
Denote that
[Equation]
We define an expected version of c j :
[Equation]
The next lemma bound e j in terms of c j .
Lemma 15.
With probability at least 1 − δ , for all j ∈ [ d ] ,
[Equation]
for some absolute constant C > 0 .
Proof of Lemma 11.
Note that
[Equation]
Thus the error caused by ˆ r in stage h can be represented as:
[Equation]
where w ′ [ j ] = w [ j ] · µ h
[ j ]
Here we bound the error vector w ′ under the Λ h -norm.
For i ∈ [ K ] , denote ϕ i = ϕ
( s ih , a ih ) .
Then we have that
[Equation]
= ( ψ i [ j ] w [ j ])
[Equation]
d ≤ d d (cid:88) j = [Equation] i = [Equation]
[ j ] w [ j ] (cid:33) [Equation] d ( Note that ϕ i
[ j ] w [ j ] ≥ 0) =
d d (cid:88)
[Equation]
[Equation] [Equation]
Thus we have that
[Equation]
C.2 Proof of the Tabular Case
We choose β tbl to be:
[Equation]
Before the proof, we remark that directly treating the linear case as a special case of the tabular case will derive a much looser bound.
Our proof is based on the analysis in Wu et al.
[2021] and Zanette and Brunskill [2019].
We streamline the key lemmas and omit some of the detailed proofs for brevity
[Equation]
C.2.1 Good Events
Denoting w kh
( s, a ) =
P π k { ( s h
[Equation]
a h ) = ( s, a ) }
[Equation] we construct the following “good event”.
[Equation]
Lemma 16.
[Equation]
Proof.
The proof is identical to that of Lemma 1 in Wu et al.
We omit it for brevity.
Lemma 17.
If events G P , G (cid:98) P hold, then for all V 1 , V 2 : S → [0 , H ] satisfying V 1 ≤ V 2 and ( s, a ) ∈ S ×
A
[Equation]
and
[Equation]
Proof.
The proof is identical to that of Lemma 3 in Wu et al.
We omit it for brevity.
C.2.2 Analysis
Lemma 18 (Optimism of the planning phase) .
If G H holds, for all ( s, a ) ∈ S × A ,
h ∈
[ H ] and k ∈ [ K ] ,
[Equation]
Proof.
Note that the estimated reward function ˆ r h is always true for N kh
( s, a ) > 0 .
On the other hand, for N kh ( s, a ) = 0 , the optimistic Q-function Q kh ( s, a ) is H − h
+
and the value of ˆ r h will not affect Q kh ( s, a ) .
The rest of the proof follows from standard techniques from Azar et al.
Lemma 19.
If events G H , G (cid:98) P holds, then for all s ∈ S , h ∈ [ H ] and k ∈
[ K ] ,
[Equation]
In particular,
[Equation]
Proof.
The proof is identical to that of Lemma 10 in Wu et al.
We omit it for brevity.
Lemma 20.
If events G H , G P holds, then for all k ∈
[ K ] ,
[Equation]
Proof.
We denote a 1 = π kh
( s 1 ) .
Note that
[Equation]
and we are done.
Lemma 21.
With probability at least 1 − δ ,
K [Equation] k
[Equation] [Equation] SAKι + H 3 S 2 Aι, where ι = log( HSAK/δ ) .
Proof.
We set L kh =
{ ( s, a ) | (cid:80) k − 1 τ =1 w τh ( s, a ) ≥ 2 ι } .
Note that
[Equation]
We estimate these parts separately.
By definition we have
[Equation]
Note that K (cid:88)
[Equation]
and
K (cid:88)
[Equation]
Combining the above three parts we complete the proof.
Lemma 22.
[Equation]
K , where ι = log( HSAK/δ ) .
Proof.
Combining the results in Lemma 17,Lemma 19 and Lemma 21 completes the proof.
Proof of Theorem 2 in the Tabular Case.
Plugging in the value of K into Lemma 22 completes the proof.
D Proof of Theorem
We choose β ′ tbl to be:
[Equation]
By standard techniques developed in Jaksch et al.
[2010], we bound the L1-norm of the estimation error of (cid:98) P h in the following sense.
Lemma 23.
For τ ∈ [ K ] , h ∈ [ H ] and ( s,
a ) ∈ S × A , denote (cid:98) P τh ( ·| s, a ) ∈ R S the empirical estimation of P h ( ·| s, a ) based on the first τ samples from ( s, a ) in D .
Then with probability at least 1 − δ ,
[Equation]
τ
The next lemma bound the single-step planning error.
Lemma 24.
With probability at least 1 − δ , for all ( s, a ) ∈ S × A and all h ∈
[ H ] , | (cid:98) P h (cid:98) V h
+1 ( s, a ) − P h (cid:98) V h
+1 ( s, a ) |
≤ Γ h ( s, a ) , and | ˆ r h ( s, a ) − r h ( s, a ) | ≤ Γ h ( s, a ) .
Proof.
Note that
[Equation]
The proof of the first part follows from the results in Lemma 23.
The second part is obvious.
Define the model evaluation error to be
[Equation]
Lemma 25.
Under the event defined in Lemma 24, for all ( s, a ) ∈ S × A and all h ∈ [ H ] ,
[Equation]
Proof of Theorem 3.
With Lemma 25, Theorem 3 falls into a special case of Theorem 4.2 of Jin et al.
[2021b].
We omit the complete proof for brevity.
E Extensions E.1 Unknown Noise Margin
In the main paper we assume that the noise margin ∆ is known as a prior, and the algorithms need ∆ as a input.
But in reality the value of ∆ is usually unknown to the agent.
Here we provide an approach to bypass this issue.
We use binary search to guess the value of ∆ .
This only introduces a log factor to the asymptotic sample complexity as we only need to guess logarithmically many times.
First, we add a validation step in the active learning algorithm. After learning the human model (cid:101) f , we test whether for each data point z in the data pool Z we have (cid:101) f ( z ) > ∆ / 2 . If this is true, the reward labels of the data points in the data pool is guaranteed to be right, which is enough to guarantee the
Input: Data Pool Z = { z i } i ∈ [ T ] , guess margin ∆ , failure probability δ ∈ (0 , 1)
Z 0 ← {} //Query
Dataset
Set N ← C 1 · (dim 2 ( F )+dim( F ) · log(1 /δ ))
· (log 2 (dim( F )))
∆for k = 1 , 2 , ..., N do β ← C 2 · (cid:112) log(1 /δ )
+ log N · dim( F )
Set the bonus function: b k ( · ) ← sup f,f ′ ∈F , ∥ f − f ′ ∥
Z k − 1 ≤ β | f ( · ) − f ′ ( · ) | z k ← arg max z ∈Z b k ( z )
Z k ← Z k − 1 ∪ { z k } end for for z ∈ Z N do
Ask the human expert for a label l ( z ) ∈ { 0 , 1 } end for
Estimate the human model as (cid:101) f = arg min f ∈F (cid:80) z ∈Z N ( f ( z ) − l ( z ))for all z ∈ Z do if | (cid:101) f
( z ) − 1 / 2 | > ∆ / 2 then return false end if end for
Let ˆ f ∈ C ( F , ∆ / 2) such that ∥ ˆ f − (cid:101) f ∥ ∞ ≤ ∆ /
Estimate the underlying true reward: ˆ r ( · ) =
(cid:40) 1 , ˆ f ( · ) > 1 /0 , ˆ f ( · ) ≤ 1 /return:
The estimated reward function ˆ r .
Algorithm 6 GuessDelta for n = 1 , 2 , . . .
do ∆ ′
← 12 n
Run Algorithm 2 and Algorithm 3 (equipped with Algorithm 5) with guess margin ∆ ′ and confidence parameter δ n ( n +1) if A policy π is returned from Algorithm 3 then return π end if end for accuracy of the learned reward function.
Otherwise we halt the algorithm and try the next guess of ∆ .
The full algorithm is presented in Algorithm 5.
Now we introduce the procedure for guessing ∆ .
We set ∆ ′
= 1 / (2 n ) , ( n = 1 , 2 , ... ) and run
Algorithm 2 and Algorithm 3 repeatedly.
For a guess of ∆ , the output policy is guaranteed to be near-optimal if the algorithms successfully finish and have not been halted by the validation step.
Otherwise, we replace ∆ ′ with ∆ ′ / 2 and rerun the whole algorithm.
The doubling schedule implies that the smallest guess is at least ∆ / 2 .
Besides, we also need to adjust the confidence parameter to δ/ ( n ( n + 1)) .
The whole procedure for guessing ∆ is presented in Algorithm 6.
We state the theoretical guarantee in Theorem 4.
Theorem 4.
In the linear case, Algorithm 6 can find an ε -optimal policy with probability at least 1 − δ , with at most
[Equation]
episodes.
In the tabular case, Algorithm 6 can find an ε -optimal policy with probability at least 1 − δ , with at most
[Equation]
episodes.
In both cases, the total number of queries to the reward is bounded by (cid:101)
O
( H · dim 2 ( F ) / ∆ 2 ) .
Proof.
Note that
[Equation]
Thus we can condition on the good events defined in the proof of Theorem 1 and Theorem 2 for all n ∈ N .
Note that
• With the validation step, the output policy of Algorithm 3 is guaranteed to be ε -optimal, regardless of whether the guess ∆ ′ is true. • Algorithm 3 will output a policy whenever ∆ ′ < ∆ .
As a result, Algorithm 6 will terminate with an ε -optimal policy, and with at most O (log(1 / ∆)) guesses of ∆ .
Note that the sample and feedback complexity bounds are both monotonically increasing in 1 / ∆ , thus they at most multiply a log facter log(1 / ∆) .
The difference in the confidence parameter won’t effect the bound.
E.2 Beyond Binary Reward
In the main paper we assume that the valid reward function is binary.
We remark that our framework can be generalized to RL problems with n -uniform discrete rewards.
We consider a fixed stage h ∈
[ H ] , and omit the subscript h in this section.
In this case, the reward function takes value from { 0 , 1 n , 2 n , . .
In each query, the human teacher chooses from { 0 , 1 n , 2 n , . . , 1 } (when n = 2 , the choices are { 0 , 12 , 1 } , which can be interpreted as “bad”, “average”, and “good” actions).
We assume that when queried about a data point z
= ( s, a ) , the probability of the human teacher choosing in is p
i ( z ) ( 0 ≤ i ≤ n ), and the human response model f ∗ satisfies:
[Equation]
where f ∗ belongs to the pre-specified function class F .
We assume the true reward of z is determined by f ∗ ( z ) .
Concretely,
[Equation]

[Equation]
The bounded noise assumption becomes that f ∗ ( z ) can not be too near the decision boundary.
Assumption 4 (Bounded Noise in Uniform Discrete Rewards Setting) .
There exists ∆ > 0 , such that for all z ∈ S × A , and all 1 ≤ i ≤ n ,
[Equation]
In Algorithm 1 we estimate the underlying true reward as
[Equation]
The other parts of the algorithm are similar to that with binary rewards.
Following similar analysis in the proof of Theorem 1, we can learn the reward labels in the data pool correctly using only (cid:101)
O
( d 2 ∆ 2 ) queries.
Thus we can derive the exact same sample and feedback complexity bounds as in the binary reward case.
E.3 Beyond Bounded Noise
In this section we generalize the bounded noise assumption to the low noise assumption (a.k.a, Tsybakov noise)
[Mammen and Tsybakov, 1999, Tsybakov, 2004], which is another standard assumption in the active learning literature.
Assumption 5 (Low Noise) .
There exists constants α ∈ [0 , 1] and c > 0 , such that for any policy π , level h ∈
[ H ] , and ε > 0 ,
[Equation]
In this case, the difficulty of the reward learning problem depends on the exponent α .
With this assumption, we can design algorithms with similar feedback and sample complexity.
Concretely, We run Algorithm 2 and Algorithm 3 with ∆ =
( cK ) − 1 α , where K is the number of episodes, c and α are the constants in Assumption 5.
We state the theoretical guarantee in Theorem 5.
Theorem 5.
In the linear case, under Assumption 5, Algorithm 2 and Algorithm 3 with ∆ = ( cK ) − 1 α can find an ε -optimal policy with probability at least 1 − δ , with at most
K =
O
[Equation]
episodes.
The total number of queries to the reward is bounded by
[Equation]
In the tabular case, under Assumption 5, Algorithm 2 and Algorithm 3 with ∆ = ( cK ) − 1 α can find an ε -optimal policy with probability at least 1 − δ , with at most
[Equation]
episodes.
The total number of queries to the reward is bounded by
[Equation]
Proof.
We denote ∆ =
( cK ) − 1 α in the proof.
Let ε = ∆ = ( cK ) − 1 α in Assumption 5.
We have that for any policy π , and level h ∈
[ H ] ,
[Equation]
By a martingale version of the Chernoff bound, we have that with probability at least 1 − δ , the number of elements in
[Equation]
is at most O (log( H/δ )) for all h ∈
[ H ] .
The active learning algorithm guarantees to learn the reward labels correctly for all the elements in the dataset D
= { ( s kh , a kh ) } ( h,k ) ∈
[ H ] ×
[ K ] , except the ones in (cid:83)
Hh =1 G h .
Simply rehashing the proof of Theorem 2 shows the optimality of the output policy.
Plugging in the value of ∆ to Theoremgives the bound on the total number of queries.