# Progress on Causal Influence Diagrams

*By Tom Everitt, Ryan Carey, Lewis Hammond, James Fox, Eric Langlois, and Shane Legg*

*Crossposted from* [*DeepMind Safety Research*](https://deepmindsafetyresearch.medium.com/progress-on-causal-influence-diagrams-a7a32180b0d1)

About 2 years ago, we released the [first](https://medium.com/@deepmindsafetyresearch/understanding-agent-incentives-with-causal-influence-diagrams-7262c2512486) [few](https://medium.com/@deepmindsafetyresearch/designing-agent-incentives-to-avoid-reward-tampering-4380c1bb6cd) [papers](https://arxiv.org/abs/1906.08663) on understanding agent incentives using causal influence diagrams. This blog post will summarize progress made since then.

What are causal influence diagrams?
===================================

A key problem in AI alignment is understanding agent incentives. Concerns have been raised that agents may be incentivized to [avoid correction](https://intelligence.org/files/Corrigibility.pdf), [manipulate users](https://www.youtube.com/watch?v=ZkV7anCPfaY), or [inappropriately influence their learning](https://arxiv.org/abs/2004.13654). This is particularly worrying as training schemes often shape incentives in [subtle](https://arxiv.org/abs/1611.08219) and [surprising](https://arxiv.org/abs/2009.09153) ways. For these reasons, we’re developing a formal theory of incentives based on causal influence diagrams (CIDs).

Here is an example of a CID for a one-step Markov decision process (MDP). The random variable S~1~ represents the state at time 1, A~1~ represents the agent’s action, S~2~ the state at time 2, and R~2~ the agent’s reward. 

![](https://lh3.googleusercontent.com/16A_lLPST-xQ40OtIW6dPkvXWA-Xvi6lswvtUZKEGU_VbJUZkHu9L6sA_dScbGUDSWumjIIxC_wnObcEjO0FAnj_EHyw8sLoBa4MZkZL0Faj40fLO3d29jk7Blk37p_B1LKuUDfmWw)

The action A~1~ is modeled with a decision node (square) and the reward R~2~ is modeled as a utility node (diamond), while the states are normal chance nodes (rounded edges). Causal links specify that S~1~ and A~1~ influence S~2~, and that S~2~ determines R~2~. The information link S~1~ → A~1~ specifies that the agent knows the initial state S~1~ when choosing its action A~1~.

In general, random variables can be chosen to represent agent decision points, objectives, and other relevant aspects of the environment.

In short, a CID specifies:

*   Agent decisions
*   Agent objectives
*   Causal relationships in the environment
*   Agent information constraints

These pieces of information are often essential when trying to figure out an agent’s incentives: how an objective can be achieved depends on how it is causally related to other (influenceable) aspects in the environment, and an agent’s optimization is constrained by what information it has access to. In many cases, the qualitative judgements expressed by a (non-parameterized) CID suffice to infer important aspects of incentives, with minimal assumptions about implementation details. Conversely, it has [been shown](https://arxiv.org/abs/1910.10362) that it is necessary to know the causal relationships in the environment to infer incentives, so it’s often impossible to infer incentives with less information than is expressed by a CID. This makes CIDs natural representations for many types of incentive analysis.

Other advantages of CIDs is that they build on well-researched topics like [causality](https://www.amazon.co.uk/Causality-Judea-Pearl/dp/052189560X) and [influence diagrams](https://arxiv.org/abs/cs/9512104), and so allows us to leverage the deep thinking that’s already been done in these fields.

Incentive Concepts
==================

Having a unified language for objectives and training setups enables us to develop generally applicable concepts and results. We define four such concepts in [Agent Incentives: A Causal Perspective](https://arxiv.org/abs/2102.01685) (AAAI-21):

*   **Value of information**: what does the agent want to know before making a decision?
*   **Response incentive**: what changes in the environment do optimal agents respond to?
*   **Value of control**: what does the agent want to control?
*   **Instrumental control incentive**: what is the agent both interested and able to control?

For example, in the one-step MDP above:

*   For S~1,~ an optimal agent would act differently (i.e. respond) if S~1~ changed, and would value knowing and controlling S~1~, but it cannot influence S~1~ with its action. So S~1~ has value of information, response incentive, and value of control, but not an instrumental control incentive.
*   For S~2~ and R~2~, an optimal agent could not respond to changes, nor know them before choosing its action, so these have neither value of information nor a response incentive. But the agent would value controlling them, and is able to influence them, so S~2~ and R~2~ have value of control and instrumental control incentive.

![](https://lh4.googleusercontent.com/ewpqjJEsRJd-PSvhIkPRfuXIDdtjfNi1OLRIjGlA66LDxjysepH_8pWimvqqPjXS6shy22SKF0G5i5sFgD9iy3QViw20IOrcITN9lWNrlr0Wbd6vAVZtuWbmCOfBlPnfxsYniMUtDA)

In the paper, we prove sound and complete graphical criteria for each of them, so that they can be recognized directly from a graphical CID representation (see previous [blog](https://medium.com/@deepmindsafetyresearch/understanding-agent-incentives-with-causal-influence-diagrams-7262c2512486) [posts](https://towardsdatascience.com/new-paper-the-incentives-that-shape-behaviour-d6d8bb77d2e4)).

Value of information and value of control are classical concepts that have been around for a long time (we contribute to the graphical criteria), while response incentives and instrumental control incentives are new concepts that we have found useful in several applications.

For readers familiar with [previous](https://arxiv.org/abs/1902.09980) [iterations](https://arxiv.org/abs/2001.07118) of this paper, we note that some of the terms have been updated. **Instrumental control incentives** were previously called just “control incentives”. The new name emphasizes that it’s control as an instrumental goal, as opposed to control arising as a side effect (or [due to mutual information](https://www.alignmentforum.org/posts/67a8C6KsKn2NyW2Ry/counterfactual-control-incentives)). **Value of information** and **value of control** were previously called “observation incentives” and “intervention incentives”, respectively.

User Interventions and Interruption
===================================

Let us next turn to some recent applications of these concepts. In [How RL Agents Behave when their Actions are Modified](https://arxiv.org/abs/2102.07716) (AAAI-21), we study how different RL algorithms react to user interventions such as interruptions and over-ridden actions. For example, [Saunders et al.](https://arxiv.org/abs/1707.05173#:~:text=Trial%20without%20Error%3A%20Towards%20Safe%20Reinforcement%20Learning%20via%20Human%20Intervention,-William%20Saunders%2C%20Girish&text=AI%20systems%20are%20increasingly%20applied,that%20involve%20interaction%20with%20humans.&text=For%20model%2Dfree%20reinforcement%20learning,way%20to%20prevent%20all%20catastrophes.) developed a method for safe exploration where a user overrides dangerous actions. Alternatively, agents might get interrupted if analysis of their “thoughts” (or internal activations) suggest they are planning something dangerous. How do such interventions affect the incentives of various RL algorithms?

First, we formalize action-modification by extending MDPs with a parameter P~A~ that describes action-modification. We then model such **modified-action MDPs** with a CID: 

![](https://lh5.googleusercontent.com/2rilLYr9N-25tuj-4bgTqQ990E-76RmuKO68-jsugRKb5anVGjuKwQ9jVshOrOKZT_yJNOBiAp8Y6O177HX62kY6AXQG-CPZFCNDUxx3ZxqswymZrUQC_0eY3H27w5UhRlLz8sDxMw)

Here we model the agent’s policy Π as the decision rather than the actions A~i~, as the latter are not under full control of the agent, but can also be influenced by the action-modification P~A~ (as represented by arrows P~A~ → A~i~ and Π → A~i~). The agent might know the interruption scheme P~A~ from interruptions during training, so we include an information link P~A~ → Π.

We analyze different prototypical RL algorithms in terms of the causal assumptions they make on the environment:

*   **Black-box optimization** algorithms such as **evolutionary strategies** take into account all causal relationships.
*   In contrast, the update rule of **Q-learning** effectively assumes that the next action will be taken optimally, with no action-modification. This means that Q-learners ignore causal effects P~A~ -\> A. Similarly, **SARSA** with the action chosen by the agent in the TD-update assumes that it will be in control of its next action. We call this version **virtual SARSA**.
*   SARSA based on the modified action (**empirical SARSA**) ignores the effect of action-modification on the current action, but takes into account the effect on subsequent actions.

We can represent the differences with the following CIDs. (The extra policy node Π’ for empirical SARSA represents that action are optimized separately rather than jointly.) 

![](https://lh6.googleusercontent.com/waQQXivEd2YAMrcSIl0Oea215a6rNBXcr82DmD-NGcfM5_FjtNIL-rYSBeVuHcfQpk0NQkMXZSQ33FWdr75EL7hxs61wpLcAHaSnzawqoFSte5SACkJ4-sZGS9SeJnNUiP1rSc-V1Q)

The CIDs can be used to understand how the different algorithms adapt to interruption, via a graphical criterion for **path-specific response incentives**. Black-box optimization tries to both obscure its policy and to disable its off-switch, whereas Q-learning and Virtual SARSA do neither. Empirical SARSA tries to disable the off-switch, but does not try to obscure its policy. 

We verify these results empirically in the relevant [AI safety gridworlds](https://arxiv.org/abs/1711.09883), as well as in one new environment where the agent has to behave well in simulation to be deployed in reality, where black-box optimizers exhibit “[treacherous turn](https://www.lesswrong.com/posts/B39GNTsN3HocW8KFo/superintelligence-11-the-treacherous-turn)”-like behavior. The results are a generalization of [Orseau and Armstrong](https://deepmind.com/research/publications/safely-interruptible-agents)’s interruptibility results for Q-learning and SARSA.

Zooming out, these results are a good example of causal analysis of ML algorithms. Different design choices translate into different causal assumptions, which in turn determine the incentives. In particular, the analysis highlights why the different incentives arise, thus deepening our understanding of how behavior is shaped.

Reward Tampering
================

Another AI safety problem that we have studied with CIDs is **reward tampering**. Reward tampering can take several different forms, including the agent:

*   rewriting the source code of its implemented reward function (“wireheading”),
*   influencing users that train a learned reward model (“feedback tampering”),
*   manipulating the inputs that the reward function uses to infer the state (“RF-input tampering / delusion box problems”).

For example, the problem of an agent influencing its reward function may be modeled with the following CID, where RFᵢ represent the agent’s reward function at different time steps, and the red links represent an undesirable instrumental control incentive.

![](https://lh3.googleusercontent.com/Z02mWoyTwd01n0y4zMjmXB11VfoAou5IV0hzkEENZ0miSM40B_iovEMKkKGRKRgOr1eoLbVC3yKaaM3pFhTvUq3CCyPQtjpHBb5Yf5PFaKetQMT7E7yluZHptGsaL6yxqLfZ-m8DsQ)

In [Reward Tampering Problems and Solutions](https://rdcu.be/ckWLC) (published in the well-respected philosophy journal Synthese) we model all these different problems with CIDs, as well as a range of  proposed solutions such as current-RF optimization, [uninfluenceable reward learning](https://arxiv.org/abs/2004.13654#:~:text=We%20show%20that%20this%20comes,for%20all%20relevant%20reward%20functions).), and [model-based utility functions](https://arxiv.org/abs/1111.3934). Interestingly, even though these solutions were initially developed independently of formal causal analysis, they all avoid undesirable incentives by cutting some causal links in a way that avoids instrumental control incentives. 

By representing these solutions in a causal framework, we can get a better sense of why they work, what assumptions they require, and how they relate to each other. For example, current-RF optimization and model-based utility functions both formulate a modified objective in terms of an observed random variable from a previous time step, whereas uninfluenceable reward learning (such as [CIRL](https://arxiv.org/abs/1606.03137)) uses a latent variable:

![](https://lh6.googleusercontent.com/bA28xRAozioCuhRfjdnkf8Ax1CY2gmRG9iWW5qrOBqcEmhUQiZoEtlsp0UsoBXW1h3Nxe7CG3AwU0US0O3KJNm6GHyIGurHlwKBdR_l2PO27bwa27WsyvQQ7gDiuXsa-A7TQ4xSwVA)

As a consequence, the former methods must deal with time-inconsistency and a lack of incentive to learn, while the latter requires inference of a latent variable. It will likely depend on the context whether one is preferable over the other, or if a combination is better than either alone. Regardless, having distilled the key ideas should put us in a better position to flexibly apply the insights in novel settings.

We refer to the [previous blog post](https://medium.com/@deepmindsafetyresearch/designing-agent-incentives-to-avoid-reward-tampering-4380c1bb6cd) for a longer summary of current-RF optimization. The paper itself has been significantly updated since previously shared preprints.

Multi-Agent CIDs
================

Many interesting incentive problems arise when multiple agents interact, each trying to optimize their own reward while they simultaneously influence each other's payoff. In [Equilibrium Refinements in Multi-Agent Influence Diagrams](https://arxiv.org/abs/2102.05008) (AAMAS-21), we begin to lay some foundations for understanding multi-agent situations with multi-agent CIDs (MACIDs). 

First, we relate MACIDs to [extensive-form games](https://en.wikipedia.org/wiki/Extensive-form_game) (EFGs), currently the most popular graphical representations of games. While EFGs sometimes offer more natural representations of games, they have some significant drawbacks compared to MACIDs. In particular, EFGs can be exponentially larger, don’t represent conditional independencies, and lack random variables to apply incentive analysis to.

As an example, consider a game where a store (Agent 1) decides (D^1^) whether to charge full (F) or half (H) price for a product depending on their current stock levels (X), and a customer (Agent 2) decides (D^2^) whether to buy it (B) or pass (P) depending on the price and how much they want it (Y). The store tries to maximize their profit U^1^, which is greater if the customer buys at a high price. If they are overstocked and the customer doesn’t buy, then they have to pay extra rent. The customer is always happy to buy at half price, and sometimes at full price (depending on how much they want the product).

The EFG representation of this game is quite large, and uses **information sets** (represented with dotted arcs) to represent the facts that the store doesn’t know how much the customer wants the gadget, and that the customer doesn’t know the store’s current stock levels:

![](https://lh4.googleusercontent.com/5cyKs1IRDfEi2g3h5sNy8Ub5lWHDEIkuNRoNMvLK-6UoE3NRV9ANjFlYx_jeGy7osAVlVWw3wFDIqhKKDFAp0nJIH6sSGADeBu9DU2aKPkCCYpJfcFzC8oSPeQViHQvRBTlbbrj1Iw)

In contrast, the MACID representation is significantly smaller and clearer. Rather than relying on information sets, the MACID uses information links (dotted edges) to represent the limited information available to each player:

![](https://lh4.googleusercontent.com/PdI9vtCz4YkcXYnbZAegu-7FQBQmmMZitFjFVvpTwIYcHGUpRd8cp6JjSZeCtEGK6uPHJTBtQi6MFF9RDb-EqGBedFK306bK3a9h4UB3Q26nVJhD5GLTaRnaUltqYeKdsolk8r2v6w)

Another aspect that is made more clear from the MACID, is that for any fixed customer decision, the store’s payoff is independent of how much the customer wanted the product (there’s no edge Y→U^1^). Similarly, for any fixed product price, the customer’s payoff is independent of the store’s stock levels (no edge X→U^2^). In the EFG, these independencies could only be inferred by looking carefully at the payoffs.

One benefit of MACIDs explicitly representing these conditional independencies is that more parts of the game can be identified as independently solvable. For example, in the MACID, the following independently solvable component can be identified. We call such components **MACID subgames**:

![](https://lh3.googleusercontent.com/Ishr6jmJThhTAVL40TF0ti-Sp547wNgr30pT14FvnHgRX3wAkFnzjZNy808KD73cHg152Jq9FXsg6UJMBYupCNja_TJsgD0rPlz7d77PAvTLlmTOf2tpuZLmqjRweW8729HK0JM4Pw)

Solving this subgame for any value of D^1^ reveals that the customer always buys when they really want the product, regardless of whether there is a discount. This knowledge makes it simpler to next compute the optimal strategy for the store. In contrast, in the EFG the information sets prevent any proper subgames from being identified. Therefore, solving games using a MACID representation is often faster than using an EFG representation.

Finally, we relate various forms of equilibrium concepts between MACIDs and EFGs. The most famous type of equilibrium is the **Nash equilibrium**, which occurs when no player can unilaterally improve their payoff. An important refinement of the Nash equilibrium is the [**subgame perfect equilibrium**](https://en.wikipedia.org/wiki/Subgame_perfect_equilibrium)**,** which rules out non-credible threats by requiring that a Nash equilibrium is played in every subgame. An example of a non-credible threat in the store-customer game would be the customer “threatening” the store to only buy at a discount. The threat is **non-credible**, since the best move for the customer is to buy the product even at full price, if he really wants it. Interestingly, only the MACID version of subgame perfectness is able rule such threats out, because only in the MACID is the customer’s choice recognized as a proper subgame. 

Ultimately, we aim to use MACIDs to analyze incentives in multi-agent settings. With the above observations, we have put ourselves in position to develop a theory of multi-agent incentives that is properly connected to the broader game theory literature.

Software
========

To help us with our research on CIDs and incentives, we’ve developed a Python library called  [PyCID](https://github.com/causalincentives/pycid), which offers:

*   A convenient syntax for defining CIDs and MACIDs,
*   Methods for computing optimal policies, Nash equilibria, d-separation, interventions, probability queries, incentive concepts, graphical criteria, and more,
*   Random generation of (MA)CIDs, and pre-defined examples.

No setup is necessary, as the [tutorial notebooks](https://colab.research.google.com/github/causalincentives/pycid/blob/master/notebooks/CID_Basics_Tutorial.ipynb) can be run and extended directly in the browser, thanks to Colab.

We’ve also made available a [Latex package](https://github.com/causalincentives/cid-latex) for drawing CIDs, and have launched [causalincentives.com](https://causalincentives.com/) as a place to collect links to the various papers and software that we’re producing.

Looking ahead
=============

Ultimately, we hope to contribute to a more careful understanding of how design, training, and interaction shapes an agent’s behavior. We hope that a precise and broadly applicable language based on CIDs will enable clearer reasoning and communication on these issues, and facilitate a cumulative understanding of how to think about and design powerful AI systems.

From this perspective, we find it encouraging that several other research groups have adopted CIDs to:

*   Analyze the incentives of [unambitious agents](https://arxiv.org/pdf/1905.12186.pdf) to break out of their box,
*   Explain [uninfluenceable reward learning](https://arxiv.org/abs/2004.13654), and clarifying its desirable properties (see also Section 3.3 in the [reward tampering paper](https://rdcu.be/ckWLC)),
*   Develop a novel framework to make agents [indifferent](https://link.springer.com/chapter/10.1007%2F978-3-030-52152-3_21) to human interventions.

We’re currently to pursuing several directions of further research:

*   Extending the general incentive concepts to multiple decisions and multiple agents.
*   Applying them to fairness and other AGI safety settings.
*   Analysing limitations that have been identified with work so far. Firstly, considering the issues raised by [Armstrong and Gorman. And secondly,](https://www.alignmentforum.org/posts/67a8C6KsKn2NyW2Ry/counterfactual-control-incentives) looking at broader concepts than instrumental control incentives, as influence can also be incentivized as a side-effect of an objective.
*   Probing further at their philosophical foundations, and establishing a clearer semantics for decision and utility nodes.

Hopefully we’ll have more news to share soon.

Thanks for reading, and please comment and/or get in touch in other ways if you have any thoughts!

*We would like to thank Neel Nanda, Zac Kenton, Sebastian Farquhar, Carolyn Ashurst, and Ramana Kumar for helpful comments on drafts of this post.*

List of recent papers:
======================

*   [Agent Incentives: A Causal Perspective](https://arxiv.org/abs/2102.01685)
*   [How RL Agents Behave When Their Actions Are Modified](https://arxiv.org/abs/2102.07716)
*   [Reward tampering problems and solutions in reinforcement learning: A causal influence diagram perspective](https://rdcu.be/ckWLC)
*   [Equilibrium Refinements for Multi-Agent Influence Diagrams: Theory and Practice](https://arxiv.org/abs/2102.05008)

See also [causalincentives.com](https://causalincentives.com/)