# Decision Theories: A Semi-Formal Analysis, Part I

Or: The Problem with Naive Decision Theory  

---------------------------------------------

**Previously:** [Decision Theories: A Less Wrong Primer](/lw/aq9/decision_theories_a_less_wrong_primer/)

**Summary of Sequence:** _In_ _the context of a tournament for computer programs__, I give almost-explicit versions of causal, timeless, ambient, updateless, and several other decision theories. I explain the mathematical considerations that make decision theories tricky in general, and end with a bunch of links to the relevant recent research. This sequence is heavier on the math than [the primer](/lw/aq9/decision_theories_a_less_wrong_primer/) was, but is meant to be accessible to a fairly general audience. Understanding the basics of [game theory](http://en.wikipedia.org/wiki/Game_theory) (and [Nash equilibria](http://en.wikipedia.org/wiki/Nash_equilibrium)) will be essential. Knowing about things like [Gödel numbering](http://en.wikipedia.org/wiki/G%C3%B6del_numbering), [quining](http://en.wikipedia.org/wiki/Quine_%28computing%29) and [Löb's Theorem](/lw/t6/the_cartoon_guide_to_l%C3%B6bs_theorem/) will help, but won't be required.  
_

**Summary of Post:** _I introduce a context in which we can avoid most of the usual tricky philosophical problems and formalize the decision theories of interest. Then I show the chief issue with what might be called "naive decision theory": the problem of spurious counterfactual reasoning. In future posts, we'll see how other decision theories get around that problem._

In my [Decision Theory Primer](/lw/aq9/decision_theories_a_less_wrong_primer/), I gave an intuitive explanation of decision theories; now I'd like to give a [technical explanation](http://yudkowsky.net/rational/technical). The main difficulty is that in the real world, there are all sorts of complications that are extraneous to the core of decision theory. (I'll mention more of these in the last post, but an obvious one is that we can't be sure that our perception and memory match reality.)

In order to avoid such difficulties, I'll need to demonstrate decision theory in a completely artificial setting: a tournament among computer programs.

![](http://images.lesswrong.com/t3_axl_0.png?v=db05d2a4c02b1aa6015785c9315cdbdb)

You're a computer programmer entering a tournament for spectacular stakes. But you won't be competing in person: instead, you'll be submitting code for a program to represent you, and that program will be competing one-on-one with other programs in a series of games.

You don't know what the specific games are, but the contest has specified some ground rules:

*   In each game, your program and its opponent will have to choose separately between several options. (There are independent sources of randomness available to each program, so [mixed strategies](http://en.wikipedia.org/wiki/Strategy_%28game_theory%29) are legal.)
*   The games are pure strategic conflicts: the expected payouts to _each_ programmer depend on the outputs of _both_ programs, and can be calculated simply if you know those outputs. (In particular, you can represent each game as a [payoff matrix](http://en.wikipedia.org/wiki/Normal-form_game) in terms of the programs' outputs.) For example, your program might play the [Prisoner's Dilemma](http://wiki.lesswrong.com/wiki/Prisoner%27s_dilemma) against another program.
*   Both programs have access to the source code of _each other_ and of the game they're playing.
*   The programs don't get to carry any memories from round to round, or modify their source code at any stage. (This makes the analysis _much_ simpler, and makes it even more impressive if we find unexploitable programs which are capable of mutual cooperation.)
*   While many of the programs were written by other programmers trying to win prizes for themselves, there are also some special algorithms included to test your reactions; for example, there could be programs that always cooperate in the Prisoner's Dilemma, or an instance of [Newcomb's Predictor](http://wiki.lesswrong.com/wiki/Newcomb%27s_problem).
*   The tournament may also include some exact copies of your own program, but _you_ won't get any of the prizes won by these extra copies, only the prizes won by your actual entry. (There's no way for your program to distinguish whether it's the original or a copy.)
*   There are more than enough prizes to go around, so you don't have to make anyone else lose, you just want your program to win as much as it can.
*   Also, there will be enough games played that most of the variance should wash out, so you should aim for the highest expected value per round rather than worry about the [concave utility](http://en.wikipedia.org/wiki/Risk_averse#Utility_of_money) of more prizes.

So, what kind of program should you write?

In the next few posts, we'll examine several ideas, problems and decision theories, increasing our sophistication as we go. We'll use **X** to denote your program, and _x~1~_, . . . , _x~n~_ to denote its possible outputs; likewise, your opponent in the current round is **Y** with possible outputs _y~1~_, . . . , _y~m~_. We'll let **U**(_x~i~_,_y~j~_) denote the resulting payout to you if **X** outputs _x~i~_ and **Y** outputs _y~j~_.

### Idea 1: Play defense with a Nash equilibrium

In our example, we know what utility function the opponent should have: its own expected payout.[^0^](#utilities) Any such game has at least one [Nash equilibrium](http://en.wikipedia.org/wiki/Nash_equilibrium), a pair of strategies (which may be [mixed](http://en.wikipedia.org/wiki/Mixed_strategy#Mixed_strategy)) such that if **X** and **Y** both adopted them, then neither would be better off unilaterally switching strategies. In that sense, at least, if **X** plays a Nash equilibrium, it can be sure of not being exploited by **Y**. (In particular, **X** will never end up tricked into cooperating in the Prisoner's Dilemma while **Y** defects.)

Of course, there may be more than one Nash equilibrium in a game, and these may be of unequal value if the game is non-zero-sum. ([Coordination problems](http://en.wikipedia.org/wiki/Coordination_game) are tricky in general.) So this is underspecified; still, choosing an arbitrary Nash equilibrium is a decent backup strategy. But we can often do better:

### Idea 2: Inference

The most basic intuition a human being has in this situation is to start trying to deduce things about **Y**'s output from its source code, or even deduce things directly about **U**. This idea is best illustrated by playing Rock, Paper, Scissors against [a player who always throws Rock](http://www.youtube.com/watch?v=NMxzU6hxrNA): if you figure this out, then you should of course play Paper rather than the Nash equilibrium of 1/3 Rock, 1/3 Paper, 1/3 Scissors. (And in a coordination game, you'd prefer to settle on the _same_ Nash equilibrium that **Y** outputs.)

Automating inference is [an exceedingly difficult problem in general](http://en.wikipedia.org/wiki/Automated_reasoning), though researchers have made substantial progress. All the decision theories we'll talk about will include some sort of "inference module", which can be applied to the source code of **Y** to deduce its output, applied to the code of the full round (including **X**, **Y**, and the payoff matrix) to deduce the value of **U**, etc.

### Problem: You can't deduce everything

[Gödel's First Incompleteness Theorem](http://en.wikipedia.org/wiki/G%C3%B6del%27s_incompleteness_theorems) and the [Halting Problem](http://en.wikipedia.org/wiki/Halting_problem) both imply that it's impossible to write a program that correctly deduces _in general_[^1^](#ingeneral) the output of arbitrary other programs. So we have to be prepared for our inference module to fail sometimes.

A well-written inference module will either return a correct answer for a question or return "Unknown"; a sloppily-written module can get stuck in an infinite process, and a badly-written one will return an incorrect answer sometimes. It should be clear that we'll want our inference module to be of the first sort.

It seems we have enough already to define our first candidate decision theory:

### Naive Decision Theory

Let's first consider the approach that seems most obvious. Since we know the source code of the entire round (including **X** and **Y**), we could implement the following program:

*   For each _x~i~_, assume the output of **X** is _x~i~_, and try to deduce the expected value of **U**. (That is, try and deduce statements of the form "if (output **X**)=_x~i~_ then **U**=_u~i~_" for some _u~i~_).
*   If this succeeds for each _x~i~_, output the _x~i~_ for which _u~i~_ is the largest.
*   If this does not succeed for some _x~i~_, output a Nash equilibrium strategy.

This "naive decision theory" certainly qualifies for our tournament; it may be a bit trickier to write an inference module that does an open-ended search for the value of **U**, but it's not impossible (since human mathematicians solve open-ended deduction problems all the time). And it looks like the worst-case scenario is a Nash equilibrium, not total exploitation. What could possibly go wrong?

### Problem: Beware self-fulfilling prophecies!

There's a reason that we don't normally ask an automated theorem prover to consider questions about its _own_ mathematical structure: if we ask the question in a certain way, [any choice becomes a self-fulfilling prophecy](/lw/t8/you_provably_cant_trust_yourself/).

If **X** deduces its own output by a valid process, then it's created a self-fulfilling prophecy for its output, and the problem with _that_ is that a bad self-fulfilling prophecy is just as consistent as a good one. If we want to use statements like "if (output **X**)=_x~i~_ then **U**=_u~i~_" to make our final choice, then we have to beware the other half of logical implication, that "not P" implies "if P then Q". This allows for what we might call _spurious counterfactuals_, which can throw off the actual decision in a perfectly self-consistent way.

Consider, for example, the one-player game where **X** gets $1 for outputting _a_, or $10 for outputting _b_. We want **X** to do the following:

*   Prove "if (output **X**)=_a_ then **U**=1"
*   Prove "if (output **X**)=_b_ then **U**=10"
*   Output _b_.

But it's just as consistent for **X** to do the following:

*   Prove "(output **X**)=_a_"
*   Prove "if (output **X**)=_a_ then **U**=1"
*   Prove "if (output **X**)=_b_ then **U**=0"
*   Output _a_.

How could that possibly work? Since (output **X**)=_a_, the third line is a true logical statement! It's like the fact that [you can prove anything if you assume a falsehood](http://xkcd.com/704/) (though rather than unconditionally accepting a false premise, **X** is using a false premise as the antecedent of a [material conditional](http://en.wikipedia.org/wiki/Material_conditional)). In this example, the very order in which **X** looks for proofs (which is part of the definition of **X**) affects which counterfactuals **X** can and cannot prove. (One important thing to note is that **X** _cannot_ prove a spurious counterfactual about the action that it _does_ output, only about the ones that it doesn't!)

I don't need to tell you that the second chain of proofs is _not_ what we want **X** to do. Worse, if this is a real bug, then it could also be an _exploitable vulnerability_: if your source code for **X** were released in advance of the tournament, then other programmers might write programs that cause **X** to generate spurious counterfactuals for all but the moves that are most favorable to **Y**.

### Can NDT be salvaged?  

Let's consider some quick fixes before we give up on Naive Decision Theory.

Can we simply prohibit **X** from ever deducing "(output **X**)=_x~i~_" as a step? This doesn't work because of the possibility of indirect self-reference; **X** could end up deducing some seemingly innocuous statements which happen to correspond to its own [Gödel numbering](http://en.wikipedia.org/wiki/G%C3%B6del_numbering), and the spurious counterfactuals would follow from those- without **X** ever having noticed that it had done anything of the sort. And it's provably impossible for **X** to recognize every possible Gödel numbering for its own inference module!

Next, it might seem like an inference module should stumble on the "genuine" counterfactuals before running into spurious ones, since the "genuine" ones seem necessarily simpler. However, it turns out ([as proved by cousin_it](/r/discussion/lw/b5t/a_model_of_udt_with_a_malicious_proof_searcher/)) that one can write a valid but malicious inference module which returns and acts on a spurious proof, and ([as proved by gRR](/lw/b5t/an_example_of_selffulfilling_spurious_proofs_in/67bx)) that a game with malicious code can similarly dupe a NDT agent with a good inference module!

Lastly, it seems safer to deduce counterfactuals "if (output **X**)=_x~i~_ then (output **Y**)=_y~j~_" and apply the **U**(_x~i~_,_y~j~_) afterwards. And indeed, I can't see how to make **Y** exploit **X** in a straight-up Prisoner's Dilemma if that algorithm is used. There are still two problems, though. First, this algorithm now depends on the values **U**(_x~i~_,_y~j~_) being given to it by authority- it can't safely deduce them from the source code for the game. And secondly, it could two-box on Newcomb's Problem and defect against itself in the Prisoner's Dilemma if it finds spurious counterfactuals there.

Thus it seems we'll need to do something substantially different.

### Well, now what?  

There are several ways we could write a decision theory to do inference without risking spurious counterfactuals, and indeed the decision theories we discuss on Less Wrong correspond to different valid approaches. The differences in their decisions come not from better-written inference modules, but from more effective strategies for using their inference module. In the posts to come, I'll show you how they work in detail.

**Next:** [Part II: Causal Decision Theory and Substitution](/lw/az6/decision_theories_a_semiformal_analysis_part_ii/)

### Notes:  

**0.** Things get wacky if we don't know the utility function of the opponent; fortunately, even the special cases like Newcomb's predictor can be expressed as expected utility maximizers for some payoff matrix (in this case, one where the predictor gets rewarded when it matches your decision exactly).

**1.** That "in general" is important: it's quite possible to write programs that deduce the outputs of plenty of other programs. It just so happens that there's always some program that your inference module will fail on. The [classic way to generate a failure case](http://en.wikipedia.org/wiki/Cantor%27s_diagonal_argument) is to run the inference module on a modified version of itself, such that returning a correct answer would induce a contradiction. This isn't just a hypothetical disability: if **X** is trying to deduce the output of **Y** in this round, and **Y** is trying to deduce the output of **X** in this round, then we might have exactly this problem!