How does Your RL Agent Explore? An Optimal Transport Analysis of Occupancy Measure Trajectories

## Abstract

Abstract The rising successes of RL are propelled by combining smart algorithmic strategies and deep architectures to optimize the distribution of returns and visitations over the state-action space.
A quantitative framework to compare the learning processes of these eclectic RL algorithms is currently absent but desired in practice.
We address this gap by representing the learning process of an RL algorithm as a sequence of policies generated during training, and then studying the policy trajectory induced in the manifold of state-action occupancy measures.
Using an optimal transport-based metric, we measure the length of the paths induced by the policy sequence yielded by an RL algorithm between an initial policy and a final optimal policy.
Hence, we first define the Effort of Sequential Learning (ESL) . ESL quantifies the relative distance that an RL algorithm travels compared to the shortest path from the initial to the optimal policy.
Further, we connect the dynamics of policies in the occupancy measure space and regret (another metric to understand the suboptimality of an RL algorithm), by defining the Optimal Movement Ratio (OMR). OMR assesses the fraction of movements in the occupancy measure space that effectively reduce an analogue of regret.
Finally, we derive approximation guarantees to estimate ESL and OMR with finite number of samples and without access to an optimal policy.
Through empirical analyses across various environments and algorithms, we demonstrate that ESL and OMR provide insights into the exploration processes of RL algorithms and hardness of different tasks in discrete and continuous MDPs.

## 1 Introduction

In recent years, significant advancements in Reinforcement Learning (RL) have been achieved in developing exploration techniques that improve learning (Bellemare et al., ; Burda et al., ; Eysenbach et al., ) along with new learning methods (Lazaridis et al., ; Müller et al., ; Li, ).
With growing computational resources, these techniques have led to various successful applications of RL, such as playing games up to human proficiency (Silver et al., ; Jaderberg et al., ), controlling robots (Ibarz et al., ; Kaufmann et al., ), tuning databases and computer systems (Wang et al., ; Basu et al., ), etc.
However, there remains a lack of consensus over approaches that can quantitatively compare these exploratory processes across RL algorithms and tasks (Seijen et al., ; Amin et al., ; Ladosz et al., ). This is attributed to some methods being algorithm-specific (Tang et al., ), while others provide theoretical guarantees for very specific settings (Lattimore & Szepesvári, ; Agarwal et al., ).
Thus, comparing the exploratory processes of these eclectic algorithms across the multi-directional space of RL algorithm design, emerges as a natural question. However, the present literature lacks a metric to compare them except regret, which is often hard to estimate (Ramos et al., ; ).

This paper aims to address this gap based on two key observations.
First, we observe from the linear programming formulation of RL that solving the value maximization problem is equivalent to finding an optimal occupancy measure (Syed et al., ; Neu & Pike-Burke, ; Kalagarla et al., ).
Occupancy measure is the distribution of state-action pair visits induced by a policy (Altman, ; Laroche & des Combes, ). Under mild assumptions, a policy maps uniquely to an occupancy measure.
Second, we observe that any RL algorithm learns by sequentially updating policies starting from an initial policy to reach an optimal policy.
The search for an optimal policy is influenced by the exploration-exploitation strategy and functional approximators, both of which impact the overall performance of the agent by determining the quality of experiences from which it learns (Zhang et al., ; Ladosz et al., ).
Hereby, we term collectively the learning strategy and the exploration-exploitation interplay as the exploratory process.

Contributions. 1. A Framework. Motivated by our observations, we abstract any RL algorithm as a trajectory of occupancy measures induced by a sequence of policies between an initial and a final (optimal) policy.
The occupancy measure of a policy given an environment corresponds to the data-generating distribution of state-actions. Thus, we can quantify the effort of each policy update, i.e. the effort to shift the state-action data distributions, as the transportation distance between their occupancy measures. The total effort of learning by the algorithm can be measured as the total distance covered by its occupancy measure trajectory.
We provide a mathematical basis for this quantification by proving that the space of occupancy measures is a differentiable manifold for smoothly parameterized policies (Section 3).
Hence, we can compute the length of the occupancy measure trajectory on this manifold using Wasserestein distance as the metric (Villani, ).

2. Effort of Sequential Learning. In contrast to RL, if we knew the optimal policy we could update our initial policy directly via supervised or imitation learning. Effort of this learning is represented by a direct, shortest (geodesic) path from initial to optimal policy on the occupancy measure manifold.
To quantify the cost of the exploratory process to learn the environment, we define the Effort of Sequential Learning (ESL) as the ratio of the (indirect) path traversed by an RL algorithm in the occupancy measure space to the direct distance between the initial and optimal policy (Section 3.1). Lower ESL implies more efficient exploratory process.

3. Efforts to learn that lead to Regret-analogue minimization. Regret is a widely used optimality measures for reward-maximizing RL algorithms (Sutton & Barto, ). It measures the total deviation in the value functions achieved by a sequence of policies learned by an RL algorithm with
respect to the optimal algorithm that always uses the optimal policy (Sinclair et al., ). We show that regret is related to the sum of distances between the optimal policy and each policy in the sequence learned by the RL algorithm, in the occupancy measure space. We can define an analogue of instantaneous regret (at any one step during learning rather than cumulative), in the occupancy measure space, as the geodesic distance between the occupancy measure of the policy at this step in the learning sequence, and the optimal one. We find that not all policy updates lead to a reduction in this analogue of immediate regret, and thus define another index Optimal Movement Ratio that measures the fraction that do (Section 3.2).

4. Computational and Numerical Insights. We prove sample complexity guarantees to approximate ESL and OMR in practice as we do not have access to the occupancy measures but collection of rollouts from the corresponding policies (Section 4). We show the relation of empirical OMR and ESL to the true ones if the optimal policy is never reached by an algorithm. We conduct experiments on multiple environments, both discrete and continuous, with sparse and dense rewards, comparing state-of-the-art algorithms. We observe that by visualizing aspects of the path traversed (and by comparing ESL and OMR), we are able to compare and provide insights into their exploratory processes and the impact of task hardness on them (Section 5). The results confirm the ubiquity and effectiveness of our approach to study the exploratory processes of RL algorithms.

## 2 Preliminaries

Markov Decision Processes. Consider an agent interacting with an environment in discrete timesteps. At each timestep ${t}\in\mathbb{N}$, the agent observes a state ${s_{t}}$, executes an action ${a_{t}}$, and receives a scalar reward ${\mathcal{R}(s_{t},a_{t})}$. The behaviour of the agent is defined by a policy ${\pi}(a_{t}|s_{t})$, which maps the observed states to actions. The environment is modelled as a Markov Decision Process (MDP) $\mathbb{M}$ with a state space $\mathcal{S}$, action space $\mathcal{A}$, transition dynamics $\mathcal{T}:\mathcal{S}\times\mathcal{A}\to\mathcal{S}$, and reward function ${\mathcal{R}:\mathcal{S}\times\mathcal{A}\to\mathbb{R}}$. During task execution, the agent issues actions in response to states visited, and hence a sequence of states and actions ${h_{t}=(s_{0},a_{0},s_{1},a_{1},...,s_{t-1},a_{-1},s_{t})}$, here called a rollout, is observed.

In infinite-horizon settings, the state value function for a given policy $\pi$ is the expected discounted cumulative reward over time ${V_{\pi}(s)\triangleq\mathbb{E}_{\pi}\left[\sum_{t=0}^{\infty}\gamma^{t}
\mathcal{R}(s_{t},a_{t})\mid s_{0}=s\right]}$, where ${\gamma\in[0,1)}$ is the discount rate. The goal is to learn a policy that maximises the objective ${J^{\pi}_{\mu}\triangleq\mathbb{E}_{s\sim\mu}[V_{\pi}(s)]}$, where $\mu(s)$ is the initial state distribution.

Occupancy Measure.
The state-action occupancy measure is a distribution over the ${\mathcal{S}\times\mathcal{A}}$ space that represents the discounted frequency of visits to each state-action pair when executing a policy ${\pi}$ in the environment (Syed et al., ). Formally, the occupancy measure of $\pi$ is $v_{\pi}(s,a)\triangleq\rho\sum_{t=0}^{\infty}\gamma^{t}\mathbb{P}(s_{t}=s,a_{t
}=a\mid\pi,\mu)$, where $\rho=1-\gamma$ is the normalizing factor.

Stationary Markovian policies allow a bijective correspondence with their state-action occupancy measures (Givchi, ). We express the objective $J^{\pi}_{\mu}$ in terms of the occupancy measure as

$$ $J^{\pi}_{\mu}=\frac{1}{\rho}\mathbb{E}_{(s,a)\sim v_{\pi}}\left[\mathcal{\bar{ R}}(s,a)\right],$ (1) $$

where $\mathcal{\bar{R}}(s,a)$ is the expected immediate reward for the state-action pair $(s,a)$.

Wasserstein Distance. Let $\mu,\nu\in\mathcal{P}(\mathcal{X})$ be probability measures on a complete and separable metric (Polish) space $(\mathcal{X},d_{\mathcal{X}})$. The p-Wasserstein distance between $\mu$ and $\nu$ is (Villani, )

$$ $\displaystyle\mathcal{W}_{p}(\mu,\nu)\triangleq\left(\min_{\pi\in\Pi(\mu,\nu)} \int_{\mathcal{X}\times\mathcal{X}}c(x,x^{\prime})\,d\pi(x,x^{\prime})\right)^ {1/p}\,,$ (2) $$

where the cost function is given by the metric as $c(x,x^{\prime})=(d_{\mathcal{X}}(x,x^{\prime}))^{p}$ for some $p\geq 1$. ${\Pi(\mu,\nu)}$ is a set of all admissible transport plans between $\mu$ and $\nu$, i.e. probability measures on $\mathcal{X}\times\mathcal{X}$ space with marginals $\mu$ and $\nu$. We consider the 1-Wasserstein distance where $p=1$.

MDPs with Lipschitz Rewards.
Following Pirotta et al. () and Kallel et al. (), we assume an MDP with $L_{\mathcal{R}}$-Lipschitz rewards (ref. Appendix A.1 for elaboration) that satisfies
$|\mathcal{\bar{R}}(s,a)-\mathcal{\bar{R}}(s^{\prime},a^{\prime})|\leq L_{
\mathcal{R}}d_{\mathcal{S}\mathcal{A}}((s,a),(s^{\prime},a^{\prime}))$ for all $s,s^{\prime}\in\mathcal{S}$ and $a,a^{\prime}\in\mathcal{A}$.
Here, $d_{\mathcal{S}\mathcal{A}}((s,a),(s^{\prime},a^{\prime}))=d_{\mathcal{S}}((s,s
^{\prime}))+d_{\mathcal{A}}((a,a^{\prime}))$ is the metric defined on the joint state-action space $\mathcal{S}\times\mathcal{A}$.
This is a weaker condition than assuming a completely Lipschitz MDP. Pirotta et al. () showed that for any pair of stationary policies $\pi$ and $\pi^{\prime}$, the absolute difference between their corresponding objectives is

$$ $\left|J^{\pi}_{\mu}-J^{\pi^{\prime}}_{\mu}\right|\leq\frac{L_{\mathcal{R}}}{ \rho}\mathcal{W}_{1}(v_{\pi},v_{\pi^{\prime}})\,,$ (3) $$

where $\mathcal{W}_{1}(v_{\pi},v_{\pi^{\prime}})$ is the 1-Wasserstein distance between the occupancy measures of the policies (ref. Appendix A.2 for details).

## 3 RL Algorithms as Trajectories of Occupancy Measures

The exploration process (i.e. the exploration-exploitation interplay and learning strategy) of an RL algorithm, influence how the policy model updates its policies (Kaelbling et al., ; Sutton & Barto, ). During training, a policy trajectory, i.e. sequence of policies $(\pi_{0},\pi_{1},\dots,\pi_{N})$, is generated during policy updates due to the exploratory process. We assume these policies belong to a set of stationary Markov policies parameterised by $\theta$. For policies in this set $\pi_{\theta}\in\mathbf{\Gamma}_{\theta}$, we define the space of occupancy measures corresponding to $\mathbf{\Gamma}_{\theta}$ as $\mathcal{M}=\{v_{\pi_{\theta}}(s,a)\mid\pi_{\theta}\in\mathbf{\Gamma}_{\theta}
,\theta\in\mathbb{R}^{N_{\theta}}\}$.

###### Proposition 1 (Properties of $\mathcal{M}$ ) .

If the policy $\pi$ has a smooth parameterization $\theta$ and the inverse of $P^{\pi}(s,s^{\prime})\triangleq\sum_{a}T(s\mid s^{\prime},a)\pi(a\mid s^{
\prime})$ exists, then the space of occupancy measures $\mathcal{M}$ is a differentiable manifold.
(Proof in Appendix A.3)

Thus, we can compute the length of any path on this differentiable manifold $\mathcal{M}$ using an appropriate metric. The manifold $\mathcal{M}$ of occupancy measures is endowed with a 1-Wasserstein metric to compute the distance between occupancy measures corresponding to policies parameterized by $\theta,\theta+d\theta\in\mathcal{M}$ as $ds=\mathcal{W}_{1}(v_{\pi_{\theta}},v_{\pi_{\theta+d\theta}})$. In imitation learning, the 1-Wasserstein distance between the occupancy measures of the learner and expert can be used as a minimizable loss function to learn the expert’s policy (Zhang et al., ). Hence, the 1-Wasserstein distance reflects the effort required to achieve this imitation learning. Similarly, we propose the following quantification for the effort to update from one policy to another.

###### Definition 1 (Effort of Learning) .

We define the 1-Wasserstein metric between occupancy measures of two policies $\pi$ and $\pi^{\prime}$, i.e. $\mathcal{W}_{1}(v_{\pi},v_{\pi^{\prime}})$, as the effort required to learn or update from one policy to the other.

Therefore, when a learning process causes an update between occupancy measures in $\mathcal{M}$, we attribute the resulting update effort to the learning process and refer to it as the effort of learning. In a learning process, first the initial policy $\pi_{0}$ is obtained typically by randomly sampling the model parameters, then these parameters $\theta$ undergo updates until a predefined convergence criterion is satisfied, yielding the final optimal policy $\pi_{N}=\pi^{*}$. Since each policy has a corresponding occupancy measure, this process yields a sequence of points on $\mathcal{M}$, which can be connected by geodesics between successive points, producing a curve. The length of the curve is computed by the summation of the finite geodesic distances between consecutive policies along it (Lott, )

$$ $C\triangleq\sum_{k=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{\theta_{k}}},v_{\pi_{\theta _{k+1}}})\,,$ (4) $$

where $\theta_{0}$ and $\theta_{N}$ are respectively the initial and final parameter values before and after learning.

###### Proposition 1 (Properties of ℳ ℳ \mathcal{M} caligraphic_M ) .

###### Definition 1 (Effort of Learning) .

### 3.1 Effort of Sequential Learning (ESL)

As we saw above, RL generates a trajectory in the occupancy measure manifold $\mathcal{M}$, whose length is given by Equation (4). Compared to the long trajectory of sequential policies generated by the exploratory process, the geodesic $L$ is the ideal, shortest path to the optimal policy $\pi_{N}=\pi^{*}$ from $\pi_{0}$, whose length is $L=\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})$. This path would be taken by an imitation-learning oracle algorithm that knows $\pi^{*}$. Both these paths are schematically depicted in Figure 2.

Figure: Figure 1: Schematic of the policy trajectory $C$ in the space of occupancy measures $\mathcal{M}$ during RL training (solid line) vs. the geodesic $L$ (shortest path, dashed line) between the initial and final points (i.e. $\pi_{0}$ and $\pi_{N}=\pi^{*}$).
Refer to caption: extracted/5930571/images/schematic_space.png

###### Definition 2 (Effort of Sequential Learning (ESL)) .

We define the effort of sequential learning incurred by a trajectory of the exploratory process of an RL algorithm, relative to the oracle that knows $\pi^{*}(=\pi_{N})$, as

$$ $\eta\triangleq\frac{\sum_{k=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi_{k+1}}) }{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}$ (5) $$

Due to the stochasticity of the exploratory process, we introduce an expectation to obtain $\bar{\eta}=\mathbb{E}_{\pi_{0},\mu}\left[\mathrm{\eta}\right]$. We refer to $\bar{\eta}$ as the effort of sequential learning (ESL).

Note that $\bar{\eta}\geq 1$, and a larger $\bar{\eta}$ corresponds to a less efficient exploratory process of the RL algorithm. Hence, an RL algorithm with $\bar{\eta}\approx 1$ closely mimics the oracle and has an efficient exploratory process.

###### Definition 2 (Effort of Sequential Learning (ESL)) .

### 3.2 Optimal Movement Ratio (OMR)

Regret measures the total deviation in value functions incurred by a sequence of policies learned by an RL algorithm with respect to the optimal algorithm that always uses the optimal policy (Sinclair et al., ). We show that regret is connected to the sum of distances from each policy in the sequence learned by an RL algorithm to the optimal policy in the occupancy measure space.

###### Proposition 2 (Regret and Occupancy Measures) .

Given an MDP with $L_{\mathcal{R}}$-Lipschitz rewards, we obtain
$\text{Regret}\triangleq\sum_{k=1}^{N}\left(J^{\pi^{*}}_{\mu}-J^{\pi_{k}}_{\mu}
\right)\leq\frac{L_{\mathcal{R}}}{\rho}\sum_{k=1}^{N}\mathcal{W}_{1}(v_{\pi_{k
}},v_{\pi^{*}})$. (Proof in Appendix A.4)

We refer to $\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi^{*}})$ as the distance-to-optimal, and analogously use it as the expected immediate regret in the occupancy measure space. Furthermore, we refer to $\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi_{k+1}})$ as stepwise-distance. Interestingly, during training, the distance-to-optimal and stepwise-distance share a relationship illustrated in Figure 2. From Figure 2, we observe that if the change in distance-to-optimal, $\delta_{k}\triangleq\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi^{*}})-\mathcal{W}_{1}(v
_{\pi_{k+1}},v_{\pi^{*}})>0$, it indicates that the agent got closer to the optimal. We define the set $K^{+}$ as containing indices $k$ for which $\delta_{k}>0$, while $K^{-}$ contains the rest.

###### Definition 3 (Optimal Movement Ratio (OMR)) .

We define the proportion of policy transitions that effectively reduce the distance-to-optimal, in a learning trajectory, as

$$ $\displaystyle\kappa$ $\displaystyle\triangleq\frac{\sum_{k\in K^{+}}\mathcal{W}_{1}(v_{\pi_{k}},v_{ \pi_{k+1}})}{\sum_{k=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi_{k+1}})}\,.$ (6) $$

Due to the stochasticity of the exploratory process, we introduce an expectation to obtain $\bar{\kappa}=\mathbb{E}_{\pi_{0},\mu}\left[\kappa\right]$. We refer to $\bar{\kappa}$ as the optimal movement ratio (OMR).

Note that $\bar{\kappa}\in[0,1]$, and $\bar{\kappa}\to 1$ indicates that nearly all the policy updates reduce the distance-to-optimal, thus showing high efficiency. $\bar{\kappa}\to 0$ implies low efficiency, since only a small fraction of the policy updates contribute towards the reduction of the distance-to-optimal.

###### Proposition 2 (Regret and Occupancy Measures) .

###### Definition 3 (Optimal Movement Ratio (OMR)) .

### 3.3 Extension to Finite-Horizon Episodic Setting

In the episodic finite-horizon MDP formulation of RL, in short Episodic RL (Osband et al., ; Azar et al., ; Ouhamma et al., ), the agent interacts with the environment in multiple episodes of $H$ steps. An episode starts by observing state $s_{1}$. Then, for $t=1,\ldots H$, the agent draws action $a_{t}$ from a (possibly time-dependent) policy $\pi_{t}(\cdot\mid s_{t})$, observes the reward $r(s_{t},a_{t})$, and transits to a state $s_{t+1}\sim T(\cdot\mid s_{t},a_{t})$. Here, the value function and the state-action value functions at step $h\in[H]$ are defined as $V_{h}^{\pi}(s)\triangleq\mathbb{E}_{\mathbb{M},\pi}\left[\sum_{t=h}^{H}r(s_{t}
,a_{t})\mid s_{h}=s\right]$, and $Q_{h}^{\pi}(s,a)\triangleq\mathbb{E}_{\mathbb{M},\pi}\left[\sum_{t=h}^{H}r(s_{
t},a_{t})\mid s_{h}=s,a_{h}=a\right]$.
Following (Altman, ), we can define a finite-horizon version of occupancy measures as

$$ $\displaystyle v^{H}_{\pi}(s,a)\triangleq\frac{1}{H}\sum_{t=1}^{H}\mathbb{P}(s_ {t}=s,a_{t}=a\mid\pi,\mu).$ (7) $$

Following (Syed et al., ), we can show that $v^{H}_{\pi}$ satisfies the linear programming description of value function maximization along with the Bellman flow constraints (ref. Sec II.C. in Kalagarla et al. ()). Additionally, we prove that under some assumptions, the finite-horizon occupancy measures also construct a manifold, referred as $\mathcal{M}^{H}$.

###### Proposition 3 (Properties of $\mathcal{M}^{H}$ ) .

If the policy $\pi$ has a smooth parametrization $\theta$ and the inverses of both $(\mathbb{I}-P^{\pi})$ and $P^{\pi}$ exist, then the space of finite-horizon occupancy measures $\mathcal{M}^{H}$ is a differentiable manifold. (Proof in Appendix A.5)

This allows us to similarly define a Wasserstein metric on this manifold, which in turn, allows us to compute ESL and OMR to evaluate different RL algorithms.

###### Proposition 3 (Properties of ℳ H superscript ℳ 𝐻 \mathcal{M}^{H} caligraphic_M start_POSTSUPERSCRIPT italic_H end_POSTSUPERSCRIPT ) .

## 4 Computational Challenges and Solutions

Similar to regret, our method requires knowing the optimal policy. This is because the efficiency and effectiveness of exploratory processes of RL algorithms are highly coupled with their ability to reach optimality. ESL and OMR depend on the policies being stationary and Markovian.

### 4.1 Policy datasets for computing occupancy measures

We consider approximations of occupancy measures using datasets assumed to be drawn from these measures. We estimate the Wasserstein distance between the occupancy measures using a method introduced by Alvarez-Melis & Fusi () known as the optimal transport dataset distance (OTDD). OTDD uses datasets to estimate the Wasserstein distance between the underlying distributions. See Appendix A.6 for a detailed account on OTDD.

Definition 4 (Policy dataset). A dataset of a policy $\mathcal{D}_{\pi}$ is a set of state-action pairs drawn from the policy’s occupancy measure, i.e. $\mathcal{D}_{\pi}=\{(s_{(i)},a_{(i)})\}_{i=1}^{m}\sim v_{\pi}$. These can be constituted from the rollouts generated by the policy during task execution.

We know from imitation learning literature that if we are given $\mathcal{D}_{\pi}$, generated by an expert policy, we can train a policy model on it in a supervised manner via behaviour cloning (Hussein et al., ). Thus, knowing $\mathcal{D}_{\pi}$ can allow converting an RL task into a Supervised Learning (SL) task. Consider a scenario when we have access to a sequence of datasets $(\mathcal{D}_{\pi_{0}},\dots,\mathcal{D}_{\pi_{N}})$, each corresponding to policy $\pi_{t}$ for ${t\geq 0}$. If we train (in a supervised manner) a policy model sequentially on these datasets, the model will undergo a similar policy evolution as via the RL algorithm that generated the policy trajectory $(\pi_{t})_{t\geq 0}$. This allows us to conceptualise learning in RL as a sequence of SL tasks with sequential transfer learning across the datasets $(\mathcal{D}_{\pi_{0}},\dots,\mathcal{D}_{\pi_{N}})$. We employ OTDD to estimate $W_{1}(v_{\pi_{k}},v_{\pi_{k+1}})$ using these datasets, i.e. $d_{OT}(\mathcal{D}_{\pi_{k}},\mathcal{D}_{\pi_{k+1}})\approx W_{1}(v_{\pi_{k}}
,v_{\pi_{k+1}})$, based on Proposition 4.

###### Proposition 4 (Upper Bound on Estimation Error) .

Let an RL algorithm yield a sequence of policies $\pi_{0},\ldots,\pi_{N}$ while training. Now, we construct $N$ datasets $\mathcal{D}_{\pi_{0}},\dots,\mathcal{D}_{\pi_{N}}$, each consisting of $M$ rollouts of the corresponding policies. Then, we can use these datasets to approximate $\sum_{k=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{\pi_{k}}},v_{\pi_{\pi_{k+1}}})$ by $\sum_{k=0}^{N-1}d_{OT}(\mathcal{D}_{\pi_{k}},\mathcal{D}_{\pi_{k+1}})$ with an expected error upper bound $\frac{2N\mathcal{E}_{2}}{\sqrt{M}}+N\gamma^{T+1}diam(\mathcal{SA})$.
Here, $T$ is the total number of steps per episode, $diam(\mathcal{SA})$ is the diameter of the state-action space, and $\mathcal{E}_{2}$ is a positive-valued and polylogarithmic function of $S$ and $A$. For finite horizon case, we can further reduce the error bound to $\frac{2N\mathcal{E}_{2}}{\sqrt{M}}$.

Proof of Proposition 4 is in Appendix A.7. The results support that ESL and OMR can be estimated as

$$ $\displaystyle\bar{\eta}$ $\displaystyle=\mathbb{E}_{\pi_{0},\mu}\left[\frac{\sum_{k=0}^{N-1}d_{OT}( \mathcal{D}_{\pi_{k}},\mathcal{D}_{\pi_{k+1}})}{d_{OT}(\mathcal{D}_{\pi_{0}}, \mathcal{D}_{\pi_{N}})}\right]\,,~{}\text{ and }~{}\bar{\kappa}=\mathbb{E}_{ \pi_{0},\mu}\left[\frac{\sum_{k\in K^{+}}d_{OT}(\mathcal{D}_{\pi_{k}},\mathcal {D}_{\pi_{k+1}})}{\sum_{k=0}^{N-1}d_{OT}(\mathcal{D}_{\pi_{k}},\mathcal{D}_{ \pi_{k+1}})}\right]\,.$ (8) $$

###### Proposition 4 (Upper Bound on Estimation Error) .

### 4.2 When an optimal policy is not reached

So far we have assumed that the algorithms converge at the optimal policy, i.e. $\pi_{N}=\pi^{*}$. However, this is not always true. We consider a scenario when $\pi_{N}\neq\pi^{*}$, and define

$$ $\displaystyle\eta_{sub}=\frac{\sum_{k=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{\pi_{k}} },v_{\pi_{\pi_{k+1}}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})},\pi_{N}\neq \pi^{*}\,.$ (9) $$

###### Proposition 5 .

Given $N\geq 2$ and $\pi_{0}\neq\pi_{N}\neq\pi^{*}$, we obtain

$$ $\frac{\eta-\eta_{sub}}{\eta}\leq\frac{2\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}} )}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\,.$ (10) $$

This is true due to the triangle inequalities: $\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi^{*}})+\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*
}})\geq\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})$ and $\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi_{N}})+\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^
{*}})\geq\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi^{*}})$.
Equation (10) shows that in the case where $\pi_{N}$ is close to $\pi^{*}$, then $\eta_{sub}$ is a good approximation of $\eta$, and thus, a good quantifier to determine the efficiency of the algorithm’s exploratory process. The proof is in Appendix A.8 and corresponding experimental results are in Appendix B.5.

###### Proposition 5 .

## 5 Experimental Evaluation

In this section, we evaluate the proposed methods in the 2D-Gridworld and Mountain Car (Moore, ; Brockman et al., ) environments, to analyse our methods in discrete and continuous state-action spaces respectively. The 2D-Gridworld environment is of size 5x5 with actions: {up, right, down, left}. In the gridworld, we perform experiments on 3 settings namely:- A) deterministic with dense rewards, B) deterministic with sparse rewards, and C) stochastic with dense rewards. Further details about these settings are provided in Appendix B.1. The Mountain Car environment, in our experimentation, is a deterministic MDP with dense rewards that consists of both continuous states and actions (described in detail in (Brockman et al., )). The final experiment studies how ESL scales with task hardness in several gridworld environments of varying difficulty.

Our experiments aim to address the following questions:
1. What information can the visualization of the policy evolution during RL training provide about the exploratory process of the algorithm?
2. How do ESL and OMR allow us to analyse the exploratory processes of RL algorithms?
3. Does ESL scale proportionally with task difficulty?

Summary of Results. In Section 5.1, we demonstrate that visualizing evolution of distance-to-optimal and stepwise-distance of different RL algorithms during training reveals: 1) whether the agent is stuck in suboptimal policies, 2) the aggressiveness of the exploration processes, and 3) their tendencies. We further compare ESL and OMR of different algorithms on a few environments in Section 5.2. Finally, we show in Section 5.3 that ESL scales proportionally with task difficulty, and thus, reflects the effects of task difficulty on exploration and learning.

### 5.1 Exploration Trajectories of RL Algorithms

(I) Discrete MDP.
We conducted an experiment with the following RL algorithms: 1) Tabular Q-learning with a) $\epsilon$-greedy ($\epsilon$ = 0) and b) $\epsilon$-greedy ($\epsilon$ = 1) strategies; 2) UCRL2 (Jaksch et al., ); 3) PSRL (Osband et al., ); 4) SAC (Haarnoja et al., ; Christodoulou, ); and 5) DQN (Mnih et al., ) with $\epsilon$-decay. The experiment was to solve the simple 5x5 gridworld with dense rewards, starting from top-left (0,0) reaching bottom-right (4,4). The aim of the exercise was to visualize the policy evolution of the RL algorithms in the occupancy measure space. In Figure 3, we observe behaviours of these RL algorithms in both the occupancy measure space and state space.

Figure: Figure 3: The top row showcases 3D scatter plots of distance-to-optimal (x-axis) and stepwise-distance (y-axis) across number of updates (z-axis), illustrating policy evolution in the occupancy measure space for RL algorithms: $\epsilon($=0)-greedy and $\epsilon($=1)-greedy Q-learning, UCRL2, PSRL, SAC, and DQN (left to right). The bottom row depicts the corresponding state visitation frequencies over the full training. The problem setting is deterministic with dense-rewards and 15 maximum number of steps per episode. (Larger versions of these plots are in Appendix D.1)
Refer to caption: extracted/5930571/images/policy_evolution/greedy.png

Q-learning: $\epsilon$ = 1 vs $\epsilon$ = 0.
As expected, the state visitations show $\epsilon$ = 0 (which updates the Q-table by always exploiting) to have preferred visits that form a specific path from the start to the goal-state. In contrast, $\epsilon$ = 1 (which updates the Q-table by always exploring) exhibits visitation frequencies that are similar at states equidistant from the start-state, gradually decreasing as the distance from the state-state increases. The policy evolution of $\epsilon$ = 0 is more erratic and less likely to be stuck in suboptima compared to $\epsilon$ = 1. This is because high action randomness causes the agent to select suboptimal actions, slowing the Q-table convergence and making the learning policy appear stuck until the best actions are discovered.

UCRL2 vs PSRL. The state visits of UCRL2 are more uniform, with exception of the start-state because the initial state distribution is 1 at state (0,0). This is consistent with literature since the algorithm selects exploratory state-action pairs more uniformly (Jaksch et al., ). On the other hand, PSRL selects actions according to the probability that they are optimal (Osband et al., ) which is observed based on high visit frequencies along the diagonals. Both algorithms have dispersed and erratic policy transitions, revealing that they search more aggressively by traversing broader within the occupancy measure space. They do not show any sign of being stuck or settling early on any particular policy. The exploration processes depict no interest of settling until the agent gains a good understanding of the environment. In this manner, UCRL2 and PSRL expend notable effort to reach optimality, especially UCRL2. The PSRL traverses fewer points than UCRL2 since it converges quicker, as per literature (Osband et al., ), and hence expends lower effort than UCRL2 (as shown in Table  1).

Figure: Figure 4: Top row: 3D scatter plots of distance-to-optimal and stepwise-distance over number of updates for algorithms DDPG and SAC. Bottom row: OMR($k$) versus #update, $k$, for the corresponding algorithms.
Refer to caption: extracted/5930571/images/ddpg_con/3D_1.png

Figure: Table 1: Evaluation of RL algorithms (over 40 runs) in the deterministic, dense-rewards setting for 5x5 gridworld, including Effort of Sequential Learning (ESL), Optimal Movement Ratio (OMR), number of updates to convergence (UC), and success rate (SR). Lowest ESL, highest OMR and lowest UC values are in bold, while the highest ESL value is starred ($\star$).

SAC vs DQN. The state visits of both the algorithms appear to be similar, however SAC manages to have higher visitation frequencies on the edges than DQN. Both algorithms start off without updating policies until the experience buffer is minimally filled. However, due to $\epsilon$ decay in DQN, it quickly converges since in this task acting more greedily is an advantage. SAC tends to stay at certain policies longer due to the slow “soft updates” of its target networks. However, once it begins moving it reaches the optimal fast.

In Figure 3, we see that UCRL2 explored the policy space more aggressively than the rest, which is corroborated by the highest ESL value in Table 1. In Figure 3, we also see that the most efficient search processes (in terms of closely mimicking an oracle) in this setting, have minimal changes of the policy and more proportion of updates toward optimal, e.g. $\epsilon$-greedy, DQN and SAC, as corroborated by their ESL and OMR values in Table 1.

(II) Continuous MDP. In this experiment, we use RL algorithms, DDPG (Lillicrap et al., ) and SAC (Haarnoja et al., ), to solve the Mountain Car. The experiment aims to visualize the policy evolutions of these two RL algorithms in the occupancy measure space (Figure 4).

DDPG vs SAC. Both algorithms exhibit short-distances $(<1)$ between policy updates. The algorithms depict no sign of being stuck or settling early on any particular policy, which shows their continuously exploratory nature. While they begin with maintaining almost constant mean distances-to-optimal and stepwise-distances, SAC drops its mean distance-to-optimal earlier than DDPG. Thus, SAC exhibits a lower ESL value than DDPG, which quantifies SAC’s higher efficiency (Table 3).

**Table 3: Evaluation of RL algorithms in the Mountain Car continuous MDP (over 5 runs). The variances for OMR and UC are negligible.**
| Algo. | ESL | OMR | UC | SR% |
| --- | --- | --- | --- | --- |
| DDPG | 1881$\pm$500 | 0.501 | 23500 | 100 |
| SAC | 1619$\pm$189 | 0.5 | 22700 | 100 |

Furthermore, we illustrate how OMR changes with update number $k$ in Figure 4. OMR$(k)$
is defined as the OMR starting with the $k$th policy as the initial policy, whereas only OMR is from the 0 0th policy. Details of computing OMR$(k)$ are provided in Appendix B.2. For both the algorithms, we observe that OMR$(k)$ stays almost constant at chance level ($\sim 0.5$) in the beginning, and then, sharply increases towards the last updates. This observation indicates that the policy updates are initially oblivious to policy improvement (in terms of value functions) and purely exploratory, while they align towards the optimal policy just before convergence. The efficiency of the algorithm depends on how early this transition happens. For example, it starts earlier for SAC than DDPG rendering the first one more efficient.

### 5.2 Comparison of ESL and OMR across RL Algorithms and Environments

Tables 1-3 showcase the evaluation of RL algorithms in various settings.

Dense Rewards. We observe, in Table 1, that PSRL took the lowest number of updates to reach the optimal policy in contrast with SAC. As explained in the previous section, SAC’s ”soft updates” of the target network slow down convergence. Despite the number of updates, SAC, DQN and Q-learning algorithms are meandering less as they move towards the optimal policies. The OMR of 0.61 in $\epsilon($=1)-greedy indicate that about 61% of the algorithm’s learning effort contributed to reducing the distance to the optimal policy. Generally, OMR values above 0.5 show that the algorithm spends more of its effort in reducing our regret analogue in the occupancy measure space.

Figure: Figure 5: Q-learning with $\epsilon$-greedy ($\epsilon$ = 0.9 decaying, averaged over 40 runs) across deterministic 2D-Gridworld (5x5 and 15x15) tasks. The 1st and 4th (from left to right) have dense rewards, while the rest have sparse rewards (details in Appendix B.1).
Refer to caption: extracted/5930571/images/task_difficulty.png

Sparse Rewards. In the sparse rewards setting (Table 2), SAC is more efficient with lowest ESL and highest OMR. UCRL2 has the lowest number of updates. DQN has the worst overall performance depicted by low success rate, high number of updates, ESL and OMR. From the dense-rewards to the sparse-rewards settings, we notice a general increase in ESL values and decrease in OMR across algorithms. This makes sense since the task hardness increases.

Stochastic Transitions. In the stochastic setting (Table 2), PSRL leads in all metrics, along with a high success rate. In all the settings, lower ESL values correlate with higher OMR values, as a more efficient agent travels more directly towards the optimal policy. The number of policy updates does not reveal much about the policy’s evolution, whereas ESL indicates whether the agent is mostly meandering or moving directly towards optimality. Once again, we notice a significant increase in ESL values when shifting from deterministic to stochastic transitions, indicating an increase in the effort of the exploratory process.

### 5.3 ESL Increases with Task Difficulty

Figure 5 illustrates the ESL values for Q-learning with $\epsilon$-decay strategy (for $\epsilon$ = 0.9) across tasks with varying hardness.
These tasks are deterministic 2D-Gridworld of sizes 5x5 and 15x15 matched with either dense or sparse rewards (as specified in Appendix B.1). We chose to assess the $\epsilon$-decay Q-learning algorithm because it is simple and yet completes all these tasks. We observe that the ESL is lowest for [5x5] dense (5x5 grid, dense rewards) and highest for [15x15] sparse (15x15 grid, sparse rewards) as anticipated. The results demonstrate that ESL scales proportionally with task difficulty, matching expectations that more difficult tasks demand greater effort of the exploratory process.

## 6 Related Works

Several prior works have utilized various components leveraged in our work, namely Wasserstein distance, occupancy measures, and the trajectory of RL on a manifold, but for different purposes.
Here, we summarise them and elucidate the connections.

In supervised learning, Alvarez-Melis & Fusi () proposed an optimal transport approach, namely Optimal Transport Dataset Distance (OTDD), to quantify the transferability between two supervised learning tasks by computing the similarity (aka distance) between the task datasets. Here, we conceptualise and define the effort of learning for RL, as a sequence of such supervised learning tasks. We observe that the total effort of sequential learning can be computed as the sum of OTDD distances between consecutive occupancy measures. Recently, Zhu et al. () have developed generalized occupancy models by defining cumulative features that are transferable across tasks. In future, one can generalize our indices for the cumulative features constructed from some invertible functions of the step-wise occupancy measures.

Optimal transport-based approaches are also explored in RL literature. These works broadly belong to two families. First line of works uses Wasserstein distance over a posterior distribution of Q-values (Metelli et al., ; Likmeta et al., ) or return distributions (Sun et al., ) to quantify uncertainty, and then to use this Wasserstein distance as a loss to learn better models of the posterior distribution of Q-values or return distributions, respectively.
The second line of works uses Wasserstein distance between a feasible family of MDPs as an additional robustness constraint to design robust RL algorithms (Abdullah et al., ; Derman & Mannor, ; Hou et al., ). Here, we bring a novel concept of using Wasserstein distance between occupancy measures to understand the exploratory dynamics. Incorporating this insight into better algorithm design would be an interesting future work.
Recently, Calo et al. () relate Wasserstein distance between reward-labelled Markov chains to bisimulation metrics which abstract state spaces. In the same spirit, we could use reward as the cost-function in computing our nested Wasserstein distance (OTDD) to obtain a reward- or value-aware OTDD to define broader bisimulation metrics with abstract state-action spaces, instead of just state spaces.

As a parallel approach to optimal transport, the information geometries of the trajectory of an RL algorithm under different settings are studied. These approaches use mutual information as a metric instead of Wasserstein distance. Basu et al. () study the information geometry of Bayesian multi-armed bandit algorithms. They consider a bandit algorithm as a trajectory on a belief-reward manifold, and propose a geometric approach to design a near-optimal Bayesian bandit algorithm. Eysenbach et al. (); Laskin et al. () study information geometry of unsupervised RL and propose mutual information maximization schemes over a set of tasks and their marginal state distributions. Yang et al. () extend this approach with Wasserstein distance and demonstrate benefits of using Wasserstein distance than mutual information. We use Wasserstein distance as a natural metric in occupancy manifold that also allows comparison of hardness of different tasks. It would be interesting to extend our framework to understand the dynamics of unsupervised RL algorithms.

## 7 Discussion and Future Works

Our work introduces methods to theoretically and quantitatively understand and compare the learning strategies of different RL algorithms. Since learning in a typical RL algorithm happens through a sequence of policy updates, we propose to understand the learning process by visualizing and analysing the path traversed by an RL algorithm in the space of occupancy measures corresponding to this sequence.

We show the usefulness of this approach by conducting experiments on various environments. Our results show that the indices ESL and OMR provide insight into the agent’s policy evolution, revealing whether it is steadily approaching the optimal policy or mostly meandering. Additionally, this allows us to understand how the learning process of the same algorithm changes with different rewards and transitions structures, and task hardness. A key limitation of our indices is that they are based on assumption that the final policy reached at the end of training is an optimal one, though we could still derive some benefit from our approach even if not. In the future, it would be interesting to use this approach to benchmark and compare the learning dynamics of different RL algorithms on further environments. In addition, it would be useful to study whether the occupancy measures trajectory of an algorithm provides insights to improve its exploratory process.

#### Acknowledgments

R. Nkhumise thanks Pawel Pukowski for helpful discussions on initial theoretical aspects. R. Nkhumise was supported by the EPSRC Doctoral Training Partnership (DTP) - Early Career Researcher funding awarded to A. Gilra. A. Gilra acknowledges the CHIST-ERA grant for the Causal Explanations in Reinforcement Learning (CausalXRL) project (CHIST-ERA-19-XAI-002), by the Engineering and Physical Sciences Research Council, United Kingdom (grant reference EP/V055720/1) for supporting the work. D. Basu acknowledges the CHIST-ERA grant for the CausalXRL project (CHIST-ERA-19-XAI-002) by L’Agence Nationale de la Recherche, France (grant reference ANR-21-CHR4-0007), the ANR JCJC for the REPUBLIC project (ANR-22-CE23-0003-01), and the PEPR project FOUNDRY (ANR23-PEIA-0003) for supporting the work. We thank Eleni Vasilaki and Philippe Preux for their support.

## Appendix A Theoretical Analysis

### A.1 MDP with Lipschitz Rewards

Given two metric spaces $(\mathcal{X},d_{\mathcal{X}})$ and $(\mathcal{Y},d_{\mathcal{Y}})$, a function $f:\mathcal{X}\to\mathcal{Y}$ is called 1-Lipschitz continuous if (Villani, ):

$$ $\displaystyle d_{Y}(f(x),f(x^{\prime}))\leq d_{X}(x,x^{\prime})\text{, } \forall(x,x^{\prime})\in X$ (11) $$

This implies that the Lipschitz semi-norm over the function space $\mathcal{F}(X,Y)$, defined as

$$ $\displaystyle\|f\|_{L}=\sup_{x\neq x^{\prime}}\left\{\frac{d_{Y}(f(x),f(x^{ \prime}))}{d_{X}(x,x^{\prime})}\mid\forall(x,x^{\prime})\in\mathcal{X}\right\},$ (12) $$

is $\leq 1$. When $(\mathcal{X},d_{\mathcal{X}})$ is a Polish space and $\mu,\nu\in\mathcal{P}(\mathcal{X})$, the Kantorovich-Rubinstein formula states that (Villani, ):

$$ $\displaystyle\mathcal{W}_{1}(\mu,\nu)$ $\displaystyle=\sup_{\|f\|_{L}\leq 1}\left\{\int_{\mathcal{X}}f\,d\mu-\int_{ \mathcal{X}}f\,d\nu\right\}$ (13) $\displaystyle=\sup_{\|f\|_{L}\leq 1}\left\{\mathbb{E}_{\mu}\left[f(X)\right]- \mathbb{E}_{\nu}\left[f(X)\right]\right\},$ $$

where $W_{1}(\mu,\nu)$ is the 1-Wasserstein distance between $\mu$ and $\nu$ with $f$ as the cost function.

Note that when $\|f\|_{L}\leq L_{\mathcal{R}}$ for any $L_{\mathcal{R}}>0$, then function $f$ is called $L_{\mathcal{R}}$-Lipschitz continuous, and Equation (13) becomes (Gelada et al., ),

$$ $\displaystyle\mathcal{W}_{1}(\mu,\nu)$ $\displaystyle=\frac{1}{L_{\mathcal{R}}}\sup_{\|f\|_{L}\leq L_{\mathcal{R}}} \left\{\mathbb{E}_{\mu}\left[f(X)\right]-\mathbb{E}_{\nu}\left[f(X)\right] \right\}.$ (14) $$

Now, we consider $\mathcal{X}=\mathcal{S}\times\mathcal{A}$, i.e. the state-action space, $\mathcal{Y}=\mathbb{R}$, i.e. the real line, and the function $f$ to be the reward function $\mathcal{\bar{R}}$.
Then, we can call the reward function $\mathcal{\bar{R}}$ to be $L_{\mathcal{R}}$-Lipschitz if

$$ $|\mathcal{\bar{R}}(s,a)-\mathcal{\bar{R}}(s^{\prime},a^{\prime})|\leq L_{ \mathcal{R}}d_{\mathcal{S}\mathcal{A}}((s,a),(s^{\prime},a^{\prime}))$ $$

for all $s,s^{\prime}\in\mathcal{S}$, and $a,a^{\prime}\in\mathcal{A}$,
and $d_{\mathcal{S}\mathcal{A}}((s,a),(s^{\prime},a^{\prime}))=d_{\mathcal{S}}((s,s
^{\prime}))+d_{\mathcal{A}}((a,a^{\prime}))$ being the metric on the state-action space $\mathcal{S}\times\mathcal{A}$.
If the reward function $\mathcal{\bar{R}}$ of an MDP is $L_{\mathcal{R}}$-Lipschitz, we refer it as an MDP with Lipschitz rewards.

### A.2 Performance Difference and Occupancy Measures

We know that

$$ $J^{\pi}_{\mu}=\frac{1}{\rho}\mathbb{E}_{(s,a)\sim v_{\pi}}\left[\mathcal{\bar{ R}}(s,a)\right]\,.$ (15) $$

Using Equation (15), we write for two policies $\pi$ and $\pi^{\prime}$, with $\mu(s)$ as the initial state distribution,

$$ $\displaystyle\left|J^{\pi}_{\mu}-J^{\pi^{\prime}}_{\mu}\right|$ $\displaystyle=\frac{1}{\rho}\left|\mathbb{E}_{(s,a)\sim v_{\pi}}\left[\mathcal {\bar{R}}(s,a)\right]-\mathbb{E}_{(s,a)\sim v_{\pi^{\prime}}}\left[\mathcal{ \bar{R}}(s,a)\right]\right|$ (16) $$

Given an MDP with $L_{\mathcal{R}}$-Lipschitz rewards, the Kantorovich-Rubinstein formula dictates that (Gelada et al., ):

$$ $\displaystyle\sup_{\|\bar{R}\|_{L}\leq L_{\mathcal{R}}}\left|\mathbb{E}_{(s,a) \sim v_{\pi}}\left[\mathcal{\bar{R}}(s,a)\right]-\mathbb{E}_{(s,a)\sim v_{\pi^ {\prime}}}\left[\mathcal{\bar{R}}(s,a)\right]\right|$ $\displaystyle=L_{\mathcal{R}}\mathcal{W}_{1}(v_{\pi},v_{\pi^{\prime}})$ (17) $$

By dividing both sides of Equation (17) by $\rho$, and due to an upper bound by the supremum, this inequality follows:

$$ $\displaystyle\left|J^{\pi}_{\mu}-J^{\pi^{\prime}}_{\mu}\right|\leq\frac{L_{ \mathcal{R}}}{\rho}\mathcal{W}_{1}(v_{\pi},v_{\pi^{\prime}})$ (18) $$

### A.3 Proof of proposition 1

The Linear Programming formulation for solving MDPs, assuming discrete state and action spaces, is (Puterman, ):

$$ $\displaystyle\max_{v_{\pi}}$ $\displaystyle\sum_{s,a}r(s,a)v_{\pi}(s,a)$ (19) subject to $\displaystyle\sum_{a}v_{\pi}(s,a)=p_{0}(s)+\gamma\sum_{s^{\prime},a}T(s\mid s^ {\prime},a)v_{\pi}(s^{\prime},a)$ $\displaystyle v_{\pi}(s,a)\geq 0~{}~{}~{}~{}\forall(s,a)\in\mathcal{S}\times \mathcal{A}\,,$ $$

where $p_{0}(s)$ is the initial state distribution and $T(s\mid s^{\prime},a)$ is the transition probability. The constraints of this optimization problem are often referred to as Bellman Flow Constraint.

A stationary policy $\pi$ has a corresponding occupancy measure $v_{\pi}(s,a)$ that satisfies the Bellman flow constraint (Syed et al., ), and hence $\pi$ and $v_{\pi}(s,a)$ share a bijective relationship (Syed et al., ; Givchi, ),

$$ $\pi(a\mid s)=\frac{v_{\pi}(s,a)}{u_{\pi}(s)}$ (20) $$

with

$$ $u_{\pi}(s)=\sum_{a^{\prime}}v_{\pi}(s,a^{\prime})=p_{0}(s)+\gamma\sum_{s^{ \prime},a^{\prime}}T(s\mid s^{\prime},a^{\prime})v_{\pi}(s^{\prime},a^{\prime})$ (21) $$

By rearranging Equation (20) to

$$ $v_{\pi}(s,a)=\pi(a\mid s)u_{\pi}(s)$ (22) $$

and substituting Equation (22) into Equation (21), we can rewrite Equation (21) as (defining $\mathcal{P}^{\pi}\triangleq\sum_{a}T(s\mid s^{\prime},a)\pi(a\mid s^{\prime})$),

$$ $\displaystyle p_{0}(s)$ $\displaystyle=u_{\pi}(s)-\gamma\sum_{s^{\prime},a}T(s\mid s^{\prime},a)\pi(a \mid s^{\prime})u_{\pi}(s^{\prime})$ (23) $\displaystyle\triangleq u_{\pi}(s)-\gamma\sum_{s^{\prime}}\mathcal{P}^{\pi}(s \mid s^{\prime})u_{\pi}(s^{\prime})$ $$

which in matrix form is

$$ $\displaystyle\mathbf{p}_{0}$ $\displaystyle=\mathbf{u}_{\pi}-\gamma\mathbf{P^{\pi}}\mathbf{u}_{\pi}$ (24) $\displaystyle=\left(\mathbb{I}-\gamma\mathbf{P^{\pi}}\right)\mathbf{u}_{\pi}\,,$ $$

where $\mathbf{p}_{0},\mathbf{u}_{\pi}\in\mathbb{R}^{|\mathcal{S}|}$ are column vectors and $\mathbf{P^{\pi}}\in\mathbb{R}^{|\mathcal{S}|\times|\mathcal{S}|}$ are matrices. Solving for $\mathbf{u}_{\pi}$, we get

$$ $\mathbf{u}_{\pi}=\left(\mathbb{I}-\gamma\mathbf{P^{\pi}}\right)^{-1}\mathbf{p} _{0}$ (25) $$

The inverse matrix $\left(\mathbb{I}-\gamma\mathbf{P^{\pi}}\right)^{-1}$ exists because for $\gamma<1$, $\left(\mathbb{I}-\gamma\mathbf{P^{\pi}}\right)$ is a strictly diagonally dominant matrix (Syed et al., ). Thus, $\left(\mathbb{I}-\gamma\mathbf{P^{\pi}}\right)^{-1}=\sum_{t=0}^{\infty}(\gamma
\mathbf{P^{\pi}})^{t}$, where $\sum_{t=0}^{\infty}(\gamma\mathbf{P^{\pi}})^{t}$ forms a valid Neumann series (Ward, ). We let $\mathbf{A}^{\pi}=\sum_{t=0}^{\infty}(\gamma\mathbf{P^{\pi}})^{t}$, so Equation (24) can be written as $\mathbf{u}_{\pi}=\mathbf{A}^{\pi}\mathbf{p}_{0}$. We can therefore express Equation (22) in matrix form as:

$$ $\displaystyle\mathbf{v}_{\pi}$ $\displaystyle=\mathbf{\Pi}\odot\left(\mathbf{u}_{\pi}^{T}\otimes\mathbf{1} \right)^{T}$ (26) $\displaystyle=\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}(\mathbf{A}^{\pi})^{T} \otimes\mathbf{1}\right)^{T}\,,$ $$

where $\mathbf{\Pi},\mathbf{v}_{\pi}\in\mathbb{R}^{|\mathcal{S}|\times|\mathcal{A}|}$, $\mathbf{1}\in\mathbb{R}^{|\mathcal{A}|}$ is a column vector of ones, $\otimes$ presents the Kronecker product, and $\odot$ denotes the Hadamard product.

If we consider the case of a parameterized policy $\mathbf{\Pi}({\theta})$, then the derivative of $\mathbf{v}_{\pi}$ with respect to $\theta$ is

$$ $\displaystyle\nabla_{\theta}\mathbf{v}_{\pi}=$ $\displaystyle\nabla_{\theta}\left[\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}( \mathbf{A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}\right]$ (27) $\displaystyle=$ $\displaystyle\nabla_{\theta}\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}(\mathbf{ A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}+\mathbf{\Pi}\odot\nabla_{\theta} \left(\mathbf{p}_{0}^{T}(\mathbf{A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}$ $\displaystyle=$ $\displaystyle\nabla_{\theta}\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}(\mathbf{ A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}+\mathbf{\Pi}\odot\left(\mathbf{p}_{0 }^{T}(\nabla_{\theta}\mathbf{A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}$ $$

The first term in Equation (27) is differentiable since the policy is parameterized by $\theta$. We expand $\nabla_{\theta}\mathbf{A}^{\pi}$ as follows:

$$ $\displaystyle\nabla_{\theta}\mathbf{A}^{\pi}$ $\displaystyle=\sum_{t=0}^{\infty}t(\gamma\mathbf{P}^{\pi})^{t-1}\gamma\nabla_{ \theta}\mathbf{P}^{\pi}$ (28) $\displaystyle\equiv\sum_{t=0}^{\infty}t(\gamma\mathbf{P}^{\pi})^{t-1}\gamma \nabla_{\theta}\left[\sum_{a}T(s|s^{\prime},a)\pi(a|s^{\prime})\right]$ $\displaystyle=\sum_{t=0}^{\infty}t(\gamma\mathbf{P}^{\pi})^{t-1}\gamma\left[ \sum_{a}T(s|s^{\prime},a)\nabla_{\theta}\pi(a|s^{\prime})\right]$ $\displaystyle=\sum_{t=0}^{\infty}t(\gamma\mathbf{P}^{\pi})^{t}({\mathbf{P}^{ \pi}})^{-1}\left[\sum_{a}T(s|s^{\prime},a)\nabla_{\theta}\pi(a|s^{\prime})\right]$ $$

If $({\mathbf{P}^{\pi}})^{-1}$ exists, then $\nabla_{\theta}\mathbf{A}^{\pi}$ is differentiable, and consequently so is $\nabla_{\theta}\mathbf{v}_{\pi}$, based on Equation (27) and Equation (28). Proceeding similarly, given the same conditions, we see that all higher derivatives of $v_{\pi}$ also exist with respect to $\theta$. Thus, the space of parametrized occupancy measures $v_{\pi}$ forms a differentiable manifold.

### A.4 Proof of proposition 2

Regret is a common metric for evaluating agents, that measures the total loss an agent incurs over policy updates by using its policy in lieu of the optimal one, defined as (Osband et al., ),

$$ $\displaystyle\text{Regret}=\mathbb{E}_{s\sim\mu}\left[\sum_{k}(V^{*}(s)-V_{\pi _{k}}(s))\right]$ (29) $$

where $V^{*}=V_{\pi^{*}}$ is the value function of the optimal policy $\pi^{*}$ while $V_{\pi_{k}}(s)$ is the value function of policy $\pi_{k}$, and $\mu$ is the initial state distribution.

Since ${J^{\pi}_{\mu}=\mathbb{E}_{s\sim\mu}[V_{\pi}(s)]}$, we can conclude from Equation (29) that

$$ Regret $\displaystyle=\mathbb{E}_{s\sim\mu}\left[\sum_{k}(V^{*}(s)-V_{\pi_{k}}(s))\right]$ (30) $\displaystyle=\sum_{k}\left[\mathbb{E}_{s\sim\mu}(V^{*}(s)-V_{\pi_{k}}(s))\right]$ $\displaystyle=\sum_{k}\left(J^{\pi^{*}}_{\mu}-J^{\pi_{k}}_{\mu}\right)$ $\displaystyle=\sum_{k}\left|J^{\pi^{*}}_{\mu}-J^{\pi_{k}}_{\mu}\right|$ $\displaystyle\leq\sum_{k}\frac{L_{\mathcal{R}}}{\rho}\mathcal{W}_{1}(v_{\pi^{* }},v_{\pi_{k}})$ $$

The last inequality is due to Equation (18).

### A.5 Proof of proposition 3

Let us begin the proof by defining the visitation probability at any step $h\in[H]$ in an episode, following policy $\pi(a|s)$. Specifically,

$$ $q^{h}_{\pi}(s,a)\triangleq\mathbb{P}(s_{h}=s,a_{h}=a)~{}~{}\forall h\in[H]~{}~ {}\text{ and }~{}~{}q^{h}_{\pi}(s,a)\triangleq 0~{}~{}\forall h\in\mathbb{N} \wedge h>H\,.$ (31) $$

Thus, we rewrite Equation (7) $v^{H}_{\pi}(s,a)=\frac{1}{H}\sum_{h=1}^{H}q^{h}_{\pi}(s,a)$.

Then, following (Kalagarla et al., ), we can write the Linear Programming formulation for solving episodic MDP $\mathbb{M}^{H}$ as

$$ $\displaystyle\max_{\{q^{h}_{\pi}\}_{h=1}^{H}}$ $\displaystyle\sum_{h,s,a}r(s,a)q^{h}_{\pi}(s,a)$ (32) subject to $\displaystyle\sum_{a}q^{h}_{\pi}(s,a)=\sum_{s^{\prime},a}T(s\mid s^{\prime},a) q^{h-1}_{\pi}(s^{\prime},a)~{}~{}~{}\forall h\in[H]\wedge h>1\,,$ $\displaystyle q^{1}_{\pi}(s,a)=\pi(a|s)\mu(s)\,,$ $\displaystyle q^{h}_{\pi}(s,a)\geq 0~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}\forall h\in [H],(s,a)\in\mathcal{S}\times\mathcal{A}\,,$ $$

where $\mu(s)$ is the initial state distribution and $T(s\mid s^{\prime},a)$ is the transition probability. The constraints of this optimization problem are often referred to as Bellman Flow Constraints.

This implies that

$$ $\displaystyle\sum_{h=2}^{H+1}\sum_{a}q^{h}_{\pi}(s,a)=\sum_{h=2}^{H+1}\sum_{s^ {\prime},a}T(s\mid s^{\prime},a)q^{h-1}_{\pi}(s^{\prime},a)$ $\displaystyle\implies$ $\displaystyle\sum_{a}q^{1}_{\pi}(s,a)+\sum_{h=2}^{H+1}\sum_{a}q^{h}_{\pi}(s,a) =\sum_{h=2}^{H+1}\sum_{s^{\prime},a}T(s\mid s^{\prime},a)q^{h-1}_{\pi}(s^{ \prime},a)+\sum_{a}q^{1}_{\pi}(s,a)$ $\displaystyle\implies$ $\displaystyle\sum_{a}\sum_{h=1}^{H+1}q^{h}_{\pi}(s,a)=\sum_{h=2}^{H+1}\sum_{s^ {\prime},a}T(s\mid s^{\prime},a)q^{h-1}_{\pi}(s^{\prime},a)+\sum_{a}q^{1}_{\pi }(s,a)$ $\displaystyle\implies$ $\displaystyle H\sum_{a}v^{H}_{\pi}(s,a)=\sum_{s^{\prime},a}T(s\mid s^{\prime}, a)(\sum_{h=2}^{H+1}q^{h-1}_{\pi}(s^{\prime},a))+\mu(s)$ $\displaystyle\implies$ $\displaystyle H\sum_{a}v^{H}_{\pi}(s,a)=H\sum_{s^{\prime},a}T(s\mid s^{\prime} ,a)v^{H}_{\pi}(s^{\prime},a)+\mu(s)$ $\displaystyle\implies$ $\displaystyle\sum_{a}v^{H}_{\pi}(s,a)=\sum_{s^{\prime},a}T(s\mid s^{\prime},a) v^{H}_{\pi}(s^{\prime},a)+\frac{1}{H}\mu(s)$ $\displaystyle\implies$ $\displaystyle u^{H}_{\pi}(s)\triangleq\sum_{a}v^{H}_{\pi}(s,a)=\sum_{s^{\prime },a}T(s\mid s^{\prime},a)\pi(a|s^{\prime})u^{H}_{\pi}(s^{\prime})+\frac{1}{H} \mu(s)\,.$ (33) $$

Now, we denote $\mathbf{u}^{H}_{\pi}$ and $\mathbf{\mu}$ as corresponding column vectors and $P^{\pi}(s,s^{\prime})\triangleq\sum_{s^{\prime},a}T(s\mid s^{\prime},a)\pi(a|s
^{\prime})$ as matrix. Thus, we obtain

$$ $\displaystyle(\mathbb{I}-P^{\pi})\mathbf{u}^{H}_{\pi}$ $\displaystyle=\frac{1}{H}\mathbf{\mu}\implies\mathbf{u}^{H}_{\pi}=\frac{1}{H}( \mathbb{I}-P^{\pi})^{-1}\mathbf{\mu}\,.$ (34) $$

We can therefore express the finite horizon occupancy measure in matrix form as

$$ $\displaystyle\mathbf{v}^{H}_{\pi}$ $\displaystyle=\mathbf{\Pi}\odot\left((\mathbf{u}^{H}_{\pi})^{T}\otimes\mathbf{ 1}\right)^{T}=\mathbf{\Pi}\odot\left(\mu^{T}(\mathbf{A}^{\pi}_{H})^{T}\otimes \mathbf{1}\right)^{T}$ (35) $$

where $\mathbf{\Pi},\mathbf{v}_{\pi}\in\mathbb{R}^{|\mathcal{S}|\times|\mathcal{A}|}$, $\mathbf{1}\in\mathbb{R}^{|\mathcal{A}|}$ is a column vector of ones, $\otimes$ presents the Kronecker product, $\odot$ denotes the Hadamard product, and $\mathbf{A}^{\pi}_{H}\triangleq\frac{1}{H}(\mathbb{I}-P^{\pi})^{-1}$.

If we consider the case of a parameterized policy $\mathbf{\Pi}({\theta})$, the derivative of $\mathbf{v}_{\pi}$ with respect to $\theta$ is

$$ $\displaystyle\nabla_{\theta}\mathbf{v}_{\pi}=$ $\displaystyle\nabla_{\theta}\left[\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}( \mathbf{A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}\right]$ (36) $\displaystyle=$ $\displaystyle\nabla_{\theta}\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}(\mathbf{ A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}+\mathbf{\Pi}\odot\nabla_{\theta} \left(\mathbf{p}_{0}^{T}(\mathbf{A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}$ $\displaystyle=$ $\displaystyle\nabla_{\theta}\mathbf{\Pi}\odot\left(\mathbf{p}_{0}^{T}(\mathbf{ A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}+\mathbf{\Pi}\odot\left(\mathbf{p}_{0 }^{T}(\nabla_{\theta}\mathbf{A}^{\pi})^{T}\otimes\mathbf{1}\right)^{T}$ $$

The first term in Equation (36) is differentiable since the policy is parameterized by $\theta$. We expand on $\nabla_{\theta}\mathbf{A}^{\pi}$ as follows:

$$ $\displaystyle H~{}\nabla_{\theta}\mathbf{A}^{\pi}$ $\displaystyle=\nabla_{\theta}(\mathbb{I}-P^{\pi})^{-1}$ (37) $\displaystyle=\nabla_{\theta}\left(\sum_{i=0}^{\infty}(P^{\pi})^{i}\right)$ $\displaystyle=\sum_{i=0}^{\infty}i(P^{\pi})^{i-1}\nabla_{\theta}P^{\pi}$ $\displaystyle=\sum_{i=0}^{\infty}i(P^{\pi})^{i-1}T\nabla_{\theta}\Pi\,.$ $$

If $(P^{\pi})^{-1}$ exists, then $\nabla_{\theta}\mathbf{A}^{\pi}$ is differentiable, and consequently so is $\nabla_{\theta}\mathbf{v}^{H}_{\pi}$. Proceeding similarly, given the same conditions, we see that all higher derivatives of $\mathbf{v}^{H}_{\pi}$ also exist with respect to $\theta$. Thus, the space of parametrized finite-horizon occupancy measures $v^{H}_{\pi}$ forms a differentiable manifold $\mathcal{M}^{H}$.

### A.6 Optimal Transport Dataset Distance (OTDD)

Suppose we have two datasets, each consisting of feature-label pairs, $\mathcal{D}_{A}=\{(t_{A}^{i},u_{A}^{i})\}_{i=1}^{m}\sim P_{A}(t,u)$ and $\mathcal{D}_{B}=\{(t_{B}^{i},u_{B}^{i})\}_{i=1}^{n}\sim P_{B}(t,u)$ with $t_{A},t_{B}\in\mathcal{T}$ and $u_{A},u_{B}\in\mathcal{U_{A}},\mathcal{U_{B}}$. These datasets can be used to create empirical distributions $\hat{P}_{A}(t,u)$ and $\hat{P}_{B}(t,u)$. OTDD is the p-Wasserstein distance between the datasets $\mathcal{D}_{A}$ and $\mathcal{D}_{B}$ - which is essentially the distance between their empirical distributions $\hat{P}_{A}$ and $\hat{P}_{B}$ - with the cost function defined as the metric of the joint space $\mathcal{T}\times\mathcal{U}$ (Alvarez-Melis & Fusi, ).

Naturally, the metric on this joint space can be defined as $d_{\mathcal{T}\mathcal{U}}((t,u),(t^{\prime},u^{\prime}))=\left(d_{\mathcal{T}
}(t,t^{\prime})^{p}+d_{\mathcal{U}}(u,u^{\prime})^{p}\right)^{1/p}$, for $p\geq 1$. However, in most applications $d_{\mathcal{T}}$ is readily available, while $d_{\mathcal{U}}$ might be scarce, especially in supervised learning (SL) between labels from unrelated label sets (Alvarez-Melis & Fusi, ). Further, we want $d_{|}mathcal{T}$ and $d_{\mathcal{U}}$ to have the same units to be addable. To overcome these issues, $d_{\mathcal{U}}$ is expressed in terms of $d_{\mathcal{T}}$ by mapping labels $u$ to distributions over the feature space $\mathcal{P(T)}$ as $u\to\alpha_{u}(T)\triangleq P(T\mid U=u)\in\mathcal{P(T)}.$
Therefore, the distance between the labels $u$ and $u^{\prime}$ is defined as the p-Wasserstein distance between $\alpha_{u}(T)$ and $\alpha_{u^{\prime}}(T)$,

$$ $\displaystyle d_{\mathcal{U}}(u,u^{\prime})$ $\displaystyle=\mathcal{W}^{p}_{p}(\alpha_{u}(T),\alpha_{u^{\prime}}(T))$ (38) $\displaystyle=\min_{\pi\in\Pi(\alpha_{u},\alpha_{u^{\prime}})}\int_{\mathcal{T }\times\mathcal{T}}(d_{\mathcal{T}}(t,t^{\prime}))^{p}\,d\pi(t,t^{\prime})\$ $$

The metric on the joint space becomes,

$$ $\displaystyle d_{\mathcal{T}\mathcal{U}}((t,u),(t^{\prime},u^{\prime}))=\left( d_{\mathcal{T}}(t,t^{\prime})^{p}+\mathcal{W}^{p}_{p}(\alpha_{u}(T),\alpha_{u^ {\prime}}(T))\right)^{1/p}$ (39) $$

Let $\mathcal{Z}=\mathcal{T}\times\mathcal{U}$, then the p-Wasserstein distance between $\hat{P}_{A}(t,u)$ and $\hat{P}_{B}(t,u)$ is a ”nested” Wasserstein distance:

$$ $\displaystyle\mathcal{W}^{p}_{p}(\hat{P}_{A},\hat{P}_{B})$ $\displaystyle=\min_{\pi\in\Pi(P_{A},P_{B})}\int_{\mathcal{Z}\times\mathcal{Z}} (d_{\mathcal{Z}}(z,z^{\prime}))^{p}\,d\pi$ (40) $\displaystyle=\min_{\pi\in\Pi(P_{A},P_{B})}\int_{\mathcal{TU}\times\mathcal{TU }}\left(d_{\mathcal{T}}(t,t^{\prime})^{p}+\mathcal{W}^{p}_{p}(\alpha_{u}, \alpha_{u^{\prime}})\right)\,d\pi$ $$

$W^{p}_{p}(\hat{P}_{A},\hat{P}_{B})$ is the OTDD between datasets $\mathcal{D}_{A}$ and $\mathcal{D}_{B}$, often expressed as $d_{OT}(\mathcal{D}_{A},\mathcal{D}_{B})$. This is used in transfer learning to determine the distance (or similarity) between datasets.

### A.7 Proof of Proposition 4

We compute the error in occupancy measure for both the infinite and finite horizon cases. In infinite horizon MDPs, the occupancy measure is defined as the expected discounted number of visits of a state-action pair $(s,a)$ in a trajectory (Laroche & des Combes, ): $\mu=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\mu_{t}$, where $\mu_{t}=P(s_{t},a_{t}\mid\pi,\eta)$ is the state-action probability distribution at time step $t$ with the initial state distribution $\eta$ following the policy $\pi$. In finite horizon MDPs, the occupancy measure is the expected number of visits of a state-action pair $(s,a)$ in an episode of length $H$ (Altman, ): $\mu=\frac{1}{H}\sum_{t=1}^{H}\mu_{t}$.

First, we derive error bounds for the infinite horizon MDP in which $\gamma<1$ and the occupancy measure is approximated using a finite number of samples collected up to a finite number of time steps $T$. Later, we derive error bounds for the finite horizon MDP.

#### A.7.1 Infinite Horizon MDPs

Estimated Occupancy Measure.
For convenience, we express the occupancy measure as $\mu=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\mu_{t}$, where $\mu_{t}=P(s_{t},a_{t}\mid\pi,\eta)$ is the state-action probability distribution at time step $t$ with the initial state distribution $\eta$ following the policy $\pi$. To compute $\mu$, we roll out $N$ episodes (each of multiple time steps) using $\pi$, and take $N$ number of samples at $t$ to approximate $\mu_{t}$. Thus, the empirical occupancy measure $\hat{\mu}$ is given by $\hat{\mu}=\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N}_{t}$, where $\rho=\frac{1}{\sum_{t=0}^{T}\gamma^{t}}$. Note that the total number of samples in the policy dataset $\mathcal{D}_{\pi}$ is $|\mathcal{D}_{\pi}|=N(T+1)$.

Occupancy Measure Estimation Error. Consider two occupancy measures $\mu=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\mu_{t}$ and $\nu=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\nu_{t}$ (with estimates $\hat{\mu}=\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$ and $\hat{\nu}=\rho\sum_{t=0}^{T}\gamma^{t}\hat{\nu}^{N_{\nu}}_{t}$). For independent sets $\{\mu_{t}\}_{t\geq 0}$ and $\{\nu_{t}\}_{t\geq 0}$, the Wasserstein distance has the following additive property (Panaretos & Zemel, ),

$$ $\displaystyle\mathcal{W}_{p}(\sum_{t}\mu_{t},\sum_{t}\nu_{t})\leq\sum_{t} \mathcal{W}_{p}(\mu_{t},\nu_{t})$ (41) $$

While for $a\in\mathbb{R}$ (Panaretos & Zemel, ),

$$ $\displaystyle\mathcal{W}_{p}(a\mu,av)=|a|\mathcal{W}_{p}(\mu,v)$ (42) $$

Therefore, for our scenario where $p=1$, the Wasserstein distance between $\mu$ and $\nu$ is given by:

$$ $\displaystyle\mathcal{W}_{1}(\mu,\nu)$ $\displaystyle=\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\mu_{t},( 1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\nu_{t})$ (43) $\displaystyle\leq(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\mathcal{W}_{1}(\mu_{t },\nu_{t})$ $$

while for $\hat{\mu}$ and $\hat{\nu}$,

$$ $\displaystyle\mathcal{W}_{1}(\hat{\mu},\hat{\nu})\leq\rho\sum_{t=0}^{T}\gamma^ {t}\mathcal{W}_{1}(\hat{\mu}^{N_{\mu}}_{t},\hat{\nu}^{N_{\nu}}_{t})$ (44) $$

In the RL problems we consider, the state-action space $\mathcal{Z}=\mathcal{S}\times\mathcal{A}$ is commonly defined as the subset of the Euclidean space $\mathcal{Z}\in\mathbb{R}^{B}$, where usually $B\geq 2$. Theorems 1 and 3 in (Sommerfeld et al., ) establish the following error bounds between the true and empirical probability distributions,

$$ $\displaystyle\mathbb{E}[\mathcal{W}_{1}(\hat{\mu}^{N_{\mu}}_{t},\mu_{t})]\leq \mathcal{E}_{2}N_{\mu}^{-\frac{1}{2}}$ (45) $\displaystyle\mathbb{E}[\mathcal{W}_{1}(\hat{\nu}^{N_{\nu}}_{t},\nu_{t})]\leq \mathcal{E}_{2}N_{\nu}^{-\frac{1}{2}}$ $$

where

$$ $\displaystyle\mathcal{E}_{2}$ $\displaystyle\leq 4B^{1/2}diam(\mathcal{Z})\cdot\begin{cases}2+(1/2)\text{log} _{2}|\mathcal{Z}|&\text{ if $B=2$}\\ |\mathcal{Z}|^{1/2-1/B}\left[2+1/(2^{B/2-1}-1)\right]&\text{ if $B>2$}\end{cases}$ $$

Note that $|\mathcal{Z}|$ and $diam(\mathcal{Z})$ denote the cardinality and diameter of $\mathcal{Z}$, respectively.

Suppose $a=\mathcal{W}_{1}(\hat{\mu},\hat{\nu})$, $b=\mathcal{W}_{1}(\hat{\mu},\mu)$, $c=\mathcal{W}_{1}(\hat{\nu},\mu)$, $d=\mathcal{W}_{1}(\mu,\nu)$, and $e=\mathcal{W}_{1}(\hat{\nu},\nu)$. Then by performing two reverse triangle inequalities,

$$ $\displaystyle|a-c|\leq b~{}~{}~{}\text{ and }~{}~{}~{}|c-d|\leq e$ (46) $\displaystyle\implies$ $\displaystyle|a-d|\leq b+e$ $$

Equation (46) implies that,

$$ $\displaystyle\mathbb{E}[|\mathcal{W}_{1}(\hat{\mu},\hat{\nu})-\mathcal{W}_{1}( \mu,\nu)|]$ $\displaystyle\leq\mathbb{E}[\mathcal{W}_{1}(\hat{\mu},\mu)+\mathcal{W}_{1}( \hat{\nu},\nu)]$ (47) $\displaystyle=\mathbb{E}[\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu} ^{N_{\mu}}_{t},\mu)+\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\nu}^{N_{ \nu}}_{t},\nu)]$ $\displaystyle=\mathbb{E}[\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu} ^{N_{\mu}}_{t},\mu)]+\mathbb{E}[\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t} \hat{\nu}^{N_{\nu}}_{t},\nu)]$ $\displaystyle+\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{ t}\hat{\mu}^{N_{\mu}}_{t},\mu)-\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty} \gamma^{t}\hat{\mu}^{N_{\mu}}_{t},\mu)]$ $\displaystyle+\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{ t}\hat{\nu}^{N_{\nu}}_{t},\nu)-\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty} \gamma^{t}\hat{\nu}^{N_{\nu}}_{t},\nu)]$ $$

By virtue of triangle inequalities, we get

$$ $\displaystyle\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{ t},(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t})\geq\mathcal {W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t},\mu)-\mathcal{W}_{ 1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t},\mu)$ (48) $\displaystyle\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\nu}^{N_{\nu}}_{ t},(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\nu}^{N_{\nu}}_{t})\geq\mathcal {W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t}\hat{\nu}^{N_{\nu}}_{t},\nu)-\mathcal{W}_{ 1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\nu}^{N_{\nu}}_{t},\nu)$ $$

Therefore, the right-hand-side (R.H.S) of Equation (47) can be further simplified as

$$ $\displaystyle\text{R.H.S}\leq\mathbb{E}[\mathcal{W}_{1}(\rho\sum_{t=0}^{T} \gamma^{t}\hat{\mu}^{N_{\mu}}_{t},(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{ \mu}^{N_{\mu}}_{t})]+\mathbb{E}[\mathcal{W}_{1}(\rho\sum_{t=0}^{T}\gamma^{t} \hat{\nu}^{N_{\nu}}_{t},(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\nu}^{N_{ \nu}}_{t})]$ (49) $\displaystyle+\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{ t}\hat{\mu}^{N_{\mu}}_{t},\mu)]+\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0 }^{\infty}\gamma^{t}\hat{\nu}^{N_{\nu}}_{t},\nu)]$ $$

For simplicity, we denote $\hat{\mu}_{\infty}=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_
{t}$ (similarly $\hat{\nu}_{\infty}$) and $\hat{\mu}_{T}=\rho\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$ (similarly $\hat{\nu}_{T}$), where $\rho=\frac{1}{\sum_{t=0}^{T}\gamma^{t}}=\frac{1-\gamma}{1-\gamma^{T+1}}$. Using Theorem 4 in (Gibbs & Su, ), the 1-Wasserstein metric $\mathcal{W}_{1}$ and the total variation distance $d_{TV}$ satisfy the following,

$$ $\displaystyle\mathcal{W}_{1}(\hat{\mu}_{\infty},\hat{\mu}_{T})$ $\displaystyle\leq diam(\mathcal{Z})\cdot d_{TV}(\hat{\mu}_{\infty},\hat{\mu}_{ T})$ (50) $\displaystyle=diam(\mathcal{Z})\cdot\frac{1}{2}\sum_{z\in\mathcal{Z}}|\hat{\mu }_{\infty}(z)-\hat{\mu}_{T}(z)|$ $$

However,

$$ $\displaystyle\hat{\mu}_{\infty}-\hat{\mu}_{T}$ $\displaystyle=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}- \frac{1-\gamma}{1-\gamma^{T+1}}\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$ (51) $\displaystyle=(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}- \frac{1-\gamma}{1-\gamma^{T+1}}\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$ $\displaystyle+(1-\gamma)\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}-(1- \gamma)\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$ $\displaystyle=(1-\gamma)\left(\sum_{t=0}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}} _{t}-\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}\right)+\left((1-\gamma)- \frac{1-\gamma}{1-\gamma^{T+1}}\right)\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^{N_{ \mu}}_{t}$ $\displaystyle=(1-\gamma)\sum_{t=T+1}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t} -\gamma^{T+1}\frac{1-\gamma}{1-\gamma^{T+1}}\sum_{t=0}^{T}\gamma^{t}\hat{\mu}^ {N_{\mu}}_{t}$ $\displaystyle\leq(1-\gamma)\sum_{t=T+1}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_ {t}$ $\displaystyle=\gamma^{T+1}\frac{1-\gamma}{\gamma^{T+1}}\sum_{t=T+1}^{\infty} \gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$ $\displaystyle=\gamma^{T+1}\hat{\mu}_{T+1,\infty}$ $$

where $\frac{1-\gamma}{\gamma^{T+1}}$ normalizes $\sum_{t=T+1}^{\infty}\gamma^{t}\hat{\mu}^{N_{\mu}}_{t}$. We utilize Equation (51) in Equation (50) as,

$$ $\displaystyle\mathcal{W}_{1}(\hat{\mu}_{\infty},\hat{\mu}_{T})$ $\displaystyle\leq diam(\mathcal{Z})\cdot\frac{1}{2}\sum_{z\in\mathcal{Z}}|\hat {\mu}_{\infty}(z)-\hat{\mu}_{T}(z)|$ (52) $\displaystyle\leq diam(\mathcal{Z})\cdot\frac{1}{2}\sum_{z\in\mathcal{Z}}| \gamma^{T+1}\hat{\mu}_{T+1,\infty}(z)|$ $\displaystyle=\frac{\gamma^{T+1}}{2}diam(\mathcal{Z})$ $$

Equation (52) also applies for $\mathcal{W}_{1}(\hat{\nu}_{\infty},\hat{\nu}_{T})$, therefore by substituting these into Equation (49),

$$ R.H.S $\displaystyle\leq\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty} \gamma^{t}\hat{\mu}^{N_{\mu}}_{t},\mu)]+\mathbb{E}[\mathcal{W}_{1}((1-\gamma) \sum_{t=0}^{\infty}\gamma^{t}\hat{\nu}^{N_{\nu}}_{t},\nu)]+\gamma^{T+1}diam( \mathcal{Z})$ (53) $\displaystyle=\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{ t}\hat{\mu}^{N_{\mu}}_{t},(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\mu_{t})]$ $\displaystyle+\mathbb{E}[\mathcal{W}_{1}((1-\gamma)\sum_{t=0}^{\infty}\gamma^{ t}\hat{\nu}^{N_{\nu}}_{t},(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\nu_{t})]+ \gamma^{T+1}diam(\mathcal{Z})$ $\displaystyle\leq(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\left(\mathbb{E}[ \mathcal{W}_{1}(\hat{\mu}^{N_{\mu}}_{t},\mu_{t})]+\mathbb{E}[\mathcal{W}_{1}( \hat{\nu}^{N_{\mu}}_{t},\nu_{t})]\right)+\gamma^{T+1}diam(\mathcal{Z})\,.$ $$

By substituting Equation (45) into Equation (53)

$$ R.H.S $\displaystyle\leq(1-\gamma)\sum_{t=0}^{\infty}\gamma^{t}\left(\mathcal{E}_{2}N _{\mu}^{-\frac{1}{2}}+\mathcal{E}_{2}N_{\nu}^{-\frac{1}{2}}\right)+\gamma^{T+1 }diam(\mathcal{Z})$ (54) $\displaystyle=\mathcal{E}_{2}\left(N_{\mu}^{-\frac{1}{2}}+N_{\nu}^{-\frac{1}{2 }}\right)+\gamma^{T+1}diam(\mathcal{Z})$ $$

Therefore, Equation (47) becomes:

$$ $\displaystyle\mathbb{E}[|\mathcal{W}_{1}(\hat{\mu},\hat{\nu})-\mathcal{W}_{1}( \mu,\nu)|]\leq\mathcal{E}_{2}\left(N_{\mu}^{-\frac{1}{2}}+N_{\nu}^{-\frac{1}{2 }}\right)+\gamma^{T+1}diam(\mathcal{Z})$ (55) $$

Over the full trajectory in the occupancy measure space. The true distance between consecutive policies $\pi_{i}$ and $\pi_{i+1}$ after an update is $\mathcal{W}_{1}(v_{\pi_{i}},v_{\pi_{i+1}})$, which is induced by the $i^{th}$ policy update. We estimate this distance using datasets of the policies, i.e. approximated distributions, using $\mathcal{W}_{1}(\hat{v}_{\pi_{i}},\hat{v}_{\pi_{i+1}})$.

For $M$ roll out episodes of each $\pi_{i}$, we use Equation (55), with $N_{\mu}=N_{\nu}=M$, to derive the following error bounds,

$$ $\displaystyle\mathbb{E}\left[\left|\mathcal{W}_{1}(v_{\pi_{i}},v_{\pi_{i+1}})- \mathcal{W}_{1}(\hat{v}_{\pi_{i}},\hat{v}_{\pi_{i+1}})\right|\right]\leq 2 \mathcal{E}_{2}M^{-\frac{1}{2}}+\gamma^{T+1}diam(\mathcal{Z})$ (56) $$

which is consistent with learning from $\mathcal{D}_{\pi_{i}}$ and then $\mathcal{D}_{\pi_{i+1}}$. By summing sequentially through policies encountered during RL training, we compute the total distance over a path of $N$ segments obtained via policy updates:

$$ $\displaystyle\sum_{i=0}^{N-1}\mathbb{E}\left[\left|\mathcal{W}_{1}(v_{\pi_{i}} ,v_{\pi_{i+1}})-\mathcal{W}_{1}(\hat{v}_{\pi_{i}},\hat{v}_{\pi_{i+1}})\right| \right]\leq 2N\mathcal{E}_{2}M^{-\frac{1}{2}}+N\gamma^{T+1}diam(\mathcal{Z})$ (57) $$

Since $|\sum_{t}x_{t}|\leq\sum_{t}|x_{t}|$ then,

$$ $\displaystyle\mathbb{E}\left[\left|\sum_{i=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{i}} ,v_{\pi_{i+1}})-\sum_{i=0}^{N-1}\mathcal{W}_{1}(\hat{v}_{\pi_{i}},\hat{v}_{\pi _{i+1}})\right|\right]\leq\frac{2N\mathcal{E}_{2}}{\sqrt{M}}+N\gamma^{T+1}diam (\mathcal{Z})$ (58) $$

#### A.7.2 Finite Horizon MDPs

Occupancy Measure Estimated Error. Consider two occupancy measures $\mu=\frac{1}{H}\sum_{t=1}^{H}\mu_{t}$ and $\nu=\frac{1}{H}\sum_{t=1}^{H}\nu_{t}$ with estimates $\hat{\mu}=\frac{1}{H}\sum_{t=1}^{H}\hat{\mu}^{N_{\mu}}_{t}$ and $\hat{\nu}=\frac{1}{H}\sum_{t=1}^{H}\hat{\nu}^{N_{\nu}}_{t}$. From Equation (46), we have

$$ $\displaystyle\mathbb{E}[|\mathcal{W}_{1}(\hat{\mu},\hat{\nu})-\mathcal{W}_{1}( \mu,\nu)|]$ (59) $\displaystyle\leq\mathbb{E}[\mathcal{W}_{1}(\hat{\mu},\mu)+\mathcal{W}_{1}( \hat{\nu},\nu)]$ $\displaystyle=\mathbb{E}[\mathcal{W}_{1}(\frac{1}{H}\sum_{t=1}^{H}\hat{\mu}^{N _{\mu}}_{t},\frac{1}{H}\sum_{t=1}^{H}\mu_{t})+\mathcal{W}_{1}(\frac{1}{H}\sum_ {t=1}^{H}\hat{\nu}^{N_{\nu}}_{t},\frac{1}{H}\sum_{t=1}^{H}\nu_{t})]$ $\displaystyle\leq\frac{1}{H}\sum_{t=1}^{H}\mathbb{E}[\mathcal{W}_{1}(\hat{\mu} ^{N_{\mu}}_{t},\mu_{t})]+\frac{1}{H}\sum_{t=1}^{H}\mathbb{E}[\mathcal{W}_{1}( \hat{\nu}^{N_{\nu}}_{t},\nu_{t})]$ $\displaystyle\leq\mathcal{E}_{2}\left(N_{\mu}^{-\frac{1}{2}}+N_{\nu}^{-\frac{1 }{2}}\right)$ $$

Therefore for the total path in the occupancy measure space with $M$ roll out episodes of each $\pi_{i}$, the error bound is

$$ $\displaystyle\mathbb{E}\left[\left|\sum_{i=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{i}} ,v_{\pi_{i+1}})-\sum_{i=0}^{N-1}\mathcal{W}_{1}(\hat{v}_{\pi_{i}},\hat{v}_{\pi _{i+1}})\right|\right]\leq\frac{2N\mathcal{E}_{2}}{\sqrt{M}}$ (60) $$

by assigning $N_{\mu}=N_{\nu}=M$ in Equation (59), which concludes the proof.

### A.8 Proof of Proposition 5

By definition of $\eta_{sub}$, we get

$$ $\displaystyle\eta_{sub}$ $\displaystyle=\frac{\sum_{i=0}^{N-2}\mathcal{W}_{1}(v_{\pi_{i}},v_{\pi_{i+1}}) +\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi_{N}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{ \pi_{N}})}$ $\displaystyle=\frac{\sum_{i=0}^{N-2}\mathcal{W}_{1}(v_{\pi_{i}},v_{\pi_{i+1}}) +\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi_{N}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{ \pi^{*}})}\times\frac{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi^{*}})}{\mathcal{W}_{1 }(v_{\pi_{0}},v_{\pi_{N}})}$ $\displaystyle\geq\frac{\sum_{i=0}^{N-2}\mathcal{W}_{1}(v_{\pi_{i}},v_{\pi_{i+1 }})+\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi^{*}})-\mathcal{W}_{1}(v_{\pi_{N}},v_{ \pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi^{*}})}\times\frac{\mathcal{W}_{1 }(v_{\pi_{0}},v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}$ $\displaystyle=\left(\eta-\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})}{ \mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\right)\frac{\mathcal{W}_{1}(v_{\pi_{ 0}},v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\,.$ (61) $$

The inequality above is true due to the triangle inequality $\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi_{N}})+\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^
{*}})\geq\mathcal{W}_{1}(v_{\pi_{N-1}},v_{\pi^{*}})$.

By applying triangle inequality, we also get

$$ $\displaystyle\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi^{*}})+\mathcal{W}_{1}(v_{\pi_{ N}},v_{\pi^{*}})\geq\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})\,.$ $$

This implies that

$$ $\displaystyle\frac{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi^{*}})}{\mathcal{W}_{1}(v _{\pi_{0}},v_{\pi_{N}})}\geq 1-\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})} {\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\,.$ (62) $$

Equation (61) and Equation (62) together yield

$$ $\displaystyle\eta_{sub}$ $\displaystyle\geq\left(\eta-\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})}{ \mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\right)\left(1-\frac{\mathcal{W}_{1}( v_{\pi_{N}},v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\right)$ $\displaystyle=\eta-\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})}{\mathcal{W} _{1}(v_{\pi_{0}},v_{\pi_{N}})}-\eta\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{* }})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}+\left(\frac{\mathcal{W}_{1}(v_{ \pi_{N}},v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\right)^{2}$ $\displaystyle\geq\eta\left(1-\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})}{ \mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\right)-\frac{\mathcal{W}_{1}(v_{\pi_ {N}},v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}$ $\displaystyle\geq\eta\left(1-\frac{2\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})}{ \mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\right)\,.$ $$

The second last inequality is due to non-negativity of $\left(\frac{\mathcal{W}_{1}(v_{\pi_{N}},v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{
0}},v_{\pi_{N}})}\right)^{2}$. The last inequality is due to the fact that $\eta\geq 1$.

Thus, we conclude that

$$ $\displaystyle\frac{\eta-\eta_{sub}}{\eta}\leq\frac{2\mathcal{W}_{1}(v_{\pi_{N} },v_{\pi^{*}})}{\mathcal{W}_{1}(v_{\pi_{0}},v_{\pi_{N}})}\,.$ $$

## Appendix B Additional Experimental Analysis and Results

### B.1 Environment Description

2D-Gridworld environment of size 5x5 with actions: {up, right, down, left}. The start and goal states are always located at top-left and bottom-right, respectively. A) Deterministic, dense rewards setting: State transitions are deterministic. The reward function is given by $\lVert s_{t}-s_{g}\rVert_{1}$, where $s_{t}$ is the agent state at timestep $t$ and $s_{g}$ is the goal state. B) Deterministic, sparse rewards setting: State transitions are deterministic and all states issue a reward of -0.04 except the goal state with reward of 1. C) Stochastic, dense rewards setting: Actions have a probability of 0.8 in the instructed direction and 0.1 in each adjacent direction. Reward function is as defined in setting A.

2D-Gridworlds (Task Difficulty). Figure 6 depicts the configurations of the 5 tasks that were used to assess ESL with respect to task hardness. They are all deterministic with actions: {up, right, down, left}, and mostly have the start-state at the top-left and the goal-state at the bottom-right - with only one task that has the goal-state at the center. In the order of appearance: a) [5x5] dense: has size 5x5 and dense rewards, b) [5x5] sparse (hard): has size 5x5 and sparse rewards, c) [5x5] sparse (easy): has size 5x5, sparse rewards, and goal-state at the center, d) [15x15] dense: has size 15x15 and dense rewards, and e) [15x15] sparse: has size 15x15 and sparse rewards. The reward functions for both dense and sparse rewards are as previously described above for 2D-Gridworld.

Figure: Figure 6: Five gridworld tasks with the same action space, but different rewards, state space and location of the goal state.
Refer to caption: extracted/5930571/images/settings2.png

### B.2 OMR(k): OMR over number of updates

OMR is defined for the entire policy trajectory by Equation 6 as,

$$ $\displaystyle\kappa$ $\displaystyle\triangleq\frac{\sum_{k\in K^{+}}\mathcal{W}_{1}(v_{\pi_{k}},v_{ \pi_{k+1}})}{\sum_{k=0}^{N-1}\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi_{k+1}})}\,.$ $$

To observe how it changes with respect to updates, we compute OMR from update $i$ onwards till the end of the learning trajectory, i.e. over subsequences with a decreasing number of policy updates with increasing $i$, using:

$$ $\displaystyle\kappa(i)$ $\displaystyle\triangleq\frac{\sum_{k\in K^{+},k\geq i}\mathcal{W}_{1}(v_{\pi_{ k}},v_{\pi_{k+1}})}{\sum_{k=i}^{N-1}\mathcal{W}_{1}(v_{\pi_{k}},v_{\pi_{k+1}}) },\,\,\text{such that }i\in[0,N-T]$ (63) $$

where $T\approx 0.9N$ to ensure that the last subsequence of policy updates have at least 10% of the total updates in the trajectory.

### B.3 Computation of Occupancy Measures

The finite-horizon occupancy measure is defined as (Altman, ),

$$ $\displaystyle v^{H}_{\pi}(s,a)=\frac{1}{H}\sum_{t=1}^{H}\mathbb{P}(s_{t}=s,a_{ t}=a\mid\pi,\mu)$ $$

for which the probability of the state-action pair selected is time-dependent. If we restrict our analysis to stationary policies where $\pi(a_{t}|s_{t})=\pi(a|s)$, then the probability of the state-action pair becomes time-independent and thus

$$ $\displaystyle v^{H}_{\pi}(s,a)=\mathbb{P}(s,a\mid\pi,\mu)$ $$

This implies that the use of stationary policies in finite-horizon MDPs, as observed in practice with many episodic MDPs (Memmel et al., ; Aleksandrowicz & Jaworek-Korjakowska, ; Liu, ), induces stationary occupancy measures - where the expected number of state-action pair visits are independent of the time-step. Work by (Bojun, ) provides extensive details about the existence of stationarity in episodic MDPs and shows (in Theorem 4) that

$$ $\displaystyle\mathbb{E}_{(s,a)\sim v_{\pi}^{H}}\left[\mathcal{\bar{R}}(s,a) \right]=\frac{\mathbb{E}_{\zeta\sim M_{\pi}}\left[\sum_{t=1}^{H(\zeta)}R(s_{t} ,a_{t})\right]}{\mathbb{E}_{\zeta\sim M_{\pi}}\left[H(\zeta)\right]}$ (64) $$

where $\zeta$ is the episodic state-action pair trajectory, $H(\zeta)$ is the episode length corresponding to $\zeta$, and $M_{\pi}$ is the markov chain induced by policy $\pi$. We verified the correctness of our $v_{\pi}^{H}$ computation by calculating the relative error derived from Equation 64 to check its validity. The relative error is given as

$$ $\displaystyle\text{Rel. Error \%\ }=100*\frac{\mathbb{E}_{(s,a)\sim v_{\pi}^{H }}\left[\mathcal{\bar{R}}(s,a)\right]\mathbb{E}_{\zeta\sim M_{\pi}}\left[H( \zeta)\right]-\mathbb{E}_{\zeta\sim M_{\pi}}\left[\sum_{t=1}^{H(\zeta)}R(s_{t} ,a_{t})\right]}{\mathbb{E}_{\zeta\sim M_{\pi}}\left[\sum_{t=1}^{H(\zeta)}R(s_{ t},a_{t})\right]}$ (65) $$

Figure 7 depicts Rel. Error$\%$ vs number of updates in the stochastic 2D-Gridworld environment with dense rewards. We observe that increasing the number of rollouts $M$ reduces the estimation error of $v^{H}_{\pi}$. For $M=10$, the absolute relative error can be as high as around 40% with the mean (red line) is at most about 10%. While for $M=500$, the maximum absolute relative error is about 3.5%.

Figure: Figure 7: Rel. Error$\%$ vs number of updates plots in the 2D-Gridworld environment where $v^{H}_{\pi}$ is estimated using $M=10$ rollouts (left) and $M=500$ rollouts (right). The noisy true data is in grey, while the rolling mean is the red line.
Refer to caption: x3.png

### B.4 Effects of the number of rollouts - SAC

The policy dataset $D_{\pi_{i}}$ in a deterministic environment is made up of (s,a) pairs generated from a single episode of the policy $\pi_{i}$. In a deterministic environment, this sequence remains the same across repeats of episodes, for each policy $\pi_{i}$ (deterministic) at update step $i$. Therefore, a single rollout is sufficient to estimate the occupancy measure $v_{\pi_{i}}$. In a stochastic environment, rollouts are impacted by the environment’s stochasticity. Thus, multiple rollouts are needed to estimate the occupancy measure accurately. As the number of rollouts increases, the occupancy measure should converge and become less noisy.

Table 4 shows that, in a stochastic setting, the ESL values converge as the number of rollouts increases. OMR appears to be invariant across various the number of rollouts, and the mean number of updates appear to be consistent around 2900 (with exception for #rollouts = 1). The results indicate that from about 6 rollouts, the estimated occupancy measures become less noisy. This aligns with Equation (58), which shows that increasing the number of rollouts reduces estimation error.

**Table 4: Evaluation of SAC algorithm in the stochastic, dense-rewards setting for 5x5 gridworld with 40 maximum steps per episode across various number of rollouts. The effects of #rollouts on the Effort of Sequential Learning (ESL), Optimal Movement Ratio (OMR), and number of updates to convergence (UC) are observed.**
| #rollouts | ESL | OMR | UC |
| --- | --- | --- | --- |
| 1 | 849.1$\pm$468.5 | 0.500$\pm$0.004 | 2349$\pm$742.2 |
| 3 | 618.6$\pm$257.3 | 0.501$\pm$0.005 | 2913$\pm$1397 |
| 6 | 445.4$\pm$245.8 | 0.501$\pm$0.042 | 2962$\pm$2043 |
| 9 | 428.1$\pm$234.4 | 0.503$\pm$0.004 | 2781$\pm$1743 |

### B.5 η 𝜂 \eta italic_η vs η s ⁢ u ⁢ b subscript 𝜂 𝑠 𝑢 𝑏 \eta_{sub} italic_η start_POSTSUBSCRIPT italic_s italic_u italic_b end_POSTSUBSCRIPT

We compare ESL when the optimal policy was reached, denoted $\eta$, versus when it was not, denoted $\eta_{sub}$, in Tables 5 and 6. First, we observe that the number of rollouts impacts the metric values. Second, $\eta_{sub}$ values are always greater than $\eta$ values. Note that UCRL2 and PSRL update their policies only at the end of each episode, whereas SAC and DQN update theirs after each time step. Hence, UC${}_{sub}=499$ for both UCRL2 and PSRL.

The ESL values (both $\eta$ and $\eta_{sub}$) in Table 6 are lower than those in Table 5, as expected since more data samples reduce estimation error. The distance from the initial policies to the final polices are not so different. Using both Tables 5 and 6, we notice that comparing algorithms with $\eta_{sub}$ yields the same efficiency ranking (e.g. PSRL, UCRL, SAC and DQN) as $\eta$. This indicates that $\eta_{sub}$ reliably predicts results provided by $\eta$ for comparing algorithms.

The results presented in Table 2 for stochastic dense-rewards setting are consistent with those in Table 6 because the number of rollouts used was Nr = 6.

**Table 5: Evaluation of algorithms in the stochastic, dense-rewards setting for 5x5 gridworld with 40 maximum steps per episode with the number of rollouts Nr = 1. The total number of training episodes is 500. When the algorithm converged at optimality, $\eta$ is the Effort of Sequential Learning, $d=\mathcal{W}_{1}(\pi_{0},\pi^{*})$ is distance from initial policy to the optimal policy, and UC is the number of updates to convergence. When the algorithm did not converge at the optimal policy, rather a non-optimal $\pi_{N}$, we use $\eta_{sub}$, $c=\mathcal{W}_{1}(\pi_{0},\pi_{N})$, and UCsub to denote the aforementioned quantities. 40 training trials were used.**
| Algo. | $\eta$ | $\eta_{sub}$ | d | c | UC | UCsub |
| --- | --- | --- | --- | --- | --- | --- |
| SAC | 849$\pm$<br>468 | 3623$\pm$<br>4166 | 5.63$\pm$<br>1.50 | 5.26$\pm$<br>2.10 | 2350$\pm$<br>742 | 7951$\pm$<br>3535 |
| UCRL2 | 230$\pm$<br>155 | 613$\pm$<br>999 | 5.65$\pm$<br>0.93 | 5.45$\pm$<br>2.15 | 284$\pm$<br>180 | 499$\pm$<br>0.0 |
| PSRL | 86.2$\pm$<br>44.4 | 389$\pm$<br>102 | 4.96$\pm$<br>1.26 | 5.29$\pm$<br>1.49 | 97.2$\pm$<br>52.5 | 499$\pm$<br>0.0 |
| DQN | 564$\pm$<br>478 | 3911$\pm$<br>1710 | 5.52$\pm$<br>1.39 | 6.54$\pm$<br>2.05 | 1278$\pm$<br>1061 | 9162$\pm$<br>1904 |

**Table 6: Evaluation of algorithms in the stochastic, dense-rewards setting for 5x5 gridworld with 40 maximum steps per episode with the number of rollouts Nr = 6. The total number of training episode is 500. When the algorithm converged at optimality, $\eta$ is the Effort of Sequential Learning, $d=\mathcal{W}_{1}(\pi_{0},\pi^{*})$ is distance from initial policy to the optimal policy, and UC is the number of updates to convergence. When the algorithm did not converge at the optimal policy however some $\pi_{N}$, we use $\eta_{sub}$, $c=\mathcal{W}_{1}(\pi_{0},\pi_{N})$, and UCsub to denote the aforementioned quantities. 40 training trials were used.**
| Algo. | $\eta$ | $\eta_{sub}$ | d | c | UC | UCsub |
| --- | --- | --- | --- | --- | --- | --- |
| SAC | 445$\pm$<br>246 | 853$\pm$<br>127 | 5.63$\pm$<br>1.23 | 7.26$\pm$<br>1.45 | 2963$\pm$<br>2043 | 6793$\pm$<br>441 |
| UCRL2 | 198$\pm$<br>121 | 510$\pm$<br>274 | 5.36$\pm$<br>0.84 | 4.58$\pm$<br>1.90 | 268$\pm$<br>155 | 499$\pm$<br>0.0 |
| PSRL | 55.4$\pm$<br>33.6 | 361$\pm$<br>43.6 | 4.97$\pm$<br>1.34 | 3.91$\pm$<br>0.48 | 76.1$\pm$<br>50.6 | 499$\pm$<br>0.0 |
| DQN | 458$\pm$<br>311 | 1971$\pm$<br>250 | 4.88$\pm$<br>1.06 | 6.52$\pm$<br>0.31 | 1651$\pm$<br>1077 | 13778$\pm$<br>6907 |

### B.6 Results for over 500 rollouts

In a stochastic environment, the optimal policy $\pi^{*}$ may not always return optimal rewards due to the stochasticity of the environment. However, we expect the optimal policy to have higher success rate of reaching optimal rewards than any other policy. Therefore, we reason that if the final policy $\pi$ has less than 30% success rate, then it is considered a sub-optimal policy. In this section, we present more results to compare algorithms in the gridworld with stochastic transitions and dense rewards. The results (shown in Tables 7 and 8) are for over 500 number of rollouts across 10 trial runs.

**Table 7: Evaluation of RL algorithms (10 runs, number of rollouts 500) in the stochastic, dense-rewards setting for 5x5 gridworld, including Effort of Sequential Learning (ESL), Optimal Movement Ratio (OMR), number of updates to convergence (UC), and success rate (SR). Lowest ESL, highest OMR and lowest UC values are in bold, while the highest ESL value is starred ($\star$).**
| Algo. | ESL | OMR | UC | SR% |
| --- | --- | --- | --- | --- |
| SAC | 97.6$\pm$34 | 0.506$\pm$0.01 | 2130$\pm$328 | 80 |
| UCRL2 | 293$\pm$89.5^⋆ | 0.502$\pm$0.02 | 388$\pm$118 | 60 |
| PSRL | 73.4$\pm$34.2 | 0.49$\pm$0.04 | 85.5$\pm$40.4 | 80 |
| DQN | 104$\pm$33.4 | 0.511$\pm$0.012 | 1069$\pm$334 | 90 |

**Table 8: Evaluation of algorithms in the stochastic, dense-rewards setting for 5x5 gridworld with 40 maximum steps per episode with the number of rollouts is 500. The total number of training episode is 500. When the algorithm converged at optimality, $\eta$ is the Effort of Sequential Learning, $d=\mathcal{W}_{1}(\pi_{0},\pi^{*})$ is distance from initial policy to the optimal policy, and UC is the number of updates to convergence. When the algorithm did not converge at the optimal policy however some $\pi_{N}$, we use $\eta_{sub}$, $c=\mathcal{W}_{1}(\pi_{0},\pi_{N})$, and UCsub to denote the aforementioned quantities. 40 training trials were used.**
| Algo. | $\eta$ | $\eta_{sub}$ | d | c | UC | UCsub |
| --- | --- | --- | --- | --- | --- | --- |
| SAC | 97.6$\pm$<br>34 | 356$\pm$<br>24.3 | 4.82$\pm$<br>1.04 | 4.05$\pm$<br>3.04 | 2130$\pm$<br>328 | 8890$\pm$<br>8192 |
| UCRL2 | 293$\pm$<br>89.5 | 449$\pm$<br>208 | 5.08$\pm$<br>0.10 | 4.66$\pm$<br>1.59 | 388$\pm$<br>118 | 499$\pm$<br>0.0 |
| PSRL | 73.4$\pm$<br>34.2 | 67.0$\pm$<br>49.2 | 4.32$\pm$<br>1.22 | 5.33$\pm$<br>0.07 | 85.5$\pm$<br>40.4 | 109$\pm$<br>90.5 |
| DQN | 104$\pm$<br>33.4 | 70.4$\pm$<br>0 | 5.54$\pm$<br>0.68 | 6.67$\pm$<br>0 | 1069$\pm$<br>335 | 950$\pm$<br>0 |

### B.7 Effects of Hyperparameters - UCRL2

Table 9 illustrates the effects of hyperparameter values in the UCRL2 algorithm. The environment is deterministic dense-rewards setting with 200 training episodes. We observe that high exploration rates ($\delta\to 0$) appear to align with high ESL and UC, while high exploitation rates ($\delta\to 1$) appear to align with low ESL and UC. OMR appears to be invariant across various $\delta$ values.

**Table 9: Evaluation of UCRL2 algorithm in the deterministic, dense-rewards setting for 5x5 gridworld with 15 maximum steps per episode. Different confidence parameter $\delta\in(0,1)$ were evaluated to see their effects on Effort of Sequential Learning (ESL), Optimal Movement Ratio (OMR), number of updates to convergence (UC), and success rate (SR). Note that as $\delta\to 0$, the agent approaches absolute exploration, and with $\delta\to 1$ absolute exploitation.**
| $\delta$ | ESL | OMR | UC | SR% |
| --- | --- | --- | --- | --- |
| 0.1 | 47.76$\pm$7.768 | 0.512$\pm$0.033 | 62.26$\pm$9.977 | 100 |
| 0.3 | 39.29$\pm$5.860 | 0.515$\pm$0.034 | 58.08$\pm$7.746 | 100 |
| 0.5 | 38.26$\pm$6.747 | 0.511$\pm$0.036 | 56.92$\pm$9.111 | 100 |
| 0.7 | 37.48$\pm$5.094 | 0.507$\pm$0.029 | 56.68$\pm$7.460 | 100 |
| 0.9 | 36.40$\pm$5.301 | 0.510$\pm$0.036 | 54.86$\pm$7.326 | 100 |

## Appendix C Specifications of the RL Algorithms under Study

### C.1 Methods for simulation results (Discrete MDP)

Model parameter initialisation.
We initialised model parameters for deep learning RL algorithms like DQN and SAC by uniformly sampling weight values between $-3\cdot 10^{-4}$ and $3\cdot 10^{-4}$ and the biases at 0 0. For tabular Q-learning algorithms, we randomly initialized the Q-values between $-1.0$ and $1.0$. For UCRL and PSRL, the policy model was randomly initialized. Note that all Wasserstein distances were computed using a python package POT (Flamary et al., ).

Results in Figure 3. The problem setting was deterministic with dense-rewards and 15 maximum number of steps per episode. The total number of episodes was 200. The convergence criterion was satisfied when maximum returns were produced by an algorithm over 5 consecutive updates. The results showcase a single representative run of each algorithm. The confidence parameter $\delta=0.1$ was utilized for UCRL2. The $\alpha$ parameter for SAC was autotuned using the approach in (Haarnoja et al., ) along with hyperparameters described in Table 10. While DQN began with $\epsilon=1.0$ and the value decayed as $\epsilon[t+1]=\max\{0.9999\times\epsilon[t],0.0001\}$. Table 11 shows hyperparameters for DQN. Note that the ADAM (Kingma & Ba, ) optimizer was used in all the neural network models.

**Table 10: SAC Hyperparameters.**
| Parameter | Value |
| --- | --- |
| learning rate | $5\cdot 10^{-4}$ |
| discount($\gamma$) | 0.99 |
| replay buffer size | $10^{4}$ |
| number of hidden layers (all networks) | 1 |
| number of hidden units per layer | 32 |
| number of samples per minibatch | 64 |
| nonlinearity | ReLU |
| entropy target | -4 |
| target smoothing coefficient ($\tau$) | 0.01 |
| target update interval | 1 |
| gradient steps | 1 |
| initial exploration steps |  |
| before model starts updating | 500 |

**Table 11: DQN Hyperparameters.**
| Parameter | Value |
| --- | --- |
| learning rate | $5\cdot 10^{-2}$ |
| discount($\gamma$) | 0.99 |
| replay buffer size | $10^{4}$ |
| number of hidden layers (all networks) | 1 |
| number of hidden units per layer | 32 |
| number of samples per minibatch | 64 |
| nonlinearity | ReLU |
| target smoothing coefficient ($\tau$) | 0.001 |
| target update interval | 1 |
| gradient steps | 1 |
| initial exploration steps |  |
| before $\epsilon$ decays | 500 |

Results in Tables 1 and 2. The problem settings had 40 maximum number of steps per episode, and the convergence criterion was satisfied when maximum returns were produced by an algorithm over 5 consecutive updates. The means and standard deviations for each algorithm were computed over 50 runs. The total number of episodes was 200 for results in Table 1, and 500 in Table 2. For results in Figure 5, the Q-learning with decaying $\epsilon$-greedy where $\epsilon=0.9$ was employed in the gridworld tasks described in Appendix B.1. A convergence criterion of 50 consecutive model updates with maximum returns was utilized. We aggregated the result over 40 training trials and the maximum number of steps per episode was 60.

### C.2 Methods for simulation results (Continuous MDP)

Model parameter initialisation. We initialised model parameters for the deep learning SAC algorithm by uniformly sampling weight values between $-3\cdot 10^{-4}$ and $3\cdot 10^{-4}$ and the biases at 0 0. For the DDPG algorithm, the output layer weight values were initialised using Xavier Initialization (Glorot & Bengio, ), while the rest were uniformly sampled between $-3\cdot 10^{-3}$ and $3\cdot 10^{-3}$. This was done on both the actor and critic networks. The ADAM (Kingma & Ba, ) optimizer was used in all the neural network models. In both algorithms, 1) a discount factor $\gamma=0.99$ was used, 2) 500 initial steps were taken before updating model weights, and 3) replay buffer size was $10^{6}$. Tables 12 and 13 display hyperparameters for DDPG and SAC, respectively.

Results in Figure 4. The problem setting was Mountain Car continuous (Moore, ) with 999 maximum number of steps per episode (Brockman et al., ). The total number of training episodes was 100. The convergence criterion was satisfied when maximum returns were produced by an algorithm over 10 consecutive updates. The results showcase a single representative run of each algorithm. For results in Table 3, the mean and standard deviations for each algorithm were computed over 5 runs. While RL training was conducted in a continuous state-action space, we discretized it for Wasserstein distance calculations between occupancy measures, using 4 bins for actions and 10 bins for states.

**Table 12: DDPG Hyperparameters.**
| Parameter | Value |
| --- | --- |
| number of samples per minibatch | 128 |
| nonlinearity | ReLU |
| target smoothing coefficients ($\tau$) | 0.001 |
| target update interval | 1 |
| gradient steps | 1 |
| number of hidden layers (all networks) | 2 |
| number of hidden units per layer | 64 |
| Actor learning rate | $5\cdot 10^{-4}$ |
| Critic learning rate | $5\cdot 10^{-3}$ |

**Table 13: SAC Hyperparameters.**
| Parameter | Value |
| --- | --- |
| learning rate | $3\cdot 10^{-3}$ |
| number of hidden layers (all networks) | 2 |
| number of hidden units per layer | 64 |
| number of samples per minibatch | 128 |
| nonlinearity | ReLU |
| target smoothing coefficient ($\tau$) | 0.001 |
| target update interval | 1 |
| gradient steps | 1 |

## Appendix D Supplementary Results

In this section we present enlarged versions of results in Figure 3 (see Section D.1) and additional plots that support the results in the main paper (see Section D.2). Note that the Github repository of the project is available at [https://github.com/nkhumise-rea/analysis_of_occupancy_measure_trajectory](https://github.com/nkhumise-rea/analysis_of_occupancy_measure_trajectory).

### D.1 Enlarged Visualisation of the Occupancy Measure Trajectories

Figures 8 - 10 are enlarged versions of enlarged versions of Figure 3. For each algorithm, there is a visualisation of the policy trajectory and visualisation of the state visitation below it.

Figure: Figure 8: Top row: Scatter plots of distance-to-optimal and stepwise-distance over updates for $\epsilon($=0)-greedy and $\epsilon($=1)-greedy Q-learning. Bottom row: State visitations.
Refer to caption: extracted/5930571/images/policy_evolution/greedy.png

Figure: Figure 9: Top row: Scatter plots of distance-to-optimal and stepwise-distance over updates for UCRL and PSRL. Bottom row: State visitations.
Refer to caption: extracted/5930571/images/policy_evolution/ucrl.png

Figure: Figure 10: Top row: Scatter plots of distance-to-optimal and stepwise-distance over updates for SAC and DQN. Bottom row: State visitations.
Refer to caption: extracted/5930571/images/policy_evolution/sac.png

### D.2 Evolution of distance-to-optimal , stepwise-distance , and OMR ( k ) 𝑘 (k) ( italic_k )

In this section we present 2 dimensional versions of the policy trajectories in Figures 3 and 4. These are distance-to-optimal vs updates and stepwise-distance vs. updates plots for selected algorithms (Figures 11 - 15). Furthermore, OMR($k)$ plots for algorithms used in the discrete MDP are presented.

Figure: Figure 11: distance-to-optimal and stepwise-distance vs updates plots for SAC algorithm in the Mountain Car continuous environment.
Refer to caption: x5.png

Figure: Figure 12: distance-to-optimal and stepwise-distance vs updates plots for DDPG algorithm in the Mountain Car continuous environment.
Refer to caption: x7.png

Figure: Figure 13: distance-to-optimal and stepwise-distance vs updates plots for PSRL algorithm in the 2D-Gridworld environment.
Refer to caption: x9.png

Figure: Figure 14: distance-to-optimal and stepwise-distance vs updates plots for UCRL algorithm in the 2D-Gridworld environment.
Refer to caption: x12.png

Figure: Figure 15: distance-to-optimal and stepwise-distance vs updates plots for DQN algorithm in the 2D-Gridworld environment.
Refer to caption: x15.png

## Peer Reviews

confidence: 3
contribution: 2
initial_rating: 6
presentation: 3
questions: - The plots in Fig 3 and 4 are tough to parse - what is the big line in Fig 3 for SAC and DQN. Is this the time it takes to fill the replay buffer? If so, why are the colors of the line changing?
soundness: 3
strengths: - The approach is innovative and valuable as it effectively incorporates the exploratory components of the learning problem, successfully capturing these aspects. 
- The methodology is both theoretically robust and practically applicable. Experiments conducted on grid world and mountain car environments suggest that the proposed methodology can capture key aspects related to exploratory dynamics within the learning problem. 
- The paper is clearly written and easy to follow.
summary: The paper introduces a novel method to assess the difficulty of learning in sequential decision-making problems. This is achieved by conceptualizing the learning problem as the cumulative optimal transport distance between consecutive occupancy measures, which correspond to the policies generated by a learning algorithm. The authors utilize the Wasserstein distance between occupancy measures to define the notion of distance between policies within a manifold. This leads to the definition of the hardness of the learning problem, termed as the Effort of Sequential Learning (ESL), and its connection to regret via the Optimal Movement Ratio (OMR). The authors also present finite-sample estimates for these quantities, with corresponding approximation guarantees. The efficacy of their metrics is demonstrated on classic reinforcement learning (RL) tasks, incorporating a variety of popular RL algorithms.
weaknesses: - The main limitation of this work is found in the assumption made in Proposition 1, where the authors presume the existence of the inverse of $P^{\pi}(s,s')$. This assumption effectively implies that any policy $\pi$ is reversible within the environment, meaning the agent following such a policy can always undo its actions. This is a very strong assumption; for example, in an environment where an agent can break a vase, this assumption suggests the agent can also reverse this action and restore the vase to its original state. This assumption is not highlighted enough and significantly narrows the scope of this work in comparison to broader decision-making settings. I recommend the authors explicitly state this assumption and discuss its implications.

- The practical utility of the proposed metrics is unclear. The 3D plots (Fig 3 and 4) are challenging to interpret. I suggest the authors present the same findings using separate 2D plots—one for the distance to optimal and another for the stepwise-distance.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 3
questions: 1. What information do ESL and OMR provide about the learning process beyond that provided by sample complexity / UC and regret?
2. Why is ESL better for measuring task complexity than sample complexity / UC or regret?
soundness: 2
strengths: Overall, the paper's objective of developing metrics for quantitative comparison of the learning processes of RL algorithms that go beyond the standard sample complexity / total number of update steps and regret is well-motivated and likely of interest to the community. In particular, the idea of achieving this by examining the effort expended in shifting probability mass around in occupancy measure space during the learning process is an interesting one and worth further investigation. Finally, the paper is clearly written and straightforward to understand.
summary: The paper proposes new metrics, effort of sequential learning (ESL) and optimal movement ratio (OMR), that are used to study the sequence of policies, $\pi_{\theta_1}, \ldots, \pi_{\theta_n}$, generated by a reinforcement learning (RL) algorithm by examining the corresponding sequence of state-action occupancy measures, $v_{\pi_{\theta_1}}, \ldots, v_{\pi_{\theta_n}}$, induced by those policies. These metrics consider the 1-Wasserstein distances between consecutive occupancy measures $W_1(v_{\pi_{\theta_k}}, v_{\pi_{\theta_{k+1}}})$ over the entire space of state-action occupancy measures, $\Delta(S \times A)$. Theoretical results are provided stating that the set $\mathcal{M} =$ {$v_{\pi_{\theta}} \ | \ \theta \in \Theta$} $\subset \Delta(S \times A)$ is a differentiable manifold and that regret of an RL algorithm is upper-bounded by the sum of Wasserstein distances, and practical approximations of ESL and OMR computed using finite-rollout datasets are proposed and upper bounds on their approximation error are given. Experimental results are provided on a 5x5 gridworld problem and the MountainCar environment that visualize occupancy measure trajectories of a variety of algorithms (Q-learning, UCRL, PSRL, SAC, DQN), compare their ESR, OMR and total number of updates performed until convergence (UC), and illustrate that ESL tends to increase with task difficulty.
weaknesses: Despite its strengths, the paper has key weaknesses.

First, the ESR and OMR metrics are misguided, since the effort measured by Wasserstein distance in the space of state-action occupancy measures does not necessarily correspond to effort performed by the algorithm. This arises due to Definition 1 not taking the differential structure of the manifold $\mathcal{M}$ into account: specifically, the distance $d_{\mathcal{X}}$ that the paper uses in the definition of the Wasserstein distance is $\ell$1 distance in the space $\Delta( S \times A)$, instead of a corresponding distance over the surface of the manifold $\mathcal{M}$ (see the discussion following eq. (2)). This means that ESL and OMR may misrepresent occupancy measures that are far apart (or close together) over the surface of $\mathcal{M}$ as close together (or far apart) by only considering their distance over $\Delta( S \times A)$.

To see this, suppose that two different algorithms, algorithm 1 and algorithm 2, yield a sequence of policies $\pi_{\theta_1}, \ldots, \pi_{\theta_m}$ and $\pi_{\theta_1}', \ldots, \pi_{\theta_n}'$, respectively, where $m \ll n$ and $\pi_{\theta_m} = \pi_{\theta_n}' = \pi^*$. Suppose furthermore that the occupancy measure trajectories $v_{\pi_{\theta_1}}, \ldots, v_{\pi_{\theta_m}}$ and $v_{\pi_{\theta_1}'}, \ldots, v_{\pi_{\theta_n}'}$ are such that $C = \sum_{k=1}^{m-1} W_1(v_{\pi_{\theta_k}}, v_{\pi_{\theta_{k+1}}}) \gg 1$, while $C' = \sum_{k=1}^{n-1} W_1(v_{\pi_{\theta_k}'}, v_{\pi_{\theta_{k+1}}'}) = 1$ (see eq. (4) for $C$ definition). Without imposing special structure on the policy parametrization, there is nothing preventing such a situation from arising. In this case, we have that the ESL $\eta$ of algorithm 1 (see ESL definition in eq. (5)) satisfies $\eta \gg 1$, while the ESL $\eta'$ of algorithm 2 satisfies $\eta' = 1$, despite the fact that algorithm 1 achieved optimality in far fewer steps ($m \ll n$) than algorithm 2. This casts doubt on the usefulness of ESL and OMR as proxies for the efficiency of the learning process. **Notice that this kind of situation actually arises in the experiments provided in the paper:** in Table 1 and the top half of Table 2 the algorithms with lowest UC have large ESL and OMR values, while the algorithms with smallest ESL and OMR values have large UC values. Since ESL and OMR are thus not positively correlated with sample complexity or UC, this raises the question: why are ESL and OMR useful? what insight into the learning process do they provide that sample complexity / UC or regret do not? The answer to these questions is not clear from the paper.

In addition, the experimental results do not provide clear arguments supporting the usefulness of ESL and OMR. While visualizing occupancy measure trajectories in Sec. 5.1 is an interesting exercise, it is not clear how these results support the main goal of providing "insight into the exploration processes of RL algorithms" stated in the abstract. For the reasons described at the end of the preceding paragraph, the results of Sec. 5.2 raise concerns regarding the usefulness of ESL and OMR for comparing the learning processes of RL algorithms. Finally, though Sec. 5.3 does provide evidence that ESL is positively correlated with task difficulty, it also raises an important question: aren't sample complexity / total number of update steps or even regret useful for measuring task complexity as well? why should ESL be preferred?

**Suggestion:** ESL and OMR may be more rigorously grounded by developing a version of Definition 1 that accounts for the structure of $\mathcal{M}$. This will complicate the theoretical and approximation results, but it may be possible to consider versions of those results when the differential structure of $\mathcal{M}$ is particularly simple, such as with tabular or softmax policies.

---

confidence: 2
contribution: 2
initial_rating: 5
presentation: 3
questions: 1. Normally the Wasserstein distances are not very easy to calculate, hence people usually use approximation algorithms, e.g. Sinkhorn algorithms to approximate the W-distances. How does this approximation error affects the value of ESL and OMR?

2. Is there any relation between the performance of the algorithm and these two notions of complexity, either theoretically or practically?
soundness: 2
strengths: 1. This paper is well-written. The proofs are correct.

2. This paper proposes the ESL and OMR notions, which makes contribution in understanding the effectiveness of training dynamics of RL algorithms.
summary: This paper proposes two ratios to characterize the learning pattern of RL algorithms, the ESL and OMR. ESL characterize how straight is the training trajectories, which takes smaller values if the occupancy measures admits some straight lines. OMR characterizes the proportion of trajectories which has positive effects toward the optimal policy.

This paper propose some finite-sample analysis in approximating the ESL and OMR with iid samples. They also provide numerical experiments to calculate ESL and OMR values for some popular algorithms in RL literatures.
weaknesses: 1. The definition of OMR seems very weird. This notion is not continuous to the training trajectories, which means that the OMR value can change a lot if the model is only perturbed a little (maybe due to randomness or small approximation error). It will be good if there is a more robust notion which serves the same purpose of OMR.

2. According to the finite sample proposition (Proposition 4), the number of samples required to get a good approximation is proportional to the number of states and number of actions, which could be exponentially large for real tasks.

3. This two notions of complexity only characterize the training dynamics, but there still exist some algorithms which enjoys good performances even though the dynamics are volatile. These two notions cannot capture such properties of the algorithms.

Meta-review: This paper introduces the Effort of Sequential Learning (ESL) and Optimal Movement Ratio (OMR) metrics to analyze the learning dynamics of reinforcement learning (RL) algorithms by examining the trajectories of state-action occupancy measures. The paper provides theoretical results and empirical evaluations on standard RL environments like gridworld and MountainCar.

The paper is well-written, and the introduction of ESL and OMR offers a novel perspective on RL training dynamics, moving beyond traditional metrics like sample complexity and regret. However, several concerns were raised by reviewers. The primary issue is the robustness of OMR, which is highly sensitive to small changes during training, making it unreliable in practice. Additionally, ESL and OMR are not well-aligned with learning efficiency or performance metrics, casting doubt on their practical utility. The paper also lacks a clear connection between these metrics and the overall performance of RL algorithms. Further, the finite-sample proposition suggests that the number of samples required to approximate ESL and OMR could be excessively large in real-world tasks.

The paper would benefit from addressing these concerns, particularly by refining the OMR definition for robustness and improving the alignment of ESL and OMR with actual learning efficiency. Additionally, more concrete examples showing the practical applicability of these metrics in RL tasks are needed. Though the paper’s contributions are valuable, the usefulness of ESL and OMR remains unclear without further refinement and demonstration of their relevance to algorithm performance.

Decision: Reject