Regret Guarantees for Model-Based Reinforcement Learning with Long-Term Average Constraints
Abstract
We consider the problem of constrained Markov
Decision Process (CMDP) where an agent interacts with an ergodic Markov Decision Process.
At every interaction, the agent obtains a reward and incurs
K costs.
The agent aims to maximize the longterm average reward while simultaneously keeping the K long-term average costs lower than a certain threshold.
In this paper, we propose CMDPPSRL, a posterior sampling based algorithm using which the agent can learn optimal policies to interact with the CMDP.
We show that with the assumption of slackness, characterized by κ , the optimization problem is feasible for the sampled MDPs.
Further, for MDP with S states, A actions, and mixing time T M , we prove that following CMDPPSRL algorithm, the agent can bound the regret of not accumulating rewards from an optimal policy by ˜ O
( T M S √ AT ) .
Further, we show that the violations for any of the K constraints is also bounded by ˜ O
( T M S √ AT ) .
To the best of our knowledge, this is the ﬁrst work that obtains a ˜ O ( √ T ) regret bounds for ergodic MDPs with long-term average constraints using a posterior sampling method.
INTRODUCTION
Consider a wireless sensor network where the devices aim to update a server with sensor values.
At time t , the device can choose to send a packet to obtain a reward of 1 unit or to queue the packet and obtain 0 reward.
However, communicating a packet results in p t power consumption.
At time t , if the wireless channel condition, s t , is weak and the device chooses to send a packet, the resulting instantaneous power consumption, p t , is high.
The goal is to send as many packets as possible while keep the average power consumption, (cid:80)
Tt =1 p t /T , within some limit, say C .
This environment has state ( s t , q t ) as the channel condition and queue length at time t .
To limit the power consumption, the agent may choose to send packets when the channel condition is good or when the queue length grows beyond a certain threshold.
The agent aims to learn the policies in an online manner which requires efﬁciently balancing exploration of statespace and exploitation of the estimated system dynamics [Singh et al., 2020].
Similar to the example above, many applications require to keep some costs low while simultaneously maximizing the rewards [Altman, 1999].
Owing to the importance of this problem, in this paper, we consider the problem of constrained Markov Decision Processes (CMDP).
We aim to develop a reinforcement learning algorithm following which an agent can bound the constraint violations and the regret in obtaining the optimal reward to o ( T ) .
The problem setup, where the system dynamics are known, is extensively studied [Altman, 1999].
For a constrained setup, the optimal policy is possibly stochastic
[Altman, 1999, Puterman, 2014].
In the domain where the agent learns the system dynamics and aims to learn good policies online, there has been work where to show asymptotic convergence to optimal policies [Gattami et al., 2021], or even provide regret guarantees when the MDP is episodic [Zheng and
Ratliff, 2020, Ding et al., 2021].
Recently, [Singh et al., 2020] considered the problem of online optimization of inﬁnite-horizon communicating Markov Decision Processes with long-term average constraints.
They provide an optimism based algorithm where conﬁdence bounds on each transition probabilities p ( s (cid:48) | s, a ) is constructed.
Using this, they obtain a regret bound of ˜ O (cid:16) √ SAT + T M T 2 / 3 (cid:17) 1 .
Additionally, ﬁnding the optimistic policy is a computationally intensive task as the number of optimization variables become S 2 × A for MDP with S states and A actions.
In this paper, we consider the reinforcement learning an inﬁnite-horizon ergodic MDP [Tarbouriech and Lazaric,
2019, Gattami et al., 2021] with long-term average constraints.
We use (cid:96) 1 deviation bounds [Jaksch et al., 2010] and use a Bellman error analysis to bound the reward regret of the MDP as ˜ O
( T M S √ AT ) .
Additionally, we also bound the constraint violations as ˜ O
( T M S √ AT ) .
We propose a posterior sampling based algorithm where we sample the transition dynamics using a Dirichlet distribution [Osband et al., 2013], which achieves this regret bound.
Unlike optimistic algorithms, the sampled MDP may not be infeasible for the constrained optimization.
Hence, we consider slackness characterized by Slater’s parameter Ding et al.
[2020], which allows us to prove that the optimization problem is feasible even with the sampled MDPs.
Posterior sampling also helps to reduces the optimization variables, to ﬁnd only the optimal policy for the sampled MDP, to only
S × A variables.
Finally, we provide numerical examples where the algorithm converges to the calculated optimal policies.
To the best of our knowledge, this is the ﬁrst work to obtain O ( √ T ) regret guarantees for the inﬁnite horizon long-term average constraint setup with posterior sampling.
RELATED WORK
Stochastic Optimization using Markov Decision Processes has very rich roots
[Howard, 1960].
There have been work in understanding convergence of the algorithm to ﬁnd optimal policies for known MDPs [Bertsekas and Tsitsiklis, 1996,
Altman, 1999].
Also, when the MDP is not known, there are algorithms with asymptotic guarantees for learning the optimal policies [Watkins and Dayan, 1992] which maximize an objective without any constraints.
Recent algorithms even achieve ﬁnite time near-optimal regret bounds with respect to the number of interactions with the environment [Jaksch et al., 2010, Osband et al., 2013, Agrawal and Jia, 2017, Jin et al., 2018].
Jaksch et al.
[2010] uses the optimism principle for minimizing regret for weakly communicating inﬁnite horizon MDPs with bounded diameter.
Osband et al.
[2013] extended the analysis of Jaksch et al.
[2010] to posterior sampling for episodic MDPs and bounded the Bayesian regret and further improved the regret bounds Osband and
Van Roy [2017].
Agrawal and Jia [2017] uses a posterior sampling based approach and obtains a frequentist regret for the inﬁnite horizon MDPs with bounded diameter.
In many reinforcement learning settings, the agent not only wants to maximize the rewards but also satisfy certain cost constraints
[Altman, 1999].
Early works in this area were pioneered by [Altman and Schwartz, 1991].
They provided an algorithm which combined forced explorations and following policies optimized on empirical estimates to obtain an asymptotic convergence.
[Borkar, 2005] studied the constrained RL problem using actor-critic and a two time-scale framework [Borkar, 1997] to obtain asymptotic performance guarantees.
Very recently, [Gattami et al., 2021] analyzed the asymptotic performance for Lagrangian based algorithms for inﬁnite-horizon long-term average constraints.
Inspired by the ﬁnite-time performance analysis of reinforcement learning algorithm for unconstrained problems, there has been a signiﬁcant thrust in understanding the ﬁnitetime performances of constrained MDP algorithms.
[Zheng and Ratliff, 2020] considered an episodic CMDP and use an optimism based algorithm to bound the constraint violation as ˜ O ( √ T 1 . 5 ) with high probability.
[Kalagarla et al., 2020] also considered the episodic setup to obtain PAC-style bound for an optimism based algorithm.
[Ding et al., 2021] considered the setup of H -episode length episodic CMDPs with d -dimensional linear function approximation to bound the constraint violations as ˜ O
( d √ H 5 T ) by mixing the optimal policy with an exploration policy.
[Efroni et al., 2020] proposes a linear-programming and primal-dual policy optimization algorithm to bound the regret as O ( S √ H 3 T ) .
[Qiu et al., 2020] proposed an algorithm which obtains a regret bound of ˜ O
( S √ AH 2 T ) for the problem of adversarial stochastic shortest path.
Compared to these works, we focus on setting with inﬁnite horizon long-term average constraints.
After developing a better understanding of the policy gradient algorithms [Agarwal et al., 2020], there has been theoretical work in the area of model-free policy gradient algorithms for constrained MDP and safe reinforcement learning as well.
[Xu et al., 2020] consider an inﬁnite horizon discounted setup with constraints and obtain global convergence using policy gradient algorithms.
[Ding et al., 2020] also considers an inﬁnite horizon discounted setup.
They use a natural policy gradient to update the primal variable and sub-gradient descent to update the dual variable.
Recently [Singh et al., 2020] considered the setup of inﬁnitehorizon CMDPs with long-term average constraints and obtain a regret bound of ˜ O
( T 2 / 3 ) using an optimism based algorithm and forced explorations.
We consider a similar setting with ergodic CMDP and propose a posterior sampling based algorithm to bound the regret as ˜ O
( poly ( DSA ) √ T ) using explorations assisted by the ergodicity of the MDP.
PROBLEM FORMULATION
We consider an inﬁnite horizon discounted Markov decision process (MDP) M , deﬁned by the tuple (cid:0)
S , A , P, r, c 1 , · · · , c k (cid:1) .
S denotes a ﬁnite set of state space with |S| = S , and A denotes a ﬁnite set of actions with |A| =
A .
P : S ×
A → ∆( S ) denotes the probability
P ( s (cid:48) | s, a ) of transitioning to state s (cid:48) from state s after taking action a .
r : S × A → [0 , 1] denotes the average reward in state s after taking action a .
c k : S ×
A → [0 , 1] denotes average cost incurred by the agent for constraint k ∈
[ K ] = { 1 , 2 , · · · , K } after taking action a in state s .
We use a stochastic policy π : S → ∆( A ) , such that given state s , π ( a | s ) is the probability of selecting action a .
Note that the a policy π induces a Markov chain over the state space of the MDP.
Pertaining to the Markov chains generated by the policies for M , we now deﬁne the mixing time of MDP.
Deﬁnition 1 (Mixing Time) .
Consider the Markov Chain induced by the policy π on the MDP M .
Let T πs → s (cid:48) be a random variable that denotes the ﬁrst time step when this
Markov Chain enters state s (cid:48) starting from state s .
Then, the mixing time of the MDP M is deﬁned as:
[Equation]
Similar to Singh et al.
[2020], let P tπ ( s ) be the t step state distribution starting from state s following policy π and P π be the steady-state state distribution generated by policy π .
Our ﬁrst assumption on the MDP allows any policy to reach any state s (cid:48) starting from any state s , and to converge to a steady state.
We formalize the result in the following assumption:
Assumption 1.
The MDP M is ergodic, or (cid:107) P
tπ ( s ) −
P π (cid:107) TV ≤ Cρ t with P π being the long-term steady state distribution induced by policy π , and C > 0 and ρ <are problem speciﬁc constants.
And, the mixing time of the
MDP M is ﬁnite or T M < ∞ .
After discussing the transition dynamics of the system, we move to the rewards and costs of the MDP M .
Assumption 2.
The reward function r ( s, a ) and the costs c k ( s, a ) , k ∈ [ K ] are known to the agent.
We note that in most of the problems, rewards are engineered.
Hence, Assumption 2 is justiﬁed in many setups.
However, the system dynamics are stochastic and typically not known.
Following a policy π , the expected long-term average cost are given by ζ P,kπ .
Also, we denote the average long-term reward using ζ P,kπ .
Formally, we have:
[Equation]
For brevity, in the rest of the paper, E s t ,a t ,s t +1 ; t ≥ 0 [ · ] will be denoted as E ρ,π,P [ · ] , where s 0 ∼ ρ 0 ( s 0 ) , a t ∼ π ( s t | a t ) , s t +1 ∼ P ( s t +1 | s t , a t ) .
Both, ζ P,kπ and λ P,rπ satisfy the following form of Bellman equation:
[Equation]
where h P,rπ ( s ) is the bias for reward and h P,kπ is the bias for cost k ∈ [ K ] .
The objective is ﬁnd a policy π ∗ which is the solution of the following optimization problem.
[Equation]
where C k ∀ k ∈ [ K ] are the bounds on the average costs which the agent needs to satisfy.
After formulating the optimization problem, we now state our next assumption characterizing the slackness.
Assumption 3.
There exists a policy π , and one constant
[Equation]
such that
[Equation]
The slackness assumption is mild because, in various applications some a priori knowledge about a strictly feasible policy is available.
Hence, this assumption is again a standard assumption in the constrained RL literature Efroni et al.
[2020], Ding et al.
κ is referred as Slater’s constant.
Ding et al.
[2021] assumes that the Slater’s constant κ is known.
Any online algorithm starting with no prior knowledge will require to obtain estimates of transition probabilities P and obtain reward r and costs c k ,
∀ k ∈
[ K ] for each state action pair.
Initially, when algorithm does not have good estimates of the model, it accumulates a regret as well as violates constraints as it does not know the optimal policy.
We deﬁne reward regret R ( T ) as the difference between the cumulative reward obtained r t vs the expected rewards from running the optimal policy π ∗ for T steps, or
[Equation]
Additionally, we deﬁne constraint regret R k ( T ) for each constraint k ∈
[ K ] as the gap between the cumulative cost incurred c kt , k ∈
[ K ] and constraint bounds, or
R k ( T
[Equation]
=
[Equation]
where ( x ) + = max(0 , x ) .
In the following section, we present a model-based algorithm to obtain this policy π ∗ , and reward regret and the constraint regret accumulated by the algorithm.
THE CMDP-PSRL ALGORITHM
For inﬁnite horizon optimization problems (or τ → ∞ ), we can use steady state distribution of the state to obtain expected long-term rewards or costs [Puterman, 2014].
We use
[Equation]
where d Pπ ( s, a ) is the steady state joint distribution of the state and actions under policy π .
Based on the above formulation, we can solve the joint optimization problem of following form
[Equation]
with the following set of constraints,
[Equation]
for all s (cid:48) ∈ S , ∀ s ∈ S , and ∀ a ∈ A .
Equation (15) denotes the constraint on the transition structure for the underlying
Markov Process.
Equation (16) ensures that the solution is a valid probability distribution.
Finally, Equation (17) are the constraints for the constrained MDP setup which the policy must satisfy.
Note that arguments in Equation (14) are linear, and the constraints in Equation (15) and Equation (16) are linear, this is a linear programming problem.
Since convex optimization problems can be solved in polynomial time [Potra and Wright, 2000], we can use standard approaches to solve
Equation (14).
After solving the optimization problem, we obtain the optimal policy from the obtained steady state distribution d ∗ ( s, a ) as,
[Equation]
Since we assumed that the CMDP is ergodic, the Markov
Chain induced from policy π is ergodic.
Hence, every state is reachable following the policy π ∗ , we have P ( s ) > 0 and
Equation (18) is deﬁned for all states s ∈ S .
Further, since we assumed that the induced Markov Chain is irreducible for all stationary policies, we assume Dirichlet distribution as prior for the state transition probability
P ( s (cid:48) | s, a ) .
Dirichlet distribution is also used as a standard prior in literature [Agrawal and Jia, 2017, Osband et al., 2013].
Further, there exists a steady state distribution when the transition probability is sampled from a Dirichlet distribution [Agarwal et al., 2022, Proposition 1].
The complete constrained posterior sampling based algorithm, which we name CMDP-PSRL, is described in Algorithm 1.
The algorithm proceeds in epochs, and a new epoch is started whenever the visitation count in epoch e ,
ν e
( s, a ) , is at least the total visitations before episode e , N e ( s, a ) , for any state action pair (Line 8).
In Line 9, we sample transition probabilities ˜ P using the updated posterior and in
Line 10, we update the policy using the optimization problem speciﬁed in Equation (14)-(17) for P = ˜
P e .
Further, if the sampled MDP does not satisfy the cost constraint in
Equation (17), we ignore that constraint 2 for that epoch.
1: Input: S , A , r, c 1 , · · · , c K 2: Initialize N ( s, a, s (cid:48) )
= 1 ∀ ( s, a, s (cid:48) )
∈ S×A×S , π e ( a | s )
=|A| ∀ ( a, s ) ∈
A × S , e = 0 , ν e ( s, a ) =
N e ( s, a ) =
∀
( s, a ) ∈ S
×
A 3: for time index t = 1 , 2 , · · · do 4:
Observe state s 5:
Play action a ∼ π ( ·| s ) 6:
Observe rewards { r k } and next state s (cid:48) 7: ν e ( s, a )+ = 1 , N ( s, a, s (cid:48) )
+ =8: if ν e ( s, a ) ≥ max(1 , N e ( s, a )) for any s, a then 9: ˜
P e ( s (cid:48) | a, s ) ∼ Dir ( N ( s, a, s (cid:48) )) ∀ ( s, a, s (cid:48) ) 10:
Solve steady state distribution d ( s, a ) as the solution of the optimization problem in Equations (14-17) for ˜ P e .
Obtain optimal policy for next epoch, e + 1 , π e +1 as π e +1 ( a | s ) =
d ( s, a ) (cid:80) a ∈A d ( s, a ) 12: e = e +13: t e = t 14: ν e
( s, a ) = 0 , N e
( s, a ) =
(cid:80) ee (cid:48)
ν
e (cid:48) ( s, a ) ∀
( s, a ) 15: end
if 16: end for
ANALYSIS
We ﬁrst obtain the feasibility of the optimization problem
Equation (14)-(17) for the sampled MDP.
We note that we assumed slackness in the true MDP with transition probabilities P .
Hence, if the the sampled MDP is close to the true
MDP, the deviation in the cost will be less and there will be a policy which satisﬁes the constraint in Equation (17).
We formalize this intuition in the following result.
Lemma 1.
Following Algorithm 1, if t e +1 − t e ≥ √ T and
[Equation]
a policy π which satisﬁes,
[Equation]
and the optimization problem in Equation (14) - (17) is feasible, where t e is the start time of epoch e .
Proof Outline.
We consider the policy π which satisﬁes the
Slater’s condition in Equation (9).
We then consider the
Bellman error of taking one step in MDP with transition probabilities ˜
P e
and then following policy π on the MDP with transition probabilities P .
Now, using [Agarwal et al., 2022, Lemma 1] relating the average costs following policy π with P and ˜ P e ( ζ P,kπ , and ζ ˜ P e ,k π for all k ∈
[ K ] respectively) with the Bellman error gives the required result.
After obtaining a feasible policy π e maximizing rewards for the sampled MDP, we now quantify is regret.
We note that when optimizing for long-term average rewards and long-term average constraints, we want to simultaneously minimize the reward regret and the constraint regrets.
Further, if we know the optimal policy π ∗ before hand, the deviations resulting from the stochasticity of the process can still result in some constraint violations.
Also, since we sample a MDP, the policy which is feasible for the MDP may violate constraints on the true MDP.
We want to bound this gap between K costs for the two MDPs as well.
We aim to quantify the regret from (R.1) deviation of longterm average rewards of the optimal policy because of incorrect knowledge of the MDP ( λ P,rπ ∗ − λ ˜
P e ,r π e ), (R.2) deviation of the long-term average rewards generated by the optimal policy for the sampled MDP on the sampled MDP and the long-term average rewards generated by the optimal policy for the sampled MDP on the true MDP ( λ ˜ P e ,r π e − λ P,rπ e ), and (R.3) deviation of the expected rewards from following the optimal policy of the sampled MDP ( λ P,rπ e − r ( s t , a t ) ).
Similarly, the constraint violations for each k ∈ [ K ] are incurred from (C.1) deviation of long-term average rewards of the optimal policy because of incorrect knowledge of the
MDP ( C k − ζ ˜ P e ,k π e ), (C.2) deviation of the long-term average costs generated by the optimal policy for the sampled
MDP on the sampled MDP and the long-term average costs generated by the optimal policy for the sampled MDP on the true MDP ( ζ ˜ P e ,r π e − λ P,rπ e ), and (C.3) deviation of the expected costs from following the optimal policy of the sampled MDP ( ζ P,rπ e − c k
( s t , a t ) ).
We now prove the regret bounds for Algorithm 1.
We ﬁrst give the high level ideas used in obtaining the bounds on regret.
We divide the regret into regret incurred in each epoch e .
Then, we use the posterior sampling lemma
[Osband et al., 2013, Lemma 1] to obtain the equivalence between the longterm average rewards of the true MDP M and the long-term average rewards for the optimal value of the sampled MDP (cid:99) M .
This step allows us to deal with the regret from (R.1) .
Then we use the Bellman error formulation to relate average rewards for the policy π e on P and ˜
P e [Agarwal et al., 2022].
Combining this with Azuma’s concentration inequality for
Martingales allows us to bound the regret from (R.2) and (R.3) .
Bounding constraint violations requires similar considerations for (C.2) and (C.3) .
Further, (C.1) becomes zero if
Equation (17) is feasible for the sampled MDP.
However, if Equation (17) is not feasible, the cost may be as high as 1 ( c k ( s, a ) ≤ 1 ∀ k ∈
[ K ] ).
We bound the violations by bounding the time-steps for which the optimal policy for unconstrained optimization runs.
To obtain bounds on the regret, we ﬁrst note that the total number of epochs, E , for which the Algorithm 1 runs is bounded by O (1 + 2 SA + SA log( T ) from [Jaksch et al., 2010, Proposition 1].
We formally state the regret bounds and constraint violation bounds in Theorem 1 which we prove rigorously in the supplementary material.
Theorem 1.
The expected reward regret E [ R ( T )] , and the expected constraint regret E [ R k ( T )] ∀ k ∈
[ K ] of Algorithm 1 are bounded as
[Equation]
Proof Outline.
We break the cumulative regret into the regret incurred in each epoch e .
This gives us:
[Equation]
The Equation (22) follows from [Osband et al., 2013,
Lemma 1] for regret each each epoch of Equation (21).
Proceeding from Equation (23) requires additional consideration.
Typical proof techniques to bound regret requires a bounded bias-span ( max s,s (cid:48)
( h ˜ P e ,r π
[Equation]
s
[Equation]
)) ) which may be large for the sampled MDP.
For this, we consider an
MDP for the transition probability P re satisﬁes
[Equation]
, where
[Equation] [Equation]
where ¯ P t e ( ·| s, a ) is the estimated transition probability given s, a at time t e .
We now have,
[Equation]
The ﬁrst term of Equation (25) is bounded by bounding the expected Bellman error.
The second term is converted to a Martingale sequence by conditioning it on the state s t e and is bounded using the ergodicity of the MDP M and Azuma’s concentration inequality.
The complete proof on bounding the regret is provided in the supplementary material.
Regarding the constraint violations, for each k ∈ [ K ] , we want to bound,
[Equation]
We divide the constraint violation regret into regret over epochs as well.
Now, for each epoch, we know that the constraint is satisﬁed by the policy for the sampled MDP.
This allows us to obtain:
[Equation]
The ﬁrst term in Equation (28) denotes the difference between the incurred costs and the expected costs from following policy π e .
The second term denotes the difference between the expected costs from policy π e on the true MDP and on the sampled MDP.
The third terms denotes the violations of the policy π e which would be zero if the policy π e satisﬁes constraint Eqution (17) for the sampled MDP.
Equation (29) is obtained from the fact max(0 , x + y ) ≤ max(0 , x ) + max(0 , y ) and Equation (28) is obtained from the fact max(0 , x ) ≤ | x | .
The ﬁrst and second term in Equation (28) are bounded similar to Equation (23), and we focus our attention to the third term.
If the optimization problem in Equation (14)-(17) is feasible, the term ( ζ ˜ P e ,k π e − C k ) ≤ 0 and if the optimization equation is infeasible, the term is upper bounded by 1 as
C k ≥ 0 and ζ ˜ P e π e ≤ 1 .
Hence, we get:
[Equation]
where Equation (31) follows from the fact that total violations are less than the cumulative violations are considered per epoch.
Equation (33) follows from Lemmaas (cid:16) ζ ˜ P e ,k π e − C k (cid:17) ≤ 0 when t e > √ T and Equation (35) comes from [Jaksch et al., 2010, Proposition 1].
We note that the fundamental setup of unconstrained optimization ( K = 0 ), the bound is loose compared to that of UCRL2 algorithm Jaksch et al.
This is because we use a stochastic policy instead of a deterministic policy.
Recall that the optimal policy for CMDP setup is possibly stochastic Altman [1999].
EVALUATION OF THE PROPOSED ALGORITHM
To validate the performance of the proposed CDMP-PSRL algorithm and the understanding of our analysis, we run the simulation on the ﬂow and service control in a singleserve queue, which is introduced in [Altman and Schwartz, 1991].
A discrete-time single-server queue with a buffer of ﬁnite size L is considered in this case.
The number of the customer waiting in the queue is considered as the state in this problem and thus | S | =
L + 1 .
Two kinds of the actions, service and ﬂow, are considered in the problem and control the number of customers together.
The action space for service is a ﬁnite subset A in [ a min , a max ] , where 0 < a min ≤ a max < 1 .
Given a speciﬁc service action a , the service a customer is successfully ﬁnished with the probability b .
If the service is successful, the length of the queue will reduce by 1.
Similarly, the space for ﬂow is also a ﬁnite subsection B in [ b min , b max ] .
In contrast to the [Figure] service action, ﬂow action will increase the queue by 1 with probability b if the speciﬁc ﬂow action b is given.
Also, we assume that there is no customer arriving when the queue is full.
The overall action space is the Cartesian product of the
A and B .
According to the service and ﬂow probability, the transition probability can be computed and is given in the
Table 1.
For the reward function as r ( s, a, b ) and the constraints for service and ﬂow as c 1 ( s, a, b ) and c 2 ( s, a, b ) , respectively, and stationary policies for service and ﬂow as π a and π b ,
[Table]
[Equation] [Equation]
P (
[Equation]
t
[Equation] [Equation]
P ( x t +1 = x t
[Equation] [Equation]
x [Equation] L −a (1 − b ) ab + (1 − a )(1 − b ) (1 − a ) b x t = L a 1 − a x t = 1 − b (1 − a ) b (1 − a ) respectively, the problem can be deﬁned as
[Equation]
According to the discussion in [Altman and Schwartz, 1991], we deﬁne the reward function as r ( s, a, b ) = 5 − s , which is an decreasing function only dependent on the state.
It is reasonable to give higher reward when the number of customer waiting in the queue is small.
For the constraint function, we deﬁne c 1 ( s, a, b )
= − 10 a + 6 and c 2 = − 8 ∗ (1 − b ) 2 + 2 , which are dependent only on service and ﬂow action, respectively.
Higher constraint value is given if the probability for the service and ﬂow are low and high, respectively.
In the simulation, the length of the buffer is set as L = 5 .
The service action space is set as [0 . 2 , 0 . 4 , 0 . 6 , 0 . 8] and the ﬂow action space is set as [0 . 4 , 0 . 5 , 0 . 6 , 0 .
We use the length of horizon T = 50000 and run 50 independent simulations of the proposed CMDP-PSRL algorithm.
We also plot the standard deviation around the mean value in the shadow to show the random error.
In order to compare this result to the optimal, we assume that the full information of the transition dynamics is known and then use Linear
Programming to solve the problem.
The optimal cumulative reward from LP is shown to be 4 . 47 .
The reward performance of the CMDP-PSRL algorithm is shown in the Figure 1 where we observe that the reward converges towards the optimal value.
We also plot the constraint violations in
Figure 2.
The service and ﬂow constraints converge to 0 as expected.
We note that the reward of the proposed CMDPPSRL algorithm becomes closer the optimal reward as the algorithm proceeds, and to further increase the reward, it does not violates the constraint.
We also compared our algorithm against the optimistic algorithm of Singh et al.
We note that their algorithm performs signiﬁcantly worse compared to our algorithm.
We account this poor performance on two accounts.
An optimistic algorithm does not ﬁnd a policy for transition probabilities close to P for signiﬁcantly large time.
The other issue is because they consider conﬁdence interval for each P ( s (cid:48) | s, a ) .
This also shows in their analysis and hence they obtain a O ( T 2 / 3 ) regret bound.
Further, the optimization problem takes a signiﬁcantly more time to solve for optimistic setup.
However, the variance of their optimistic algorithm is signiﬁcantly lower compared to the variance of our CMDP-PSRL algorithm.
CONCLUSION
This paper, considers the setup of reinforcement learning in ergodic inﬁnite-horizon constrained Markov Decision
Processes with K long-term average constraint.
We propose a posterior sampling based algorithm, CMDP-PSRL, which proceeds in epochs.
At every epoch, we sample a new CMDP and generate a solution for the constraint optimization problem.
A major advantage of the posterior sampling based algorithm over an optimistic approach is, that it reduces the complexity of solving for the optimal solution of the constraint problem.
We also study the proposed
CMDP-PSRL algorithm from regret perspective.
We bound the regret of the reward collected by the CMDP-PSRL algorithm as ˜ O
( T M S √ AT
+ CS 2 A/ (1 − ρ )) .
Further, we bound the gap between the long-term average costs of the sampled MDP and the true MDP to bound the K constraint violations as ˜ O
( T M S √ AT
+ CS 2 A/ (1 − ρ )) .
Finally, we evaluate the proposed CMDP-PSRL algorithm on a ﬂow control problem for single queue and show that the proposed algorithm performs empirically well.
This paper is the ﬁrst work which obtains a ˜ O ( √ T ) regret bounds for ergodic
MDPs with long-term average constraints using a posterior sampling algorithm.
A model-free algorithm that obtains similar regret bounds for inﬁnite horizon long-term average constraints remains an open problem.