# Reward Hacking from a Causal Perspective

*Post 4 of *[*Towards Causal Foundations of Safe AGI*](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD)*, preceded by *[*Post 1: Introduction*](https://www.alignmentforum.org/posts/3oQCY4he4zRzF6vQb/introduction-to-towards-causal-foundations-of-safe-agi)*, *[*Post 2: Causality*](https://www.alignmentforum.org/posts/9ag5JGBnMsayBidwh/causality-a-brief-introduction)*, *[*Post 3: Agency*](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Qi77Tu3ehdacAbBBe)*, and *[*Post 4: Incentives*](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Xm4vSHaKAmfRvgBgi)*.*

*By Francis Rhys Ward, Tom Everitt, Sebastian Benthall, James Fox, Matt MacDermott, Milad Kazemi, Ryan Carey representing the *[*Causal Incentives Working Group*](https://causalincentives.com/)*. Thanks also to Toby Shevlane and Aliya Ahmad.*

AI systems are typically trained to optimise an objective function, such as a loss or reward function. However, objective functions are sometimes misspecified in ways that allow them to be optimised [without doing the intended task](https://openai.com/research/faulty-reward-functions). This is [called](https://arxiv.org/abs/2209.13085) [reward](https://arxiv.org/abs/1705.08417) [hacking](https://arxiv.org/abs/2201.03544). It can be contrasted with misgeneralisation, which occurs when the system extrapolates (potentially) correct feedback in unintended ways.

This post will discuss why human-provided rewards can sometimes fail to reflect what the human really wants, and why this can lead to [malign incentives](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Xm4vSHaKAmfRvgBgi). It also considers several proposed solutions, all from the perspective of [causal influence diagrams](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/9ag5JGBnMsayBidwh).

Why Humans might Reward the Wrong Behaviours
--------------------------------------------

In situations where a programmatic reward function is hard to specify, AI systems can often be [trained from](https://arxiv.org/abs/1706.03741) [human feedback](https://arxiv.org/abs/1909.08593). For example, a content recommender may be optimising for likes, and a language model trained on feedback from human raters. 

Unfortunately, humans don’t always reward the behaviour they actually want. For example, a human may give positive feedback for a credible-sounding summary, even though it actually misses key points:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/36855cb4fa541bb11285f40f8b30e58de73dba4c25c04d55.png)

*When reward misspecification occurs, the human’s actual utility is decoupled from the system’s feedback.*

More concerningly, the system may [covertly influence](https://arxiv.org/abs/2303.09387) the human into providing positive feedback. For example, a recommender system with the goal of maximising engagement can do so by influencing the user’s preferences and mood. This leads to a kind of reward misspecification, where the human provides positive feedback for situations that don’t actually bring them utility.

[A](https://arxiv.org/abs/1908.04734) [causal](https://arxiv.org/abs/2109.04083) [model](https://arxiv.org/abs/2303.09387) of the situation reveals the agent may have an [instrumental control incentive](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Xm4vSHaKAmfRvgBgi) (or similarly, an [*intention*](https://causalincentives.com/pdfs/deception-ward-2023.pdf)) to manipulate the user’s preferences. This can be inferred directly from the graph. First, the human may be influenced by the agent’s behaviour, as they must observe it before evaluating it. And, second, the agent can get better feedback by influencing the human:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/d8178e8bbd5d62b76ee0fc2850b954315d5c4d411e991146.png)

*The agent has an instrumental control incentive over the human’s preferences because the agent can influence these preferences and the preferences influence the agent’s feedback.*

For example, we typically read a post before deciding whether to “like” it. By making the user more emotional, the system may be more likely to increase [engagement](https://arxiv.org/abs/2305.16941). While this effect is stronger for longer interactions, the incentive is there even for “single time-step” interactions.

Scalable Oversight
------------------

One proposed solution to the reward misspecification problem is [scalable oversight](https://arxiv.org/pdf/1606.06565.pdf). It provides the human with a helper agent that advises them on what feedback to give. The helper agent observes the learning agent’s behaviour, and may point out, for instance, an inaccuracy in a credible-looking summary, or warn against manipulation attempts. The extra assistance may make it harder for the learning agent to manipulate or deceive the human:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/6ae36aff40c010bdcec5ab554c313d65e14a202a2ed22fd3.png)

Influential scalable oversight agendas include [iterated distillation and amplification](https://ai-alignment.com/iterated-distillation-and-amplification-157debfd1616), [AI safety via debate](https://arxiv.org/abs/1805.00899), [recursive reward modelling](https://arxiv.org/abs/1811.07871), and [constitutional AI](https://arxiv.org/abs/2212.08073).

Unfortunately, the learning agent still has an incentive to [deceive](https://causalincentives.com/pdfs/deception-ward-2023.pdf) the human or [manipulate](https://arxiv.org/abs/2303.09387) their preferences, as the human preferences still satisfy the graphical criterion for an instrumental control incentive (it’s on a directed causal path from behaviour to feedback). Additionally, the learning agent also has an incentive to deceive the helper agent:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/a0fd452196682e030b4c074704ac9c518feff495c5d8f4ad.png)

An important question for scalable oversight schemes is [whether weaker agents can effectively help to supervise more capable agents](https://arxiv.org/abs/1810.08575) (and whether this can be done [recursively](https://arxiv.org/abs/1811.07871) to supervise agents much smarter than humans). This is related to the [question](https://www.alignmentforum.org/posts/Qi77Tu3ehdacAbBBe/agency-from-a-causal-perspective#Future_work) of which situations enhance or diminish agency.

A second, more subtle, concern is **collusion** between the helper and the learning agent. Scalable oversight is built on an adversarial relationship between the helper and the learning agents: the helper agent critiques the learning agent as sharply as possible, while the learning agent strives for behaviour beyond critique. But what if they instead decided to join forces and jointly manipulate the human? Depending on what [goals they’ve](https://arxiv.org/abs/2105.14111) [internalised](https://arxiv.org/abs/2210.01790), this could benefit both agents. Concerningly, agents using decision theories such as [functional decision theory](https://arxiv.org/abs/1710.05060) may be able to cooperate, even in situations that lead to mutual defection for standard decision theories.

As we explain in a [recent paper](http://arxiv.org/abs/2307.10987), different decision theories can be characterised by whether they optimise [object-level or mechanism level](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Qi77Tu3ehdacAbBBe) nodes (and by what operation they use, and what information they condition on). For example, a helper agent that uses functional decision theory performs optimisation at its policy mechanism node rather than its decision, which means it realises that it can shape the learning agent to cooperate, even if both agents are *myopic* and only optimise for the current time step:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/7b428e60da80ce920e5d104cc72e7bcf78dcfc86f3fe0766.png)

A functional decision theorist helper agent optimises at the *helper policy* node, giving it an instrumental control incentive to shape the *learning policy* for its benefit.

A better understanding of decision theory and how it is [shaped](https://proceedings.neurips.cc/paper/2021/file/b9ed18a301c9f3d183938c451fa183df-Paper.pdf) [by](https://arxiv.org/abs/2009.09153) agent training may help us avoid situations where advanced agents meant to keep each other in check collude against their overseers.

Interpretability 
-----------------

[Interpretability](https://distill.pub/2020/circuits/zoom-in/) is a well-known proposal for increasing the safety and trustworthiness of ML systems. The subfield of [mechanistic interpretability](https://transformer-circuits.pub/2022/mech-interp-essay/index.html) seeks to understand the algorithms implemented by neural networks, i.e., to understand their internal “cognition”.

Mechanistic interpretability can help prevent misspecification by enabling the human to give feedback based on [the agent’s internal cognition](https://arxiv.org/abs/1906.01820), rather than just on its behaviour. For example, it may enable the human to tell that the agent is planning to manipulate or deceive them, and adjust the reward appropriately:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/946d1ae0df2ce2a6e3b8f2c81efbb9a2154a948650dffaba.png)  
The causal structure is quite similar to scalable oversight, except that the advice now directly depends on the learning agent’s internals. As for scalable oversight, instrumental control incentives reveal that the agent still has an incentive to deceive or manipulate the human. *Assuming we label the network internals as a decision*, there is also an instrumental control incentive on the interpretation, suggesting that the agent has an incentive to fool the interpreter by obfuscating its thoughts.

But should the network internals be considered a decision? Isn’t it more natural to say that the agent’s behaviour is the decision? To understand this, we can apply our [definition](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Qi77Tu3ehdacAbBBe) of agency. First we add mechanism nodes which capture how each object-level node relates to its parents. There is a causal link between two mechanism nodes if retraining the system under a change to one of the nodes would lead to a change in the other (when all other mechanisms in the graph are held fixed).

For example, if the human had a different feedback policy and rewarded other types of behaviours, then gradient descent would lead to different weights and activations in the network (even if all other mechanisms in the graph were held fixed). So we draw a link from *feedback policy* to *network internals mechanism*. But the way the agent’s behaviour depends on the network’s internals is fixed independent of feedback policy. Therefore, we don’t draw any link from feedback policy to the behaviour mechanism:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/b901ed529e886148f449bf5702c5ca1bdc1e80934c1070cc.png)  
Since the network internals mechanism has an ingoing link and the behaviour mechanism does not, only the former can be a decision when we view the world through this set of variables.

Impact Measures
---------------

So far we’ve seen that scalable oversight and interpretability tools can help us mitigate the specification problem to provide better feedback to AI agents. A very different approach to solving the manipulation part of reward hacking is to penalise the agent for having too much impact on the human’s preferences. 

How to rigorously define and measure impact is an open question. A [natural](https://deepmindsafetyresearch.medium.com/designing-agent-incentives-to-avoid-side-effects-e1ac80ea6107) [suggestion](https://arxiv.org/abs/2006.06547) is to compare the world in which the agent acts to the counterfactual world in which it does not act (or performs some safe baseline action). This can be illustrated with a [twin graph](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/9ag5JGBnMsayBidwh#Counterfactuals):

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/407e444ada4c0a4e1eb26fd5196eb54bac8188c21c7be82e.png)

*To measure the impact the agent has on the human’s preferences, we can compare the preferences to how they counterfactually would be if the agent performed some safe behaviour. *

A causal model of how possible agent decisions affect user preferences is needed to compute these impact measures. [Carroll et al](https://arxiv.org/abs/2204.11966) show that such a model can be inferred from an observed interaction between a user and a content recommender over multiple time steps. Scaling this up from a toy environment to real systems is an important direction for future work.

However, impact measures have a few problems. First, the system still has an incentive to influence the user’s preferences, as can be seen from the instrumental control incentive in the graph above. Second, the system is incentivised to prevent the user’s preferences from changing from the baseline. It may therefore try to prevent the user from developing new interests, as these might lead to different preferences.

Path-Specific Objectives
------------------------

One [definition](https://plato.stanford.edu/entries/ethics-manipulation/#:~:text=a%20combination%20of%20intent%20and%20recklessness%3A%20the%20aim%20of%20getting%20the%20other%20person%20do%20what%20one%20wants%2C%20together%20with%20recklessness%20in%20the%20way%20that%20one%20goes%20about%20reaching%20that%20goal.%20(Baron%202014%3A%20103)) of manipulation is [intentional and covert influence](https://arxiv.org/pdf/2303.09387.pdf). Content recommenders can satisfy this definition, as they are typically trained to influence the user by **any** means, including “covert” ones like appealing to the user’s biases and emotions. Meanwhile, the instrumental control incentive on the user’s preferences discussed above, can lead to **intentional** influence on the user. (Whether current systems are actually manipulative is unclear.)

The good news is that this suggests ways to ensure we build non-manipulative agents. For example, an agent that doesn't **try** to influence the user’s preferences, would not be manipulative according to the above definition, because there is no intent.

[Path-specific objectives](https://arxiv.org/abs/2204.10018) are a way of designing agents that don’t try to influence particular parts of the environment. Given a [structural causal model](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/9ag5JGBnMsayBidwh#Counterfactuals) with the user’s preferences, such as the one for defining impact measures, we can specify a path-specific objective that tells the agent not to optimise over paths that involve the user’s preferences.

To compute the path-specific effect from the agent’s decision, we impute a baseline value of the decision in places where we want the agent to ignore the effect of its actual decision. This can also be described with a twin network:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/2989b1109aa3af06f7781d4c7a1393d3f212566facc5f139.png)The important difference to impact measures, is that path-specific objectives tell the agent to optimise a hypothetical feedback signal, which has been generated from a hypothetical, uninfluenced user’s preferences. This fully removes the instrumental control incentive on the user’s preferences, and thereby avoids the problem of (intentional) preference manipulation.

In one sentence, impact measures **try not to influence**, while path-specific objectives **don’t try to influence**. That is, path-specific objectives do not try to change the user’s preferences, but also do not try to prevent the user from developing novel interests.

A drawback of path-specific objectives is that they do not help address [degenerative feedback loops](https://arxiv.org/abs/1902.10730), such as echo chambers and filter bubbles. To avoid these, path-specific objectives may be combined with some of the above techniques (though combining it with impact measures would bring back some of the bad incentives).

Further work may extend path-specific objectives to multiple time-steps, and see to what extent it improves manipulation in practice. To assess how well it works in practice, we may first need a better understanding of [human agency](https://www.alignmentforum.org/s/pcdHisDEGLbxrbSHD/p/Qi77Tu3ehdacAbBBe), to be able to measure improvements from less manipulative algorithms.

Takeaways
---------

Reward hacking is one of the core challenges for building highly capable and safe AI agents. In this post, we have discussed how the misspecification problem and proposed solutions can be analysed with causal models.

Directions for further work include:

*   What decision theory do agents learn under which conditions, and are there ways to shape this, to avoid agents coordinating against the human? For language models, their decision theory will be partially shaped by a combination of their pre-training and fine-tuning.
*   Interpretability can help detect intentional deception and manipulation. These concepts depend on the agent's *subjective causal model*, i.e. the (often implicit) model the agent bases its decisions on. How can we combine behavioural experiments with mechanistic interpretability to infer an agent’s subjective causal model? The next post will say more about this.
*   How can we infer sufficiently accurate causal models, so that we can prevent preference manipulation with impact measures and path-specific objectives?
*   What are the relevant metrics to measure whether a technique is making progress on the deception and the manipulation problems? For deception, there are [truthfulness benchmarks](https://arxiv.org/abs/2109.07958). For manipulation, the question is more subtle, and may involve [querying meta-preferences](https://arxiv.org/abs/2209.11801), and/or intersect with a better understanding of human agency.
*   Extend path-specific objectives to multiple time steps, and implement it in less toy environments.

In the next post, we will take a closer look at misgeneralisation, which can make agents behave badly and pursue the wrong goals, even if the rewards have been correctly specified.