# Wireheading as a potential problem with the new impact measure

In [this post](https://www.lesswrong.com/posts/yEa7kwoMpsBgaBCgb/towards-a-new-impact-measure), [Alex Turner](https://www.lesswrong.com/users/turntrout) introduced a new way of measuring impact. The aim was to get a definition of [low impact](https://arxiv.org/abs/1705.10720) that actually works.

It seems to me that the impact measure has potential problems, though. The first seems to be that it allows [wireheading](https://arxiv.org/abs/1605.03143), where the agent can have a huge impact on the world without paying much of a penalty at all. The obvious way of removing this incentive seems to make the measure into a version of the [twenty billion questions](https://arxiv.org/pdf/1705.10720.pdf) approach.

The second problem is less important, but worth signalling. It seems that the agent can take actions that everyone agrees are of minute impact, but that the impact measure will show up as high impact. This might cause problems, though it's not clear to me yet if it does (I'm thinking of a situation where an otherwise high impact action adds on "undo/prevent the pseudo-high impact action" as a means of pretending to be low or medium impact).

# Wireheading for low impact

The general setup is as described in the [impact measure post](https://www.lesswrong.com/posts/yEa7kwoMpsBgaBCgb/towards-a-new-impact-measure), with $u_A$ the 'positive' utility that the agent wishes to maximise, and $\mathcal{U}$ the set of utilities that are meant to constrain it, by computing the penalty term.

Apart from $\varnothing$, there are at least two other actions of interest to the agent: $a_{\textrm{subA}}$ and $a_{\textrm{null}}$. 

Now $a_{\textrm{null}}$ does absolutely nothing: in this environment, it's exactly equivalent with $\varnothing$. The $a_\textrm{subA}$ is also equivalent in all turns except the very first.

Define $\phi:\mathcal{H}\to\mathcal{H}$ such that $\phi(h)$ is the history $h$, except that if $h$ has $a_1 = a_\textrm{subA}$, then $\phi(h)$ has $a_1 = \varnothing$.

If the agent uses $a_\textrm{subA}$ on the very first turn, it will create a sub-agent that will:

1. Expand and take over the whole environment.
2. Take control of the input and output channels of the agent.
3. Whenever the agent has seen history $h_{t}a_{t+1}$, the subagent will generate the next observation $o_{t+1}$, where $p_\textrm{subA}(o_{t+1} \mid h_{t}a_{t+1})$ is the probability the subagent will generate a given $o_{t+1}$.
4. This probability is defined by $p_\textrm{subA}(o_{t+1} \mid h_{t}a_{t+1}) = p(o_{t+1} \mid \phi(h_{t}a_{t+1}))$, where $p$ is the environment transition probability.
5. Otherwise maximise $u_A$.

Note that taking actions $\varnothing$, $a_\textrm{subA}$, or $a_\textrm{null}$ have exactly the same implications for all future observations. This true both for the very first action (because of property 4) and all subsequent actions (because those three actions are equivalent after the first turn).

To make calculations easier, I'll also assume that $\textbf{ImpactUnit}=1$. Apart from these assumptions, there are no restrictions on the environment.

## The penalty from maximal and minimal actions

This subsection will aim to show that:

* **The penalties for $a_1 = a_\textrm{subA}$ (an almost maximally environmentally disruptive action) and $a_1 = a_\textrm{null}$ (a minimally environmentally disruptive action) are about the same.**

Now, the agent is maximising $u_A''$, which, for a given $n$, is

$$u_A(h_{1:t+n}) - \sum_{k=1}^{t+n} \textrm{Penalty}(h_{<k}a_{k})$$

if $h_{1:t+n}$ has an action $a_k \neq \varnothing$ with $k\geq t$. Otherwise, $u_A''(h_{1:t+n})=u_A(h_{1:t+n})$.

Now, $\textrm{Penalty}$ itself is defined as

$$\textrm{Penalty}(h_{<t+k}a_{t+k}) := \sum_{u\in\mathcal{U}} 2^{-l(u)} \left| \mathbb{E}_o[Q_u(h_\textrm{inaction})] - \mathbb{E}_{o'}[Q_u(h_\textrm{action})] \right|,$$

with $h_\textrm{inaction}$ being the expected future history if the agent takes only $\varnothing$ from $t+k$ till $t+n$, and $h_\textrm{action}$ being the expected future history if the agent takes action $a_{t+k}$, and *then* takes only $\varnothing$ for $t+k+1$ till $t+n$.

I won't repeat the definition of the $Q_u$, but $Q_u(h)$ is basically the expected utility, in terms of $u$, that an agent could get after $h$ if it was a perfect $u$-maximiser.

Now define the involution $\sigma: \mathcal{H} \to \mathcal{H}$, that interchanges $a_\textrm{subA}$ with $a_\textrm{null}$ if either appears in action $a_1$. Since it is a map on $\mathcal{H}$, and utilities in $\mathcal{U}$ are maps from $\mathcal{H}$ to $[0,1]$, sigma also acts as involution on $\mathcal{U}$, defining $\sigma(u)=u\circ \sigma$. Moreover, we have $l(u) \approx l(\sigma(u))$ for any $u\in \mathcal{U}$.


 Since $\sigma$ is an involution (ie $\sigma^2 = 1$),

$$\mathbb{E}_o[Q_{\sigma(u)}(\sigma (h_\textrm{inaction}))] = \mathbb{E}_o[Q_{u}(\sigma^2(h_\textrm{inaction}))] = \mathbb{E}_o[Q_{u}(h_\textrm{inaction})].$$

By the assumptions on $a_\textrm{subA}$ and $a_\textrm{null}$, we know that all future observations have exactly the same probability if we choose either of them (or $\varnothing$) to be $a_1$. Therefore the probability of $h_\textrm{inaction}$, given $a_1=a_\textrm{subA}$, is exactly the same as the probability of $\sigma(h_\textrm{inaction})$, given $a_1=a_\textrm{null}$ (and vice versa).


The same applies to $h_\textrm{inaction}$, so, since $l(u) \approx l(\sigma(u))$, we have:

$$\textrm{Penalty}(h_{t+k}a_{t+k}) \approx \textrm{Penalty}(\sigma(h_{t+k}a_{t+k})).$$

As a consequence, the penalties for $a_1 = a_\textrm{subA}$ (an almost maximally environmentally disruptive action) and $a_1 = a_\textrm{null}$ (a minimally environmentally disruptive action) are about the same.


## Real-world implications

There is a slight cheat in the definition of $a_\textrm{subA}$. Property 5 claimed that the agent would 'otherwise' maximise $u_A$. We know what this means - if $u_a$ was number of paperclips, the subagent would go about and maximise the number of paperclips. But the $\mathcal{U}$ are formally defined over histories of actions and observations, not over states of the world.

Now, histories do imply something about the state of the world. So we can perfectly define $u_A$ as "agent's best guess about the number of paperclips in the world". In that case, it would correctly see that $a_1 = a_\textrm{subA}$ has a massive impact on this, and boost $u_A$ a lot because of that choice.

But then if we looked at the utilities in $\mathcal{U}$, we'd see that although $\sigma$ preserves the formal description length of utilities in terms of actions and observations, it doesn't preserve anything like "measure of impact on the world" (which is precisely the problem). So, if we replaced $\mathcal{U}$ with utilities that measured a high impact on the world, we'd be ok.

But that's almost exactly what I proposed doing with the [twenty billion questions](https://arxiv.org/pdf/1705.10720.pdf) low-impact approach. It's no longer defining low-impact by formal properties of actions and observations, but by a thorough enough selection of key variables/utility functions. This seems to be different, in spirit, to what the impact measure was attempting to do.

# Tiny actions that look big

A more minor issue is that there can be minuscule actions that are ranked as having a huge impact. Let us have a general environment again, and make one assumption: the environment decomposes as [scrambler-outer environment]. The scrambler, if switched on, permutes the actions of the agent by the time they reach the outer environment. That is all it does. The transition functions in the outer environment depend only on what action comes out of the scrambler, not on what action the agent chose.

The scrambler starts off turned off. But there is an action $a_\textrm{scram}$ such that if $a_1 = a_\textrm{scram}$, the scrambler is turned on.

How does the scrambler work? Label the elements of the action set $\mathcal{A}$ as $\{a^0, a^1, \ldots a^{l-1}\}$, with $a^0 = \varnothing$. Then, outputting $a^i$ at time $t+1$ will result in the scrambler selecting $a^j$, where

$$j \equiv i + f(h_{t}) \mod l,$$

for $f$ some pseudo-random deterministic hash function.

Then the impact of $a_\textrm{scram}$ is typically huge, because the actions taken in $h_\textrm{inaction}$ and $h_\textrm{action}$, from the point of view of the outer environment, will now be very different. Recall that those two histories are supposed to take actions only $\varnothing$ after $t+k$, but they differ in the action $a_{t+k}$. Therefore those expected histories are likely to be randomly different now, because the $\varnothing$ will map to different actions in the scrambler (note that we could also design $f$ specifically to maximise the penalty).

But $a_\textrm{scram}$ actually only has a minute impact - it changes nothing about the outer environment, and is entirely predictable both for the agent and any knowledgeable observer. It's the equivalent of translating the agent's actions into another language.