C ONFIDENCE -C ONDITIONED V ALUE F UNCTIONS FOR O FFLINE R EINFORCEMENT L EARNING
Anonymous authors
Paper under double-blind review
A BSTRACT
Offline reinforcement learning (RL) promises the ability to learn effective policies solely using existing, static datasets, without any costly online interaction.
To do so, offline RL methods must handle distributional shift between the dataset and the learned policy.
The most common approach is to learn conservative, or lower-bound, value functions, which underestimate the return of out-of-distribution (OOD) actions.
However, such methods exhibit one notable drawback: policies optimized on such value functions can only behave according to a fixed, possibly suboptimal, degree of conservatism.
However, this can be alleviated if we instead are able to learn policies for varying degrees of conservatism at training time and devise a method to dynamically choose one of them during evaluation.
To do so, in this work, we propose learning value functions that additionally condition on the degree of conservatism, which we dub confidence-conditioned value functions .
We derive a new form of a Bellman backup that simultaneously learns Q-values for any degree of confidence with high probability.
By conditioning on confidence, our value functions enable adaptive strategies during online evaluation by controlling for confidence level using the history of observations thus far.
This approach can be implemented in practice by conditioning the Q-function from existing conservative algorithms on the confidence.
We theoretically show that our learned value functions produce conservative estimates of the true value at any desired confidence.
Finally, we empirically show that our algorithm outperforms existing conservative offline RL algorithms on multiple discrete control domains.
I NTRODUCTION
Offline reinforcement learning (RL) aims to learn effective policies entirely from previously collected data, without any online interaction (Levine et al., 2020).
This addresses one of the main bottlenecks in the practical adoption of RL in domains such as recommender systems (Afsar et al., 2021), healthcare (Shortreed et al., 2011; Wang et al., 2018), and robotics (Kalashnikov et al., 2018), where exploratory behavior can be costly and dangerous.
However, offline RL introduces new challenges, primarily caused by distribution shift .
Na¨ıve algorithms can grossly overestimate the return of actions that are not taken by the behavior policy that collected the dataset (Kumar et al., 2019a).
Without online data gathering and feedback, the learned policy will exploit these likely suboptimal actions.
One common approach to handle distribution shift in offline RL is to optimize a a conservative lower-bound estimate of the expected return, or Q-values (Kumar et al., 2020;
Kostrikov et al., 2021;
Yu et al., 2020).
By intentionally underestimating the Q-values of out-of-distribution (OOD) actions, policies are discouraged from taking OOD actions.
However, such algorithms rely on manually specifying the desired degree of conservatism, which decides how pessimistic the estimated Q-values are.
The performance of these algorithms is often sensitive to this choice of hyperparameter, and an imprecise choice can cause such algorithms to fail.
Our work proposes the following solution: instead of learning one pessimistic estimate of Q-values, we propose an offline RL algorithm that estimates Q-values for all possible degrees of conservatism.
We do so by conditioning the learned Q-values on its confidence level , or probability that it achieves a lower-bound on the true expected returns.
This allows us to learn a range of lower-bound Qvalues of different confidences.
These confidence-conditioned Q-values enables us to do something conservative RL algorithms could not—control the level of confidence used to evaluate actions.
Specifically, when evaluating the offline-learned Q-values, policies derived from conservative offline
RL algorithms must follow a static behavior, even if the online observations suggest that they are being overly pessimistic or optimistic.
However, our approach enables confidence-adaptive policies that can correct their behavior using online observations, by simply adjusting the confidence-level used to estimate Q-values.
We posit that this adaptation leads to successful policies more frequently than existing static policies that rely on tuning a rather opaque hyperparameter during offline training.
Our primary contribution is a new offline RL algorithm that we call confidence-conditioned valuelearning (CCVL), which learns a mapping from confidence levels to corresponding lower-bound estimations of the true Q-values.
Our theoretical analysis shows that our method learns appropriate lower-bound value estimates for any confidence level.
Our algorithm also has a practical implementation that leverages multiple existing ideas in offline RL.
Namely, we use network parameterizations studied in distributional RL to predict Q-values parameterized by confidence (Dabney et al., 2018b;a).
Our objective, similar to conservative Q-learning (CQL) (Kumar et al., 2020), uses regularization to learn Q-values for all levels of pessimism and optimism, instead of anti-exploration bonuses that may be difficult to accurately compute in complex environments (Rezaeifar et al., 2021).
In addition, our algorithm can be easily extended to learn both lower- and upper-bound estimates, which can be useful when fine-tuning our offline-learned value function on additional data obtained via online exploration.
Finally, we show that our approach outperforms existing state-of-the-art approaches in discrete-action environments such as Atari (Mnih et al., 2013; Bellemare et al., 2013).
Our empirical results also confirm that conditioning on confidence, and controlling the confidence from online observations, can lead to significant improvements in performance.
R ELATED W ORK
Offline RL (Lange et al., 2012; Levine et al., 2020) has shown promise in numerous domains.
The major challenge in offline RL is distribution shift (Kumar et al., 2019a), where the learned policy might select out-of-distribution actions with unpredictable consequences.
Methods to tackle this challenge can be roughly categorized into policy-constraint or conservative methods.
Policy-constraint methods regularize the learned policy to be “close” to the behavior policy either explicitly in the objective via a policy regularizer (Fujimoto et al., 2018; Kumar et al., 2019a;
Liu et al., 2020; Wu et al., 2019;
Fujimoto & Gu, 2021), implicitly update (Siegel et al., 2020; Peng et al., 2019; Nair et al., 2020), or via importance sampling (Liu et al., 2019; Swaminathan & Joachims, 2015; Nachum et al., 2019).
On the other hand, conservative methods learn a lower-bound, or conservative, estimate of return and optimize the policy against it (Kumar et al., 2020; Kostrikov et al., 2021; Kidambi et al., 2020; Yu et al., 2020; 2021).
Conservative approaches traditionally rely on estimating the epistemic uncertainty, either explicitly via exploration bonuses (Rezaeifar et al., 2021) or implicitly using regularization on the learned Q-values (Kumar et al., 2020).
The limitation of existing offline RL approaches is that the derived policies can only act under a fixed degree of conservatism, which is determined by an opaque hyperparameter that scales the estimated epistemic uncertainty, and has to be chosen during offline training.
This means the policies will be unable to correct their behavior online, even if it becomes evident from online observations that the estimated value function is too pessimistic or optimistic.
Our algorithm learns confidence-conditioned Q-values that capture all possible degrees of pessimism by conditioning on the confidence level, modeling epistemic uncertainty as a function of confidence.
By doing so, instead of committing to one degree of pessimism, we enable policies that adapt how conservative they should behave using the observations they sees during online evaluation.
Our approach is related to ensemble (Agarwal et al., 2020; Lee et al., 2021; Chen et al., 2021; An et al., 2021) approaches in that they also predict multiple Q-values to model epistemic uncertainty.
However, existing ensemble methods train individual Q-values on the same objective, and rely on different parameter initializations.
In contrast, each of our Q-values captures a different confidence-level.
In addition, standard ensemble approaches do not consider adaptive policies.
Recently, APE-V proposes using ensembles to learn adaptive policies that condition on belief over which value function is most accurate (Ghosh et al., 2022).
Our approach considers a similar strategy for adaptation, but explicitly parameterizes the value function by the confidence level, introducing a novel training objective for this purpose.
In our experiments, we compare to a method that adapts APE-V to our discrete-action benchmark tasks.
Jiang & Huang (2020); Dai et al.
(2020) propose confidence intervals for policy evaluation at specified confidence-levels.
We aim to learn a value function across all confidences, and use it for adaptive policy optimization.
Finally, distributional RL (Dabney et al., 2017; Bellemare et al., 2017; Dabney et al., 2018b) learns a distribution over values, but only capture aleatoric uncertainty, whereas our focus is on epistemic uncertainty and offline RL.
P RELIMINARIES
The goal in reinforcement learning is to learn a policy π ( ·| s ) that maximizes the expected cumulative discounted reward in a Markov decision process (MDP), which is defined by a tuple ( S , A , P, R, γ ) .
S , A represent state and action spaces, P ( s ′ | s , a ) and R ( s , a ) represent the dynamics and reward distribution, and γ ∈ (0 , 1) represents the discount factor.
We assume that the reward r ( s , a ) is bounded in magnitude, i.e. , | r ( s , a ) | ≤ R max for some finite R max .
π β ( a | s ) represents the (unknown) behavior policy used to collect the offline dataset D that will be used for training, d π β ( s ) is the discounted marginal state distribution of π β ( a | s ) , and the offline dataset D
= { ( s , a , r, s ′ ) } is formed from interactions sampled from d π β ( s ) π β ( a | s ) .
Policy evaluation attempts to learn the Q -function Q π : S ×
A → R of a policy π at all state-action pairs ( s , a ) ∈ S × A , Specifically, for a policy π , its Q-value Q π ( s , a ) =
E π [ (cid:80) ∞ t =
γ t r t ] is its expected mean return starting from that state and action.
The Q-function is the unique fixed point of the Bellman operator B π given by B π Q ( s , a ) =
r ( s , a ) + γ E s ′ ∼ P
( s ′ | s , a ) , a ′ ∼ π ( a ′ | s ′ )
[ Q ( s ′ , a ′ )] , meaning Q π = B π Q π .
Q-learning learns Q ∗ =
Q π ∗ as the fixed point of the Bellman optimality operator B ∗ given by B ∗ Q ( s , a )
=
r ( s , a )+ γ E s ′ ∼ P
( s ′ | s , a ) [max a ′ Q ( s ′ , a ′ )] , and derives the optimal policy π ∗ ( a | s )
[Equation]
Offline reinforcement learning.
In offline RL, we are limited to interactions that appear in the dataset D of N samples ( s , a , r, s ′ ) , where a ∈ A is derived from some suboptimal behavior policy.
Hence, we do not have access to the optimal actions used in the backup of the Bellman optimality operator.
Because of this, offline RL suffers from distributional shift (Kumar et al., 2019b; Levine et al., 2020).
Prior methods address this issue by learning conservative, or lower-bound, value functions that underestimate expected return outside of the dataset.
One method to accomplish this is to subtract anti-exploration bonuses that are larger for out-of-distribution (OOD) states and actions (Rezaeifar et al., 2021):
[Equation]
where α > 0 is a hyperparameter.
Another relevant method is conservative Q-learning (CQL) (Kumar et al., 2020), which proposes a regularizer to the standard objective to learn pessimistic Q-values:
[Equation]
Here, π is some policy that approximately maximizes the current Q-function iterate, and R is some regularizer.
This objective includes a penalty that ensures Q-values at OOD actions are underestimated compared to in-distribution (ID) actions.
Such methods learn lower-bound value functions for a fixed confidence-level, that is implicitly captured in hyperparameter α .
In this paper, we propose learning value functions that condition the confidence-level explicitly.
Additional notation.
Let n ∧ 1 = max { n, 1 } .
Denote ι = polylog( |S| , (1 − γ ) − 1 , N ) .
We let ι be a polylogarithmic quantity, changing with context.
C ONFIDENCE -C ONDITIONED V ALUE F UNCTIONS
In this section, we describe our method for learning confidence-conditioned value functions , such that conditioned on some confidence level δ ∈ (0 , 1) , the learned Q-function can lower-bound its true value with probability 1 − δ .
Because such Q-functions depend not only on state-action pairs, but also the confidence δ , they enable adaptive policies that change behavior based on δ , and adjust delta to maximize online performance.
In contrast, pessimistic offline RL is limited to a fixed Markovian strategy.
We first propose a novel Q-learning algorithm, which we dub confidence-conditioned value learning (CCVL), then show how such learned Q-function enables adaptive strategies, dubbed confidence-adaptive policies .
In this work, we focus on discrete-action environments, but our insights can be straightforwardly extended to develop actor-critic algorithms for continuous environments.
4. C ONFIDENCE -C ONDITIONED V ALUE L EARNING
Recall from Section 3 that standard Q-learning involves learning Q-values that satisfy the Bellman optimality update Q ∗ =
B ∗ Q ∗ .
We are interested in learning confidence-conditioned Q-values, which we define as:
Definition 4.1.
A confidence-conditioned value function Q ( s , a , δ ) satisfies, for a given δ ∈ (0 , 1) :
Q
[Equation]
a
[Equation]
δ
[Equation]
sup
[Equation]
such that Pr [ Q ∗ ( s , a ) ≥ q
[Equation]
[Equation] δ .
Note that we include the suprenum to prevent Q ( s , a , δ ) =
Q ( s , a , 0) for all other values of δ .
The randomness is due to noise in dataset sampling, as the dataset is used to compute our learned value function.
To achieve a high-probability lower-bound on Q ∗ ( s , a ) , we account for two sources of uncertainty: (1) we must approximate the Bellman optimality operator, which assumes known reward and transition model, using samples in D , and (2) we need to additionally lower-bound the target Q ∗ used in the Bellman backup.
The uncertainty due to (1), also called epistemic uncertainty , can be bounded using concentration arguments on the samples from D .
Namely, we define b ( s , a , δ ) as a high-probability anti-exploration bonus that upper-bounds epistemic uncertainty, or
P (cid:16)(cid:12) (cid:12) (cid:12) B ∗ Q ∗ ( s , a ) − (cid:98) B ∗ Q ∗ ( s , a ) (cid:12) (cid:12) (cid:12) ≤ b ( s , a , δ ) (cid:17) ≥ 1 − δ .
Such bonuses are well-studied in the prior literature (Burda et al., 2018;
Rezaeifar et al., 2021), and can be derived using concentration inequalities such as Chernoff-Hoeffding or Bernstein.
Using the former, the bonuses are given by b ( s , a , δ ) =
(cid:113)
ι log(1 /δ )
n ( s , a ) ∧ 1 , where n ( s , a ) is the number of times the state-action pair appears in D .
Next, the uncertainty due to (2) can be straightforwardly bounded using our learned Q-function.
This gives rise to the iterative update for training the confidence-conditioned Q-function:
[Equation]
where α > 0 is again some hyperparameter.
In Theorem 6.1, we show that for any confidence level δ ∈ (0 , 1) , the resulting Q-values (cid:98) Q ( s , a , δ ) =
lim k →∞ (cid:98) Q k ( s , a , δ ) lower-bounds the true Q-value
Q ∗ ( s , a ) with probability at least 1 − δ .
Note that Equation 4 is similar to a traditional Q-learning using anti-exploration bonuses, as in
Equation 1, but with important differences.
In conservative Q-learning, the δ value is not modeled and implicitly captured in the α hyperparameter.
Equation 1 can be made more similar to Equation 4 by explicitly conditioning on δ , and setting δ 1 = δ 2 = δ .
We believe our approach offers the following advantages compared to using anti-exploration bonuses without conditioning.
First, tuning α in our approach is easier as we do not need to commit to a degree of conservatism beforehand.
Also, by introducing an outer maximization over δ 1 , δ 2 , we see that for any iteration k ∈ N , and any δ ∈ (0 , 1) , (cid:98) Q k +
( s , a , δ ) as the solution to Equation 4 is at least as tight of a lower-bound one that would set δ 1 =
δ 2 = δ .
The latter is what Equation 1 implicitly does.
Implicit bonuses via regularization.
The objective in Equation 4 requires explicit computation of anti-exploration bonuses, which requires computation of state-action visitations n ( s , a ) − 1 that we discuss in Section 5 is difficult with neural network value functions.
Here, we propose a new objective that is inspired by how CQL achieves pessimistic value functions (Kumar et al., 2020).
The key idea is, instead of explicitly subtracting a bonus, we can add a regularizer in the objective.
Specifically, we have the following iterative update as an alternative to equation 4:
[Equation]
where like in Kumar et al.
, R is some regularizer (typically the entropy of π ).
Note that
Equation 5 still relies on the computation of n ( s ) − 1 .
However, we noticed that estimating state visitations is actually much easier than state-action visitations with neural networks: we observed that state-action density estimators were insufficiently discriminative between seen and unseen actions at a given state, although state-only visitations, which do not require estimating densities of unseen samples were a bit more reliable (see Section 5 for details)
In Theorem 6.2, we show that the resulting (cid:98) Q ( s , a , δ ) may not point-wise lower-bound Q ∗ ( s , a ) , but will do so in expectation.
Specifically, for (cid:98) V ( s , δ ) = max a (cid:98) Q ( s , a , δ ) , we have that (cid:98) V ( s , δ ) lower-bounds the true value
V ∗ ( s ) = max a Q ∗ ( s , a ) with probability at least 1 − δ .
The objective in Equation 5 differs from the CQL update in Equation 2 in two notable aspects: (1) we explicitly condition on δ and introduce a maximization over δ 1 , δ 2 , and (2) rather than a fixed weight of α > 0 on the CQL regularizer, the weight now depends on the state visitations.
Like with
Equation 4, we can argue that (1) implies that for any k ∈ N , we learn at least as tight lower-bounds for any δ than the CQL update implicitly would.
In addition, (2) means that the lower-bounds due to the CQL regularizer additionally depends on state visitations in D , which will improve the quality of the obtained lower-bounds over standard CQL.
4. C ONFIDENCE -A DAPTIVE P OLICIES
Given a learned Q-function, standard Q-learning would choose a stationary Markovian policy that selects actions according to (cid:98) π ( a | s ) =
I (cid:110) a = arg max a (cid:98) Q ( s , a ) (cid:111) .
We can na ¨ ıvely do this with the learned confidence-conditioned Q-function by fixing δ and tuning it as a hyper-parameter.
However, especially in offline RL, it can be preferable for the agent to change its behavior upon receiving new observations during online evaluation, as such observations can show that the agent has been behaving overly pessimistic or optimistic.
This adaptive behavior is enabled using our confidence-conditioned
Q-function by adjusting δ using online observations.
Let h be the history of observations during online evaluation thus far.
We propose a confidenceadaptive policy that conditions the confidence δ under which it acts on h ; namely, we propose a non-Markovian policy that selects actions as (cid:98)
π
( a | s , h ) =
I (cid:110) a = arg max a (cid:98) Q ( s , a , δ ) (cid:111) , where δ ∼ b ( h ) .
Here, b ( h ) is a distribution representing the “belief” over which δ is best to evaluate actions for history h .
Inspired by Ghosh et al.
, we compute b ( h ) using Bellman consistency (Xie et al., 2021) as a surrogate log-likelihood.
Here, the probability of sampling δ under b ( h ) is:
[Equation]
Note that this surrogate objective is easy to update.
This leads to a tractable confidence-adaptive policy (cid:98) π that can outperform Markovian policies learned via conservative offline RL.
4. L EARNING L OWER - AND U PPER -B OUNDS
A natural extension of our method is to learn confidence-conditioned upper-bounds on the true Qvalues.
Formally, as change of notation, let Q ℓ ( s , a , δ ) be the lower-bounds as defined in Equation 3.
We can learn upper-bounds Q u ( s , a , δ ) as
[Equation]
Following analogous logic as in Secton 4.1, we can derive an iterative update as
[Equation]
Learning both (cid:98) Q ℓ and (cid:98) Q u presents the opportunity for improved policy extraction from the learned value functions.
Instead of simply optimizing the learned lower-bounds, which may lead to overly conservative behavior, we can optimize the upper-bounds but constrained to safe actions whose corresponding lower-bounds are not too low.
Formally, our policy can perform
[Equation]
where δ ∼ b ( h ) , and
A
[Equation]
=
[Equation]
for some parameter β > 0 .
To simplify notation, for the remainder of the paper, we again drop the subscript on ℓ when referencing lower-bounds.
Learning upper-bounds offline is particularly important when fine-tuning the value functions on online interactions, which is a natural next-step after performing offline RL.
Existing offline RL algorithms achieve strong offline performance, but lack the exploration necessary to improve greatly during online fine-tuning.
By learning both lowerand upper-bounds, our method can achieve better online policy improvement (see Section 7.3).
P RACTICAL A LGORITHM
In this section, we describe implementation details for our CCVL algorithm, and arrive at a practical algorithm.
We aim to resolve the following details: (1) how the confidence-conditioned Q-function is parameterized, and (2) how the objective in Equation 4 or Equation 5 is estimated and optimized.
Our Q-function is parameterized by a neural network with parameters θ .
To handle conditioning on δ , we build upon implicit quantile networks (IQN) (Dabney et al., 2018a), and propose a parametric model that can produce (cid:98) Q ( s , a , δ ) for given values of δ .
Alternatively, we could fix quantized values of δ , and model our Q-function as an ensemble where each ensemble member corresponds to one fixed δ .
We choose the IQN parameterization because training over many different δ ∼ U (0 , 1) may lead to better generalization over confidences.
However, when computing beliefs b online, we maintain a categorical distribution over quantized values of δ .
In Equation 4 or Equation 5, we must compute the inverse state-action or state visitations.
This can be exactly computed for tabular environments.
However, in non-tabular ones, we need to estimate inverse counts n ( s , a ) − 1 or n ( s ) − 1 .
In prior work, O’Donoghue et al.
(2018) proposed obtaining linear-value estimates using the last layer of the neural network, i.e. , n ( s , a ) − 1 ≈ ϕ ( s ) ⊤ (cid:0)
Φ ⊤ a Φ
[Equation]
(cid:1) − 1 ϕ ( s ) , where ϕ extracts state representations, and Φ a is a matrix of ϕ ( s i ) for states s i ∈ D where action a was taken.
However, we found that such methods were not discriminative enough to separate different actions in the dataset from others under the same state.
Instead of state-action visitations, the update in Equation 5 requires only estimating inverse state visitations n ( s ) − 1 .
Empirically, we find that linear estimates such as n ( s ) − [-
-]1 ≈ ϕ ( s ) ⊤ (Φ ⊤ Φ) − 1 ϕ
( s ) could successfully discriminate between states.
Hence, we use the latter update when implementing CCVL in non-tabular environments.
Finally, we summarize our CCVL algorithm in Algorithm 1.
Note that aside from sampling multiple δ ∼ U (0 , 1) for training, CCVL is no more computationally expensive than standard Q-learning, and is on the same order as distributional or ensemble RL algorithms that train on multiple Q-value estimations per state-action pair.
Hence, our algorithm is very practical, while enabling adaptive non-Markovian policies as described in Section 4.2.
Algorithm
T HEORETICAL A NALYSIS
In this section, we show that in a tabular MDP, the value functions learned by CCVL properly estimate lower-bounds of the true value, for any confidence δ .
We show this for both the update using anti-exploration bonuses in equation 4 as well as the one using regularization in Equation 5.
First, we show a simple lemma that CCVL will learn a value function such that the values decrease as the confidence level increases.
Formally, we show the following:
Lemma 6.1.
The Q-values (cid:98) Q learned via CCVL satisfy, for any δ, δ ′ ∈ (0 , 1) such that δ ≤ δ ′ : (cid:98) Q ( s , a , δ ) ≤ (cid:98) Q ( s , a , δ ′ ) .
Proof.
Let δ 1 , δ 2 ≤ δ be the solution to the maximization for (cid:98) Q ( s , a , δ ) in Equation 4.
Since δ ≤ δ ′ , we have δ 1 , δ 2 ≤ δ ′ .
This implies (cid:98) Q ( s , a , δ ) ≤ (cid:98) Q ( s , a , δ ′ ) , as desired.
Lemma 6.1 means that as δ decreases, which equates to estimating a lower bound of higher confidence, our estimated Q-values will monotonically decrease.
Using Lemma 6.1 allows us to show the following theorems, which are the main results of this section.
We state the results below, and defer proofs to the Appendix A.
The first shows that using when equation 4, our value-function estimates, for any confidence δ ∈ (0 , 1) , a proper lower-bound on the optimal Q-values with probability at least 1 − δ .
Theorem 6.1.
For any δ ∈ (0 , 1) , the Q-values (cid:98) Q learned via CCVL with Equation 4 satisfies (cid:98) Q ( s , a , δ ) ≤ Q ∗ ( s , a ) for all states s ∈ S , and actions a ∈ A with probability at least 1 − δ for some α > 0 .
The second theorem shows an analogous result to Theorem 6.1, but using the update in equationinstead.
However, using the alternative update does not guarantee a pointwise lower-bound on
Q-values for all state-action pairs.
However, akin to Kumar et al.
(2020), we can show a lower-bound on the values for all states.
Theorem 6.2.
For any δ ∈ (0 , 1) , the value of the policy (cid:98) V ( s , δ ) = max a ∈A (cid:98) Q ( s , a , δ ) , where (cid:98) Q are learned via CCVL with Equation 5 satisfies
[Equation]
for all states s ∈ S where V ∗ ( s ) = max a ∈A Q ∗ ( s , a ) with probability at least 1 − δ for some α > 0 .
E MPIRICAL E VALUATION
In our experiments, we aim to evaluate our algorithm, CCVL on discrete-action offline RL tasks.
We use the iterative update in Equation 5, as it achieves stabler performance when the Q-function is a neural network.
We aim to ascertain whether the two distinct properties of our method lead to improved performance: (1) conditioning on confidence δ during offline training, and (2) adapting the confidence value δ during online rollouts.
We compare to prior offline RL methods, REM (Agarwal et al., 2020) and CQL (Kumar et al., 2020), and ablations of our method where we either replace confidence-conditioning with a simple ensemble, which we dub adaptive ensemble value-learning (AEVL), or behave according to a fixed confidence online, which we call Fixed-CCVL.
Comparisons.
REM and CQL are existing state-of-the-art offline RL algorithms for discrete-action environments.
AEVL allows us to study question (1) by replacing confidence-conditioned values with a random ensemble, where each model in the ensemble roughly has the same level of conservatism.
Each ensemble member of AEVL is trained independently using different initial parameters, and which ensemble member to act under is controlled online using Bellman error as in our proposed method.
Note that AEVL can be viewed as a special case of APE-V in Ghosh et al.
(2022) for discrete-action domains.
Finally, Fixed-CCVL tests (2) by treating confidence δ used by the policy as a fixed hyper-parameter instead of automatically adjusting it during online rollouts.
The confidence is selected as the one that minimized Bellman error during offline training.
Because AEVL and CCVL change their behavior during evaluation, we maintain a fair comparison by reporting the average score across the adaptation process, including episodes where adaptation has not yet converged.
7. I LLUSTRATIVE E XAMPLE ON G RIDWORLD
We first present a didactic example that illustrates the benefit of CCVL over standard conservative offline RL algorithms.
We consider a 8 × 8 gridworld environment (Fu et al., 2019), with a start and goal state, walls, lava.
The reward is 1 upon reaching the goal, but entering a lava state results in receiving a reward of 0 for the rest of the trajectory.
We consider an offline RL task where the learned policy must generalize to a slightly different gridworld environment than the one it was trained on.
Dataset Composition 1 0 1 2 3 4 5 6 7
CQL State-Action Visitations 1 0 1 2 3 4 5 6 7
CCVL State-Action Visitations
In our case, during offline training, the environment is stochastic, in that there is a 30% chance that the agent travels in an unintended direction; however, during evaluation, that probability decreases to 15% .
This makes previously risky paths more optimal.
This is where we anticipate that adaptive methods such as ours will have a severe advantage.
While CQL will act too conservatively, our method CCVL can evaluate and change its level of conservatism on the fly.
[Figure]
We construct an offline dataset consisting of 2 .
5 k samples from a behavior policy, which takes the optimal action with probability 0 .
5 , and a random action otherwise.
In Figure 1, we show the returns of CQL and CCVL (normalized by optimal return) for various choices of α . We see that because CCVL does not commit to a degree of conservatism beforehand, it does not suffer from overly conservative behavior as CQL does when α ≥ 0 . For α = 0 .
2 , we also visualize the process of CCVL adapting δ over 10 evaluation trajectories, ultimately becoming less conservative. Finally, in Figure 2, we see that for large settings of α , CQL is unable to recover the optimal trajectory–instead learning the most likely trajectory in the dataset–whereas CCVL can.
7. O FFLINE T RAINING ON A TARI
Next, we evaluate our algorithm against prior methods on Atari games (Bellemare et al., 2013) with offline datasets of varying size and quality, previously considered by Agarwal et al.
; Kumar et al.
We follow the exact setup of Kumar et al.
(2022), including evaluating across the same set of 17 games, using the same three offline datasets, with 1% and 5% of samples uniformly drawn from DQN replay dataset introduced in Agarwal et al.
(2020), as well as a more suboptimal dataset consisting of 10% of the initial samples from the DQN dataset (corresponding to the first 20 M observations during online DQN).
Including this more suboptimal dataset allows us to evaluate the degree to which each method can improve over the average performance in the dataset.
Following
Agarwal et al.
(2020), the Atari games have stochastic dynamics, with a 25% chance of “sticky actions,” i.e. , executing the previous action instead of a new one.
The REM and CQL baselines use exactly the hyperparamter configurations used by Kumar et al.
We refer to Table E.1 of Kumar et al.
for a table of hyperparamters used.
Across all methods, we found it useful to perform DR3 regularization on the learned state representations (Kumar et al., 2022).
Following Agarwal et al.
(2021), we report the interquartile mean (IQM) normalized scores, where the normalization gives score 0 to a random policy and 100 to the nature
DQN (Mnih et al., 2015), and each score is computed using the average of 100 episodes.
We also report 95% confidence intervals (CIs) computed using stratified bootstrapping.
The results across all 17 games for the three datasets are in Table 1.
We also show complete per-game results in Tables 4-6.
Note that our method CCVL outperforms all baselines that we evaluate against.
Though the average improvement across all games is small, we see that CCVL sometimes outperforms REM and CQL by over 30% for games such as Asterix or Breakout.
We believe this is because REM and CQL can only act according to a fixed level of conservatism across all games, whereas CCVL is able to adapt [Table] its level on a per-game basis.
We also notice that CCVL outperforms both ablations, showing that both confidence-conditioning and adaptation are important to the success of our algorithm.
Though
AEVL is adaptive, because the ensemble members do not represent diverse hypotheses about how to act optimally, adaptation is not useful.
Perhaps unsurprisingly, Fixed-CCVL and CQL perform similarly due to the similarities in the objective in Equation 5 and Equation 2.
However, CCVL greatly improves over Fixed-CCVL due to being able to adapt the δ used by the policy online.
7. O NLINE F INE -T UNING ON A TARI
It is often realistic to consider that the value functions obtained by offline RL can be improved additional online interactions, which we call online fine-tuning.
Our CCVL method, when extended to learn both lower- and upper-bounds as discussed in Section 4.3, is well-suited for this setting.
This is because our approach can leverage lower-bounds to act pessimistically offline, while using upper-bounds for online exploration.
Note that these experiments include additional training with online RL for all methods.
Like in previous experiments, all methods receive the same exact amount of data, but must now perform online exploration themselves.
We select 5 representative Atari games, similarly considered in Kumar et al.
We first run offline training across all algorithms on the 1% dataset for [Table]
25 M gradient steps,
[Table]
then run 625 k steps of online RL, and report the final performance.
We report the gain in normalized
IQM after online fine-tuning in
Table 2.
Our method, CCVL, achieves the best score acrossof 5 games.
Though CQL often achieves the second best overall score, it often sees the smallest improvement, as conservatism is detrimental to exploration.
C ONCLUSION
In this work, we propose confidence-conditioned value learning (CCVL), a offline RL algorithm that learns a value function for all degrees of conservatism, called confidence-levels.
Contrary to standard offline RL algorithms like CQL that must specify a degree of conservatism during training via hyperparameter tuning, CCVL enables condition-adaptive policies that adjust this degree using online observations.
CCVL can be implemented practically, using slight modifications on top of existing offline RL algorithms.
Theoretically, we show that in a tabular environment, CCVL, for any confidence-level, learns appropriate value that is a lower-bound at that confidence.
Empirically, we demonstrate that in discrete-action environments, CCVL performs better than prior methods.
We view CCVL as a first-step in proposing conservative offline RL algorithms that adjust their level of conservatism, rather than having the level tuned beforehand via an opaque hyperparameter.
Many angles for further investigation exist.
Theoretically, it remains to see whether the confidenceconditioned values are lower-bounds under function approximation.
Algorithmically, an important direction of future work is to extend CCVL to continuous-action environments, which would involve developing an actor-critic algorithm using confidence-conditioned policies.
A P ROOFS
In this section, we provide proofs of theorems stated in Section 6.
Recall from Section 3 that ι = polylog( |S| , (1 − γ ) − 1 , N ) is some constant.
Our proofs rely on the following lemma, which bounds the estimation error due to using the empirical Bellman operator:
Lemma A.1.
For all state-action ( s , a ) ∈ S ×
A such that n ( s , a ) ≥ 1 , function Q , and δ ∈ (0 , 1) , we have:
[Equation]
The above lemma is a well-known result in reinforcement learning (Rashidinejad et al., 2021), whose derivation follows from Hoeffding’s inequalities.
A. P ROOF OF T HEOREM 6.
Without loss of generality, assume that δ 1 , δ 2 ≤ δ are the solution to the outer maximization of
Equation 4 at convergence.
Using Lemma A.1, we have that
[Equation]
holds with probability at least 1 − δ 1 for any α ≥ ι 1 / 2 .
Using Lemma 6.1, we have
[Equation]
( s , a , δ ) ≤ B ∗ (cid:98) Q ( s , a , δ ) =
⇒ (cid:98) Q ≤ ( I − γP ∗ ) − 1 R = ⇒ (cid:98) Q ( s , a ) ≤ Q ∗ ( s , a ) ∀ s ∈ S , a ∈ A , holds with probability at least 1 − δ 1 ≥ 1 − δ , as desired.
A. P ROOF OF T HEOREM 6.
Recall from Equation 5 that at convergence, we have,
[Equation]
For any δ 1 , δ 2 ≤ δ and π , we have that the solution to the inner-minimization over Q yields ˜ Q ( s , a , δ, δ 1 , δ 2 , π ) =
arg min Q α
[Equation]
/δ 1 ) ( n ( s ) ∧ 1)
(cid:0) E s ∼ D, a ∼ π ( a | s )
[ Q ( s , a , δ )] − E s , a ∼ D
[ Q ( s , a , δ )] (cid:1) +
E s , a , s ′ ∼ D (cid:20)(cid:16) Q ( s , a , δ ) − (cid:98) B ∗ (cid:98) Q ( s , a , δ 2 ) (cid:17) 2 (cid:21) ≤ (cid:98) B ∗ (cid:98) Q ( s , a , δ 2 ) − α (cid:115) log(1 /δ 1 ) n ( s ) (cid:20) π ( a | s ) π β ( a | s ) −(cid:21) .
This arises from taking the derivative of the minimization objective, and solving for Q that makes the derivative equal to 0 .
Note that we can simplify
[Equation]
Without loss of generality, assume that δ 1 , δ 2 ≤ δ and π are the solution to the outer-maximization.
Substituting the previous result into the equation for (cid:98) Q ( s , a , δ )
[Equation]
and applying Lemma A.1 yields,
[Equation]
Note that the middle term is not positive if π ( a | s ) <
π β ( a | s ) .
However, we know that for a ∗ = arg max a (cid:98) Q ( s , a , δ ) then π ( a | s ) ≥ π β ( a | s ) by definition of π maximizing the learned
Q-values.
Therefore, we have
[Equation]
holds with probability at least 1 − δ 1 for α satisfying
[Equation]
Then, using Lemma A.1, we have
[Equation]
holds with probability at least 1 − δ 1 ≥ 1 − δ , as desired.
B A TARI R ESULTS
In this section, we provide per-game results across all Atari games that we evaluated on for the three considered dataset sizes.
As mentioned in the main paper, we use the hyperparameter configuration detailed in Kumar et al.
for our Atari experiments.
For completion, we also reproduce the table in this section.
[Table]
[Table] [Table]