# AIXI

AIXI ['ai̯k͡siː] is a theoretical mathematical formalism for artificial general intelligence. It combines Solomonoff induction with sequential decision theory. AIXI was first proposed by Marcus Hutter in 2000[1] and several results regarding AIXI are proved in Hutter's 2005 book Universal Artificial Intelligence.[2]

AIXI is a reinforcement learning agent. It maximizes the expected total rewards received from the environment. Intuitively, it simultaneously considers every computable hypothesis (or environment). In each time step, it looks at every possible program and evaluates how many rewards that program generates depending on the next action taken. The promised rewards are then weighted by the subjective belief that this program constitutes the true environment. This belief is computed from the length of the program: longer programs are considered less likely, in line with Occam's razor. AIXI then selects the action that has the highest expected total reward in the weighted sum of all these programs.

## Definition

AIXI is a reinforcement learning agent that interacts with some stochastic and unknown but computable environment ${\displaystyle \mu }$. The interaction proceeds in time steps, from ${\displaystyle t=1}$ to ${\displaystyle t=m}$, where ${\displaystyle m\in \mathbb {N} }$ is the lifespan of the AIXI agent. At time step t, the agent chooses an action ${\displaystyle a_{t}\in {\mathcal {A}}}$ (e.g. a limb movement) and executes it in the environment, and the environment responds with a "percept" ${\displaystyle e_{t}\in {\mathcal {E}}={\mathcal {O}}\times \mathbb {R} }$, which consists of an "observation" ${\displaystyle o_{t}\in {\mathcal {O}}}$ (e.g., a camera image) and a reward ${\displaystyle r_{t}\in \mathbb {R} }$, distributed according to the conditional probability ${\displaystyle \mu (o_{t}r_{t}|a_{1}o_{1}r_{1}...a_{t-1}o_{t-1}r_{t-1}a_{t})}$, where ${\displaystyle a_{1}o_{1}r_{1}...a_{t-1}o_{t-1}r_{t-1}a_{t}}$ is the "history" of actions, observations and rewards. The environment ${\displaystyle \mu }$ is thus mathematically represented as a probability distribution over "percepts" (observations and rewards) which depend on the full history, so there is no Markov assumption (as opposed to other RL algorithms). Note again that this probability distribution is unknown to the AIXI agent. Furthermore, note again that ${\displaystyle \mu }$ is computable, that is, the observations and rewards received by the agent from the environment ${\displaystyle \mu }$ can be computed by some program (which runs on a Turing machine), given the past actions of the AIXI agent [3].

The only goal of the AIXI agent is to maximise ${\displaystyle \sum _{t=1}^{m}r_{t}}$, that is, the sum of rewards from time step 1 to m.

The AIXI agent is associated with a stochastic policy ${\displaystyle \pi :({\mathcal {A}}\times {\mathcal {E}})^{*}\rightarrow {\mathcal {A}}}$, which is the function it uses to choose actions at every time step, where ${\displaystyle {\mathcal {A}}}$ is the space of all possible actions that AIXI can take and ${\displaystyle {\mathcal {E}}}$ is the space of all possible "percepts" that can be produced by the environment. The environment (or probability distribution) ${\displaystyle \mu }$ can also be thought of as a stochastic policy (which is a function): ${\displaystyle \mu :({\mathcal {A}}\times {\mathcal {E}})^{*}\times {\mathcal {A}}\rightarrow {\mathcal {E}}}$, where the ${\displaystyle *}$ is the Kleene star operation.

In general, at time step ${\displaystyle t}$ (which ranges from 1 to m), AIXI, having previously executed actions ${\displaystyle a_{1}\dots a_{t-1}}$ (which is often abbreviated in the literature as ${\displaystyle a_{) and having observed the history of percepts ${\displaystyle o_{1}r_{1}...o_{t-1}r_{t-1}}$ (which can be abbreviated as ${\displaystyle e_{), chooses and executes in the environment the action, ${\displaystyle a_{t}}$, defined as follows [4]

${\displaystyle a_{t}:=\arg \max _{a_{t}}\sum _{o_{t}r_{t}}\ldots \max _{a_{m}}\sum _{o_{m}r_{m}}[r_{t}+\ldots +r_{m}]\sum _{q:\;U(q,a_{1}\ldots a_{m})=o_{1}r_{1}\ldots o_{m}r_{m}}2^{-{\textrm {length}}(q)}}$

or, using parentheses, to disambiguate the precedences

${\displaystyle a_{t}:=\arg \max _{a_{t}}\left(\sum _{o_{t}r_{t}}\ldots \left(\max _{a_{m}}\sum _{o_{m}r_{m}}[r_{t}+\ldots +r_{m}]\left(\sum _{q:\;U(q,a_{1}\ldots a_{m})=o_{1}r_{1}\ldots o_{m}r_{m}}2^{-{\textrm {length}}(q)}\right)\right)\right)}$

Intuitively, in the definition above, AIXI considers the sum of the total reward over all possible "futures" up to ${\displaystyle m-t}$ time steps ahead (that is, from ${\displaystyle t}$ to ${\displaystyle m}$), weighs each of them by the complexity of programs ${\displaystyle q}$ (that is, by ${\displaystyle 2^{-{\textrm {length}}(q)}}$) consistent with the agent's past (that is, the previously executed actions, ${\displaystyle a_{, and received percepts, ${\displaystyle e_{) that can generate that future, and then picks the action that maximises expected future rewards [3].

Let us break this definition down in order to attempt to fully understand it.

${\displaystyle o_{t}r_{t}}$ is the "percept" (which consists of the observation ${\displaystyle o_{t}}$ and reward ${\displaystyle r_{t}}$) received by the AIXI agent at time step ${\displaystyle t}$ from the environment (which is unknown and stochastic). Similarly, ${\displaystyle o_{m}r_{m}}$ is the percept received by AIXI at time step ${\displaystyle m}$ (the last time step where AIXI is active).

${\displaystyle r_{t}+\ldots +r_{m}}$ is the sum of rewards from time step ${\displaystyle t}$ to time step ${\displaystyle m}$, so AIXI needs to look into the future to choose its action at time step ${\displaystyle t}$.

${\displaystyle U}$ denotes a monotone universal Turing machine, and ${\displaystyle q}$ ranges over all (deterministic) programs on the universal machine ${\displaystyle U}$, which receives as input the program ${\displaystyle q}$ and the sequence of actions ${\displaystyle a_{1}\dots a_{m}}$ (that is, all actions), and produces the sequence of percepts ${\displaystyle o_{1}r_{1}\ldots o_{m}r_{m}}$. The universal Turing machine ${\displaystyle U}$ is thus used to "simulate" or compute the environment responses or percepts, given the program ${\displaystyle q}$ (which "models" the environment) and all actions of the AIXI agent: in this sense, the environment is "computable" (as stated above). Note that, in general, the program which "models" the current and actual environment (where AIXI needs to act) is unknown because the current environment is also unknown.

${\displaystyle {\textrm {length}}(q)}$ is the length of the program ${\displaystyle q}$ (which is encoded as a string of bits). Note that ${\displaystyle 2^{-{\textrm {length}}(q)}={\frac {1}{2^{{\textrm {length}}(q)}}}}$. Hence, in the definition above, ${\displaystyle \sum _{q:\;U(q,a_{1}\ldots a_{m})=o_{1}r_{1}\ldots o_{m}r_{m}}2^{-{\textrm {length}}(q)}}$ should be interpreted as a mixture (in this case, a sum) over all computable environments (which are consistent with the agent's past), each weighted by its complexity ${\displaystyle 2^{-{\textrm {length}}(q)}}$. Note that ${\displaystyle a_{1}\ldots a_{m}}$ can also be written as ${\displaystyle a_{1}\ldots a_{t-1}a_{t}\ldots a_{m}}$, and ${\displaystyle a_{1}\ldots a_{t-1}=a_{ is the sequence of actions already executed in the environment by the AIXI agent. Similarly, ${\displaystyle o_{1}r_{1}\ldots o_{m}r_{m}=o_{1}r_{1}\ldots o_{t-1}r_{t-1}o_{t}r_{t}\ldots o_{m}r_{m}}$, and ${\displaystyle o_{1}r_{1}\ldots o_{t-1}r_{t-1}}$ is the sequence of percepts produced by the environment so far.

Let us now put all these components together in order to understand this equation or definition.

At time step t, AIXI chooses the action ${\displaystyle a_{t}}$ where the function ${\displaystyle \sum _{o_{t}r_{t}}\ldots \max _{a_{m}}\sum _{o_{m}r_{m}}[r_{t}+\ldots +r_{m}]\sum _{q:\;U(q,a_{1}\ldots a_{m})=o_{1}r_{1}\ldots o_{m}r_{m}}2^{-{\textrm {length}}(q)}}$ attains its maximum.

### Parameters

The parameters to AIXI are the universal Turing machine U and the agent's lifetime m, which need to be chosen. The latter parameter can be removed by the use of discounting.

## The meaning of the word AIXI

According to Hutter, the word "AIXI" can have several interpretations. AIXI can stand for AI based on Solomonoff's distribution, denoted by ${\displaystyle \xi }$ (which is the Greek letter xi), or e.g. it can stand for AI "crossed" (X) with induction (I). There are other interpretations.

## Optimality

AIXI's performance is measured by the expected total number of rewards it receives. AIXI has been proven to be optimal in the following ways.[2]

• Pareto optimality: there is no other agent that performs at least as well as AIXI in all environments while performing strictly better in at least one environment.[citation needed]
• Balanced Pareto optimality: Like Pareto optimality, but considering a weighted sum of environments.
• Self-optimizing: a policy p is called self-optimizing for an environment ${\displaystyle \mu }$ if the performance of p approaches the theoretical maximum for ${\displaystyle \mu }$ when the length of the agent's lifetime (not time) goes to infinity. For environment classes where self-optimizing policies exist, AIXI is self-optimizing.

It was later shown by Hutter and Jan Leike that balanced Pareto optimality is subjective and that any policy can be considered Pareto optimal, which they describe as undermining all previous optimality claims for AIXI.[5]

However, AIXI does have limitations. It is restricted to maximizing rewards based on percepts as opposed to external states. It also assumes it interacts with the environment solely through action and percept channels, preventing it from considering the possibility of being damaged or modified. Colloquially, this means that it doesn't consider itself to be contained by the environment it interacts with. It also assumes the environment is computable.[6] Since AIXI is incomputable (see below), it assigns zero probability to its own existence[citation needed].

## Computational aspects

Like Solomonoff induction, AIXI is incomputable. However, there are computable approximations of it. One such approximation is AIXItl, which performs at least as well as the provably best time t and space l limited agent.[2] Another approximation to AIXI with a restricted environment class is MC-AIXI (FAC-CTW) (which stands for Monte Carlo AIXI FAC-Context-Tree Weighting), which has had some success playing simple games such as partially observable Pac-Man.[3][7]