MODEL - BASED OFFLINE META - REINFORCEMENT LEARNING WITH REGULARIZATION
A BSTRACT
Existing ofﬂine reinforcement learning (RL) methods face a few major challenges, particularly the distributional shift between the learned policy and the behavior policy.
Ofﬂine Meta-RL is emerging as a promising approach to address these challenges, aiming to learn an informative meta-policy from a collection of tasks.
Nevertheless, as shown in our empirical studies, ofﬂine Meta-RL could be outperformed by ofﬂine single-task RL methods on tasks with good quality of datasets, indicating that a right balance has to be delicately calibrated between “exploring” the out-of-distribution state-actions by following the meta-policy and “exploiting” the ofﬂine dataset by staying close to the behavior policy.
Motivated by such empirical analysis, we propose model-based ofﬂine Meta-RL with regularized Policy
Optimization (MerPO), which learns a meta-model for efﬁcient task structure inference and an informative meta-policy for safe exploration of out-of-distribution state-actions.
In particular, we devise a new meta-Regularized model-based ActorCritic (RAC) method for within-task policy optimization, as a key building block of MerPO, using both conservative policy evaluation and regularized policy improvement; and the intrinsic tradeoff therein is achieved via striking the right balance between two regularizers, one based on the behavior policy and the other on the meta-policy.
We theoretically show that the learnt policy offers guaranteed improvement over both the behavior policy and the meta-policy, thus ensuring the performance improvement on new tasks via ofﬂine Meta-RL.
Experiments corroborate the superior performance of MerPO over existing ofﬂine Meta-RL methods.
I NTRODUCTION
Ofﬂine reinforcement learning (a.k.a., batch RL) has recently attracted extensive attention by learning from ofﬂine datasets previously collected via some behavior policy (Kumar et al., 2020).
However, the performance of existing ofﬂine RL methods could degrade signiﬁcantly due to the following issues: 1) the possibly poor quality of ofﬂine datasets (Levine et al., 2020) and 2) the inability to generalize to different environments (Li et al., 2020b).
To tackle these challenges, ofﬂine Meta -RL (Li et al., 2020a; Dorfman & Tamar, 2020; Mitchell et al., 2020; Li et al., 2020b) has emerged very recently by leveraging the knowledge of similar ofﬂine RL tasks (Yu et al., 2021a).
The main aim of these studies is to enable quick policy adaptation for new ofﬂine tasks, by learning a meta-policy with robust task structure inference that captures the structural properties across training tasks.
Because tasks are trained on ofﬂine datasets, value overestimation (Fujimoto et al., 2019) inevitably occurs in dynamic programming based ofﬂine Meta-RL resulted from the distribution shift between the behavior policy and the learnt task-speciﬁc policy.
To guarantee the learning performance on new ofﬂine tasks, a right balance has to be carefully calibrated between “exploring” the out-of-distribution state-actions by following the meta-policy, and “exploiting” the ofﬂine dataset by staying close to the behavior policy.
However, such a unique “exploration-exploitation” tradeoff has not been considered in existing ofﬂine Meta-RL approaches, which would likely limit their ability to handle diverse ofﬂine datasets particularly towards those with good behavior policies.
To illustrate this issue more concretely, we compare the performance between a state-of-the-art ofﬂine Meta-RL algorithm FOCAL (Li et al., 2020b) and an ofﬂine single-task RL method COMBO (Yu et al., 2021b) in two new ofﬂine tasks.
As illustrated in Figure 1, while FOCAL performs better than COMBO on the task with a bad-quality dataset (left plot in Figure 1), it is outperformed by COMBO on the task with a good-quality dataset (right plot in Figure 1).
Clearly, existing ofﬂine Meta-RL fails in several standard environments (see
Figure 1 and Figure 11) to generalize universally well over datasets with varied quality.
In order to ﬁll such a substantial gap, we seek to answer the following key question in ofﬂine Meta-RL:
How to design an efﬁcient ofﬂine Meta-RL algorithm to strike the right balance between exploring with the meta-policy and exploiting the ofﬂine dataset?
To this end, we propose MerPO, a model-based ofﬂine Me ta-RL approach with r egularized P olicy
O ptimization, which learns a meta-model for efﬁcient task structure inference and an informative meta-policy for safe exploration of out-of-distribution state-actions.
Compared to existing approaches, MerPO achieves: (1) safe policy improvement : performance improvement can be guaranteed for ofﬂine tasks regardless of the quality of the dataset, by strike the right balance between exploring with the meta-policy and exploiting the ofﬂine dataset; and (2) better generalization capability : through a conservative utilization of the learnt model to generate synthetic data, MerPO aligns well with a recently emerging trend in supervised meta-learning to improve the generalization ability by augmenting the tasks with “more data” (Rajendran et al., 2020; Yao et al., 2021).
Our main contributions can be summarized as follows:
(1) Learnt dynamics models not only serve as a natural remedy for task structure inference in ofﬂine Meta-RL, but also facilitate better exploration of out-of-distribution state-actions by generating synthetic rollouts.
With this insight, we develop a model-based approach, where an ofﬂine metamodel is learnt to enable efﬁcient task model learning for each ofﬂine task.
More importantly, we propose a meta-regularized model-based actor-critic method (RAC) for within-task policy optimization, where a novel regularized policy improvement module is devised to calibrate the unique “exploration-exploitation” tradeoff by using an interpolation between two regularizers, one based on the behavior policy and the other on the meta-policy.
Intuitively, RAC generalizes COMBO to the multi-task setting, with introduction of a novel regularized policy improvement module to strike a right balance between the impacts of the meta-policy and the behavior policy.
(2) We theoretically show that under mild conditions, the learnt task-speciﬁc policy based on MerPO offers safe performance improvement over both the behavior policy and the meta-policy with high probability.
Our results also provide a guidance for the algorithm design in terms of how to appropriately select the weights in the interpolation, such that the performance improvement can be guaranteed for new ofﬂine RL tasks.
(3) We conduct extensive experiments to evaluate the performance of MerPO.
More speciﬁcally, the experiments clearly show the safe policy improvement offered in MerPO, corroborating our theoretical results.
Further, the superior performance of MerPO over existing ofﬂine Meta-RL methods suggests that model-based approaches can be more beneﬁcial in ofﬂine Meta-RL.
R ELATED W ORK
Ofﬂine single-task RL.
Many existing model-free ofﬂine RL methods regularize the learnt policy to be close to the behavior policy by, e.g., distributional matching (Fujimoto et al., 2019), support matching (Kumar et al., 2019), importance sampling (Nachum et al., 2019; Liu et al., 2020), learning lower bounds of true Q-values (Kumar et al., 2020).
Along a different avenue, model-based algorithms learn policies by leveraging a dynamics model obtained with the ofﬂine dataset.
(Matsushima et al., 2020) directly constrains the learnt policy to the behavior policy as in model-free algorithms.
To penalize the policy for visiting states where the learnt model is likely to be incorrect, MOPO (Yu et al., 2020) and MoREL (Kidambi et al., 2020) modify the learnt dynamics such that the value estimates are conservative when the model uncertainty is above a threshold.
To remove the need of uncertainty quantiﬁcation, COMBO (Yu et al., 2021b) is proposed by combining model-based policy optimization (Janner et al., 2019) and conservative policy evaluation (Kumar et al., 2020).
Ofﬂine Meta-RL.
A few very recent studies have explored the ofﬂine Meta-RL.
Particularly, (Li et al., 2020a) considers a special scenario where the task identity is spuriously inferred due to biased datasets, and applies the triplet loss to robustify the task inference with reward relabelling.
(Dorfman & Tamar, 2020) extends an online Meta-RL method VariBAD (Zintgraf et al., 2019) to the ofﬂine setup, and assumes known reward functions and shared dynamics across tasks.
Based on MAML (Finn et al., 2017), (Mitchell et al., 2020) proposes an ofﬂine Meta-RL algorithm with advantage weighting loss, and learns initializations for both the value function and the policy, where they consider the ofﬂine dataset in the format of full trajectories in order to evaluate the advantage.
Based on the off-policy Meta-RL method PEARL (Rakelly et al., 2019), (Li et al., 2020b) combines the idea of deterministic context encoder and behavior regularization, under the assumption of deterministic
MDP.
Different from the above works, we study a more general ofﬂine Meta-RL problem.
More importantly, MerPO strikes a right balance between exploring with the meta-policy and exploiting the ofﬂine dataset, which guarantees safe performance improvement for new ofﬂine tasks.
P RELIMINARIES
Consider a Markov decision process (MDP)
M = ( S , A , T, r, µ 0 , γ ) with state space S , action space A , the environment dynamics T ( s (cid:48) | s, a ) , reward function r ( s, a ) , initial state distribution µ 0 , and γ ∈ (0 , 1) is the discount factor.
Without loss of generality, we assume that | r ( s, a ) | ≤
R max .
Given a policy π , let d π M ( s ) :
= (1 − γ ) (cid:80) ∞
t =
γ t P M ( s t = s | π ) denote the discounted marginal state distribution, where P M ( s t = s | π ) denotes the probability of being in state s at time t by rolling out π in M .
Accordingly, let d π M ( s, a ) :
= d π M ( s ) π ( a | s ) denote the discounted marginal state-action distribution, and J ( M , π ) :
= 11 − γ E ( s,a ) ∼ d π M ( s,a )
[ r ( s, a )] denote the expected discounted return.
The goal of RL is to ﬁnd the optimal policy that maximizes J ( M , π ) .
In ofﬂine
RL, no interactions with the environment are allowed, and we only have access to a ﬁxed dataset
D = { ( s, a, r, s (cid:48) ) } collected by some unknown behavior policy π β .
Let d π β M ( s ) be the discounted marginal state distribution of π β .
The dataset D is indeed sampled from d π β M ( s, a ) =
d π β M ( s ) π β ( a | s ) .
Denote M as the empirical MDP induced by D and d ( s, a ) as a sample-based version of d π β M ( s, a ) .
In ofﬂine Meta-RL, consider a distribution of RL tasks p ( M ) as in standard Meta-RL (Finn et al., 2017; Rakelly et al., 2019), where each task M n is an MDP, i.e., M n = ( S , A , T n , r n , µ 0 ,n , γ ) , with task-shared state and action spaces, and unknown task-speciﬁc dynamics and reward function.
For each task M n , no interactions with the environment are allowed and we only have access to an ofﬂine dataset D n , collected by some unknown behavior policy π β,n .
The main objective is to learn a meta-policy based on a set of ofﬂine training tasks {M n } Nn =1 .
Conservative Ofﬂine Model-Based Policy Optimization (COMBO).
Recent model-based ofﬂine
RL algorithms, e.g., COMBO (Yu et al., 2021b), have demonstrated promising performance on a single ofﬂine RL task by combining model-based policy optimization (Janner et al., 2019) and conservative policy evaluation (CQL (Kumar et al., 2020)).
Simply put, COMBO ﬁrst trains a dynamics model (cid:98) T θ ( s (cid:48) | s, a ) parameterized by θ , via supervised learning on the ofﬂine dataset D .
The learnt MDP is constructed as (cid:99) M :
=
( S , A , (cid:98) T, r, µ 0 , γ ) .
Then, the policy is learnt using D and model-generated rollouts.
Speciﬁcally, deﬁne the action-value function (Q-function) as Q π ( s, a ) :=
E [ (cid:80) ∞ t =0 γ t r ( s t , a t ) | s 0 =
s, a 0 = a ] , and the empirical Bellman operator as: (cid:98) B π Q ( s, a ) =
r ( s, a )+ γ E ( s,a,s (cid:48) )
∼D [ Q ( s (cid:48) , a (cid:48) )] , for a (cid:48) ∼ π ( ·| s (cid:48) ) .
To penalize the Q functions in out-of-distribution stateaction tuples, COMBO employs conservative policy evaluation based on CQL:
[Equation]
) where ρ ( s, a ) :
=
d π (cid:99) M ( s ) π ( a | s ) is the discounted marginal distribution when rolling out π in (cid:99) M , and d f ( s, a ) =
fd π β M ( s, a ) + (1 − f ) ρ ( s, a ) for f ∈ [0 , 1] .
The Bellman backup (cid:98) B π over d f can be interpreted as an f -interpolation of the backup operators under the empirical MDP (denoted by
B π M ) and the learnt MDP (denoted by B π (cid:99) M ).
Given the Q-estimation (cid:98) Q π , the policy can be learnt by:
[Table]
M ER PO: M ODEL -B ASED O FFLINE M ETA -RL WITH R EGULARIZED P OLICY O PTIMIZATION
Learnt dynamics models not only serves as a natural remedy for task structure inference in ofﬂine
Meta-RL, but also facilitates better exploration of out-of-distribution state-actions by generating synthetic rollouts (Yu et al., 2021b).
Thus motivated, we propose a general framework of modelbased ofﬂine Meta-RL, as depicted in Figure 2.
More speciﬁcally, the ofﬂine meta-model is ﬁrst learnt by using supervised meta-learning, based on which the task-speciﬁc model can be quickly adapted.
Then, the main attention of this study is devoted to the learning of an informative metapolicy via bi-level optimization, where 1) a model-based policy optimization approach is leveraged in the inner loop for each task to learn a task-speciﬁc policy; and 2) the meta-policy is then updated in the outer loop based on the learnt task-speciﬁc policies.
4. O FFLINE M ETA -M ODEL L EARNING
Learning a meta-model based on the set of ofﬂine dataset {D n } Nn =1 can be carried out via supervised meta-learning.
Many gradient-based meta-learning techniques can be applied here, e.g., MAML (Finn et al., 2017) and Reptile (Nichol et al., 2018).
In what follows, we outline the basic idea to leverage the higher-order information of the meta-objective function.
Speciﬁcally, we consider a proximal meta-learning approach, following the same line as in (Zhou et al., 2019):
[Equation]
(3) where the learnt dynamics for each task M n is parameterized by θ n and the meta-model is parameterized by φ m .
Solving Eq.
(3) leads to an ofﬂine meta-model.
Given the learnt meta-model T φ ∗ m , the dynamics model for an individual ofﬂine task j can be found by solving the following problem via gradient descent with initialization T φ
[Equation]
m using D j , i.e.,
[Equation]
Compared to learning the dynamics model from scratch, adapting from T φ ∗ m can quickly generate a dynamics model for task identity inference by leveraging the knowledge from similar tasks, and hence improve the sample efﬁciency (Finn et al., 2017; Zhou et al., 2019).
4. O FFLINE M ETA -P OLICY L EARNING
In this section, we turn attention to tackle one main challenge in this study: How to learn an informative ofﬂine meta-policy in order to achieve the optimal tradeoff between “exploring” the out-ofdistribution state-actions by following the meta-policy and “exploiting” the ofﬂine dataset by staying close to the behavior policy?
Clearly, it is highly desirable for the meta-policy to safely ‘explore’ out-of-distribution state-action pairs, and for each task to utilize the meta-policy to mitigate the issue of value overestimation.
4.2. H OW D O E XISTING P ROXIMAL M ETA -RL A PPROACHES P ERFORM ?
Proximal Meta-RL approaches have demonstrated remarkable performance in the online setting (e.g., (Wang et al., 2020)), by explicitly regularizing the task-speciﬁc policy close to the meta-policy.
We ﬁrst consider the approach that applies the online Proximal Meta-RL method directly to devise ofﬂine Meta-RL, which would lead to:
[Equation]
where π c is the ofﬂine meta-policy, π n is the task-speciﬁc policy, ρ n is the state marginal of ρ n ( s, a ) for task n and D ( · , · ) is some distance measure between two probability distributions.
To alleviate value overestimation, conservative policy evaluation can be applied to learn ˆ Q πn by using Eq.
Intuitively, Eq.
(5) corresponds to generalizing COMBO to the multi-task setting, where a meta policy π c is learned to regularize the within-task policy optimization.
To get a sense of how the meta-policy learnt using Eq.
(5) performs, we evaluate its performance in an ofﬂine variant of standard Meta-RL benchmark Walker-2D-Params with good-quality datasets, and evaluate the testing performance of the task-speciﬁc policy after ﬁne-tuning based on the learnt meta-policy, with respect to the meta-training steps.
As can be seen in Figure 3, the proximal Meta-RL algorithm
Eq.
(5) performs surprisingly poorly and fails to learn an informative meta-policy, despite conservative policy evaluation being applied in within-task policy optimization to deal with the value overestimation.
In particular, the testing performance degrades along with the metatraining process, implying that the quality of the learnt meta-policy is in fact decreasing.
Why does the proximal Meta-RL method in Eq.
(5) perform poorly in ofﬂine Meta-RL, even with conservative policy evaluation?
To answer this, it is worth to take a closer look at the within-task policy optimization in Eq.
(5), which is given as follows:
[Equation]
Clearly, the performance of Eq.
(6) depends heavily on the quality of the meta-policy π c .
A poor meta-policy may have negative impact on the performance and result in a task-speciﬁc policy π n that is even outperformed by the behaviour policy π β,n .
Without online exploration, the quality of π n could not be improved, which in turn leads to a worse meta-policy π c through Eq.
The iterative meta-training process would eventually result in the performance degradation in Figure 3.
In a nutshell, simply following the meta-policy may lead to worse performance of ofﬂine tasks when π β is a better policy than π c .
Since it is infeasible to guarantee the superiority of the meta-policy a priori , it is necessary to balance the tradeoff between exploring with the meta-policy and exploiting the ofﬂine dataset, in order to guarantee the performance improvement of new ofﬂine tasks.
4.2. S AFE P OLICY I MPROVEMENT WITH M ETA -R EGULARIZATION
To tackle the above challenge, we next devise a novel regularized policy improvement for within- task policy optimization of task n , through a weighted interpolation of two different regularizers based on the behavior policy π β,n and the meta-policy π c , given as follows:
[Equation]
for some α ∈ [0 , 1] .
Here, α controls the trade-off between staying close to the behavior policy and following the meta-policy to “explore” out-of-distribution state-actions.
Intuitively, as α is closer to 0 , the policy improvement is less conservative and tends to improve the task-speciﬁc policy π n towards the actions in π c that have highest estimated Q-values.
Compared to Eq.
(6), the exploration penalty induced by D ( π n , π β,n ) serves as a safeguard and stops π n following π c over-optimistically.
Algorithm
[Table]
Safe Policy Improvement Guarantee.
Based on conservative policy evaluation Eq.
(1) and regularized policy improvement Eq.
(7), we have the meta-regularized model-based actor-critic method (RAC), as outlined in
Algorithm 1.
Note that different distribution distance measures can be used in Eq.
In this work, we theoretically show that the policy π n ( a | s ) learnt by RAC is a safe improvement over both the behavior policy π β,n and the meta-policy π c on the underlying MDP M n , when using the maximum total-variation distance for
D ( π 1 , π 2 ) , i.e., D ( π 1 , π 2 ) :=
max s D TV ( π 1 || π 2 ) .
For convenience, deﬁne ν n ( ρ, f ) =
E ρ
[( ρ ( s, a ) − d n ( s, a )) /d
f,n ( s, a )] , and let δ ∈ (0 , 1 / 2) .
We have the following important result on the safe policy improvement achieved by π n ( a | s ) .
Theorem 1.
(a) Let (cid:15) =
β [ ν n ( ρ πn ,f ) − ν n ( ρ πβ,n ,f )] 2 λ (1 − γ ) D ( π n ,π β,n ) .
If ν n ( ρ π n , f ) − ν n ( ρ π β,n , f ) > 0 and α ∈ (cid:0) max { 12 − (cid:15), 0 } , 12 (cid:1) , then J ( M n , π n ) ≥ max { J ( M n , π c ) + ξ 1 , J ( M n , π β,n ) + ξ 2 } holds with probability at least 1 − 2 δ , where both ξ 1 and ξ 2 are positive for large enough β and λ ;
(b) More generally, we have that J ( M n , π n ) ≥ max { J ( M n , π c ) + ξ 1 , J ( M n , π β,n ) +
ξ 2 } holds with probability at least 1 − 2 δ , when α ∈ (0 , 1 / 2) , where ξ 1 is positive for large enough λ .
Remark 1.
The expressions of ξ 1 and ξ 2 are involved and can be found in Eq.
(14) and Eq.
(15) in the appendix.
In part (a) of Theorem 1, both ξ 1 and ξ 2 are positive for large enough β and λ , pointing to guaranteed improvements over π c and π β,n .
Due to the fact that the dynamics T (cid:100) M n learnt via supervised learning is close to the true dynamics T M n on the states visited by the behavior policy π β,n , d π β,n (cid:100)
M n ( s, a ) is close to d π β,n M n ( s, a ) and ρ π β,n is close to d n ( s, a ) , indicating that the condition ν n ( ρ π n , f ) − ν n ( ρ π β,n , f ) > 0 is expected to hold in practical scenarios (Yu et al., 2021b).
For more general cases, a slightly weaker result can be obtained in part (b) of Theorem 1, where ξ 1 is positive for large enough λ and ξ 2 can be negative.
Remark 2.
Intuitively, the selection of α balances the impact of π β,n and π c , while delicately leaning toward the meta-policy π c because π β,n has played an important role in policy evaluation to ﬁnd a lower bound of Q-value.
As a result, Eq.
(7) maximizes the true Q-value while implic- itly regularized by a weighted combination, instead of α -interpolation, between D ( π n , π β,n ) and
D ( π n , π c ) , where the weights are carefully balanced through α .
In particular, in the tabular setting, the conservative policy evaluation in Eq.
(1) corresponds to penalizing the Q estimation (Yu et al., 2021b): (cid:98)
[Equation]
Clearly, (cid:15) increases with the value of the penalty term in Eq.
As a result, when the policy evaluation Eq.
(1) is overly conservative, the lower bound of α will be close to 0, and hence the regularizer based on the meta-policy π c can play a bigger role so as to encourage the “exploration” of out-of-distribution state-actions following the guidance of π c .
On the other hand, when the policy evaluation Eq.
(1) is less conservative, the lower bound of α will be close to 12 , and the regularizer based on π β,n will have more impact, leaning towards “exploiting” the ofﬂine dataset.
In fact, the introduction of 1) behavior policy-based regularizer and 2) the interpolation for modeling the interaction between the behavior policy and the meta-policy, is the key to prove Theorem 1.
Practical Implementation.
In practice, we can use the KL divergence to replace the total variation distance between policies, based on Pinsker’s Inequality: (cid:107) π 1 − π 2 (cid:107) ≤ (cid:112) 2 D KL ( π 1 || π 2 ) .
Moreover, since the behavior policy π β,n is typically unknown, we can use the reverse KL-divergence between π n and π β,n to circumvent the estimation of π β,n , following the same line as in (Fakoor et al., 2021):
D
[Equation]
Then, the task-speciﬁc policy can be learnt by solving the following problem:
[Equation]
4.2. O FFLINE M ETA -P OLICY U PDATE
Built on RAC, the ofﬂine meta-policy π c is updated by taking the following two steps, in an iterative manner: 1) ( inner loop ) given the meta-policy π c , RAC is run for each training task to obtain the task-speciﬁc policy π n ; 2) ( outer loop ) based on { π n } n , π c is updated by solving:
[Equation]
where both ρ n and ˆ Q πn are from the last iteration of the inner loop for each training task.
By using RAC in the inner loop for within-task policy optimization, the learnt task-speciﬁc policy π n and the meta-policy π c work in concert to regularize the policy search for each other, and improve akin to ‘positive feedback’.
Here the regularizer based on the behavior policy serves an important initial force to boost the policy optimization against the ground: RAC in the inner loop aims to improve the task-speciﬁc policy over the behavior policy at the outset and the improved task-speciﬁc policy consequently regularizes the meta-policy search as in Eq.
(10), leading to a better meta-policy eventually.
Noted that a meta-Q network is learnt using ﬁrst-order meta-learning to initialize taskspeciﬁc Q networks.
It is worth noting that different tasks can have different values of α to capture the heterogeneity of dataset qualities across tasks.
In a nutshell, the proposed model-based ofﬂine Meta-RL with regularized Policy Optimization (MerPO) is built on two key steps: 1) learning the ofﬂine meta-model via Eq.
(3) and 2) learning the ofﬂine meta-policy via Eq.
The details are presented in Algorithm 2 in the appendix.
M ER PO- BASED P OLICY O PTIMIZATION FOR N EW O FFLINE RL T ASK
Let T φ ∗ m and π ∗ c be the ofﬂine meta-model and the ofﬂine meta-policy learnt by MerPO.
For a new ofﬂine RL task, the task model can be quickly adapted based on Eq.
(4), and the task-speciﬁc policy can be obtained based on π ∗ c using the within-task policy optimization module RAC.
Appealing to
Theorem 1, we have the following result on MerPO-based policy learning on a new task.
Proposition 1.
Consider a new ofﬂine RL task with the true MDP M .
Suppose π o is the
MerPO-based task-speciﬁc policy, learnt by running RAC over the meta-policy π ∗ c .
If
[Equation]
≥ 0 and α ∈ (cid:0) max { 12 − (cid:15), 0 } , 12 (cid:1) , then π o achieves the safe performance improvement over both π ∗ c and π β , i.e., J ( M , π o ) > max { J ( M , π ∗ c ) , J ( M , π β ) } holds with probability at least 1 − 2 δ , for large enough β and λ .
Proposition 1 indicates that MerPO-based policy optimization for learning task-speciﬁc policy guarantees a policy with higher rewards than both the behavior policy and the meta-policy.
This is particularly useful in the following two scenarios: 1) the ofﬂine dataset is collected by some poor behavior policy, but the meta-policy is a good policy; and 2) the meta-policy is inferior to a good behavior policy.
E XPERIMENTS
In what follows, we ﬁrst evaluate the performance of RAC for within-task policy optimization on an ofﬂine RL task to validate the safe policy improvement, and then examine how MerPO performs when compared to state-of-art ofﬂine Meta-RL algorithms.
Due to the space limit, we relegate additional experiments to the appendix.
5. P ERFORMANCE E VALUATION OF RAC
Setup.
We evaluate RAC on several continuous control tasks in the D4RL benchmark (Fu et al., 2020) from the Open AI Gym (Brockman et al., 2016), and compare its performance to 1) COMBO (where no meta-policy is leveraged) and 2) COMBO with policy improvement Eq.
(6) (namely,
COMBO-3), under different qualities of ofﬂine datasets and different qualities of meta-policy (good and poor).
For illustrative purpose, we use a random policy as a poor-quality meta-policy, and choose the learnt policy after 200 episodes as a better-quality meta-policy.
We evaluate the average return over 4 random seeds after each episode with 1000 gradient steps.
Results.
As shown in Figure 4, RAC can achieve comparable performance with COMBO-3 given a good-quality meta-policy, and both clearly outperform COMBO.
Besides, the training procedure is also more stable and converges more quickly as expected when regularized with the meta-policy.
When regularized by a poor-quality meta-policy, that is signiﬁcantly worse than the behavior policy in all environments, the performance of COMBO-3 degrades dramatically.
However, RAC outperforms COMBO even when the meta-policy is a random policy.
In a nutshell, RAC consistently achieves the best performance in various setups and demonstrates compelling robustness against the quality of the meta-policy, for suitable parameter selections ( α = 0 .
4 in Figure 4).
Impact of α .
As shown in Theorem 1, the selection of α is important to guarantee the safe policy improvement property of RAC.
Therefore, we next examine the impact of α on the performance of RAC under different qualities of datasets and meta-policy.
More speciﬁcally, we consider four choices of α : α = 0 , 0 . 4 , 0 .
Here, α = 0 corresponds to COMBO-3, i.e., regularized by the meta-policy only, and the policy improvement step is regularized by the behavior policy only when α = 1 .
Figure 5 shows the average return of RAC over different qualities of meta-policies under different qualities of the ofﬂine datasets.
It is clear that RAC achieves the best performance when α = 0 .
4 among the four selections of α , corroborating the result in Theorem 1.
In general, the performance of RAC is stable for α ∈ [0 . 3 , 0 .
5] in our experiments.
5. P ERFORMANCE E VALUATION OF M ER PO
Setup.
To evaluate the performance of MerPO, we follow the setups in the literature (Rakelly et al., 2019; Li et al., 2020b) and consider continuous control meta-environments of robotic locomotion.
More speciﬁcally, tasks has different transition dynamics in Walker-2D-Params and Point-RobotWind, and different reward functions in Half-Cheetah-Fwd-Back and Ant-Fwd-Back.
We collect the ofﬂine dataset for each task by following the same line as in (Li et al., 2020b).
We consider the following baselines: (1) FOCAL (Li et al., 2020b), a model-free ofﬂine Meta-RL approach based on a deterministic context encoder that achieves the state-of-the-art performance; (2) MBML (Li et al., 2020a), an ofﬂine multi-task RL approach with metric learning; (3) Batch PEARL, which modiﬁes PEARL (Rakelly et al., 2019) to train and test from ofﬂine datasets without exploration; (4) Contextual BCQ (CBCQ), which is a task-augmented variant of the ofﬂine RL algorithm BCQ (Fujimoto et al., 2019) by integrating a task latent variable into the state information.
We train on a set of ofﬂine RL tasks, and evaluate the performance of the learnt meta-policy during the training process on a set of unseen testing ofﬂine RL tasks.
Fixed α vs Adaptive α .
We consider two implementations of MerPO based on the selection of α .
1) MerPO: α is ﬁxed as 0.4 for all tasks; 2) MerPO-Adp: at each iteration k , given the task-policy π kn for task n and the meta-policy π kc at iteration k , we update α kn using one-step gradient descent to minimize the following problem.
[Equation]
The idea is to adapt α kn in order to balance between D ( π kn , π β,n ) and D ( π kn , π kc ) , because Theorem 1 implies that the safe policy improvement can be achieved when the impacts of the meta-policy and the behavior policy are well balanced.
Speciﬁcally, at iteration k for each task n , α kn is increased when the task-policy π kn is closer to the meta-policy π kc , and is decreased when π kn is closer to the behavior policy.
Note that α kn is constrained in the range [0 . 1 , 0 . 5] as suggested by Theorem 1.
Results.
As illustrated in Figure 6, MerPO-Adp yields the best performance, and both MerPOAdp and MerPO achieve better or comparable performance in contrast to existing ofﬂine Meta-RL approaches.
Since the meta-policy changes during the learning process and the qualities of the behavior policies vary across different tasks, MerPO-Adp adapts α across different iterations and tasks so as to achieve a ‘local’ balance between the impacts of the meta-policy and the behavior policy.
As expected, MerPO-Adp can perform better than MerPO with a ﬁxed α .
Here the best testing performance for the baseline algorithms is selected over different qualities of ofﬂine datasets.
Ablation Study.
We next provide ablation studies by answering the following questions.
(1) Is RAC important for within-task policy optimization?
To answer this question, we compare
MerPO with the approach Eq.
(5) where the within-task policy optimization is only regularized by
[Figure]
the meta-policy.
As shown in Figure 7(a), with the regularization based on the behavior policy in
RAC, MerPO performs signiﬁcantly better than Eq.
(5), implying that the safe policy improvement property of RAC enables MerPO to continuously improve the meta-policy.
(2) Is learning the dynamics model important?
Without the utilization of models, the within-task policy optimization degenerates to CQL (Kumar et al., 2020) and the Meta-RL algorithm becomes a model-free approach.
Figure 7(b) shows the performance comparison between the cases whether the dynamics model is utilized.
It can be seen that the performance without model utilization is much worse than that of MerPO.
This indeed makes sense because the task identity inference (Dorfman & Tamar, 2020; Li et al., 2020a;b) is a critical problem in Meta-RL.
Such a result also aligns well with a recently emerging trend in supervised meta-learning to improve the generalization ability by augmenting the tasks with “more data” (Rajendran et al., 2020; Yao et al., 2021).
(3) How does MerPO perform in unseen ofﬂine tasks under different data qualities?
We evaluate the average return in unseen ofﬂine tasks with different data qualities, and compare the performance between (1) MerPO with α = 0 .
4 (“With meta”) and (2) Run a variant of COMBO with behavior-regularized policy improvement, i.e., α = 1 (“With beha only”).
For a fair comparison, we initialize the policy network with the meta-policy in both cases.
As shown in Figure 7(c), the average performance of “With meta” over different data qualities is much better than that of “With beha only”.
More importantly, for a new task with expert data, MerPO (“With meta”) clearly outperforms
COMBO as illustrated in Figure 7(d), whereas the performance of FOCAL is worse than COMBO.
C ONCLUSION
In this work, we study ofﬂine Meta-RL aiming to strike a right balance between “exploring” the out-of-distribution state-actions by following the meta-policy and “exploiting” the ofﬂine dataset by staying close to the behavior policy.
To this end, we propose a model-based ofﬂine Meta-RL approach, namely MerPO, which learns a meta-model to enable efﬁcient task model learning and a meta-policy to facilitate safe exploration of out-of-distribution state-actions.
Particularly, we devise
RAC, a meta-regularized model-based actor-critic method for within-task policy optimization, by using a weighted interpolation between two regularizers, one based on the behavior policy and the other on the meta-policy.
We theoretically show that the learnt task-policy via MerPO offers safe policy improvement over both the behavior policy and the meta-policy.
Compared to existing ofﬂine Meta-RL methods, MerPO demonstrates superior performance on several benchmarks, which suggests a more prominent role of model-based approaches in ofﬂine Meta-RL. A CKNOWLEDGEMENT
This work is supported in part by NSF Grants CNS-2003081, CNS-2203239, CPS- and
CCSS-2121222.
R EPRODUCIBILITY S TATEMENT
For the theoretical results presented in the main text, we state the full set of assumptions of all theoretical results in Appendix B and include the complete proofs of all theoretical results in Appendix C. For the experimental results presented in the main text, we include the code in the supplemental material, and specify all the training details in Appendix A. For the datasets used in the main text, we also give a clear explanation in Appendix A
A E XPERIMENTAL D ETAILS A. M ETA E NVIRONMENT D ESCRIPTION
• Walker-2D-Params: Train an agent to move forward.
Different tasks correspond to different randomized dynamcis parameters.
• Half-Cheeta-Fwd-Back: Train a Cheetah robot to move forward or backward, and the reward function depends on the moving direction.
All tasks have the same dynamics model but different reward functions.
• Ant-Fwd-Back: Train an Ant robot to move forward or backward, and the reward function depends on the moving direction.
All tasks have the same dynamics model but different reward functions.
• Poing-Robot-Wind: Point-Robot-Wind is a variant of Sparse-Point-Robot (Li et al., 2020b), a 2D navigation problem introduced in (Rakelly et al., 2019), where each task is to guide a point robot to navigate to a speciﬁc goal location on the edge of a semi-circle from the origin.
In Point-Robot-Wind, each task is affected by a distinct “wind” uniformly sampled from [ − 0 .
] 2 , and hence differs in the transition dynamics.
A. I MPLEMENTATION D ETAILS AND M ORE E XPERIMENTS A.2. E VALUATION OF RAC
Model learning.
Following the same line as in (Janner et al., 2019; Yu et al., 2020; 2021b), the dynamics model for each task is represented as a probabilistic neural network that takes the current state-action as input and outputs a Gaussian distribution over the next state and reward:
[Equation]
An ensemble of 7 models is trained independently using maximum likelihood estimation, and the best 5 models are picked based on the validation prediction error using a held-our set of the ofﬂine dataset.
Each model is represented by a 4-layer feedforward neural network with 256 hidden units.
And one model will be randomly selected from the best 5 models for model rollout.
Policy optimization.
We represent both Q-network and policy network as a 4-layer feedforward neural network with 256 hidden units, and use clipped double Q-learning (Fujimoto et al., 2018) for
Q backup update.
A max entropy term is also included to the value function for computing the target
Q value as in SAC (Haarnoja et al., 2018).
The hyperparameters used for evaluating the performance of RAC are described in Table 1.
Additional experiments.
We also evaluate the performance of RAC in Walker2d under different qualities of the meta-policy.
As shown in Figure 8(a) and 8(b), RAC achieves the best performance in both scenarios, compared to COMBO and COMBO-3.
Particularly, the performance of COMBO3 in Figure 8(a) degrades in the later stage of training because the meta-policy is not superior over the behavior policy in this case.
In stark contrast, the performance of RAC is consistently better, as it provides a safe policy improvement guarantee over both the behavior policy and the meta-policy.
[Figure]
Beside, we also compare the performance of these three algorithms under an expert behavior policy in Figure 8(c), where a meta-policy usually interferes the policy optimization and drags the learnt policy away from the expert policy.
As expected, RAC can still achieve comparable performance with COMBO, as a result of safe policy improvement over the behavior policy for suitable parameter selections.
We examine the impact of α on the performance of RAC under different qualities of the meta-policy for HalfCheetah with expert data.
In this case, the meta-policy is a worse policy compared to the behavior policy.
As shown in Figure 8(d), the performance α = 0 .
4 is comparable to the case of α = 1 where the policy improvement step is only regularized based on the behavior policy, and clearly better than the other two cases.
A.2. E VALUATION OF M ER PO
Data collection.
We collect the ofﬂine dataset for each task by training a stochastic policy network using SAC (Haarnoja et al., 2018) for that task and rolling out the policies saved at each checkpoint to collect trajectories.
Different checkpoints correspond to different qualities of the ofﬂine datasets.
When training with MerPO, we break the trajectories into independent tuples { s i , a i , r i , s (cid:48) i } and store in a replay buffer.
Therefore, the ofﬂine dataset for each task does not contain full trajectories over entire episodes, but merely individual transitions collected by some behavior policy.
Setup.
For each testing task, we obtain the task-speciﬁc policy through quick adaptation using the within-task policy optimization method RAC, based on its own ofﬂine dataset and the learnt metapolicy, and evaluate the average return of the adapted policy over 4 random seeds.
As shown earlier, we take α = 0 .
4 for all experiments about MerPO.
In MerPO-Adp, we initialize α with 0.4 and update with a learning rate of 1 e − 4 .
Meta-model learning.
Similar as in section A.2.1, for each task we quickly adapt from the metamodel to obtain an ensemble of 7 models and pick the best 5 models based on the validation error.
The neural network used for representing the dynamics model is same with that in section A.2.1.
Meta-policy learning.
As in RAC, we represent the task Q-network, the task policy network and the meta-policy network as a 5-layer feedforward neural network with 300 hidden units, and use clipped double Q-learning (Fujimoto et al., 2018) for within task Q backup update.
For each task, we also use dual gradient descent to automatically tune both the parameter β for conservative policy evaluation and the parameter λ for regularized policy improvement:
• Tune β .
Before optimizing the Q-network in policy evaluation, we ﬁrst optimize β by solving the following problem:
[Equation]
Intuitively, the value of β will be increased to penalty the Q-values for out-of-distribution state-actions if the difference E s,a ∼ ρ [ Q ( s, a )] − E s,a ∼D [ Q ( s, a )] is larger than some threshold value τ .
[Figure]
• Tune λ .
Similarly, we can
optimize λ in policy improvement by solving the following problem:
[Equation]
Intuitively, the value of λ will be increased so as to have stronger regularizations if the divergence is larger than some threshold D target , and decreased if the divergence is smaller than D target .
Besides, we also build a meta-Q network Q meta over the training process as an initialization of the task Q networks to facilitate the within task policy optimization.
At the k -th meta-iteration for meta-policy update, the meta-Q network is also updated using the average Q-values of current batch
B of training tasks with meta-q learning rate ξ q , i.e.,
[Equation]
Therefore, we initialize the task Q networks and the task policy with the meta-Q network and the meta-policy, respectively, for within task policy optimization during both meta-training and metatesting.
The hyperparameters used in evaluation of MerPO are listed in Table 2.
For evaluating the performance improvement in a single new ofﬂine task, we use a smaller learning rate of 8 e − 5 for the Q network and the policy network update.
A.2. M ORE EXPERIMENTS .
We also evaluate the impact of the utilization extent of the learnt model, by comparing the performance of MerPO under different cases of real data ratio, i.e., the ratio of the data from the ofﬂine dataset in the data batch for training.
As shown in Figure 9(a), the performance of MerPO can be further boosted with a more conservative utilization of the model.
To understand how much beneﬁt MerPO can bring for policy learning in unseen ofﬂine RL tasks, we compare the performance of the following cases with respect to the gradient steps taken for learning in unseen ofﬂine RL tasks: (1) Initialize the task policy network with the meta-policy and run RAC (“With meta”); (2) Run RAC using the meta-policy without network initialization (“With meta (no init)”); (3) Run RAC with a single regularization based on behavior policy without network initialization, i.e., α = 1 (“With beha only”); (4) Run COMBO (“No regul.”).
As shown in Figure 9(b), “With meta” achieves the best performance and improves signiﬁcantly over “No regul.”
and “With beha only”, i.e., learning alone without any guidance of meta-policy, which implies that
the
[Figure] [Figure]
learnt meta-policy can efﬁciently guide the exploration of out-of-distribution state-actions.
Without network initialization, “With meta (no init)” and “With beha only” achieve similar performance because good ofﬂine dataset is considered here.
Such a result is also consistent with Figure 8(d).
We evaluate the testing performance of MerPO, by changing sample size of all tasks.
Figure 10(a) shows that the performance of MerPO is stable even if we decrease the number of trajectories for each task to be around 200.
In contrast, the number of trajectories collected in other baselines is of the order 10 3 .
Figure 10(b) illustrates the testing sample efﬁciency of MerPO, by evaluating the performance at new ofﬂine tasks under different sample sizes.
Clearly, a good task-speciﬁc policy can be quickly adapted at a new task even with 5 trajectories (1000 samples) of ofﬂine data.
We also evaluate the training sample efﬁciency of MerPO in Point-Robot-Wind.
As shown in Figure 9(c) the performance of MerPO is stable even if we decrease the number of trajectories for each task to be around 200.
A.2. M ORE COMPARISON BETWEEN FOCAL AND COMBO
Following the setup as in Figure 1, we compare the performance between FOCAL and COMBO in two more environments: Half-Cheetah-Fwd-Back and Ant-Fwd-Back.
As shown in Figure 11, although FOCAL performs better than COMBO on the task with a bad-quality dataset, it is outperformed by COMBO on the task with a good-quality dataset.
This further conﬁrms the observation made in Figure 1.
A. A LGORITHMS
We include the details of MerPO in Algorithm 2.
[Figure]
Solve the following problem with gradient descent for h steps to compute the dynamics model (cid:98) T θ kn based on the ofﬂine dataset D i :
[Equation]
for 6:
Update
[Equation]
do 10: do 11: do 12:
Perform model rollouts with T n states in D n and model rollouts to
Policy evaluation by recursively solving Eq
(1) using data from D n ∪ D nmodel ; 14:
Given the meta-policy π kc , improve policy π kn by solving Eq.
(7); 15: end for 16: end for 17:
Given the learnt policy π kn for each task, update the meta-policy π k +1 c by solving Eq.
(10) with one step gradient descent; 18: end for
B P RELIMINARIES
For ease of exposition, let T M and r M denote the dynamics and reward function of the underlying
MDP M , T M and r M denote the dynamics and reward function of the empirical MDP M induced by the dataset D , and T (cid:99) M and r (cid:99)
M denote the dynamics and reward function of the learnt MDP (cid:99) M .
To prevent any trivial bound with ∞ values, we assume that the cardinality of a state-action pair in the dataset D , i.e., |D ( s, a ) | , in the denominator, is non-zero, by setting |D ( s, a ) | to be a small value less than 1 when ( s, a ) / ∈ D .
Following the same line as in (Kumar et al., 2020; Yu et al., 2021b), we make the following standard assumption on the concentration properties of the reward and dynamics for the empirical MDP M to characterize the sampling error.
Assumption 1.
For any ( s, a ) ∈ M , the following inequalities hold with probability 1 − δ :
[Equation]
where C T,δ and C r,δ are some constants depending on δ via a (cid:112) log(1 /δ ) dependency.
Based on Assumption
[Equation]
we can bound the estimation error induced by the empirical Bellman backup operator for any ( s, a ) ∈ M :
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
[Table]
[Equation]
Similarly, we can bound the difference between the Bellman backup induced by the learnt MDP (cid:99) M and the underlying Bellman backup:
[Equation]
where D tv ( T (cid:99) M , T M ) is the total-variation distance between T (cid:99) M and T M .
For any two MDPs, M 1 and M 2 , with the same state space, action space and discount factor γ , and a given fraction f ∈ (0 , 1) , deﬁne the f -interpolant MDP M f as the MDP with dynamics:
T M f = fT M 1 + (1 − f ) T M 2 and reward function: r M f = fr M
+ (1 − f ) r M 2 , which has the same state space, action space and discount factor with M 1 and M 2 .
Let T π be the transition matrix on state-action pairs induced by a stationary policy π , i.e., T
[Equation]
| s [Equation]
To prove the main result, we ﬁrst restate the following lemma from (Yu et al., 2021b) to be used later.
Lemma 1.
For any policy π , its returns in any MDP M , denoted by J ( M , π ) , and in M f , denoted by J ( M 1 , M 2 , f, π ) , satisfy the following:
[Equation]
where
[Equation]
Lemma 1 characterizes the relationship between policy returns in different MDPs in terms of the corresponding reward difference and dynamics difference.
C P ROOF OF T HEOREM
Let d ( s, a ) :
= d π β M ( s, a ) .
In the setting without function approximation, by setting the derivation of
Equation Eq.
(1) to 0, we have that
[Equation]
Denote ν ( ρ, f ) =
E ρ (cid:104)
[Equation]
( s,a )
[Equation]
d ( s,a )
[Equation]
( s,
[Equation]
) (cid:105) as the expected penalty on the Q-value.
It can be shown (Yu et al., 2021b) that ν ( ρ, f ) ≥ 0 and increases with f , for any ρ and f ∈ (0 , 1) .
Then, RAC optimizes the return of a policy in a f -interpolant MDP induced by the empirical MDP M and the learnt MDP (cid:99) M , which is regularized by both the behavior policy π β and the meta-policy π c :
[Equation]
Denote π o as the solution to the above optimization problem.
Based on Lemma 1, we can ﬁrst characterize the return of the learnt policy π o in the underlying MDP M in terms of its return in the f -interpolant MDP:
[Equation]
13) where
[Equation]
Note that the inequality above holds because the following is true for the empirical MDP M (Kumar et al., 2020):
[Equation]
for D CQL ( π 1 , π 2 )( s ) :=
[Equation]
a π
[Equation]
|
[Equation]
[Equation]
C. S AFE IMPROVEMENT OVER π c
We ﬁrst show that the learnt policy offers safe improvement over the meta-policy π c .
Following the same line as in Eq.
[Equation]
we next bound the return of the meta-policy π c in the underlying MDP M from above, in terms of its return in the f -interpolant MDP:
[Equation]
where
[Equation]
(cid:44) η c 2 .
It follows that
[Equation]
where the second inequality is true because π o is the solution to Eq.
This gives us a lower bound on J ( M , π o ) in terms of J ( M , π c ) :
[Equation]
It is clear that η c 1 and η c 2 are independent to β and λ .
To show the performance improvement of π o over the meta-policy π c , it sufﬁces to guarantee that for appropriate choices of β and λ ,
[Equation]
To this end, the following lemma ﬁrst provides an upper bound on | ν ( ρ π o , f ) − ν ( ρ π c , f ) | :
Lemma 2.
There exist some positive constants L 1 and L 2 such that
[Equation]
Proof.
First, we have that
[Equation]
(cid:21)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)
[Equation]
(cid:21)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)(cid:12)
[Equation]
First, observe that for the term (cid:12)(cid:12)(cid:12)
[Equation]
• If ρ π o ( s, a ) ≥ d ( s, a ) , then
[Equation]
• If ρ π o ( s, a ) <
d ( s, a ) , then
[Equation]
[Equation]
[Table]
[Equation]
[Equation]
Therefore,
[Equation]
Next, for the term (cid:12)(cid:12)(cid:12)
[Equation]
, consider the function g ( x ) = x − d fd +(1 − f ) x for x ∈ [0 , 1] .
Clearly, when d ( s, a ) = 0 ,
[Equation]
For any ( s, a ) that d ( s, a ) > 0 , it can be shown that g ( x ) is continuous and has bounded gradient, i.e., |∇ g ( x ) | ≤ 1 f 2 d (cid:44) L 2 .
Hence
[Equation]
it follows that
[Equation]
Therefore
[Equation]
we can conclude that
[Equation]
Recall that
[Equation]
which denote the marginal state-action distributions by rolling out π o and π c in the learnt model (cid:99) M , respectively
Lemma 2 gives an upper bound on the difference between the expected penalties induced under π o and π c , with regard to the difference between the marginal state-action distributions.
Next
[Equation]
we need to characterize the relationship between the marginal state-action distribution difference and the corresponding policy distance, which is captured in the following lemma.
Lemma 3.
Let D ( π
||
π 2 )
= max s D tv ( π 1 || π 2 ) denote the maximum total-variation distance between two policies π 1 and π 2 .
Then, we can have that
[Equation]
Proof.
Note that
[Equation]
It then sufﬁces to bound the state-action marginal difference at time t .
Since both state-action marginals here correspond to rolling out π o and π c in the same MDP (cid:99) M , based on Lemma B. and B
[Equation]
2 in (Janner et al., 2019)
[Equation]
we can obtain that
[Equation]
which indicates that
[Equation]
Building on Lemma 2 and Lemma 3, we can show that
[Equation]
Let D ( · , · ) = max s D tv ( ·||· ) .
It is clear that for λ ≥ λ 0 where λ 0 >
Cβ (1 − γ )(1 − 2 α ) and α < 12 ,
[Equation]
In a nutshell, we can conclude that with probability 1 − δ
J ( M , π o ) ≥ J ( M , π c ) − η c 1 − η c(cid:124) (cid:123)(cid:122) (cid:125) ( a ) +( λ
[Equation]
where (a) depends on δ but is independent to λ , (b) is positive and increases with λ , and (c) is positive.
This implies that an appropriate choice of λ will make term (b) large enough to counteract term (a) and lead to the performance improvement over the meta-policy π c :
[Equation]
where ξ 1 ≥ 0 .
C. S AFE IMPROVEMENT OVER π β
Next, we show that the learnt policy π o achieves safe improvement over the behavior policy π β .
Based on Lemma 1, we have
[Equation]
where
[Equation]
Therefore, it follows that
[Equation]
which indicates that with probability 1 − δ
[Equation]
where η β 3 is some constant that depends on δ but is independent to β and λ .
To conclude
[Equation]
we can have that with probability 1 − 2 δ
[Equation]
where
[Equation]
and
[Equation]
Moreover, as we noted earlier, ξ 1 > 0 for a suitably selected λ and α < 12 .
For the term ν ( ρ π o , f ) − ν ( ρ π β , f ) in ξ 2 where ν ( ρ π , f ) is deﬁned as E ρ π (cid:104) ρ π ( s,a ) − d ( s,a ) d f ( s,a ) (cid:105) , as noted in (Yu et al., 2021b), ν ( ρ π β , f ) is expected to be smaller than ν ( ρ π o , f ) in practical scenarios, due to the fact that the dynamics T (cid:99) M learnt via supervised learning is close to the underlying dynamics T M on the states visited by the behavior policy π β .
This directly indicates that d π β (cid:99) M ( s, a ) is close to d π β M ( s, a ) and ρ π β is close to d ( s, a ) .
In this case, let
[Equation]
We can show that for α > 12 − (cid:15) , ∆
[Equation]
=
[Equation]
[Equation]
[Equation]
+
[Equation] [Equation] [Equation] [Equation]
= λαD ( π o , π β ) + λ (1 − α ) D ( π o , π c ) − λ (1 − [Equation] ) D ( [Equation]
π
[Equation]
) + 2 (cid:15)λD ( π
[Equation]
β ) = λ [(2 (cid:15) + α ) D ( π o , π β ) + (1 − α ) D ( π o , π c ) − (1 − α ) D ( π c , π β )] >λ (
[Equation]
> 0 , and ∆ β increases with λ , which implies that
[Equation]
for an appropriate choice of λ .