Coordinated Exploration in Concurrent Reinforcement Learning

Maria Dimakopoulou, Benjamin Van Roy

Introduction

The field of reinforcement learning treats the design of agents that operate in uncertain environments and learn over time to make increasingly effective decisions. In such settings, an agent must balance between accumulating near-term rewards and probing to gather data from which it can learn to improve longer-term performance. A substantial literature, starting with (Kearns and Singh, 2002), has developed reinforcement learning algorithms that address this trade-off in a provably efficient manner.

Until recently, most provably efficient exploration algorithms (e.g., (Jaksch et al., 2010)) have been based on upper-confidence-bound approaches. Over the past few years, new approaches that build on and extend PSRL (posterior sampling for reinforcement learning) (Strens, 2000) have proved advantageous in terms of statistical efficiency (Osband et al., 2013; Osband and Van Roy, 2017a, b, 2014a, 2014b).

PSRL operates in a simple and intuitive manner. An agent learns over episodes of interaction with an uncertain environment, modeled as a Markov decision process (MDP). The agent is uncertain about the transition probabilities and rewards of the MDP, and refines estimates as data is gathered. At the start of each episode, the agent samples an MDP from its current posterior distribution. This sample can be thought of as a random statistically plausible model of the environment given the agent’s initial beliefs and data gathered up to that time. The agent then makes decisions over the episode as though the environment is accurately modeled by the sampled MDP.

In concurrent reinforcement learning (Silver et al., 2013; Pazis and Parr, 2013; Guo and Brunskill, 2015; Pazis and Parr, 2016), multiple agents interact with the same unknown environment, share data with one another, and learn in parallel. One might consider two straightforward extensions of PSRL to the multi-agent setting. In one, at the start of each episode, each agent samples an independent MDP from the current posterior, which is conditioned on all data accumulated by all agents. Then, over the course of the episode, each agent follows the decision policy that optimizes its sampled MDP. The problem with this approach is that each agent does not benefit over the duration of the episode from the potentially vast quantities of data gathered by his peers. An alternative – which we will refer to as Thompson resampling – would be to have each agent independently sample a new MDP at the start of each time period within the episode, as done in (Kim, 2017). The new sample would be from a posterior distribution additionally conditioned on data gathered by all agents up to the time. However, as discussed in (Russo et al., 2017), this naive extension is disruptive to the agents’ ability to explore the environment thoroughly. In particular, an agent may have to apply a coordinated sequence of actions over multiple time periods in order to adequately probe the environment. When MDPs are resampled independently over time periods, agents are taken off course.

The two naive approaches we have discussed highlight potentially conflicting needs to adapt to new information and to maintain the intent with which an agent started exploring the environment. Efficient coordinated exploration calls for striking the right balance. In this paper, we present a variation of PSRL – seed sampling – that accomplish es this.

To focus on the issue of coordinated exploration, we consider a single-episode reinforcement learning problem in which multiple agents operate, making decisions and progressing asynchronously. In this context, we study the rate at which per-agent regret vanishes as the number of agents increases. Through this lens, we demonstrate that seed sampling coordinates exploration in an efficient manner and can dramatically outperform other approaches to concurrent reinforcement learning. In particular, the rate at which regret decays appears to be robust across problems, while for each alternative, there are problems where regret decays at a far slower rate.

Guo and Brunskill (2015), Pazis and Parr (2013), and Pazis and Parr (2016) have proposed and studied UCB exploration schemes for concurrent reinforcement learning. Advantages of PSRL over UCB in single-agent contexts by themselves motivate extension to concurrent reinforcement learning. A possibly more important motivating factor, however, is that, as our results demonstrate, UCB approaches sometimes do not coordinate exploration in an effective manner. The issue is that UCB approaches are deterministic, and as such, they do not diversify agent behaviors to effectively divide and conquer when there are multiple facets of the environment to explore.

A broad range of applications calls for concurrent reinforcement learning. Many examples can be found in web services, where each user can be served by an agent that shares data with and learns from the experiences of other agents. Through coordinated exploration, the agents can efficiently learn to better serve the population of users. The control of autonomous vehicles presents another important context. Here, each agent manages a single vehicle, and again, the agents learn from each other as data is gathered. The goal could be to optimize a combination of metrics, such as fuel consumption, safety, and satisfaction of transportation objectives. Exploratory actions play an important role, and structured diversity of experience may greatly accelerate learning. The seed sampling algorithms we propose in this paper aim to structure such exploration in a systematic and robust manner.

Problem Formulation

Consider a time-homogeneous, single-episode MDP, which is identified by M=(S,A,R,P,ρ,H)\mathcal{M}=(\mathcal{S},\mathcal{A},\mathcal{R},\mathcal{P},\rho,H), where S\mathcal{S} is the finite state space, A\mathcal{A} is the finite action space, R\mathcal{R} is the reward model, P\mathcal{P} is the transition model, ρ\rho is the initial state distribution and HH is the horizon.

Consider KK agents, who explore and learn to operate in parallel in this common environment. Each kkth agent begins at state sk,0s_{k,0} and takes an action at arrival times tk,1,tk,2,…,tk,Ht_{k,1},t_{k,2},\dots,t_{k,H} of an independent Poisson process with rate λ=1\lambda=1. At time tk,mt_{k,m}, the agent takes action ak,ma_{k,m}, transitions from state sk,m−1s_{k,m-1} to state sk,ms_{k,m} and observes reward rk,mr_{k,m}. The agents are uncertain about the transition structure P\mathcal{P} and/or the reward structure R\mathcal{R}, over which they share common priors. There is clear value in sharing data across agents, since there is commonality across what agents aim to learn. Agents share information in real time and update their posterior, so that when selecting an action at time tk,mt_{k,m}, the kkth agent can base his decision on observations made by all agents prior to that time.

The total reward accrued by the agents is ∑k=1K∑m=1Hrk,m\sum_{k=1}^{K}\sum_{m=1}^{H}r_{k,m} and the expected mean regret per agent is defined by

We now consider some examples that illustrate this problem formulation.

Consider the directed graph of Figure 1. The chain has an even number of vertices, NN, V={0,1,…,N−1}\mathcal{V}=\{0,1,\dots,N-1\}. The endpoints of the chain are absorbing. The set of edges is E={(v,v+1),∀v=1,…,N−3}∪{(v+1,v),∀v=1,…,N−3}∪(1,0)∪(N−2,N−1)\mathcal{E}=\{(v,v+1),\forall v=1,\dots,N-3\}\cup\{(v+1,v),\forall v=1,\dots,N-3\}\cup(1,0)\cup(N-2,N-1). The leftmost edge eL=(1,0)e_{L}=(1,0) has weight θL\theta_{L} and the rightmost edge eR=(N−2,N−1)e_{R}=(N-2,N-1) has weight θR\theta_{R}, such that ∣θL∣=∣θR∣=N|\theta_{L}|=|\theta_{R}|=N and θR=−θL\theta_{R}=-\theta_{L}. All other edges e∈E\{eL,eR}e\in\mathcal{E}\backslash\{e_{L},e_{R}\} have weight θe=−1\theta_{e}=-1. The agents do not know whether θL=N,θR=−N\theta_{L}=N,\theta_{R}=-N or θL=−N,θR=N\theta_{L}=-N,\theta_{R}=N and they share a common prior that assigns probability p=0.5p=0.5 to either scenario. Each one of the KK agents starts from vertex vS=N/2v_{S}=N/2. Denote as ek,me_{k,m} the edge traversed at the mmth step of the kkth agent’s path and θk,m\theta_{k,m} the respective weight. Further, denote as tk,ht_{k,h}, 1≤h≤H1\leq h\leq H the time at which the kkth agent reaches either endpoint with the hhth traversal being the last one in the agent’s path. The kkth agent’s objective is to maximize ∑m=1hθk,m\sum_{m=1}^{h}\theta_{k,m}. The optimal reward is R∗=N/2R^{*}=N/2 if θL=N,θR=−N\theta_{L}=N,\theta_{R}=-N and R∗=N/2+1R^{*}=N/2+1 if θL=−N,θR=N\theta_{L}=-N,\theta_{R}=N because the leftmost endpoint vL=0v_{L}=0 is one vertex further from the start vS=N/2v_{S}=N/2 than the rightmost endpoint vR=N−1v_{R}=N-1 and requires the traversal of one more penalizing edge with weight −1-1.

Consider the directed graph of Figure 2. Starting from vertex , each of the KK agents chooses one of the CC chains. Once a chain is chosen, the agent cannot switch to another chain. All the edges of each chain cc have zero weights, apart from the edge incoming to the last vertex of the chain, which has weight θc\theta_{c}. Let θ∈ℜC\theta\in\Re^{C} be the vector of these edge weights for the CC chains. The KK agents are uncertain about θ\theta, over which they share a common N(μ0,Σ0)\mathcal{N}(\mu_{0},\Sigma_{0}) prior. Denote as ckc_{k} the chain chosen by the kkth agent. When traversing the last edge at time tk,Ht_{k,H}, the agent observes reward rk,Hr_{k,H} distributed according to rk,H∣θ∼N(θck,σ2)r_{k,H}|\theta\sim\mathcal{N}(\theta_{c_{k}},\sigma^{2}). For all other transitions at times tk,mt_{k,m}, m=1,…,H−1m=1,\dots,H-1, the kkth agent observes reward rk,m=0r_{k,m}=0. The objective is to choose the chain with the maximum reward.

Algorithms

Three properties are necessary for efficient coordinated exploration in concurrent reinforcement learning:

Adapt as data becomes available to make effective use of new information.

Maintain the intent to carry out probing action sequences that span multiple periods.

Divide-and-conquer learning opportunities among agents.

As we discuss in Section 3.1, straightforward extensions of provably efficient single-agent reinforcement learning algorithms fail to meet these requirements. In Section 3.2, we introduce the concept of seed sampling, which leads to algorithms that simultaneously satisfy these three properties.

All algorithms we consider share some common structure, which we will now describe. The KK concurrent agents share a prior distribution F0\mathcal{F}_{0} of the MDP M\mathcal{M}. Denote by Ft\mathcal{F}_{t} the posterior distribution, given the history of observations Ht−1\mathcal{H}_{t-1} available up to time tt. At each time tk,mt_{k,m}, the agent generates an MDP Mk,m\mathcal{M}_{k,m}, computes the optimal policy πk,m\pi_{k,m} for Mk,m\mathcal{M}_{k,m}, takes a single action ak,m=πk,m(sk,m−1)a_{k,m}=\pi_{k,m}(s_{k,m-1}), transitions to state sk,ms_{k,m} and observes reward rk,mr_{k,m}. The observation (sk,m−1,ak,m,sk,m,rk,m)\left(s_{k,m-1},a_{k,m},s_{k,m},r_{k,m}\right) is used to update the shared posterior distribution of M\mathcal{M}. Therefore, at time tk′,m′>tk,mt_{k^{\prime},m^{\prime}}>t_{k,m}, the k′k^{\prime}th agent can use the knowledge gained from this observation in order to take his m′m^{\prime}th action. The key difference between the studied algorithms is how each kkth agent forms his MDP Mk,m\mathcal{M}_{k,m} at time tk,mt_{k,m}.

First, we discuss the straight-forward adaptation of provably efficient single-agent reinforcement learning algorithms to the concurrent reinforcement learning setting. However, neither of these baselines achieve coordinated exploration in concurrent reinforcement learning, either because the agents, when adapting to new information, do not maintain the level of intent required to ensure thorough exploration or because the agents do not diversify their exploratory effort in a manner that mutually benefits their common learning.

At time tk,mt_{k,m}, the kkth agent samples MDP Mk,m\mathcal{M}_{k,m} from the posterior Ftk,m\mathcal{F}_{t_{k,m}}. If at time tk,mt_{k,m} of the mmth action of the kkth agent and at time tk′,m′t_{k^{\prime},m^{\prime}} of the m′m^{\prime}th action of the k′k^{\prime}th agent the posterior is the same, Ftk,m≡Ftk′,m′\mathcal{F}_{t_{k,m}}\equiv\mathcal{F}_{t_{k^{\prime},m^{\prime}}}, the kkth agent and the k′k^{\prime}th agent will form a different MDP. Therefore, the agents will diversify their exploration efforts. However, resampling an MDP independently at each time period may break the agent’s commitment to a sequence of actions that extend over multiple time periods. This commitment is necessary for learning in an environment with delayed consequences, and hence the learning performance may suffer.

To demonstrate the importance of Property 2 (Commitment), consider the Bipolar Chain example of Section 2. Assume that the kkth agent samples an MDP at time tk,1t_{k,1}, in which the left-most edge is positive and the right-most edge is negative. Therefore, the kkth agent decides to move left at tk,1t_{k,1}. When the kkth agent re-samples an MDP at time tk,2t_{k,2}, the left-most edge may now be negative and the right-most edge may now be positive due to randomness, even if no other agent has gathered information to warrant this change in the sampled MDP. As a consequence, the kkth agent moves right at tk,2t_{k,2}, undoing his previous move, incurring unnecessary cost and most importantly delaying the traversal of either the left-most or the right-most edge, which would produce information valuable for all agents.

1.2 Concurrent UCRL

At time tk,mt_{k,m}, the kkth agent forms confidence bounds for the reward structure R\mathcal{R} and the transition structure P\mathcal{P} that define the set of statistically plausible MDPs given the posterior Ftk,m\mathcal{F}_{t_{k,m}}. The kkth agent chooses the MDP Mk,m\mathcal{M}_{k,m} that maximizes the achievable average reward subject to these confidence bounds. This algorithm is deterministic and does not suffer from the flaw of Thompson resampling. Note, however, that if at time tk,mt_{k,m} of the mmth action of the kkth agent and at time tk′,m′t_{k^{\prime},m^{\prime}} of the m′m^{\prime}th action of the k′k^{\prime}th agent the posterior is the same, Ftk,m≡Ftk′,m′\mathcal{F}_{t_{k,m}}\equiv\mathcal{F}_{t_{k^{\prime},m^{\prime}}}, the kkth agent and the k′k^{\prime}th agent will form the same MDP. Therefore, the agents may not always diversify their exploration efforts.

To demonstrate the importance Property 3 (Diversity), consider the Parallel Chains example of Section 2 and assume that the parallel chains’ last edge weights, θc\theta_{c}, are independent. Further, assume that for any pair of chains cc, c′c^{\prime}, the prior means of θc\theta_{c}, θc′\theta_{c^{\prime}} are the same, μ0,c=μ0,c′\mu_{0,c}=\mu_{0,c^{\prime}}, but the prior variances of θc\theta_{c}, θc′\theta_{c^{\prime}} differ, σ0,c≠σ0,c′\sigma_{0,c}\neq\sigma_{0,c^{\prime}}. Then, UCRL will direct all KK agents to the chain with the maximum prior variance and will not diversify exploratory effort to the other C−1C-1 chains. As the horizon HH gets larger, the learning performance benefits less and less from an increased number of parallel agents and the expected mean regret per agent does not improve due to lack of diversity.

2 Seed Sampling Algorithms

We now present the concept of seed sampling, which offers an approach to designing efficient coordinated exploration algorithms that satisfy the three aforementioned properties. The idea is that each concurrent agent independently samples a random seed, such that the mapping from seed to MDP is determined by the prevailing posterior distribution. Independence among seeds diversifies exploratory effort among agents (Property 3). If the mapping is defined in an appropriate manner, the fact that the agent maintains a consistent seed leads to a sufficient degree of commitment (Property 2), while the fact that the posterior adapts to new data allows the agent to react intelligently to new information (Property 1).

In the subsections that follow, we discuss ways to define the mapping from seed and posterior distribution to sample. Note that the mappings we present represent special cases that apply to specific problem classes. The idea of seed sampling is broader and can be adapted to other problem classes, as we will explore further in Section 4.

Let G0\mathcal{G}_{0} be a deterministic function mapping a seed z∼Zz\sim\mathcal{Z} to MDP M0\mathcal{M}_{0}, such that M0∼M\mathcal{M}_{0}\sim\mathcal{M}. At time tt, the deterministic function mapping Gt\mathcal{G}_{t} is generated based on G0\mathcal{G}_{0} and the history of observations Ht−1\mathcal{H}_{t-1} available up to this time. At the beginning of the episode, each kkth agent samples seed zk∼Zz_{k}\sim\mathcal{Z}. At time tk,mt_{k,m}, the kkth agent samples an MDP according to Mk,m=Gtk,m(zk)\mathcal{M}_{k,m}=\mathcal{G}_{t_{k,m}}(z_{k}). The intuition behind the seed sampling algorithms is that each agent forms its own sample of the MDP at each time period, which is distributed according to the posterior over M\mathcal{M} based on all agents’ observations, while the randomness injected to the agent’s samples remains fixed throughout the horizon, allowing the agent to maintain the necessary commitment to action sequences that span multiple time periods.

2.2 Standard-Gaussian Seed Sampling

The agents are uncertain about the parameters θ∈ℜ∣S∣∣A∣\theta\in\Re^{|\mathcal{S}||\mathcal{A}|} of the reward structure, over which they share a common normal or lognormal prior F0R\mathcal{F}^{\mathcal{R}}_{0} with parameters μ0\mu_{0} and Σ0\Sigma_{0}. The posterior over θ\theta at time tt, given the history of observations Ht−1\mathcal{H}_{t-1} available up to this time, is FtR\mathcal{F}^{\mathcal{R}}_{t} and is normal or lognormal with parameters μt\mu_{t} and Σt\Sigma_{t}. In either case, conjugacy properties result in simple rules for updating the posterior distribution’s parameters upon each observation in Ht−1\mathcal{H}_{t-1}. Consider Example 1 and Example 3 of Section 2. At the beginning of the episode, each kkth agent samples seed zk=N(0,I)z_{k}=\mathcal{N}(0,I). In the case of normal prior, as in Example 3 (Parallel Chains), the mapping from seed to the reward structure’s parameters is defined as Gt(z):=μt+Dtz\mathcal{G}_{t}(z):=\mu_{t}+D_{t}z, where DtD_{t} is the positive definite matrix such that DtTDt=ΣtD_{t}^{T}D_{t}=\Sigma_{t}. Then, Gt(z)\mathcal{G}_{t}(z) is a multivariate normal with mean vector μt\mu_{t} and covariance matrix Σt\Sigma_{t} (Gentle, 2009). In the case of lognormal prior, as in Example 1 (Maximum Reward Path), the mapping from seed to the reward structure’s parameters is Gt(z):=exp⁡(μt+Dtz)\mathcal{G}_{t}(z):=\exp\left(\mu_{t}+D_{t}z\right), where DtD_{t} is defined as before. Similarly, Gt(z)\mathcal{G}_{t}(z) is a multivariate lognormal with parameters μt\mu_{t} and Σt\Sigma_{t}. The reward structure of the sampled MDP of the kkth agent at time tk,mt_{k,m} has parameters θ^k,m=Gtk,m(zk)\hat{\theta}_{k,m}=\mathcal{G}_{t_{k,m}}(z_{k}).

2.3 Martingalean-Gaussian Seed Sampling

The agents are uncertain about the parameters θ∈ℜ∣S∣∣A∣\theta\in\Re^{|\mathcal{S}||\mathcal{A}|} of the reward structure, over which they share a common normal or lognormal prior F0R\mathcal{F}^{\mathcal{R}}_{0} with parameters μ0\mu_{0} and Σ0\Sigma_{0}. Define seed z=(θ^0,w)z=(\hat{\theta}_{0},w) with distribution Z\mathcal{Z} such that θ^0∼N(μ0,Σ0)\hat{\theta}_{0}\sim\mathcal{N}(\mu_{0},\Sigma_{0}) and {wj:j=0,1,… }\{w_{j}:j=0,1,\dots\} is an IID sequence of N(μw,σw2)\mathcal{N}(\mu_{w},\sigma_{w}^{2}). At time tt, the history up to this time Ht−1\mathcal{H}_{t-1} consists of observations {(sj,aj,sj′,rj),j=1,…,∣Ht−1∣}\{(s_{j},a_{j},s^{\prime}_{j},r_{j}),j=1,\dots,|\mathcal{H}_{t-1}|\}. The deterministic mapping Gt\mathcal{G}_{t} from seed z=(θ^0,w)z=(\hat{\theta}_{0},w) to reward structure parameters is a model fit to the sample θ^0\hat{\theta}_{0} from the prior and the observations in Ht−1\mathcal{H}_{t-1} randomly perturbed by ww. In the case of normal prior, {wj:j=0,1,… }\{w_{j}:j=0,1,\dots\} is an IID sequence of N(0,σ2)\mathcal{N}(0,\sigma^{2}) and rj∣θ∼N(θ(sj,aj),σ2)r_{j}|\theta\sim\mathcal{N}\left(\theta_{\left(s_{j},a_{j}\right)},\sigma^{2}\right). The mapping at time tt from seed z=(θ^0,w)z=(\hat{\theta}_{0},w) to the reward structure’s parameters is defined as \mathcal{G}_{t}(z):=\arg\min_{\rho}\Big{(}(\rho-\hat{\theta}_{0})^{T}\Sigma_{0}^{-1}(\rho-\hat{\theta}_{0})+\frac{1}{\sigma^{2}}\sum_{j=1}^{\left|\mathcal{H}_{t-1}\right|}(o_{j}^{T}\rho-r_{j}-w_{j})^{2}\Big{)}, where ojo_{j} is the one-hot vector ∣S∣∣A∣×1|\mathcal{S}||\mathcal{A}|\times 1, whose positive element corresponds to the state-action pair of the jjth observation in Ht−1\mathcal{H}_{t-1}, rjr_{j} is the reward of the jjth observation in Ht−1\mathcal{H}_{t-1} and wjw_{j} is a component of the seed which corresponds to the perturbation of the reward of the jjth observation in Ht−1\mathcal{H}_{t-1}. In the case of lognormal prior, {wj:j=0,1,… }\{w_{j}:j=0,1,\dots\} is an IID sequence of N(−σ2/2,σ2)\mathcal{N}(-\sigma^{2}/2,\sigma^{2}) and ln⁡rj∣θ∼N(ln⁡θ(sj,aj)−σ2/2,σ2)\ln r_{j}|\theta\sim\mathcal{N}\left(\ln\theta_{\left(s_{j},a_{j}\right)}-\sigma^{2}/2,\sigma^{2}\right). The mapping at time tt from seed z=(θ^0,w)z=(\hat{\theta}_{0},w) to the reward structure’s parameters is similar as in the normal case, but instead of fitting to the rewards rjr_{j}, we fit to ln⁡rj\ln r_{j}.

Consider again Example 3 (Parallel Chains) and Example 1 (Maximum Reward Path). At the beginning of the episode, each kkth agent samples seed zk=(θ^k,0,wk)z_{k}=(\hat{\theta}_{k,0},w_{k}) distributed according to Z\mathcal{Z}. At time tk,mt_{k,m}, the kkth agent generates θ^k,m=Gt(zk)\hat{\theta}_{k,m}=\mathcal{G}_{t}(z_{k}), which is a model fit to his sample θ^k,0\hat{\theta}_{k,0} from the prior and to the observations in the history Htk,m−1\mathcal{H}_{t_{k,m}-1} perturbed by wkw_{k}, θ^k,m=(OTO+σ2Σ0−1)−1(OT(R+Wk)+σ2Σ0−1θ^k,0)\hat{\theta}_{k,m}=\left(O^{T}O+\sigma^{2}\Sigma_{0}^{-1}\right)^{-1}\left(O^{T}(R+W^{k})+\sigma^{2}\Sigma_{0}^{-1}\hat{\theta}_{k,0}\right) where OO is the ∣Htk,m−1∣×∣S∣∣A∣\left|\mathcal{H}_{t_{k,m}-1}\right|\times|\mathcal{S}||\mathcal{A}| matrix whose jjth row is ojTo_{j}^{T}, RR is the ∣Htk,m−1∣×1\left|\mathcal{H}_{t_{k,m}-1}\right|\times 1 vector whose jjth element is rjr_{j} in the normal prior case and ln⁡rj\ln r_{j} in the lognormal prior case and WkW^{k} is the ∣Htk,m−1∣×1\left|\mathcal{H}_{t_{k,m}-1}\right|\times 1 vector whose jjth element is wk,j∼N(0,σ2)w_{k,j}\sim\mathcal{N}(0,\sigma^{2}) in the normal prior case and is wk,j∼N(−σ2/2,σ2)w_{k,j}\sim\mathcal{N}(-\sigma^{2}/2,\sigma^{2}) in the lognormal prior case.

Proposition 1 follows from Lemma 4 of (Lu and Van Roy, 2017) and is core to sampling an MDP that follows the posterior distribution based on the data gathered by all agents (Property 1). Proposition 2 follows from the definitions and motivates the name of this seed sampling algorithm.

Computational Results

In this section, we present computational results that demonstrate the robustness of seed sampling algorithms of Section 3.2 versus the baseline algorithms of Section 3.1. In sections 4.1 and 4.2, we present two simple problems that highlight the weaknesses of concurrent UCRL and Thompson resampling and demonstrate how severely performance may suffer due to violation of any among Properties 1, 2, 3. In Section 4.3, we demonstrate the relative efficiency of seed sampling in a more complex problem.

Consider the directed graph of Figure 1 and the description of Example 2 in Section 2. The agents’ objective is to maximize the accrued reward. However, the agents do not know whether the leftmost edge eLe_{L} has weight θL=N\theta_{L}=N or whether the rightmost edge has weight θR=N\theta_{R}=N. The agents share a common prior that assigns equal probability p=0.5p=0.5 to either scenario. When any of the KK agents traverses eLe_{L} or eRe_{R} for the first time, all KK agents learn the true values of θL\theta_{L}, θR\theta_{R}. Denote as TT the time when the true MDP is revealed. The horizon is H=3N/2H=3N/2. The horizon is selected in such a way, so that if an agent picks the wrong direction and moves in every time period towards the wrong endpoint, if the true values of θL\theta_{L}, θR\theta_{R} are revealed before the wrong endpoint is reached, this agent has enough time to correct the trajectory and reach the correct endpoint. The optimal reward is R∗=N/2R^{*}=N/2 if θL=N,θR=−N\theta_{L}=N,\theta_{R}=-N and R∗=N/2+1R^{*}=N/2+1 if θL=−N,θR=N\theta_{L}=-N,\theta_{R}=N because the leftmost endpoint vL=0v_{L}=0 is one vertex further from the start vS=N/2v_{S}=N/2 than the rightmost endpoint vR=N−1v_{R}=N-1 and requires the traversal of one more penalizing edge with weight −1-1. We now examine how seed sampling, concurrent UCRL and Thompson resampling behave in this setting.

In seed sampling, each kkth agent samples a seed zk∼Bernoulli(p)z_{k}\sim\text{Bernoulli}(p), which remains fixed for the entire duration of the episode. The mapping from seed zk,mz_{k,m} to sampled MDP Mk,m\mathcal{M}_{k,m} at time tk,m<Tt_{k,m}<T is determined by θ^L,k,m\hat{\theta}_{L,k,m} and θ^R,k,m\hat{\theta}_{R,k,m} which are defined as θ^L,k,m=N⋅sign(zk−0.5)\hat{\theta}_{L,k,m}=N\cdot\text{sign}(z_{k}-0.5), θ^R,k,m=−θ^L,k,m\hat{\theta}_{R,k,m}=-\hat{\theta}_{L,k,m}. After one of the KK agents traverses eLe_{L} or eRe_{R}, the sampled MDP of each kkth agent who has not terminated is the true MDP, θ^L,k,m=θL,θ^R,k,m=θR\hat{\theta}_{L,k,m}=\theta_{L},\quad\hat{\theta}_{R,k,m}=\theta_{R}, satisfying Property 1. Note that in seed sampling, among the agents who start before the true MDP is revealed, i.e., {k:tk,0<T}\{k:t_{k,0}<T\}, half go left and half go right in expectation, satisfying Property 3. Thanks to the seed zk,mz_{k,m} the sampled MDP Mk,m\mathcal{M}_{k,m} remains fixed in every step of the kkth agent’s trajectory until the true MDP is learned. Therefore, all agents commit to reaching either the left or the right endpoint of the chain depending on the seed they sampled, until the correct direction is discovered by one of the agents, satisfying Property 2. When the correct direction is revealed, the horizon H=3N/2H=3N/2 allows all agents who have picked the wrong direction but have not yet terminated to change their trajectory and eventually to reach the correct endpoint.

In concurrent UCRL, the agents are initially optimistic that they can achieve the maximum attainable reward, which is N/2+1N/2+1 in the scenario that the rightmost edge (i.e., the closest one to the start) has the positive weight, θR=N\theta_{R}=N. Each kkth agent at time tk,m<Tt_{k,m}<T chooses an MDP that is defined as θ^L,k,m=−N\hat{\theta}_{L,k,m}=-N, θ^R,k,m=N\hat{\theta}_{R,k,m}=N. Therefore, all agents who start before the true MDP is revealed, i.e., {k:tk,0<T}\{k:t_{k,0}<T\} go right, violating Property 3. Note that, in this particular example, diversification is not essential to exploration, since going towards a single direction will still reveal the true MDP. When the correct direction is revealed and it is not the rightmost endpoint, all agents who have not terminated change their trajectory and eventually reach the correct endpoint. If the correct direction is the rightmost endpoint, no agent has to change trajectory.

In Thompson resampling, each kkth agent at time tk,m<Tt_{k,m}<T samples an MDP which is defined as θ^L,k,m=N⋅sign(Bernoulli(p)−0.5)\hat{\theta}_{L,k,m}=N\cdot\text{sign}\left(\text{Bernoulli}(p)-0.5\right), θ^R,k,m=−θ^L,k,m\hat{\theta}_{R,k,m}=-\hat{\theta}_{L,k,m}. Note that for two subsequent time periods tk,m<tk,m+1<Tt_{k,m}<t_{k,m+1}<T, the sampled MDP of the kkth agent may differ due to randomness in drawing a Bernoulli(p)\text{Bernoulli}(p) sample each time. Therefore, the kkth agent who decided to go towards one direction at time tk,mt_{k,m} may change his decision and go towards the opposite direction at time tk,m+1t_{k,m+1}, violating Property 2. In this setting, violation of Property 2 is detrimental to exploration. The horizon HH of each one of the KK agents is consumed to meaningless oscillations and it is very difficult for any agent to reach either endpoint of the chain. The larger the number of vertices in the chain is, the more unlikely becomes for any agent to ever discover the true MDP.

Figure 3 shows the mean regret per agent for N=100N=100 number of vertices in the chain as the number of concurrent agents increases. The figure presents averages over hundreds of simulations. As the number of agents increases, in seed sampling and concurrent UCRL more and more agents have not yet started their trajectory or moved further away from the start towards the wrong direction the moment the true MDP is revealed. Therefore the mean regret per agent decreases. On the other hand, in Thompson resampling, the lack of commitment to exploring either direction prevents the true MDP to be discovered before the horizon expires, even for a very large number of agents. As a result the mean regret per agent does not improve.

2 Parallel Chains

Consider the directed graph of Figure 2 and the description of Example 3 in Section 2. The agents’ objective is to maximize the accrued reward by choosing the chain whose last edge has the largest weight c∗=argmax⁡cθcc^{*}=\operatorname*{argmax}_{c}\theta_{c}. Recall that the weight of the last edge of chain cc is denoted as θc\theta_{c} and θ=(θ1,…,θC)\theta=\left(\theta_{1},\dots,\theta_{C}\right) When the last edge of chain cc is traversed, the reward is a noisy observation of θc\theta_{c} such that rc∣θ∼N(θc,σ2)r_{c}|\theta\sim\mathcal{N}(\theta_{c},\sigma^{2}). However, the agents do not know the true value θ\theta and they share a common, well-specified prior on it. Assume that all the θc\theta_{c}, c=1,…,Cc=1,\dots,C are independent and that the prior on the ccth chain’s last edge weight is N(μc,σc2)\mathcal{N}(\mu_{c},\sigma_{c}^{2}). Further assume that ∀c∈{1,…,C}\forall c\in\{1,\dots,C\}, the prior mean is the same, μc=μ0\mu_{c}=\mu_{0}, and the prior variance increases as we move from higher to lower chains, σc2=σ02+c\sigma_{c}^{2}=\sigma_{0}^{2}+c.

In this setting, martingalean-Gaussian seed sampling, standard-Gaussian seed sampling and Thompson resampling are expected to have identical performance. Thanks to sampling the seeds independently, the martingalean-Gaussian seed sampling and standard-Gaussian seed sampling agents construct MDPs in which different chains appear to be optimal. This is also the case for Thompson resampling agents, who sample their MDPs independently from the prior. As a result, the martingalean-Gaussian seed sampling, standard-Gaussian seed sampling and Thompson resampling agents are directed to different chains and satisfy Property 3. Note that, unlike martingalean-Gaussian seed sampling and standard-Gaussian seed sampling, Thompson resampling does not satisfy Property 2 but in this setting this does not impact the learning performance. A Thompson resampling agent kk may draw an MDP at time tk,0t_{k,0} in which chain cc is optimal, but due to resampling at time tk,1t_{k,1} his belief may change and another chain c′≠cc^{\prime}\neq c may appear to be optimal. However, since transitions from one chain to another are not possible in the directed graph of Figure 2, the agent has no choice but exploring his initial choice, which is chain cc. Even if inherently Thompson resampling lacks the commitment of martingalean-Gaussian seed sampling and standard-Gaussian seed sampling, the structure of the problem forces the Thompson resampling agents to maintain intent and perform equally well.

On the other hand, the concurrent UCRL agents are optimistic that they can achieve the maximum attainable reward and they are all directed to chain CC for which the upper confidence bound of the weight of the last edge is the largest. Once enough agents have traversed the last edge of chain CC and the posterior variance on θC\theta_{C} becomes lower than the prior variance on θC−1\theta_{C-1}, the optimistic driven behavior directs the agents who have not left the source to chain C−1C-1. As long as there are agents who have not left the source, this way of exploration repeats until some agents are directed to chain 11. The violation of Property 3 leads to a wasteful allocation of the agents’ exploratory effort, as all agents are directed to gather similar information. This is detrimental to learning performance, as an agent kk with a later activation time tk,0t_{k,0} will not have all the information to make the optimal choice of chain that he could have made if the agents who started before him had explored all the chains.

Consider the specification of the problem with C=10C=10 chains, horizon (or equivalently number of vertices in each chain) H=5H=5, θc∼N(0,100+c)\theta_{c}\sim\mathcal{N}(0,100+c), ∀c∈{1,…,C}\forall c\in\{1,\dots,C\} and likelihood of observed reward when the last edge of chain cc is traversed rc∣θc∼N(θc,1)r_{c}|\theta_{c}\sim\mathcal{N}(\theta_{c},1).

Figure 4a shows the mean regret per agent achieved by the algorithms as the number of agents increases and Figure 4b shows the cumulative regret of 100,000100,000 concurrent agents, with the agents ordered in ascending activation time tk,0t_{k,0}. Both figures present averages over hundreds of simulations.

The figures demonstrate that UCB approaches to concurrent reinforcement learning do not efficiently coordinate, and as a result, performance may suffer severely. In order for concurrent UCRL to achieve the same mean regret per agent that martingalean-Gaussian seed sampling, standard-Gaussian seed sampling and Thompson resampling achieve with 100 agents, 100,000 agents are required.

3 Maximum Reward Path

We now present the performance of the algorithms in a more complex problem. Consider the description of Example 1. The agents start from the same vertex and their goal is to make HH edge traversals that will return the highest reward. Initially, the agents do not know the edge weights. The edge weights are assumed to be independent and the agents share a common prior N(μe,σe2)\mathcal{N}(\mu_{e},\sigma_{e}^{2}) over ln⁡θe\ln\theta_{e}, ∀e∈E\forall e\in\mathcal{E}. Every time edge ee is traversed, the observed reward rer_{e} is distributed according to ln⁡re∣θe∼N(ln⁡θe−σ2/2,σ2)\ln r_{e}|\theta_{e}\sim\mathcal{N}(\ln\theta_{e}-\sigma^{2}/2,\sigma^{2}) and the common posterior of all agents is updated according to μe←σ2μe+σe2(ln⁡re+σ2/2)σe2+σ2\mu_{e}\leftarrow\frac{\sigma^{2}\mu_{e}+\sigma_{e}^{2}\left(\ln r_{e}+\sigma^{2}/2\right)}{\sigma_{e}^{2}+\sigma^{2}} and σe2←σe2σ2σe2+σ2\sigma^{2}_{e}\leftarrow\frac{\sigma_{e}^{2}\sigma^{2}}{\sigma_{e}^{2}+\sigma^{2}}. The kkth agent, at time tk,mt_{k,m}, m=1,…,Hm=1,\dots,H, constructs MDP Mk,m=θ^k,m={θ^k,m,e,e∈E}\mathcal{M}_{k,m}=\hat{\theta}_{k,m}=\{\hat{\theta}_{k,m,e},e\in\mathcal{E}\} and from vertex vk,mv_{k,m} computes the maximum reward path of H−m+1H-m+1 steps.

In Thompson resampling, the kkth agent’s sampled MDPs at time tk,mt_{k,m} and time tk,m+1t_{k,m+1} may differ significantly. Part of this difference is due to the fact that for some edges observations were made between tk,mt_{k,m} and tk,m+1t_{k,m+1}. However, Mk,m\mathcal{M}_{k,m} and Mk,m+1\mathcal{M}_{k,m+1} may also have different weights for edges that were not traversed between tk,mt_{k,m} and tk,m+1t_{k,m+1} due to randomness. Therefore, the kkth agent may be enticed to redirect towards an edge which has a large weight in Mk,m+1\mathcal{M}_{k,m+1} but did not have a large weight in Mk,m\mathcal{M}_{k,m}, even if this change in beliefs is not substantiated by true observations. As a result, Thompson resampling agents violate Property 2 and are susceptible to myopic behavior, which harms the agents’ ability to explore deep in the graph in order to identify the maximum reward path of fixed length.

In concurrent UCRL, the agents are immune to the distractions suffered by Thompson resampling agents, as they construct deterministic upper confidence bounds from the common posteriors on the edge weights. However, the kkth agent at time tk,mt_{k,m} and the k′k^{\prime}th agent at time tk′,m′>tk,mt_{k^{\prime},m^{\prime}}>t_{k,m} have identical beliefs on all the edges that have not been observed between tk,mt_{k,m} and tk′,m′t_{k^{\prime},m^{\prime}}. Therefore, the path chosen by k′k^{\prime}th agent may be very similar or even identical to the path chosen by kkth agent. This lack of diversity (Property 3) delays the exploration of the graph’s edges and the identification of the maximum reward path of fixed length.

In standard-Gaussian seed sampling or martingalean-Gaussian seed sampling, each agent samples a seed independently and constructs an MDP by using this seed and the mapping detailed in Section 3.2.2 or Section 3.2.3 respectively. The fact that each agent samples a seed independently leads, thanks to randomness, to MDPs with very different edge weights for the edges that have not been traversed yet. As a result, agents pursue diverse paths. At the same time, maintaining a constant seed ensures that each agent adjusts his beliefs in subsequent time periods in a manner that is consistent with the observations made by all agents and not driven by further randomness that would be distracting to the agent’s exploration.

Consider the specification of the problem in which we sample Erdős-Rényi graphs with number of vertices N=100N=100 and edge probability p=2ln⁡N/Np=2\ln N/N. The edge weights θ\theta are independent and the common prior of the agents on the edge weights is ln⁡θe∼N(0,4)\ln\theta_{e}\sim\mathcal{N}(0,4), ∀e∈E\forall e\in\mathcal{E}. When edge ee is traversed, the observed reward rer_{e} is distributed according to ln⁡re∣θe∼N(ln⁡θe−0.005,0.01)\ln r_{e}|\theta_{e}\sim\mathcal{N}(\ln\theta_{e}-0.005,0.01). The horizon (i.e. length of the maximum reward path to be found) is H=10H=10.

In Figure 5, we show the performance of all algorithms. The results are averaged over hundreds of simulations. Standard-Gaussian seed sampling and martingalean-Gaussian seed sampling achieve the lowest cumulative regret, as they adhere to all the properties of coordinated exploration. Concurrent UCRL follows with 49.9% higher cumulative regret than the seed sampling algorithms. Concurrent UCRL does not satisfy the diversity property, and incurs much larger cumulative regret than the seed sampling algorithms, but does better than Thompson resampling because, unlike the latter, it satisfies the commitment property which is essential in deep exploration. Thompson resampling has 191% higher cumulative regret than the seed sampling algorithms.

Closing Remarks

Concurrent reinforcement learning is poised to play an important role across many applications, ranging from web services to autonomous vehicles to healthcare, where each agent is responsible for a user, vehicle or patient. To learn efficiently in such settings, agents should coordinate the exploratory effort. We presented three properties that are essential to efficient coordinated exploration: real-time adaptivity to shared observations, commitment to carry through with action sequences that reveal new information, and diversity across learning opportunities pursued by different agents. We demonstrated that optimism-based approaches fall short with respect to diversity, while naive extensions of Thompson sampling lack the requisite level of commitment. We proposed seed sampling, a novel extension of PSRL that does satisfy these properties. We presented several seed sampling schemes, customized for particular priors and likelihoods, but the seed sampling concept transcends these specific cases, offering a general approach to more broadly designing effective coordination algorithms for concurrent reinforcement learning. Much work remains to be done on this topic. For starters, it would be useful to develop a mathematical theory that sharpens understanding of the efficiency and robustness of seeding schemes. Beyond that, work is required to develop seeding schemes that operate in conjunction with practical scalable reinforcement learning algorithms that approximate optimal value functions and policies for problems with intractable state and action spaces.

References