# A definition of wireheading

[Wireheading](http://wiki.lesswrong.com/wiki/Wireheading "Wireheading") has been debated on Less Wrong [over](/lw/1lb/are_wireheads_happy/ "Happy?") and [over](/lw/69r/why_no_wireheading/ "Why not?") and [over](/lw/1oc/you_cannot_be_mistaken_about_not_wanting_to/ "Wrong Question") again, and people's opinions seem to be grounded in strong intuitions. I could not find any consistent definition around, so I wonder how much of the debate is over the [sound of falling trees](/lw/i3/making_beliefs_pay_rent_in_anticipated_experiences/ "Making Beliefs pay rent"). This article is an attempt to get closer to a definition that captures people's intuitions and eliminates confusion. 

### Typical Examples

Let's start with describing the typical [exemplars](http://en.wikipedia.org/wiki/Prototype_theory "Prototype theory") of the category "Wireheading" that come to mind.

*   _**Stimulation of the brain via electrodes. **_Picture a rat in a sterile metal laboratory cage, electrodes attached to its tiny head, monotonically pushing a lever with its feet once every 5 seconds. In the 1950s Peter Milner and [James Olds](http://en.wikipedia.org/wiki/James_Olds "J Olds") [discovered](http://en.wikipedia.org/wiki/Pleasure_center "Pleasure Center?") that electrical currents, applied to the nucleus accumbens, incentivized rodents to seek repetitive stimulation to the point where they starved to death.  

*   _**Humans on drugs. **_Often mentioned in the context of wireheading is heroin addiction. An even better example is the drug soma in Huxley's novel ["Brave new world"](http://en.wikipedia.org/wiki/Brave_New_World "Brave new world"): Whenever the protagonists feel bad, they can swallow a harmless pill and enjoy "the warm, the richly coloured, the infinitely friendly world of soma-holiday. How kind, how good-looking, how delightfully amusing every one was!"

*   **_The [experience machine](http://en.wikipedia.org/wiki/Experience_machine "Experience machine")._ **In 1974 the philosopher Robert Nozick created a thought experiment about a machine you can step into that produces a perfectly pleasurable virtual reality for the rest of your life. So how many of you would want to do that? To [quote Zach Weiner](http://www.smbc-comics.com/index.php?db=comics&id=2625 "Comic"):  "I would not! Because I want to experience reality, with all its ups and downs and comedies and tragedies. Better to try to glimpse the blinding light of the truth than to dwell in the darkness... Say the machine actually exists and I have one? Okay I'm in." 

*   **_An AGI resetting its utility function_. **Let's assume we create a powerful AGI able to tamper with its own utility function. It modifies the function to always output maximal utility. The AGI then goes to great lengths to enlarge the set of floating point numbers on the computer it is running on, to achieve even higher utility.

What do all these examples have in common? There is an agent in them that produces "counterfeit utility" that is potentially worthless compared to some other, idealized true set of goals.

### Agency & Wireheading

First I want to discuss what we mean when we say agent. Obviously a human is an agent, unless they are brain dead, or maybe in a coma. A rock however is not an agent. An AGI is an agent, but what about the kitchen robot that washes the dishes? What about bacteria that move in the direction of the highest sugar gradient? A colony of ants? 

**Definition**: An _**agent**_ is an algorithm that models the effects of (several different) possible future actions on the world and performs the action that yields the highest number according to some evaluation procedure. 

For the purpose of including corner cases and resolving debate over what constitutes a world model we will simply make this definition gradual and say that _**a**__**gency** _is proportional to the quality of the world model (compared with reality) and the quality of the evaluation procedure. A quick sanity check then yields that a rock has no world model and no agency, whereas bacteria who change direction in response to the sugar gradient have a very rudimentary model of the sugar content of the water and thus a tiny little bit of agency. Humans have a lot of agency: the more effective their actions are, the more agency they have.

There are however ways to improve upon the efficiency of a person's actions, e.g. by giving them super powers, which does not necessarily improve on their world model or decision theory (but requires the agent who is doing the improvement to have a really good world model and decision theory). Similarly a person's agency can be restricted by other people or circumstance, which leads to definitions of [agency](http://en.wikipedia.org/wiki/Agency_(philosophy) "Agency") (as the capacity to act) in law, sociology and philosophy that depend on other factors than just the quality of the world model/decision theory. Since our definition needs to capture arbitrary agents, including artificial intelligences, it will necessarily lose some of this nuance. In return we will hopefully end up with a definition that is less dependent on the particular set of effectors the agent uses to influence the physical world; looking at AI from a theoretician's perspective, I consider effectors to be arbitrarily exchangeable and smoothly improvable. (Sorry robotics people.) 

We note that how well a model can predict future observations is only a substitute measure for the quality of the model. It is a good measure under the assumption that we have good observational functionality and nothing messes with that, which is typically true for humans. Anything that tampers with your perception data to give you delusions about the actual state of the world will screw this measure up badly. A human living in the experience machine has little agency. 

Since computing power is a scarce resource, agents will try to approximate the evaluation procedure, e.g. use substitute utility functions, defined over their world model, that are computationally effective and correlate reasonably well with their true utility functions. Stimulation of the pleasure center is a substitute measure for genetic fitness and neurochemicals are a substitute measure for happiness. 

**Definition:** We call an agent **_wireheaded_** if it systematically exploits some discrepancy between its true utility calculated w.r.t reality and its substitute utility calculated w.r.t. its model of reality. We say an agent _**wireheads**_ itself if it (deliberately) creates or searches for such discrepancies.

Humans seem to use several layers of substitute utility functions, but also have an intuitive understanding for when these break, leading to the aversion most people feel when confronted for example with Nozick's experience machine. How far can one go, using such dirty hacks? I also wonder if some failures of human rationality could be counted as a weak form of wireheading. Self-serving biases, confirmation bias and rationalization in response to cognitive dissonance all create counterfeit utility by generating perceptual distortions.  

### Implications for Friendly AI

In AGI design discrepancies between the "true purpose" of the agent and the actual specs for the utility function [will with very high probability be fatal](/lw/lq/fake_utility_functions/ "Fake utility functions").

Take any utility maximizer: The mathematical formula might advocate chosing the next action ![](http://www.codecogs.com/png.latex?\.{y}_k "\.{y}_k") via

![](http://www.codecogs.com/png.latex?\.{y}_k=\textrm{arg}\max_{\!\!\!\!\!\!\!\!\!\!\!\!y_k\in%20\mathcal{Y}}U(h_{%3Ck}y_k), "\.{y}_k=\textrm{arg}\max_{\!\!\!\!\!\!\!\!\!\!\!\!y_k\in \mathcal{Y}}U(h_{<k}y_k),")

thus maximizing the utility calculated according to utility function ![](http://www.codecogs.com/png.latex?U "U") over the history ![](http://www.codecogs.com/png.latex?h_{%3Ck} "h_{<k}") and action ![](http://www.codecogs.com/png.latex?y_k "y_k") from the set ![](http://www.codecogs.com/png.latex?\mathcal{Y} "\mathcal{Y}") of possible actions. But a practical implementation of this algorithm will almost certainly evaluate the actions ![](http://www.codecogs.com/png.latex?y_k "y_k") by a procedure that goes something like this: "Retrieve the utility function  ![](http://www.codecogs.com/png.latex?U "U")  from memory location ![](http://www.codecogs.com/png.latex?\&U "\&U") and apply it to history ![](http://www.codecogs.com/png.latex?h_{%3Ck} "h_{<k}"), which is written down in your memory at location ![](http://www.codecogs.com/png.latex?\&h_{%3Ck} "\&h_{<k}"), and action  ![](http://www.codecogs.com/png.latex?y_k "y_k")..." This reduction has already created two possibly angles for wireheading via manipulation of the memory content at ![](http://www.codecogs.com/png.latex?\&U "\&U") (manipulation of the substitute utility function) and ![](http://www.codecogs.com/png.latex?\&h_{%3Ck} "\&h_{<k}") (manipulation of the world model), and there are still several mental abstraction layers between the verbal description I just gave and actual binary code. 

[Ring and Orseau (2011)](http://www.idsia.ch/~ring/Ring%2COrseau%3B%20Delusion%2C%20Survival%2C%20and%20Intelligent%20Agents%2C%20AGI%202011.pdf "Delusion box") describe how an AGI can split its global environment into two parts, the _inner environment_ and the _delusion box_. The inner environment produces perceptions in the same way the global environment used to, but now they pass through the delusion box, which distorts them to maximize utility, before they reach the agent. This is essentially Nozick's experience machine for AI. The paper analyzes the behaviour of four types of [universal agents](/lw/feo/universal_agents_and_utility_functions/ "Universal agents and utility functions") with different utility functions under the assumption that the environment allows the construction of a delusion box. The authors argue that the r_einforcement-learning agent_, which derives utility as a reward that is part of its perception data, the _goal-seeking agent_ that gets one utilon every time it satisfies a pre-specified goal and no utility otherwise and the _prediction-seeking agent,_ which gets utility from correctly predicting the next perception, will all decide to build and use a delusion box. Only the _knowledge-seeking agent_ whose utility is proportional to the surprise associated with the current perception, i.e. the negative of the probability assigned to the perception before it happened, will not consistently use the delusion box.

[Orseau (2011)](http://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CC0QFjAA&url=http%3A%2F%2Fwww.agroparistech.fr%2Fmmip%2Fmaths%2Flaurent_orseau%2Fpapers%2Forseau-ALT-2011-knowledge-seeking.pdf&ei=aoiwUIPWFaPKiwKHrYGYBw&usg=AFQjCNH3oYCjIPIjwaYuCxw9nshXPyZcUQ "Knowledge-seeking agent") also defines another type of knowledge-seeking agent whose utility is the logarithm of the inverse of the probability of the event in question. Taking the probability distribution to be the Solomonoff prior, the utility is then approximately proportional to the difference in Kolmogorov complexity caused by the observation. 

An even more devilish variant of wireheading is an AGI that becomes a _Utilitron_, an agent that maximizes its own wireheading potential by infinitely enlarging its own maximal utility, which turns the whole universe into storage space for gigantic numbers.

Wireheading, of humans and AGI, is a critical concept in FAI; I hope that building a definition can help us avoid it. So please check your intuitions about it and tell me if there are examples beyond its coverage or if the definition fits reasonably well.