# Delegative Inverse Reinforcement Learning

$$\newcommand{\Comment}[1]{}$$

$$\newcommand{\Bool}{\{0,1\}}$$
$$\newcommand{\Words}{{\Bool^*}}$$

$$\DeclareMathOperator{\Sgn}{sgn}$$
$$\DeclareMathOperator{\Supp}{supp}$$
$$\DeclareMathOperator{\Stab}{stab}$$
$$\DeclareMathOperator{\Img}{Im}$$
$$\DeclareMathOperator{\Dom}{dom}$$

$$\newcommand{\PP}[2]{\underset{\substack{#1 \\ #2}}{\operatorname{Pr}}}$$
$$\newcommand{\PPP}[3]{\underset{\substack{#1 \\ #2 \\ #3}}{\operatorname{Pr}}}$$
$$\newcommand{\E}[1]{\underset{#1}{\operatorname{E}}}$$
$$\newcommand{\EE}[2]{\underset{\substack{#1 \\ #2}}{\operatorname{E}}}$$
$$\newcommand{\EEE}[3]{\underset{\substack{#1 \\ #2 \\ #3}}{\operatorname{E}}}$$
$$\newcommand{\Var}{\operatorname{Var}}$$

$$\newcommand{\Ent}{\operatorname{H}}$$
$$\newcommand{\Hom}{\operatorname{Hom}}$$
$$\newcommand{\End}{\operatorname{End}}$$
$$\newcommand{\Sym}{\operatorname{Sym}}$$

$$\newcommand{\Prj}{\operatorname{pr}}$$

$$\newcommand{\KL}[2]{\operatorname{D}_{\mathrm{KL}}(#1 \| #2)}$$
$$\newcommand{\Dtv}{\operatorname{d}_{\text{tv}}}$$

$$\newcommand{\Argmin}[1]{\underset{#1}{\operatorname{arg\,min}}\,}$$
$$\newcommand{\Argmax}[1]{\underset{#1}{\operatorname{arg\,max}}\,}$$

$$\newcommand{\Nats}{\mathbb{N}}$$
$$\newcommand{\Ints}{\mathbb{Z}}$$
$$\newcommand{\Rats}{\mathbb{Q}}$$
$$\newcommand{\Reals}{\mathbb{R}}$$
$$\newcommand{\Coms}{\mathbb{C}}$$

$$\newcommand{\Sq}[2]{\{#1\}_{#2 \in \Nats}}$$
$$\newcommand{\Sqn}[1]{\Sq{#1}{n}}$$

$$\newcommand{\Estr}{\boldsymbol{\lambda}}$$

$$\newcommand{\Lim}[1]{\lim_{#1 \rightarrow \infty}}$$
$$\newcommand{\LimInf}[1]{\liminf_{#1 \rightarrow \infty}}$$
$$\newcommand{\LimSup}[1]{\limsup_{#1 \rightarrow \infty}}$$

$$\newcommand{\Abs}[1]{\lvert #1 \rvert}$$
$$\newcommand{\Norm}[1]{\lVert #1 \rVert}$$
$$\newcommand{\Floor}[1]{\lfloor #1 \rfloor}$$
$$\newcommand{\Ceil}[1]{\lceil #1 \rceil}$$
$$\newcommand{\Chev}[1]{\langle #1 \rangle}$$
$$\newcommand{\Quote}[1]{\ulcorner #1 \urcorner}$$

$$\newcommand{\Alg}{\xrightarrow{\textnormal{alg}}}$$
$$\newcommand{\Markov}{\xrightarrow{\textnormal{k}}}$$
$$\newcommand{\PF}{\xrightarrow{\circ}}$$

$$\newcommand{\Prob}{\mathcal{P}}$$

$$\newcommand{\X}{\mathcal{X}}$$
$$\newcommand{\Y}{\mathcal{Y}}$$
$$\newcommand{\Ob}{\mathcal{O}}$$
$$\newcommand{\A}{\mathcal{A}}$$
$$\newcommand{\I}{\mathcal{I}}$$
$$\newcommand{\FH}{(\A \times \Ob)^*}$$
$$\newcommand{\IH}{(\A \times \Ob)^\omega}$$
$$\newcommand{\Ado}{\bar{\Ob}}$$
$$\newcommand{\Ada}{\bar{\A}}$$
$$\newcommand{\Adi}{\bar{\I}}$$
$$\newcommand{\Adao}{\overline{\A \times \Ob}}$$
$$\newcommand{\Adfh}{\Adao^*}$$
$$\newcommand{\Adih}{\Adao^\omega}$$
$$\DeclareMathOperator{\HD}{hdom}$$
$$\newcommand{\Hy}{\mathcal{H}}$$
$$\newcommand{\Co}{\mathcal{C}}$$

$$\newcommand{\Ut}{\operatorname{U}}$$
$$\newcommand{\V}{\operatorname{V}}$$
$$\newcommand{\W}{\operatorname{Q}}$$
$$\newcommand{\EU}{\operatorname{EU}}$$

$$\newcommand{\BE}[1]{\underset{#1}{\boldsymbol{\operatorname{E}}}}$$

We introduce a reinforcement-like learning setting we call *Delegative Inverse Reinforcement Learning* (DIRL). In DIRL, the agent can, at any point of time, delegate the choice of action to an "advisor". The agent knows neither the environment nor the reward function, whereas the advisor knows both. Thus, DIRL can be regarded as a special case of CIRL. A similar setting was studied in [Clouse 1997](https://web.cs.umass.edu/publication/docs/1997/UM-CS-1997-026.pdf), but as far as we can tell, the relevant literature offers few theoretical results and virtually all researchers focus on the MDP case (*please correct me if I'm wrong*). On the other hand, we consider general environments (not necessarily MDP or even POMDP) and prove a natural performance guarantee.

The use of an advisor allows us to kill two birds with one stone: learning the reward function and safe exploration (i.e. avoiding both the Scylla of "[Bayesian paranoia](http://proceedings.mlr.press/v40/Leike15.pdf)" and the Charybdis of falling into traps). We prove that, given certain assumption about the advisor, a Bayesian DIRL agent (whose prior is supported on some countable set of hypotheses) is guaranteed to attain most of the value in the slow falling time discount (long-term planning) limit (assuming one of the hypotheses in the prior is true). The assumption about the advisor is quite strong, but the advisor is not required to be fully optimal: a "soft maximizer" satisfies the conditions. Moreover, we allow for the existence of "corrupt states" in which the advisor stops being a relevant signal, thus demonstrating that this approach can deal with wireheading and avoid manipulating the advisor, at least in principle (the assumption about the advisor is still unrealistically strong). Finally we consider advisors that don't know the environment but have some *beliefs* about the environment, and show that in this case the agent converges to Bayes-optimality w.r.t. the advisor's beliefs, which is arguably the best we can expect.

***

All the proofs are in the Appendix.

# Notation

The set of natural numbers $\Nats$ is defined to begin from 0. Given $n \in \Nats$, $[n]$ denotes the set $\{m \in \Nats \mid m < n\}$. Given a logical formula $\varphi$, $[[\varphi]] \in \{0,1\}$ denotes its truth value.

Given a set $\X$, we denote $\X^*:=\bigsqcup_{n \in \Nats} X^n$, the set of finite strings over the alphabet $\X$. The unique string of length 0 is denoted $\Estr$. We also denote by $\X^\omega$ the set of *infinite* strings over alphabet $\X$. Given $\alpha \in \X^* \sqcup \X^\omega$ and $n \in \Nats$, $\alpha_n \in \X$ is the $n$-th symbol in $\alpha$ (i.e. $\alpha = \alpha_0\alpha_1\alpha_2 \ldots$) and $\alpha_{:n} \in \X^*$ is the prefix of length $n$ of $\alpha$ (ending in $\alpha_{n-1}$). Given $\alpha,\beta \in \X^*$, $\Abs{\alpha} \in \Nats$ is the length of $\alpha$ and $\alpha\beta \in \X^*$ is the concatenation of $\alpha$ and $\beta$. The latter notation is also applicable when $\beta \in \X^\omega$. The notation $\alpha \sqsubseteq \beta$ means that $\alpha$ is a prefix of $\beta$. Given sets $\X,\Y$, $x \in \X$ and $y \in \Y$, we sometimes use the notation $xy = (x,y) \in \X \times \Y$. Given $\alpha \in (\X \times \Y)^*$, and $n \in \Nats$, $\alpha_{:n+1/2} \in (\X \times \Y)^* \times \X$ is defined by $\alpha_{:n+1/2} = (\alpha_{:n}, x)$ where $\alpha_n=(x,y)$.

Given sets $A$ and $B$, the notation $f: A \PF B$ means that $f$ is a *partial* mapping from $A$ to $B$, i.e. a mapping from some set $\Dom{f} \subseteq A$ to $B$. 

Given a topological space $A$, $\Delta A$ is the space of Borel probability measures on $A$. When no topology is specified, $A$ is understood to be discrete: in this case, $\mu \in \Delta A$ can also be regarded as a function from $A$ to $[0,1]$. The space $\X^\omega$ is understood to have the product topology. Given topological spaces $A,B$, $\mu \in \Delta A$ and $\nu \in \Delta B$, $\Supp{\mu} \subseteq A$ is the support of $\mu$ and $\mu \times \nu \in \Delta(A \times B)$ is the product measure. Given $K$ a Markov kernel from $A$ to $B$, $\mu \ltimes A \in \Delta(A \times B)$ is the semidirect product of $\mu$ and $K$. When $A$ and $B$ are discrete, $\Ent(\mu)$ is the Shannon entropy of $\mu$ (in natural base) and $\KL{\mu}{\nu}$ is the Kullback-Leibler divergence from $\nu$ to $\mu$.

Given $d \in \Nats$ and $x \in \Reals^d$, we use the notation 

$$\Norm{x}_1 := \sum_{i < d} \Abs{x_i}$$

$$\Norm{x}_\infty := \max_{i < d} \Abs{x_i}$$

The symbols $o,O,\omega,\Omega,\Theta$ will refer to usual $O$-notation.

# Results

An *interface* $\I = (\A,\Ob)$ is a pair of finite sets  ("actions" and "observations"). An $\I$-*policy* is a function $\pi: \FH \rightarrow \Delta\A$. An $\I$-*environment* is a partial function $\mu: \FH \times \A \PF \Delta\Ob$ s.t. 

i. $\Estr \times \A \subseteq \Dom \mu$

ii. Given $h \in \FH$ and $aob \in \A \times \Ob \times \A$, $haob \in \Dom \mu$ iff $ha \in \Dom \mu$ and $\mu(ha)(o) > 0$.

It is easy to see that $\Dom \mu$ is always of the form $X \times \A$ for some $X \subseteq \FH$. We denote $\HD \mu := X$.

Given an $\I$-policy $\pi$ and an $\I$-environment $\mu$, we get $\mu\bowtie\pi \in \Delta\IH$ in the usual way.

An $\I$-*reward function* is a partial function $r: (\A \times \Ob)^* \PF [0,1]$. An $\I$-*universe* is a pair $(\mu,r)$ where $\mu$ is an $\I$-environment and $r$ is an $\I$-reward function s.t. $\Dom{r} \supseteq \HD{\mu}$. We denote the space of $\I$-universes by $\Upsilon_\I$. Given an $\I$-reward function $r$ and $t \in (0,\infty)$, we have the associated *utility function* $\Ut_t^r: \IH \PF [0,1]$ defined by

$$\Ut_t^{r}(x):=\frac{\sum_{n=0}^\infty e^{-n/t} r(x_{:n})}{\sum_{n=0}^\infty e^{-n/t}}$$

Here and throughout, we use geometric time discount, however this choice is mostly for notational simplicity. More or less all results carry over to other shapes of the time discount function.

Denote $\Pi_{\I}$\ the space of $\I$-policies. An $\I$-*metapolicy* is a family $\{\pi_t \in \Pi_\I\}_{t \in (0, \infty)}$, where the parameter $t$ is thought of as setting the scale of the time discount. An $\I$-*meta-universe* is a family $\{\upsilon_t \in \Upsilon\}_{t \in (0, \infty)}$. This latter concept is useful for analyzing multi-agent systems, where the environment contains other agents and we study the asymptotics when all agents' time discount scales go to infinity. We won't focus on the multi-agent case in this essay, but for future reference, it seems useful to make sure the results hold in the greater generality of meta-universes.

Given an $\I$-policy $\pi$, an $\I$-universe $\upsilon$ and $t > 0$, we denote $\EU_\upsilon^\pi(t):=\E{\mu\bowtie\pi}[\Ut^r_t]$ (this is well-defined since $\Ut^r_t$ is defined on the support of $\mu\bowtie\pi$). We also denote  $\EU_\upsilon^*(t):=\max_{\pi \in \Pi_\I} \EU_\upsilon^\pi(t)$. We will omit $\I$ when it is obvious from the context.

## Definition 1

Fix an interface $\I$. Consider $\pi^*$ a metapolicy and $\Hy$ a set of meta-universes. $\pi^*$ is said to *learn* $\Hy$ when for any $\upsilon \in \Hy$

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon_t}^{*}(t) - \EU_{\upsilon_t}^{\pi^*_t}(t)) = 0$$

$\Hy$ is said to be *learnable* when there exists $\pi^*$ that learns $\Hy$.

***

Our notion of learnability is closely related to the notion of *sublinear regret*, as defined in [Leike 2016](https://arxiv.org/abs/1611.08944), except that we allow the policy to explicitly depend on the time discount scale. This difference is important: for example, given a *single* universe $\upsilon$, it might be impossible to achieve sublinear regret, but $\{\upsilon\}$ is always learnable.

## Proposition 1

Fix an interface $\I$. Consider $\Hy$ a countable learnable set of meta-universes. Consider any $\zeta \in \Delta\Hy$ s.t. $\Supp \zeta = \Hy$. Consider $\pi^\zeta$ a $\zeta$-Bayes optimal metapolicy, i.e.

$$\pi^\zeta_t \in \Argmax{\pi \in \Pi} \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi}(t)]$$

Then, $\pi^\zeta$ learns $\Hy$.

***

Proposition 1 can be regarded as a "frequentist" justification for Bayesian agents: if *any* metapolicy is optimal in a "frequentist" sense for the class $\Hy$ (i.e. learns it), then the Bayes optimal metapolicy is such.

Another handy property of learnability is the following.

## Proposition 2

Fix an interface $\I$. Let $\Hy$ be a countable set of meta-universes s.t. any finite $\mathcal{G} \subseteq \Hy$ is learnable. Then, $\Hy$ is learnable.

***

We now introduce the formalism needed to discuss advisors. Define $\Ada:=\A \sqcup \{\bot\}$, $\Ado:=\Ada \times \Ob$ and $\Adi:=(\Ada,\Ado)$. Here, the $\Ada$ factor of $\Ado$ is the action taken by the advisor, assumed to be observable by the agent. The environments we will consider are s.t. this action is $\bot$ unless the agent delegated to the advisor at this point of time, which is specified by the agent taking action $\bot$. It will also be the case that whenever the agent takes action $\bot$, the advisor cannot take action $\bot$.

Denote $\Adao:= \Ada \times \Ado \setminus \{\bot\bot o \mid o \in \Ob\}$. Given $abo \in \Adao$, we define $\underline{abo} \in \A \times \Ob$ by

$$\underline{abo}:=\begin{cases} ao \text{ if } a\ne\bot \\ bo \text{ if } a=\bot \end{cases}$$

Given $h \in \Adfh$, we define $\underline{h} \in \FH$ by $\underline{h}_n:=\underline{h_n}$. 

## Definition 2

An $\Adi$-policy $\alpha$ is said to be *autonomous* when for any $h \in \Adfh$, $\alpha(h)(\bot)=0$.

***

Consider an $\I$-environment $\mu$ and an autonomous $\Adi$-policy $\alpha$, which we think of as the advisor policy. We define the $\Adi$-environment $\bar{\mu}[\alpha]$ as follows. For any $h \in \Adfh$ s.t. $\underline{h} \in \HD \mu$, $a,b \in \Ada$ and $o \in \Ob$:

$$\bar{\mu}[\alpha](ha)(bo):=\begin{cases} \mu(\underline{h}a)(o) \text{ if } a\ne\bot,\, b=\bot \\ \alpha(h)(b)\cdot\mu(\underline{h}b)(o) \text{ if } a=\bot,\,b\ne\bot \\ 0 \text{ if } a\ne\bot,\, b\ne\bot \text{ or } a=b=\bot \end{cases}$$

It is easy to the above is a well-defined $\Adi$-environment with $\HD \mu \subseteq \Adfh$. 

Given an $\I$-universe $\upsilon=(\mu,r)$, we define the $\Adi$-reward function $\bar{r}: \Adfh \PF [0,1]$ by $\bar{r}(h):=r(\underline{h})$ and the $\Adi$-universe $\bar{\upsilon}[\alpha]:=(\bar{\mu}[\alpha],\bar{r})$.

We now introduce the conditions on the advisor policy which will allow us to prove a learnability theorem. First, we specify an advisor that always remains "approximately rational."

The notation $\E{x \sim \rho}[X \mid h]$ will be used to mean $\E{x \sim \rho}[X \mid h \sqsubseteq x]$. Given a universe $\upsilon=(\mu,r)$ and $t \in (0, \infty)$ we define $\V_t^\upsilon: \HD{\mu} \rightarrow [0,1]$ and $\W_t^\upsilon: \HD{\mu} \times \A \rightarrow [0,1]$ by

$$\V_t^\upsilon(h):=\max_{\pi \in \Pi} {\E{x \sim \mu\bowtie\pi}[\frac{\sum_{n=\Abs{h}}^\infty e^{-n/t} r(x_{:n})}{\sum_{n=\Abs{h}}^\infty e^{-n/t}} \mid h]}$$

$$\W_t^\upsilon(ha):=(1-e^{-1/t})r(h)+e^{-1/t}\E{o \sim \mu(ha)}[V_t^\upsilon(hao)]$$

## Definition 3

Fix an interface $\I$. Consider a universe $\upsilon=(\mu,r)$. Let $t,\beta \in (0,\infty)$. A policy $\alpha$ is called *strictly $\beta$-rational* for $(\upsilon,t)$ when for any $h \in \Dom{\mu}$ and $a \in \A$

$$\alpha(h)(a) \leq \exp{[\beta(\W^{\upsilon}_t(ha)-\V^\upsilon_t(h))]} \max_{a^* \in \A} \alpha(h)(a^*)$$

***

Now we deal with the possibility of the advisor becoming "corrupt". In practical implementations where the "advisor" is a human operator, this can correspond to several types of events, e.g. sabotaging the channel that transmits data from the operator to the AI ("wireheading"), manipulation of the operator or replacement of the operator by a different entity.

## Definition 4

Fix an interface $\I$. Consider a family $\{\Co_t \subseteq \FH \}_{t \in (0,\infty)}$ s.t. for any $h,g \in \FH$, if $h \in \Co_t$ then $hg \in \Co_t$. We think of $\Co_t$ as the set of histories in which a certain event occurred. Consider a meta-universe $\upsilon=(\mu,r)$. $\Co$ is said to be a $\upsilon$-*avoidable event* when there is a meta-policy $\pi^*$ and $D: (0,\infty) \rightarrow \Nats$ s.t.

i. $\lim_{t \rightarrow \infty} {(\EU_{\upsilon_t}^{*}(t)-\EU_{\upsilon_t}^{\pi^*_t}(t))} = 0$

ii. $D = \omega(t)$

iii. $\lim_{t \rightarrow \infty} \Pr_{x \sim \mu_t\bowtie\pi^*_t}[\exists n \leq D(t): x_{:n} \in \Co_t] = 0$

***

That is, $\Co$ is $\upsilon$-avoidable when it is possible to avoid the event for a long time while retaining most of the value. Consider a meta-universe $\upsilon=(\mu,r)$ and $\Co$ a $\upsilon$-avoidable event. Denote $-\upsilon:=(\mu,1-r)$. We define the reward function $r^\Co_t$ by

$$r^\Co_t(h):=\begin{cases} r_t(h) \text{ if } h \not\in \Co_t \\ \V^{-\upsilon}_t(h_{:n}) \text{ if } h \in \Co_t \text{ and } n = \min\{m \in \Nats \mid h_{:m} \in \Co_t\}\end{cases}$$

We think of $r^\Co$ as representing a process wherein once the event represented by $\Co$ occurs, the agent starts *minimizing* the utility function. We also use the notation $\upsilon^\Co:=(\mu,r^\Co)$.

## Definition 5

Consider a meta-universe $\upsilon=(\mu,r)$ and $\beta: (0,\infty) \rightarrow (0,\infty)$, where we think of the argument of the function $\beta$ as the time discount scale. An autonomous $\Adi$-metapolicy $\alpha$ is called *$\beta$-rational* for $\upsilon$ when there exists a $\upsilon$-avoidable event $\Co$ (that we think of as the advisor becoming "corrupt") and an autonomous $\Adi$-metapolicy $\alpha^*$ (representing advisor policy conditional on non-corruption) s.t. 

i. For any $h \in \Adfh$ s.t. $\underline{h} \not\in \Co_t$, $\alpha_t(h) = \alpha^*_t(h)$.

ii. $\alpha^*_t$ is strictly $\beta(t)$-rational for $(\bar{\upsilon}^\Co_t[\alpha^*], t)$.

***

Our definition of $\beta$-rationality requires the advisor to be extremely averse to corruption: the advisor behaves as if, once a corruption occurs, the agent policy becomes the worst possible. In general, this seems much too strong: by the time corruption occurs, the agent might have already converged into accurate beliefs about the universe that allow it to detect the corruption and keep operating without the advisor. Even better, the agent can usually outperform *the worst possible policy* using the prior alone. Moreover, we can allow for corruption to depend on unobservable random events and differentiate between different degrees of corruption and treat them accordingly. We leave those further improvements for future work.

We are now ready to formulate the main result.

## Theorem

Consider $\Hy = \{\upsilon^k\}_{k \in \Nats}$ a countable family of $\I$-meta-universes and $\beta: (0,\infty) \rightarrow (0,\infty)$ s.t. $\beta(t) = \omega(t^{2/3})$. Let $\{\alpha^k\}_{k \in \Nats}$ be a family of autonomous $\Adi$-metapolicies s.t. for every $k \in \Nats$, $\alpha^k$ is $\beta$-rational for $\upsilon^k$. Define $\bar{\Hy}:=\{\bar{\upsilon}^k[\alpha^k]\}_{k \in \Nats}$. Then, $\bar{\Hy}$ is learnable.

***

Some remarks:

* By Proposition 1, $\bar{\Hy}$ is learned by any Bayes optimal metapolicy with prior supported on $\bar{\Hy}$.

* To get a feeling for the condition $\beta(t)=\omega(t^{2/3})$, consider an environment where the reward depends only on the last action and observation. In such an environment, an advisor that performs softmax (with constant parameter) on the next reward has $\beta(t) = \Theta(t)$. It is thus "more rational" than the required minimum.

* It is easy to see that the Theorem can be generalized by introducing an external penalty (negative reward) for each time the agent delegates to the advisor: as it is, using the advisor already carries a penalty due to its suboptimal choice.

The conditions of the Theorem imply that, in some sense, the advisor "knows" the true environment. This is unrealistic: obviously, we expect the human operator to have some (!) uncertainty about the world. However, we clearly cannot do away with this assumption: if the same action triggers a trap in some universes and is necessary for approaching maximal utility in other universes, and there is no observable difference between the universes before the action is taken, then there is no way to guarantee optimality. The prior knowledge you have about the universe caps the utility you can guarantee to obtain. On the other hand, as an AI designer, one can reasonably expect the AI to do at least as well as possible using the *designer's* own knowledge. If running the AI is the designer's best strategy, the AI should be close to Bayes optimal (in some sense that includes computational bounds et cetera: complications that we currently ignore) with respect to the designer's posterior rather than with respect to some simple prior. In other words, we need a way to transmit the designer's knowledge to the AI, without hand-crafting an elaborate prior.

The following shows that the DIRL achieves this goal (theoretically, given the considerable simplifying assumptions). 

Given an environment $\mu$, we define $\hat{\mu}: \FH \rightarrow [0,1]$ as follows. For $h = a_0 o_0 a_1 o_1 \ldots a_{n-1} o_{n-1} \in \HD{\mu}$

$$\hat{\mu}(h):=\prod_{m < n} \mu(h_{:m}a_m)(o_m)$$

For $h \in \FH \setminus \HD{\mu}$, $\hat{\mu}(h):=0$.

Given a family of environments $\{\mu^k\}_{k \in \Nats}$ and $\xi \in \Delta\Nats$, we will use the notation $\BE{k \sim \xi}[\mu^k]$ to denote the environment given by

$$\HD{\BE{k \sim \xi}[\mu^k]}:= \bigcup_{k \in \Supp \xi} \HD{\mu^k}$$

$$\BE{k \sim \xi}[\mu^k](ha):=\frac{\E{k \sim \xi}[ \hat{\mu}^k(h)\mu^k(ha)]}{\E{k \sim \xi}[ \hat{\mu}^k(h)]}$$

## Corollary 1

Consider $\{\mu^k\}_{k \in \Nats}$ a countable family of $\I$-meta-environments, $\{r^K\}_{K \in \Nats}$ a countable family of reward functions and $\{\xi^K \in \Delta\Nats\}_{K \in \Nats}$ s.t. given $k \in \Supp \xi^K$, $\Dom{r^K} \supseteq \HD{\mu^k}$. We think of $\xi^K$ as the advisor's belief about the environment in universe $K$. Let $\beta: (0,\infty) \rightarrow (0,\infty)$ be s.t. $\beta(t) = \omega(t^{2/3})$ and $\{\alpha^K\}_{K \in \Nats}$ be a family of autonomous $\Adi$-metapolicies s.t. for every $K \in \Nats$, $\alpha^K$ is $\beta$-rational for $(\BE{k \sim \xi^K}[\mu^k], r^K)$. Let $\zeta \in \Delta\Nats^2$ be s.t. for any $J,j \in \Nats$

$$\Pr_{(K,k) \in \zeta}[K = J] > 0$$ 

$$\Pr_{(K,k) \in \zeta}[k = j \mid K = J] = \xi^J(j)$$ 

We think of $\zeta$ as the agent's prior and the equation above as stating the agent's belief that the advisor's beliefs are "calibrated". Consider $\pi^\zeta$ a $\zeta$-Bayes optimal $\Adi$-metapolicy, i.e.

$$\pi^\zeta \in \Argmax{\pi \in \Pi_{\Adi}}{\E{(K,k) \in \zeta}[\EU_{\bar{\mu}^k[\alpha^K],\bar{r}^K}^\pi(t)]}$$ 
Then, for every $K \in \Nats$

$$\lim_{t \rightarrow \infty} (\max_{\pi \in \Pi_\I} \E{k \in \xi^K}[\EU_{\mu^k,r^K}^\pi(t)] - \E{k \in \xi^K}[\EU_{\bar{\mu}^k[\alpha^K],\bar{r}^K}^{\pi^\zeta}(t)]) = 0$$

***

If we happen to be so lucky that the advisor's (presumably justified) belief is supported on a learnable environment class, we get a stronger conclusion.

## Corollary 2

In the setting of Corollary 1, fix $K \in \Nats$. Define the set of meta-universes $\Hy^K$ by

$$\Hy^K:= \{(\mu^k, r^K) \mid k \in \Supp \xi^K\}$$

Assume $\Hy^K$ is learnable. Then, for every $k \in \Nats$


$$\lim_{t \rightarrow \infty} (\EU_{\mu^k,r^K}^*(t) - \EU_{\bar{\mu}^k[\alpha^K],\bar{r}^K}^{\pi^\zeta}(t)) = 0$$

***

We also believe that to some extent DIRL is effective against [acausal attack](https://ordinaryideas.wordpress.com/2016/11/30/what-does-the-universal-prior-actually-look-like/). Indeed, the optimality we get from the Theorem + Proposition 1 holds for any prior. However, the speed of convergence to optimality certainly depends on the prior.  It is therefore desirable to analyze this dependency and bound the damage an adversary can do by controlling a certain portion of the prior. We leave this for future work.

# Appendix

## Proposition A.0

Fix an interface $\I$. Consider $\Hy$ a countable learnable set of meta-universes. Consider any $\zeta \in \Delta\Hy$ s.t. $\Supp \zeta = \Hy$. Consider $\pi^\zeta$ a metapolicy s.t.

$$\lim_{t \rightarrow \infty} (\max_{\pi \in \Pi} \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi}(t)]-\E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^\zeta_t}(t)]) = 0$$

Then, $\pi^\zeta$ learns $\Hy$.

### Proof of Proposition A.0

Fix $\pi^*$ a metapolicy that learns $\Hy$. Consider $\epsilon > 0$ and let $\Hy_\epsilon \subseteq \Hy$ be finite s.t. $\zeta(\Hy \setminus \Hy_\epsilon) < \epsilon$. For $t \gg 0$ and every $\upsilon \in \Hy_\epsilon$ we have

$$\EU_{\upsilon_t}^{\pi^*_t}(t) \geq \EU_{\upsilon_t}^{*}(t) - \epsilon$$

Also

$$\E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^\zeta_t}(t)] \geq \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^*_t}(t)] -\epsilon \geq \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^*_t}(t); \upsilon \in \Hy_\epsilon]-\epsilon$$

Combining, we get

$$\E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^\zeta_t}(t)] \geq \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{*}(t); \upsilon \in \Hy_\epsilon] - 2\epsilon$$

$$\E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^\zeta_t}(t)] \geq \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{*}(t)] -  \E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{*}(t); \upsilon \not\in \Hy_\epsilon] - 2\epsilon$$

By definition of $\Hy_\epsilon$, this implies

$$\E{\upsilon \sim \zeta}[\EU_{\upsilon_t}^{\pi^\zeta_t}(t)] \geq \E{\upsilon \sim \zeta}[ \EU_{\upsilon_t}^{*}(t)] -  3\epsilon$$

For any $\upsilon \in \Hy$, we get

$$\EU_{\upsilon_t}^{\pi^\zeta_t}(t) \geq \EU_{\upsilon_t}^{*}(t) - \frac{3\epsilon}{\zeta(\upsilon)}$$

Taking $\epsilon$ to 0, we get the desired result.

### Proof of Proposition 1

Immediate from Proposition A.0.

### Proof of Proposition 2

Let $\Hy = \{\upsilon^k\}_{k \in \Nats}$. For each $k \in \Nats$, let $\pi^k$ learn $\{\upsilon^l\}_{l < k}$. Choose $\{t^k \in (0,\infty)\}_{k \in \Nats}$ s.t.

i. $t^0 = 0$

ii. $t^k < t^{k+1}$

iii. $\lim_{k \rightarrow \infty} t^k = \infty$

iv. For any $l < k$ and $t \geq t^k$, $\EU_{\upsilon^l_t}^{\pi^k_t}(t) \geq \EU_{\upsilon^l_t}^*(t) - \frac{1}{k+1}$.

Now define $\pi^*_t:=\pi_t^{\max\{k \mid t \geq t^k\}}$. Clearly, $\pi^*$ learns $\Hy$.

## Proposition A.1

Consider $d \in \Nats$ and $x,y \in \Reals^d \setminus \boldsymbol{0}$. Then

$$\Norm{\frac{x}{\Norm{x}_\infty}-\frac{y}{\Norm{y}_\infty}}_\infty \leq2d \Norm{\frac{x}{\Norm{x}_1}-\frac{y}{\Norm{y}_1}}_1$$

### Proof of Proposition A.1

Without loss of generality, assume $\Norm{x}_1 = \Norm{y}_1 = 1$. For any $i < d$, we have

$$\frac{x_i}{\Norm{x}_\infty} - \frac{y_i}{\Norm{y}_\infty} = \frac{x_i\Norm{y}_\infty-y_i\Norm{x}_\infty}{\Norm{x}_\infty\Norm{y}_\infty} = \frac{x_i\Norm{y}_\infty - x_i\Norm{x}_\infty + x_i\Norm{x}_\infty - y_i\Norm{x}_\infty}{\Norm{x}_\infty\Norm{y}_\infty}$$

$$\frac{x_i}{\Norm{x}_\infty} - \frac{y_i}{\Norm{y}_\infty} = \frac{x_i(\Norm{y}_\infty - \Norm{x}_\infty) + (x_i - y_i)\Norm{x}_\infty}{\Norm{x}_\infty\Norm{y}_\infty}$$

Denote $r:=\Norm{x-y}_1$. Obviously, $\Norm{x-y}_\infty \leq r$ and therefore $\Abs{x_i-y_i} \leq r$ and $\Abs{\Norm{x}_\infty - \Norm{y}_\infty} \leq r$. We get

$$\Abs{\frac{x_i}{\Norm{x}_\infty} - \frac{y_i}{\Norm{y}_\infty}} \leq \frac{\Abs{x_i}r + r\Norm{x}_\infty}{\Norm{x}_\infty\Norm{y}_\infty} \leq \frac{\Norm{x}_\infty r + r\Norm{x}_\infty}{\Norm{x}_\infty\Norm{y}_\infty} \leq \frac{2r}{\Norm{y}_\infty}$$

Since $\Norm{y}_1 = 1$, $\Norm{y}_\infty \geq \frac{1}{d}$ yielding the desired result.

## Proposition A.2

Consider $\Hy$ a finite set, $L: \Hy \rightarrow [0,\infty)$, $\zeta \in \Delta\Hy$ and $\beta,\epsilon \in (0,\infty)$. Assume that

i. For any $k \in \Hy$, $\zeta(k) \geq \beta\epsilon$.

ii. $\E{\zeta}[L] \geq \epsilon$

Then

$$\E{\zeta}[e^{-\beta L}] \leq 1 - (1 - e^{-1})\beta\epsilon$$

### Proof of Proposition A.2

Without loss of generality, we can assume that $\E\zeta[L] = \epsilon$, because otherwise we can rescale $L$ by a constant in $(0,1)$ which will only make $\E{\zeta}[e^{-\beta L}]$ larger. It now follows from conditions i+ii that for any $k$, $L(k) \leq \beta^{-1}$ and therefore $\beta L(k) \in [0,1]$. We have

$$L(k) = (1 - \beta L(k)) \cdot 0 + \beta L(k) \cdot \beta^{-1}$$

Since $e^{-\beta x}$ is a convex function, we get

$$e^{-\beta L(k)} \leq (1 - \beta L(k)) \cdot e^{-\beta \cdot 0} + \beta L(k) \cdot e^{-\beta \cdot \beta^{-1}} = 1 - \beta L(k) + e^{-1} \beta L(k) = 1-(1-e^{-1})\beta L(k)$$

$$\E\zeta[e^{-\beta L}] \leq 1-(1-e^{-1})\beta \E\zeta[L] = 1-(1-e^{-1})\beta\epsilon$$

## Proposition A.3

Consider $\Hy$ and $\A$ finite sets, $L: \Hy \times \A \rightarrow [0,\infty)$, $\zeta \in \Delta\Hy$, $\alpha: \Hy \rightarrow \Delta\A$ and $\beta,\epsilon \in (0,\infty)$. Assume that

i. For any $k \in \Hy$, $\zeta(k) \geq \beta\epsilon$.

ii. For any $a \in A$, $\E{k \in \zeta}[L(k,a)] \geq \epsilon$.

iii. For any $k \in \Hy$ and $a \in A$, $\alpha(k)(a) \leq \exp[-\beta L(k,a)] \max_{b \in \A} \alpha(k)(b)$.

Define $\zeta \ltimes \alpha \in \Delta(\Hy \times \A)$ by $(\zeta \ltimes \alpha)(k,a):=\zeta(k)\alpha(k,a)$. Then,  the mutual information $I$ between $k$ and $a$ in the distribution $\zeta \ltimes \alpha$ satisfies

$$I \geq \frac{(1-e^{-1})^2}{8\Abs{\A}^2} \beta^2 \epsilon^2$$

### Proof of Proposition A.3

Define $\bar{\alpha} \in \Delta\A$ by $\bar{\alpha}:=\E\zeta[\alpha]$. We have

$$I = \E{\zeta}[\KL{\alpha}{\bar{\alpha}}]$$

Applying Pinsker's inequality

$$I \geq 2\E{\zeta}[\Dtv(\alpha,\bar{\alpha})^2]=\frac{1}{2}\E\zeta[\Norm{\alpha-\bar{\alpha}}_1^2] \geq \frac{1}{2}\E\zeta[\Norm{\alpha-\bar{\alpha}}_1]^2$$

By Proposition A.1

$$I \geq \frac{1}{8\Abs{\A}^2}\E\zeta[\Norm{\frac{\alpha}{\Norm{\alpha}_\infty}-\frac{\bar{\alpha}}{\Norm{\bar{\alpha}}_\infty}}_\infty]^2 \geq \frac{1}{8\Abs{\A}^2}\Norm{\E\zeta[\frac{\alpha}{\Norm{\alpha}_\infty}-\frac{\bar{\alpha}}{\Norm{\bar{\alpha}}_\infty}]}_\infty^2=\frac{1}{8\Abs{\A}^2}\Norm{\E\zeta[\frac{\alpha}{\Norm{\alpha}_\infty}]-\frac{\bar{\alpha}}{\Norm{\bar{\alpha}}_\infty}}_\infty^2$$

$$I \geq \frac{1}{8\Abs{\A}^2}(\Norm{\frac{\bar{\alpha}}{\Norm{\bar{\alpha}}_\infty}}_\infty-\Norm{\E\zeta[\frac{\alpha}{\Norm{\alpha}_\infty}]}_\infty)^2=\frac{1}{8\Abs{\A}^2}(1-\Norm{\E\zeta[\frac{\alpha}{\Norm{\alpha}_\infty}]}_\infty)^2$$

By condition iii, $\alpha(k)(a) / \Norm{\alpha(k)}_\infty \leq \exp[-\beta L(k,a)]$ and therefore

$$I \geq \frac{1}{8\Abs{\A}^2}(1-\max_{a \in \A} \E{k \sim \zeta}[e^{-\beta L(k,a)}])^2$$

Applying Proposition A.2, we get

$$I \geq \frac{1}{8\Abs{\A}^2}(1-(1-(1-e^{-1})\beta\epsilon))^2=\frac{(1-e^{-1})^2}{8\Abs{\A}^2}\beta^2\epsilon^2$$

## Proposition A.4

Consider $\A$ a finite set, $L: \A \rightarrow [0,\infty)$ and $\alpha \in \Delta\A$ and $\beta \in (0,\infty)$ s.t. for any $a \in \A$

$$\alpha(a) \leq e^{-\beta L(a)} \max_{b \in \A} \alpha(b)$$

Then, $\E{\alpha}[L] \leq \Abs{\A} e^{-1}\beta^{-1}$.

### Proof of Proposition A.4

We have

$$\E{\alpha}[L] = \sum_{a \in \A} \alpha(a) L(a) \leq \max_{b \in \A} \alpha(b) \sum_{a \in \A} e^{-\beta L(a)} L(a) \leq \Abs{A} \max_{x \in [0,\infty)} e^{-\beta x} x$$

We compute $\max_{x \in [0,\infty)} e^{-\beta x} x$:

$$0=\frac{d}{dx}(e^{-\beta x}x)|_{x=x^*} = -\beta e^{-\beta x^*} x^* + e^{-\beta x^*}$$

$$x^* = \frac{1}{\beta}$$

$$e^{-\beta x^*} x^* = \frac{1}{e\beta}$$

## Proposition A.5

Consider a universe $\upsilon=(\mu,r)$, a policy $\pi^0$ and $t \in (0,\infty)$. Then,

$$\EU_{\upsilon}^{*}(t) - \EU_{\upsilon}^{\pi^0}(t)=\sum_{n=0}^\infty e^{-n/t} \E{x\sim\mu\bowtie\pi^0}[\V^{\upsilon}_t(x_{:n})-\W^{\upsilon}_t(x_{:n+1/2})]$$

### Proof of Proposition A.5

For any $x \in \IH$, it is easy to see that

$$\EU_{\upsilon}^{*}(t)=\V^{\upsilon}_t(\Estr)=\sum_{n=0}^\infty e^{-n/t} (\V^{\upsilon}_t(x_{:n})-e^{-1/t}\V^{\upsilon}_t(x_{:n+1}))$$

$$\Ut^{r}_t(x)=(1-e^{-1/t})\sum_{n=0}^\infty e^{-n/t} r(x_{:n})$$

$$\EU_{\upsilon}^{*}(t) - \Ut^{r}_t(x)=\sum_{n=0}^\infty e^{-n/t} (\V^{\upsilon}_t(x_{:n})-(1-e^{-1/t})r(x_{:n})-e^{-1/t}\V^{\upsilon}_t(x_{:n+1}))$$

$$\EU_{\upsilon}^{*}(t) - \Ut^{r}_t(x)=\sum_{n=0}^\infty e^{-n/t} (\V^{\upsilon}_t(x_{:n})-\W^{\upsilon}_t(x_{:n+1/2})+\W^{\upsilon}_t(x_{:n+1/2})-(1-e^{-1/t})r(x_{:n})-e^{-1/t}\V^{\upsilon}_t(x_{:n+1}))$$

Taking expected value over $x$, we get

$$\EU_{\upsilon}^{*}(t) - \EU_{\upsilon}^{\pi^0}(t)=\sum_{n=0}^\infty e^{-n/t} (\E{\mu\bowtie\pi^0}[\V^{\upsilon}_t(x_{:n})-\W^{\upsilon}_t(x_{:n+1/2})]+\E{\mu\bowtie\pi^0}[\W^{\upsilon}_t(x_{:n+1/2})-(1-e^{-1/t})r(x_{:n})-e^{-1/t}\V^{\upsilon}_t(x_{:n+1})])$$

It is easy to see that the second term vanishes, yielding the desired result.

## Lemma A

Consider the setting of Theorem, but assume that $\Hy = \{\upsilon^k = (\mu^k,r^k)\}_{k < N}$ for some $N \in \Nats$ (i.e. it is finite) and that $\alpha^k(t)$ is *strictly* $\beta(t)$-rational for $\bar{\upsilon}^k[\alpha^k]$. Denote $\nu^k:=\bar{\mu}^k[\alpha^k]$ and $\HD{\bar{\Hy}}:= \bigcup_{k < N} \HD{\nu^k}$. Denote $\zeta^0 \in \Delta[N]$ the uniform probability distribution. For any $t > N^3$, define $\zeta_t,\tilde{\zeta}_t: \HD{\bar{\Hy}} \rightarrow \Delta[N]$ recursively as follows

$$\tilde{\zeta}_t(\Estr):=\zeta^0$$

$$\tilde{\zeta}_t(hao)(k):=\begin{cases} \tilde{Z}_t(h)^{-1} \cdot \zeta_t(h)(k) \cdot \nu^k(ha)(o) \text{ if } \exists j: \zeta_t(h)(j) \cdot \nu^j(ha)(o) > 0 \\ N^{-1} \text{ otherwise} \end{cases}$$

$$\zeta_t(h)(k):=Z_t(h)^{-1}\tilde{\zeta}_t(h)(k)[[\tilde{\zeta}_t(h)(k) > t^{-1/3}]]$$

In the above, $Z_t(h)$ and $\tilde{Z}_t(h)$ are normalization factor chosen to make the probabilities sum to 1. That is, $\zeta_t(h)$ is obtained by starting from prior $\zeta^0$, updating on every observation, and setting to 0 the probability of any universe whose probability drops below $t^{-1/3}$. When encountering an "impossible" observation we reset to the uniform distribution, but this is arbitrary. 

Define the "loss function" $L_t: \HD{\bar{\Hy}} \times \A \rightarrow [0,1]$ by

$$L_t(ha):=\E{k \sim \zeta_t(h)}[\V^{\upsilon^k_t}_t(\underline{h})-\W^{\upsilon^k_t}_t(\underline{h}a)]$$

Denote $\epsilon_t:=\beta(t)^{-1}t^{-1/3}$. Define the following $\Adi$-metapolicy $\pi^*$:

$$\pi^*_t(h):=\begin{cases} \Argmin{a \in \A} L_t(ha) \text{ if } h \in \HD{\bar{\Hy}},\, \min_{a \in \A}{L_t(ha)} < \epsilon_t \\ \bot \text{ if } h \in \HD{\bar{\Hy}},\,\min_{a \in \A}{L_t(ha)} \geq \epsilon_t \\ \bot \text{ if } h \not\in \HD{\bar{\Hy}}\end{cases}$$

(Technically, we only defined $\pi^*_t$ for $t > N^3$, but it doesn't matter.) Then, $\pi^*$ learns $\bar{\Hy}$.
 
### Proof of Lemma A

For every $k \in [N]$, we define $\zeta^{!k}_t, \tilde{\zeta}^{!k}_t: \HD{\bar{\Hy}} \rightarrow \Delta[N]$ and $S_t^k: \HD{\bar{\Hy}} \rightarrow 2^{[N]}$ recursively as follows

$$\tilde{\zeta}^{!k}_t(\Estr):=\zeta^0$$

$$\tilde{\zeta}^{!k}_t(hao)(i):=\frac{\zeta^{!k}_t(h)(i) \cdot \nu^i(ha)(o)}{\sum_{j < N} \zeta^{!k}_t(h)(j) \cdot \nu^j(ha)(o)}$$

$$S_t^k(h):=\{i \in [N] \mid \tilde{\zeta}^{!k}_t(h)(i) > t^{-1/3}\}$$

$$\zeta^{!k}_t(h)(i):= [[k,i \in S_t^k(h)]]\frac{\tilde{\zeta}^{!k}_t(h)(i)}{\sum_{j \in S_t^k(h)}\tilde{\zeta}^{!k}_t(h)(j)}+[[k \not\in S_t^k(h),\,i=k]]$$

That is, $\zeta^{!k}$ is a belief state that, besides updating on observations, behaves as if, at each moment of time, if the true universe $k$ is low probability according to current belief state (i.e. $k \not\in S^k_t(h)$), then the true universe is "magically" revealed (i.e. $\zeta^{!k}$ becomes the Kronecker delta), and otherwise it updates on the true universe *not* being revealed. Denote 

$$\rho_t:= \zeta^0 \ltimes ({\nu_t}\bowtie{\pi^*_t}) \in \Delta([N] \times \Adih)$$

Here, the dependence of ${\nu^k_t}\bowtie{\pi^*_t}$ on $k$ is used to view it as Markov kernel from $[N]$ to $\Adih$. It is easy to see that, since the probability of "magic\ revelation" ever happening is at most $(N-1)t^{-1/3}$, we have

$$\Pr_{(k,x)\sim\rho_t}[\exists n \in \Nats: \zeta_t(x_{:n}) \ne \zeta^{!k}_t(x_{:n})] \leq (N-1)t^{-1/3}$$

Let $\pi^{!k}$ be defined exactly as $\pi^*$ but with $\zeta$ replaced by $\zeta^{!k}$. Denote $\rho^!_t:=\zeta^0\ltimes(\nu_t\bowtie\pi^!_t)$. From the above, we get

$$\Dtv(\rho_t,\rho_t^!) \leq (N-1)t^{-1/3}$$ 

Given $k \in [N]$ and $h \in \HD{\bar{\Hy}}$, we define the set $h^{!k}$ by 

$$h^{!k} := \{(j,x) \in [N] \times \Adih \mid h \sqsubseteq x,\, \forall m \leq \Abs{h}:k \in S^k_t(h_{:m}) \land j \in S^j_t(h_{:m}) \lor k \not\in S^k_t(h_{:m}) \land j=k\}$$

We have 

$$\Pr_{(j,x)\sim\rho^!_t}[j = i \mid h^{!k}] = \zeta^{!k}(h)(i)$$

It follows that

$$\E{(j,x)\sim\rho^!_t}[\Ent(\zeta^{!j}_t(x_{:\Abs{h}+1})) \mid h^{!k}] = \Ent(\zeta^{!k}_t(h)) -\E{(j,x)\sim\rho^!_t}[\KL{\zeta^{!j}_t(x_{:\Abs{h}+1})}{\tilde{\zeta}^{!j}_t(x_{:\Abs{h}+1})}+\KL{\tilde{\zeta}^{!j}_t(x_{:\Abs{h}+1})}{\zeta^{!j}_t(x_{:\Abs{h}})}\mid h^{!k}]$$

$$\E{(j,x)\sim\rho^!_t}[\Ent(\zeta^{!j}_t(x_{:\Abs{h}+1})) \mid h^{!k}] \leq \Ent(\zeta^{!k}_t(h)) -\E{(j,x)\sim\rho^!_t}[\KL{\tilde{\zeta}^{!j}_t(x_{:\Abs{h}+1})}{\zeta^{!j}_t(x_{:\Abs{h}})}\mid h^{!k}]$$

If $\pi^{!k}(h)=\bot$, we can apply Proposition A.3: condition i follows from the definition of $S^k_t$ and the observation that $\beta(t)\epsilon_t = t^{-1/3}$, condition ii follows from the fact we are in the second case in the definition of $\pi^{!k}$ (see definition of $\pi^*$) and condition iii follows from the strict $\beta(t)$-rationality of $\alpha^k(t)$. We conclude

$$\E{(j,x)\sim\rho^!_t}[\Ent(\zeta^{!j}_t(x_{:\Abs{h}+1})) \mid h^{!k}] \leq \Ent(\zeta^{!k}_t(h)) -  \frac{(1-e^{-1})^2}{8\Abs{\A}^2} \beta(t)^2 \epsilon_t^2[[\pi^{!k}(h)=\bot]]$$

$$\E{(j,x)\sim\rho^!_t}[\Ent(\zeta^{!j}_t(x_{:\Abs{h}+1})) \mid h^{!k}] \leq \Ent(\zeta^{!k}_t(h)) -  \frac{(1-e^{-1})^2}{8\Abs{\A}^2} t^{-2/3}[[\pi^{!k}(h)=\bot]]$$

Taking $\rho^!_t$-expected value over $(k,h)$, we conclude that for any $n \in \Nats$

$$\E{(k,x)\sim\rho^!_t}[\Ent(\zeta^{!k}_t(x_{:n+1}))] \leq \E{(k,x)\sim\rho^!_t}[\Ent(\zeta^{!k}_t(x_{:n}))] - \frac{(1-e^{-1})^2}{8\Abs{\A}^2} t^{-2/3} \Pr_{(k,x)\sim\rho^!_t}[\pi^{!k}(x_{:n})=\bot]$$

By induction, it follows that

$$\E{(k,x)\sim\rho^!_t}[\Ent(\zeta^{!k}_t(x_{:n}))] \leq \Ent(\zeta^0) - \frac{(1-e^{-1})^2}{8\Abs{\A}^2} t^{-2/3}\E{(k,x)\sim\rho^!_t}[\Abs{\{m \in [n] \mid x_m \in \bot \times \Ado\}}]$$

$$\E{(k,x)\sim\rho^!_t}[\Abs{\{m \in [n] \mid x_m \in \bot \times \Ado\}}] \leq \frac{8 \Abs{\A}^2 \ln{N}}{(1-e^{-1})^2}t^{2/3}$$

$$\E{(k,x)\sim\rho^!_t}[\Abs{\{n \in \Nats \mid x_n \in \bot \times \Ado\}}] \leq \frac{8 \Abs{\A}^2 \ln{N}}{(1-e^{-1})^2}t^{2/3}$$

So, the expected number of delegations is $O(t^{2/3})$. For any $k \in [N]$, Proposition A.5 yields

$$\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t)=\sum_{n=0}^\infty e^{-n/t} \E{x \sim \nu^k\bowtie\pi^{!k}}[\V^{\upsilon^k[\alpha^k]}_t(x_{:n})-\W^{\upsilon^k[\alpha^k]}_t(x_{:n}\pi^{!k}(x_{:n}))]$$

Averaging over $k$, we get

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t))=\sum_{n=0}^\infty e^{-n/t} \E{(k,x)\sim\rho^!_t}[\V^{\upsilon^k[\alpha^k]}_t(x_{:n})-\W^{\upsilon^k[\alpha^k]}_t(x_{:n}\pi^{!k}(x_{:n}))]$$

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t))=\sum_{n=0}^\infty e^{-n/t} \E{(k,x)\sim\rho^!_t}[\E{(j,y)\sim\rho^!_t}[\V^{\upsilon^j[\alpha^j]}_t(y_{:n})-\W^{\upsilon^j[\alpha^j]}_t(y_{:n}\pi^{!j}(y_{:n})) \mid x_{:n}^{!k}]]$$

Using the definitions of $\zeta^{!k}(x_{:n})$ and $x_{:n}^{!k}$, and observing that $\pi^{!j}(x_{:n})=\pi^{!k}(x_{:n})$ for $(j,y) \in x_{:n}^{!l}$

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t))=\sum_{n=0}^\infty e^{-n/t} \E{(k,x)\sim\rho^!_t}[\E{j\sim\zeta^{!k}(x_{:n})}[\V^{\upsilon^j[\alpha^j]}_t(x_{:n})-\W^{\upsilon^j[\alpha^j]}_t(x_{:n}\pi^{!k}(x_{:n}))]]$$

When $\pi^{!k}(x_{:n}) \ne \bot$, the expected loss is smaller than $\epsilon_t$ (by construction of $\pi^{!k})$. When $\pi^{!k}(x_{:n}) = \bot$, the expected loss is at most $\Abs{\A}e^{-1}\beta(t)^{-1}$, by Proposition A.4. We get

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t)) \leq \sum_{n=0}^\infty e^{-n/t} \E{(k,x)\sim\rho^!_t}[[[\pi^{!k}(x_{:n}) \ne \bot]]\epsilon_t+[[\pi^{!k}(x_{:n}) = \bot]]\Abs{\A}e^{-1}\beta(t)^{-1}]$$

The contribution of the first term on the right hand side can be bounded using the observation

$$\sum_{n=0}^\infty e^{-n/t} = 1 + \sum_{n=1}^\infty e^{-n/t} \leq 1 + \sum_{n=1}^\infty \int_{n-1}^n e^{-s/t} ds = 1 + \int_0^{\infty} e^{-s/t} ds = 1 + t$$

The contribution the of second term on the right hand side can be bounded via the expected number of delegations. We get

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t)) \leq (1+t)\beta(t)^{-1}t^{-1/3}+\frac{8 \Abs{\A}^2 \ln{N}}{(1-e^{-1})^2}t^{2/3}\Abs{\A}e^{-1}\beta(t)^{-1}$$

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{!k}}(t)) \leq (\frac{1}{t}+1+\frac{8 \Abs{\A}^3 \ln{N}}{e(1-e^{-1})^2})\frac{t^{2/3}}{\beta(t)}$$

We use the relationship between $\rho_t$ and $\rho^!_t$ on the second term on the left hand side (whose contribution is the $\rho^!_t$-expected value of the utility function, whose range lies in [0,1]), and get

$$\frac{1}{N}\sum_{k < N}(\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^{*}}(t)) \leq (\frac{1}{t}+1+\frac{8 \Abs{\A}^3 \ln{N}}{e(1-e^{-1})^2})\frac{t^{2/3}}{\beta(t)}+\frac{N-1}{t^{1/3}}$$

Using the assumption $\beta=\omega(t^{2/3})$, we conclude that for each $k \in [N]$

$$\lim_{t \rightarrow \infty} (\EU_{\bar{\upsilon}^k[\alpha^k]}^{*}(t) - \EU_{\bar{\upsilon}^k[\alpha^k]}^{\pi^*}(t)) = 0$$

## Proposition A.6

Let $\upsilon = (\mu,r)$ be a meta-universe, $\{\Co_t \subseteq \FH\}_{t \in (0,\infty)}$ and $\pi^0$ a metapolicy. Then, for all $t \in (0,\infty)$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq \EU_{\upsilon}^{\pi^0}(t)$$

### Proof of Proposition A.6

Denote $\chi_t := \chi_{\Co_t}$ the characteristic function of $\Co_t$. For notational convenience, the expression $\chi_t(x_{:-1})$ will be understood to mean 0.

$$\EU_{\upsilon^\Co}^{\pi^0}(t) = (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}} (\sum_{m=0}^{n} (1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m}) \V^{-\upsilon}_t(x_{:m})+{(1-\chi_t(x_{:n}))}r_t(x_{:n}))]$$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}} (\sum_{m=0}^{n} (1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m}) \E{y\sim\mu\bowtie\pi^0}[\frac{\sum_{l=m}^\infty e^{-\frac{l}{t}} r(y_{:l})}{\sum_{l=m}^\infty e^{-\frac{l}{t}}} \mid x_{:m}]+(1-\chi_t(x_{:n}))r_t(x_{:n}))]$$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}} (\sum_{m=0}^{n} (1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m}) \frac{\sum_{l=m}^\infty e^{-\frac{l}{t}} r(x_{:l})}{\sum_{l=m}^\infty e^{-\frac{l}{t}}} +(1-\chi_t(x_{:n}))r_t(x_{:n}))]$$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}} ((1-e^{-\frac{1}{t}})\sum_{m=0}^{n} (1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m}) \sum_{l=m}^\infty e^{-\frac{l-m}{t}} r(x_{:l}) +(1-\chi_t(x_{:n}))r_t(x_{:n}))]$$

Regrouping the sum to collect the terms $r(x_{:n})$ for the same value of $n$, we get

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty ((1-e^{-\frac{1}{t}})\sum_{m=0}^n \sum_{l=m}^\infty e^{-\frac{l}{t}}(1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m})e^{-\frac{n-m}{t}}  + e^{-\frac{n}{t}}(1-\chi_t(x_{:n})))r(x_{:n})]$$
 
$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}}((1-e^{-\frac{1}{t}})\sum_{m=0}^n  \frac{e^{-\frac{m}{t}}}{1-e^{-\frac{1}{t}}}  (1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m})e^{\frac{m}{t}}+ 1-\chi_t(x_{:n}))r(x_{:n})]$$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}}(\sum_{m=0}^n (1-\chi_{t}(x_{:m-1}))\chi_t(x_{:m})+  1-\chi_t(x_{:n}))r(x_{:n})]$$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}}(\chi_t(x_{:n}) + 1-\chi_t(x_{:n}))r(x_{:n})]$$

$$\EU_{\upsilon^\Co}^{\pi^0}(t) \leq (1-e^{-\frac{1}{t}})\E{x\sim\mu\bowtie\pi^0}[\sum_{n=0}^\infty e^{-\frac{n}{t}}r(x_{:n})] = \EU_{\upsilon}^{\pi^0}(t)$$

## Proposition A.7

Let $\upsilon$ be a meta-universe and $\Co$ a $\upsilon$-avoidable event. Suppose $\pi^!$ is a metapolicy that learns $\upsilon^\Co$. Then, $\pi^!$ learns $\upsilon$ as well.

### Proof of Proposition A.7

It is easy to see for any policy $\pi$ and $t \in (0,\infty)$

$$\EU_{\upsilon^\Co}^{\pi^*}(t) \geq (1-\Pr_{x \sim \mu_t\bowtie\pi^*_t}[\exists n \leq D(t): x_{:n} \in \Co_t]) (\EU_{\upsilon}^{\pi^*}(t) - e^{-D(t)/t})$$

Let $\pi^*$ be as in Definition 4. Proposition A.6 and the above imply that

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon}^{\pi^*}(t)-\EU_{\upsilon^\Co}^{\pi^*}(t)) = 0$$

Using condition i, we get

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon}^{*}(t)-\EU_{\upsilon^\Co}^{\pi^*}(t)) = 0$$

By Proposition A.6, $\EU_{\upsilon}^{*}(t) \geq \EU_{\upsilon^\Co}^{*}(t)$, therefore

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon^\Co}^{*}(t)-\EU_{\upsilon^\Co}^{\pi^*}(t)) = 0$$

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon^\Co}^{\pi^!}(t)-\EU_{\upsilon^\Co}^{\pi^*}(t)) = 0$$

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon^\Co}^{\pi^!}(t)-\EU_{\upsilon}^{*}(t)) = 0$$

By Proposition A.6, $\EU_{\upsilon}^{\pi^!}(t) \geq \EU_{\upsilon^\Co}^{\pi^!}(t)$, therefore

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon}^{\pi^!}(t)-\EU_{\upsilon}^{*}(t)) = 0$$

## Proof of Theorem

For any $k \in \Nats$, let $\Co^k$ and $\alpha^{k*}$ be for $\alpha^k$ as in Definition 5. Denote $\psi^k:=(\upsilon^k)^{\Co^k}$ and 

$$\bar{\Hy}^\Co:=\{\bar{\psi}^k[\alpha^{k*}] \mid k \in \Nats \}$$

By Lemma A and Proposition 2, $\bar{\Hy}^\Co$ is learnable. Let $\pi^*$ be a metapolicy that learns it. For any $k \in \Nats$, $\pi^*$ learns $\bar{\psi}^k[\alpha^{k*}]$. It is easy to see that for any policy $\pi$, $\EU_{\bar{\psi}^k[\alpha^{k*}]}^\pi(t)=\EU_{\bar{\psi}^k[\alpha^{k}]}^\pi(t)$ ($\psi^k$ is defined s.t. once the corruption occurs, the reward is constant, so the advisor has no effect after this point), therefore $\pi^*$ learns $\bar{\psi}^k[\alpha^{k}]$. By Proposition A.7, we conclude that $\pi^*$ learns $\bar{\upsilon}^k[\alpha^k]$.

## Proof of Corollary 1

Denote $\upsilon^K:=(\BE{k\in\zeta^K}[\mu^k],r^K)$. By the Theorem, $\{\bar{\upsilon}^K[\alpha^K]\}_{K \in \Nats}$ is learnable. Denote $\psi^{kK}:=(\mu^k,r^K)$. It is easy to see that for any $\Adi$-policy $\pi$ and $t\in(0,\infty)$,

$$\E{k \in \xi^K}[\EU_{\psi^{kK}[\alpha^K]}^\pi(t)] = \EU_{\bar{\upsilon}^K[\alpha^K]}^\pi(t)$$

By the calibration condition

$$\E{(K,k)\sim\zeta}[\EU_{\psi^{kK}[\alpha^K]}^\pi(t)] = \E{(K,k) \in \zeta}[\E{j \in \xi^K}[\EU_{\psi^{jK}[\alpha^K]}^\pi(t)]]=\E{(K,k) \in \zeta}[\EU_{\bar{\upsilon}^K[\alpha^K]}^\pi(t)]$$

Applying Proposition 1, we conclude that $\pi^\zeta$ learns $\{\bar{\upsilon}^K[\alpha^K]\}_{K \in \Nats}$. That is, for any $K \in \Nats$

$$\lim_{t \rightarrow \infty} (\EU_{\bar{\upsilon}^K[\alpha^K]}^*(t)-\EU_{\bar{\upsilon}^K[\alpha^K]}^{\pi^\zeta}(t)) = 0$$

$$\lim_{t \rightarrow \infty} (\EU_{\upsilon^K}^*(t)-\EU_{\bar{\upsilon}^K[\alpha^K]}^{\pi^\zeta}(t)) = 0$$

$$\lim_{t \rightarrow \infty} (\max_{\pi\in\Pi_{\I}} \E{k\in\xi^K}[\EU_{\psi^{kK}}^\pi(t)]-\E{k\in\xi^K}[\EU_{\bar{\psi}^{kK}[\alpha^K]}^{\pi^\zeta}(t)]) = 0$$

## Proof of Corollary 2

Immediate from Corollary 1 and Proposition A.0.