Title: CONSEQUENTIALIST CONDITIONAL COOPERATION IN SOCIAL DILEMMAS WITH IMPERFECT INFORMATION

Abstract: Social dilemmas, where mutual cooperation can lead to high payoffs but participants face incentives to cheat, are ubiquitous in multi-agent interaction. We wish to construct agents that cooperate with pure cooperators, avoid exploitation by pure defectors, and incentivize cooperation from the rest. However, often the actions taken by a partner are (partially) unobserved or the consequences of individual actions are hard to predict. We show that in a large class of games good strategies can be constructed by conditioning one's behavior solely on outcomes (ie. one's past rewards). We call this consequentialist conditional cooperation. We show how to construct such strategies using deep reinforcement learning techniques and demonstrate, both analytically and experimentally, that they are effective in social dilemmas beyond simple matrix games. We also show the limitations of relying purely on consequences and discuss the need for understanding both the consequences of and the intentions behind an action. * Both authors contributed equally to this paper.

1. INTRODUCTION:

Deep reinforcement learning (RL) is concerned with constructing agents that start as blank slates and can learn to behave in optimal ways in complex environments. 1 A recent stream of research has taken a particular interest in social dilemmas, situations where individuals have incentives to act in ways that undermine socially optimal outcomes (Leibo et al., 2017; Perolat et al., 2017; Lerer & Peysakhovich, 2017; Kleiman-Weiner et al., 2016) . In this paper we consider RL-based strategies for social dilemmas in which information about a partner's actions or the underlying environment is only partially observed.

The simplest social dilemma is the Prisoner's Dilemma (PD) in which two players choose between one of two actions: cooperate or defect. Mutual cooperation yields the highest payoffs, but no matter what one's partner is doing, one can get a higher reward by defecting. A well studied strategy for maintaining cooperation when the PD is repeated is tit-for-tat (TFT, Axelrod (2006) ). TFT behaves by copying the prior behavior of their partner, rewarding cooperation today with cooperation tomorrow. Thus, if an agent commits to TFT it makes cooperation the best strategy for the agent's partner. TFT has proven to be a heavily studied strategy because it has intuitive appeal: 1) it is easily explainable, 2) it begins cooperating, 3) it rewards a cooperative partner, 4) it avoids being exploited, 5) it is forgiving.

In Markov games cooperation and defection are not single actions, but rather temporally extended policies. Recent work has considered expanding TFT to more complex Markov games either as a heuristic, by learning cooperative and selfish policies and switching between them as needed (Lerer & Peysakhovich, 2017) , or as an outcome of an end-to-end procedure (Foerster et al., 2017c ). TFT is an example of a conditionally cooperative strategy -that is, it cooperates when a certain condition is fulfilled (ie. the partner's last period action was cooperative). TFT, however, has a weakness -it requires perfect observability of a partner's behavior and perfect understanding of each action's future consequences.

Our main contribution is to use RL methods to construct conditionally cooperative strategies for games with imperfect information. When information is imperfect, the agent must use what they can observe to try to estimate whether a partner is acting cooperatively (or not) and determine how to respond. We show that when the game is ergodic, observed rewards can be used as a summary statistic -if the current total (or time averaged) reward is above a time-dependent threshold (where the threshold values are computed using RL and a form of self play) the agent cooperates, otherwise the agent does not2 . We call this consequentialist conditional cooperation (CCC). We show analytically that this strategy cooperates with cooperators, avoids exploitation, and guarantees a good payoff to the CCC agent in the long run.

We study CCC agents in a partially observed Markov game which we call Fishery. In Fishery two agents live on different sides of a lake in which fish appear. The game has partial information because agents cannot observe what happens across the lake. Fish spawn randomly, starting young and swim to the other side and become mature. Agents can catch fish on their side of the lake. Catching any fish yields payoff but mature fish are worth more. Therefore, cooperative strategies are those which leave young fish for one's partner. However, there is always a temptation to defect and catch both young and mature fish. We show that CCC agents cooperate with cooperators, avoid exploitation, and get high payoffs when matched with themselves.

Second, we show that CCC is an efficient strategy for more complex games where implementing conditional cooperation by fully modeling the effect of an action on future rewards (eg. amTFT (Lerer & Peysakhovich, 2017) ) is computationally demanding. We compare the performance of CCC to amTFT in the Pong Player's Dilemma (PPD). This game is a modification of standard Atari pong such that when an agent scores they gain a reward of 1 but the partner receives a reward of -2. Cooperative payoffs are achieved when both agents try hard not to score but selfish agents are again tempted to defect and try to score points even though this decreases total social reward. We see that CCC is a successful, robust, and simple strategy in this game.

However, this does not mean CCC completely dominates forward looking strategies like amTFT. We consider a version of the Pong Players' Dilemma where when a player scores, instead of their partner losing 2 points deterministically they lose 2/p points with probability p. Here the expected rewards of non-cooperation are the same as in the PPD and so expected-future-reward based methods (eg. amTFT) will act identically. However, when p is low it may take a long time for consequentialist agents to detect a defector. Empirically we see that in short risky PPD games CCC agents can be exploited by defectors but that amTFT agents cannot. We close by discussing limitations and progress towards agents that can effectively use both intention and outcome information effectively in navigating the world.

1.1. RELATED WORK:

Game theorists have studied the emergence of cooperation in bilateral relationships under both perfect and imperfect observation (Green & Porter, 1984; Fudenberg & Maskin, 1986; Fudenberg et al., 1994; Axelrod, 2006; Kamada & Kominers, 2010; Abreu et al., 1990) . However, this research program almost exclusively studies repeated matrix games and focuses mostly on proving the existence of equilibria which maintain cooperation rather than on constructing simple strategies that do well across many complex situations. Other work has constructed algorithms for explicitly computing these folk theorem strategies (Littman & Stone, 2005; de Cote & Littman, 2008) but it focuses on perfectly observed games played iteratively rather than imperfectly observed games played once at test time.

In addition, the question of designing a good agent for social dilemmas can sometimes be quite different from questions about computing equilibrium strategies. For example, in the repeated PD, tit-for-tat is held up as a good strategy for an agent to commit to (Axelrod, 2006) . However, both players using tit-for-tat is not an equilibrium (since the best response to tit-for-tat is always cooperate).

A related literature on multi-agent learning focuses on studying how agent properties (learning rules, game parameters, etc...) affect the dynamics of behavior (Fudenberg & Levine, 1998; Sandholm & Crites, 1996; Shoham et al., 2007; Nowak, 2006; Conitzer & Sandholm, 2007; Leibo et al., 2017; Perolat et al., 2017) . A related set of work looks at learning can be shaped to converge to better outcomes (Babes et al., 2008) . These works study questions related to ours, in particular, designing agents which 'teach' their learning partners (Foerster et al., 2017c) . However they deals with a different setup (more than a single game played at test time). In addition, these techniques may require detailed knowledge of the game structure (to eg. construct reward shaping as in Babes et al. (2008) ) or a partner's updating rule (as in Foerster et al. (2017c) ). An interesting direction for future work is to blend the learning approaches with the trigger strategy approach we study here.

2. CONSEQUENTIALIST CONDITIONALLY COOPERATIVE STRATEGIES:

We work with partially observed Markov games (POMG), which are multi-agent generalizations of partially observed Markov decision problems:

Definition 1 A (two-player, finite) partially observed Markov game (POMG) consists of: a finite set of states S; a set of actions for each player A 1 , A 2 ; a transition function τ : S × A 1 × A 2 → ∆(S); an observation function that tells us what each player observes i :

S × A 1 × A 2 → ∆(Ω i )

where Ω i is a set of possible observations; and a reward function that maps states and actions to each player's reward R i :

S × A 1 × A 2 → ∆(R).

We assume that per turn rewards are bounded above and below. Agents choose a policy

π i : Ω i → ∆(A i )

which takes as input the observation and outputs a probability distribution on actions -this is similar to the notion of 'belief free strategies' in the study of repeated games (Ely et al., 2005) . Given a pair of policies, one for each agent, and a starting state, we define each player's value function as the average (undiscounted) reward if players start in state s and follow policies π 1 , π 2 , i.e.

V i (s, π 1 , π 2 ) = lim t→∞ E 1 t t k=0 r i k

Note that while we will prove results in the undiscounted setting, for δ sufficiently close to 1, the optimal policy is the same in the undiscounted and discounted setting, so standard discounted policy gradient techniques can still be used (Schwartz, 1993) .

We restrict ourselves to reward-ergodic POMGs:

Assumption 1 (Reward Ergodicity in POMG) Say a POMG is reward-ergodic if for any pair of policies π 1 , π 2 the long-run reward has a well defined rate independent of the starting state almost surely. Formally, this means for any starting state s, and either player i, there exists a rate ρ i π1π2 such that lim

t→∞ V i (s, π 1 , π 2 ) a.s. --→ ρ i π1π2

Any pair of policies applied to a POMG creates a Markov chain of underlying states. If for any pair of policies that Markov chain is 'unichain', that it, it has a single positive recurrent chain (Puterman, 2014) then the POMG will be reward ergodic (Meyn & Tweedie, 2012) [Thm. 17.0.1]. The unichain assumption is often used in applications of RL methods in the undiscounted RL problem (Schwartz, 1993) .

Definition 2 Cooperative Policies are those that maximize the joint rate of reward:

(π C 1 , π C 2 ) ∈ argmax Π1,Π2 (V 1 (π 1 , π 2 ) + V 2 (π 1 , π 2 )).

Let Π C be the set of such tuples.

We look at the class of POMGs which have two restrictions:

Assumption 2 (Social Dilemma) For any player i and any

(π C 1 , π C 2 ) ∈ Π C we have that π C i ∈ argmax Πi (V i (s, π i , π C j )). Assumption 3 (Exchangeability of Cooperative Strategies) For any (π 1 , π 2 ) ∈ Π C and (π 1 , π 2 ) ∈ Π C we have that (π i , π j ) ∈ Π C .

Note that if this exchangeability assumption is not satisfied we have both a cooperation problem (should agents defect?) and also a coordination problem (if we choose to cooperate, how do we choose among the multiple potential ways to cooperate?) We point the reader to Kleiman-Weiner et al. (2016) for further discussion of this issue. Solving the coordination problem (eg. by introducing communication) is beyond the scope of this paper though it is an important avenue for future work.

To construct a CCC agent we need access to a policy pair (π D 1 , π D 2 ) that forms a Nash equilibrium of the game. We assume that these strategies generalize two properties of defection in the Prisoner's Dilemma: 1) the have lower rates of payoff than the socially optimal strategies in the long run for both players and 2) if we take a mixed policy π C+D which behaves according to π C at some periods and π D at others then

V i (π C+D i , π C j ) ≥ V i (π C i , π C j )

. This last condition is essentially saying that π D is a selfish policy that, even if used some of the time, still increases the payoffs of the player choosing it (while decreasing total social efficiency). We explain a weaker condition in the appendix.

To behave according to CCC our agent maintains a persistent state at each time period C i t which is the current time-averaged reward it has received.

Given a threshold T , the agent plays according to π C if C i t > T and π D otherwise. Let ρ CC be the rate associated with both players behaving according to π C and let ρ CD be the rate associated with our agent playing according to π C and the other agent behaving according to π D . Let T = (1 -α)ρ CC + αρ CD , where 0 < α < 1 is a slack parameter that specifies the agent's leniency. We present the following result:

Theorem 1 Consider a strategy where agent 1 acts according to π C 1 if C i t > T and π D 1 otherwise. This gives two guarantees in the long run:

1. Cooperation Wins: If agent 2 acts according to π C 2 then for both agents lim t→∞

1 t r i t = ρ i CC .

2. Defecting Doesn't Pay: If agent 2 acts according to a policy that gives agent 1 a payoff of less than T in the long run then lim t→∞

1 t r 2 t ≤ ρ 2 DD < ρ 2 CC .

Thus, a simple threshold based strategy for player 1 makes cooperation a better strategy than defection in the long-run for player 2 in any ergodic game. CCC satisfies the desiderata we set out at the beginning: it is simple to understand, cooperates with cooperators, does not get exploited by pure defectors, incentivizes rational partners to cooperate, and, importantly, gives a way to return to cooperation if it has failed in the past. 3The CCC strategy also provides a payoff guarantee against rational learning agents: if one's partner is a learning agent who best responds in the long-run then, since π D forms an equilibrium, a CCC agent can always guarantee themselves a payoff of at least ρ DD in the long-run. Unfortunately, CCC does not give any adversarial guarantees in general. Extending conditionally cooperative strategies to be robust to not only selfish agents trying to cheat but adversarial agents trying to actively destroy value is an interesting direction for future work.

However, we note that the simple construction above only gives long-run guarantees. We now focus on generalizing this strategy to work well in finite time as well as how to use RL methods to compute its components. Finally, we note that this strategy can be extended to some non-payoff ergodic games. For example, if there is a persistent but unknown state which affects both rewards equally (say, multiplies them by some factor) then the amount of inequality (eg. the ratio or difference of rewards or more complex function such as those used by Fehr & Schmidt (1999) ) can be used as a summary statistic.

3. RL IMPLEMENTATION OF CCC:

To construct the πC and πD policies used by CCC, we follow the training procedure of Lerer & Peysakhovich (2017) . We perform self-play with modified reward schedules to compute the two policies:

1. Selfish -here both players get rewards equal to their own reward. This is the standard self-play paradigm used in multi-agent zero-sum settings. We refer to the learned policies here as πD 2. Prosocial -here both players get rewards at each time step not only for their own reward, but also for the reward their partner receives. We refer to the learned polices as πC

Our agents are set up as standard deep RL agents which take game state (e.g. pixels) as input and pass them through a convolutional neural network to compute a distribution over actions. The architectures of the agents as well as the training procedures are standard and we put them in the appendix.

We note that learning policies via RL in POMDPs has unique challenges (Jaakkola et al., 1995) . The correct choice of learning algorithm will depend on the situation; policy gradient is preferred for POMDPs because optimal policies may be nondeterministic, and a common approach is to perform a variant of policy gradient with a function approximator augmented with an RNN 'memory' that keeps track of past states (Heess et al., 2015) . In our Fishery game, the policy (but not the value) is independent of the unobserved state, so RNN augmentation was unnecessary; however, since our policy was stateless we had to avoid value-based methods (e.g. actor-critic) because the aliasing of values prevents these methods from finding good policies.

Having computed the policies, we need to compute thresholds for conditional cooperation. There are 3 important sources of finite time variance that a threshold needs to account for: first, a partner's π C may not be the same as our agent's due to function approximation. Second, initial states of the game may matter in finite time. Third, there may be inherent stochasticity in the rewards.

We compute the per-turn threshold T i t as follows: first we take our learned πC and πD and perform k rollouts of the full game assuming cooperate (we call the resulting per period cumulative payoffs to our agent Rtk CC where k corresponds to the iteration and t to the time). We also compute batches of rollouts of a paired cooperator and defector Rtk CD . We let Rt CC be the bottom q th percentile of these sample paths and we define our time dependent threshold in terms of cumulative reward as

T t = (1 -α) Rt CC + α 1 k k R tk CD .

If the CCC agent's current cumulative reward is above T t they behave according to πC , otherwise they use πD .

This process gives us slack to account for the three sources of error described above. Tuning the parameters q, α allows us to trade off between the importance of false positives (detecting defection when one hasn't occurred) and false negatives (missing a defecting opponent). The algorithm is formalized into pseudocode below. We also show an example of threshold computation as well as associated precision/recall with actual opponents in the example below.

4. EXPERIMENTS:

4.1 EXPERIMENT: FISHERY

Our first example is a common pool resource game which we call Fishery. In Fishery two agents live on different sides of a lake in which fish appear. Each side of the lake is instantiated as a 5 × 5 grid and agents can walk in all cardinal directions. Fish spawn randomly, starting young and swim to the other side and become mature. Agents can catch fish on their side of the lake by walking over them.

Catching young fish yields 1 reward while mature fish yield a reward of 3.

In Fishery cooperative strategies are those which leave young fish for one's partner. However, there is always a temptation to defect and catch both young and mature fish. Fishery is an imperfect

Algorithm 1 CCC as Agent 1 Input: πC , πD , α, q, k for b in range(0, k) do s CC [b] ← N ewGame() s CD [b] ← N ewGame() while Game do for b in range(0, k) do s CC [b], R CC [b] ← Step(s CC [b], πC 1 , πC 2 )

Step returns next state and total reward

s CD [b], R CD [b] ← Step(s CD [b], πC 1 , πD 2 ) RCC ← quantile(R CC , q) RCD ← mean(R CD ) T ← (1 -α) RCC + α RCD if CurrentT otalReward < T then Choose a = πD 1 (o) else Choose a = πC 1 (o)

observation game because agents cannot see the behavior of their partners across the lake. Figure 1 shows an example of a threshold in our Fishery game with q = .1 and α = .05, we see that CC trajectories remain mostly above the threshold (meaning low false positives) and CD trajectories mostly lie below even after a short time period (meaning low false negatives). The game as well as the experimental results are shown in Figure 1 .

We train 50 pairs of agents under the selfish and prosocial reward schemes using a policy gradient method with simple CNN policy approximators (see Appendix for details). We see that selfish training leads to agents that defect and choose greedy, suboptimal strategies whereas prosocial training finds good policies. We then compute thresholds as described above and implement CCC agents.

First, we construct 22 matchups between CCC and pure cooperator and pure defecting partners. We see that CCC agents quickly avoid full exploitation by defectors while maintaining cooperation with cooperators (Figure 1 panel D). To see whether CCC satisfies the desiderata we laid out in the introduction we consider a tournament where we draw random policies from our trained pool of 50 and have them play a 1000 time step Fishery game (we use fixed lengths to normalize the payoffs across games).

To compare strategies in the tournament and see how well they achieve our desiderata, we adopt the metrics from Lerer & Peysakhovich (2017) . Let S i (X, Y ) be the expected reward to player i when a policy of type π X 1 are matched with type π Y 2 . SelfMatch(X) = S 1 (X, X) measures whether a strategy achieves good outcomes with itself; Safety(X) = S 1 (X, D) -S 1 (D, D) measures how a strategy is safe from exploitation by a defector; and IncentC(X) = S 2 (X, C) -S 2 (X, D) measures whether a strategy incentivizes cooperation from its partner. A full matrix of how well each policy does against each other policy is provided in the Appendix.

4.2. EXPERIMENT: PONG PLAYERS' DILEMMA:

Since any perfectly observed game is trivially a partially observed game CCC can also be used in games of perfect information. We consider the Pong Players' Dilemma (PPD) which has been used in prior work to evaluate perfect information forward-looking conditionally cooperative strategies Lerer & Peysakhovich (2017) .The PPD alters the reward structure of Atari Pong so that whenever an agent scores a point they receive a reward of 1 and the other player receives -2 (Tampuu et al., 2017) . In the PPD the only (jointly) winning move is not to play. However, selfish agents are again tempted to defect and try to score points even though this decreases total social reward.

We compare CCC to the forward-looking approximate Markov Tit-for-Tat (amTFT Lerer & Peysakhovich (2017) ). amTFT conditions its cooperation on a counterfactual future reward -the amTFT agent sees the actions taken by their partner and, if the action is not the one suggested by π C uses the game's Q function (which is learned or simulated via rollouts) to estimate the one shot-gain to the partner from taking this action. The agent keeps track of the total 'debit' a partner has accrued Figure 1 : In Fishery two agents live on opposite sides of a lake and cannot observe each other's actions directly. Each time step fish can spawn on their side of the lake and begin to swim to the other side. Fish start young and become mature if they are allowed to enter the middle of the lake. Training using selfish self-play leads to agents that try to eat all the fish and thus cannot reach optimal payoffs, while social training finds cooperative strategies. Panel C shows example trajectories of payoffs as well as the CCC per-round threshold. Panel D shows trajectories of behavior by CCC agents when faced with C or D partners. Panel E shows that CCC does well with itself, is not easily exploited, and incentivizes cooperation from its partners.

over time and if that crosses a threshold the amTFT agent then behaves according to π D for enough periods such that the partner's debit is wiped out. We call this type of strategy intention-based because it computes, at the time of the action, the expected future consequences rather than waiting for those consequences to occur as CCC agents do.

To make the comparison fair we use the 18 pairs of agents trained in Lerer & Peysakhovich (2017) by the selfish and prosocial reward schemes using randomly determined game lengths using a standard A3C implementation (Mnih et al. (2016) ; see Lerer & Peysakhovich (2017) for complete details).

Selfish training leads to selfish agents that try hard to score every point while prosocial training leads to cooperative agents that hit the ball directly back and forth (Figure 2 ). We construct CCC agents as in the Fishery experiment above and see how CCC performs against π C , π D , and itself in fixed length PPD games. As with Fishery, we find that CCC cooperates with cooperators (and itself) but does not get exploited by defectors.

amTFT is more computationally expensive than CCC because it requires the use of a Q function (which can be hard to train) or rollouts (which are expensive to compute) we follow the procedure in In PPD, CCC achieves similar performance to the more expensive amTFT. In the finite length risky PPD, however, CCC loses both its ability to incentivize cooperation and to avoid exploitation. Lerer & Peysakhovich (2017) to construct amTFT agents for the PPD. However in a tournament we see that CCC agents, which are much simpler, perform just as well in the PPD.

Does this mean that CCC completely dominates amTFT in perfectly observed games? The answer is no. In particular, intention-based strategies can be effective on much shorter timescales than CCC.

To demonstrate this we further modify the reward structure of the PPD so that when a player scores, instead of their partner losing 2 points deterministically they lose 2/p points with probability p. Here the expected rewards of non-cooperation are the same as in the PPD and so amTFT acts similarly (though now we require large batches if using rollouts). However, we see that in intermediate length games (1000 time steps) and p = .1 CCC agents can be exploited by defectors. 4 A full table of how each strategy performs against each other strategy is available in the Appendix.

We also study CCC in another perfectly observed grid based social dilemma, Coins (Lerer & Peysakhovich, 2017; Foerster et al., 2017c) . The results mirror those of the PPD so we relegate them to the Appendix.

5. CONCLUSION, LIMITATIONS AND FUTURE WORK:

In this work we have introduced consequentialist conditionally cooperative strategies and shown that they are useful heuristics in social dilemmas, even in those where information is imperfect either due to the structure of the game or due to the fact that we cannot perfectly forecast a partner's future actions. We have shown that using one's own reward stream as a summary statistic for whether to cooperate (or not) in a given period is guaranteed to work in the limit as long as the underlying game is ergodic. Note that this sometimes (but not always) gives good finite time guarantees. In particular, the time scale for a CCC agent to detect exploitation is related to the mixing time of the POMG and the stochasticity of rewards; if these are large, then correspondingly long games are required for CCC to perform well.

We have also compared consequentialist and forward-looking models. As another simple example of the difference between the two we can consider the random Dictator Game (rDG) introduced by Cushman et al. (2009) . In the rDG, individuals are paired, one (the Dictator) is given an amount of money to split with a Partner, and chooses between one of two dice, a 'fair' die which yields a 50 -50 split with a high probability and an unfair split with a low probability and an 'unfair' die which yields a 50 -50 split with low probability. Consequentialist conditional cooperators would label a partner a defector if an unfair outcome came up (regardless of die choice) whereas intention-based cooperators would look at the choice of die, not the actual outcome.

For RL trained agents, conditioning purely on intentions (eg. amTFT) has advantages in that it is forward looking and doesn't require ergodicity assumptions but it is an expensive strategy that is complex (or impossible) to implement for POMDPs and requires very precise estimates of potential outcomes. CCC is simple, works in POMDPs and requires only information about payoff rates (rather than actual policies), however it may take a long time to converge. Each has unique advantages and disadvantages. Therefore constructing agents that can solve social dilemmas will require combining consequentialist and intention-based signals.

Interestingly, experimental evidence shows that while humans combine both intentions and outcomes, we often rely much more heavily on consequences than 'optimal' behavior would demand. For example, experimental subjects rely heavily on the outcome of the die throw rather than die choice in the rDG (Cushman et al., 2009) . This is evidence for the notion that rather than acting optimally in each situation, humans have social heuristics which are tuned to work across many environments (Rand et al., 2014; Hauser et al., 2014; Ouss & Peysakhovich, 2015; Arechar et al., 2016; Mao et al., 2017; Niella et al., 2016) . There is much discussion of hybrid environments that include both artificial agents and humans (eg. Shirado & Christakis (2017) ; Crandall et al. ( 2017)). Constructing artificial agents that can do well in such environments will require going beyond the kinds of optimality theorems and experiments highlighted in this and related work.

In addition, we have defined cooperative policies as those which maximize the sum of the rewards. This seems like a natural focal point in symmetric games like the ones we have studied but it is well known that human social preferences take into account factors such as inequity (Fehr & Schmidt, 1999) and social norms (Roth et al., 1991) . To be successful, AI researchers will have to understand human social heuristics and construct agents that are in tune with human moral and social intuitions (Bonnefon et al., 2016; Greene, 2014) .

6 TECHNICAL APPENDIX

6.1. PROOF OF MAIN THEOREM:

We will use this basic property of almost sure convergence. If a sequence of random variables X n converges to X almost surely then ∀δ > 0, > 0 ∃n 0 s.t. P (∀n > n 0 , |X n -X| < δ) > 1 -

Cooperation Wins::

The intuition behind the proof is as follows: first, we show that if the CCC agent's partner plays π C then for any R s > 0 there exists a time t s at which the CCC agent's total payoff exceeds the threshold t s T by at least R s with high probability. Intuitively this is because the rate T is lower than ρ CC which is weakly lower than the rate guaranteed to a CCC agent whose partner behaves according to π C always.

Second, we will show that for sufficiently large R s , if the CCC agent's total payoff exceeds the threshold by R s then the CCC agent also only plays π C from that point on with high probability.

Together this implies that if the partner plays according to π C then with high probability the CCC agent behaves according to π D only a finite amount of times and thus the rates of payoffs for both agents converge to ρ CC .

(Part 1)

Let R t be the total reward of the CCC agent at time t and pick some R s . We assumed that ρ C+D,C ≥ ρ CC > T . Therefore if the partner plays π C then Rt t → ρ CCC,C > T . We set δ = ρ CC -T 2 and use almost sure convergence to say that

∀ > 0 ∃t m s.t. P ∀t > t m , R t t > T + ρ CC -T 2 > 1 -. Let t s = max t m ,

Rs:

(ρ CC -T )/2 . Then after t s turns the CCC agents total reward will exceed t s T by at least R s with probability at least 1 -.

(Part 2):

If we assume that both players play π C forever then by reward ergodicity and the fact that ρ CC > T we have

∀ > 0 ∃t 0 s.t. P ∀t > t 0 , R t t > T > 1 -.

Assuming bounded rewards |r| ≤ r max then CCC agent's accumulated reward in t 0 turns is no less than -t 0 r max . So, if at time t the CCC agent has total payoff of t 0 r max + tT , then with probability 1 -, their payoff will never fall below the threshold after that point and thus they will always play π C . This validates the initial assumption for Part 2 that both players play π C .

Putting it all together, setting R s to t 0 R max we have that for any > 0 there exists a t s such that R ts -t s T ≥ t 0 R max with probability at least 1 -, and given that initial balance then both players play π C from that point forward and get average rewards according to ρ CC , with probability 1 -. Therefore, with probability at least 1 -2 , both players will achieve average reward of ρ CC .

Defecting Doesn't Pay:

Suppose agent 1's average reward converges to ρ < T . Then for some t 0 we have that Rt t < T for all t > t 0 , with probability 1. Starting at t 0 , CCC plays a fixed (stateless) policy π D 1 . Since π D forms an equilibrium agent 2 can achieve average reward of at most ρ DD . 6.2 A NOTE ON π C+D PAYOFFS While constructing CCC strategies, we make the assumption that the payoff of the pair (π C+D , π C ) to agent 1 is at least ρ CC . This is an overly restrictive condition, because it precludes methods of cooperation that take more than one period to execute. For example, if cooperation is walking to the left side of the room and defection is walking to the right side of the room, then a mix of the two policies may leave me in the middle gaining no reward.

In practice, CCC likely works even when this assumption doesn't strictly hold (e.g. in Pong and Coins), but with a slight modification to CCC we can use a much weaker condition: Let π kC+kD be a policy that switches between π C and π D at most once every k periods. Then we must only assume that there exists k such that the payoff to agent 1 of (π kC+kD , π C ) is at least ρ CC . In other words, as long as the Agent plays long enough stretches of π C or π D against π C , their reward will be at least ρ C C.

The modified CCC uses two thresholds: T D = (1 -α D )ρ CC + α D ρ CD is the threshold to switch from π C to π D , and T C = (1 -α C )ρ CC + α C ρ CD is the threshold to switch back, with α D > α C . These thresholds grow linearly as t → ∞ so the intervals between CCC switching policies has to grow linearly as well given bounded rewards.

6.3. FISHERY AND COINS TRAINING:

The Fishery game has a 5 × 10 state space, where each agent is confined to, and observes, only their 5 × 5 half of the game. Coins is identical to Lerer & Peysakhovich (2017) but with the board size expanded to 8 × 8.

We follow the model architecture and training setup from Lerer & Peysakhovich (2017) , with the modification that models are trained via policy gradient. We found that value-based methods (e.g. using a neural network baseline, or actor-critic) were unable to train prosocial policies in Fishery when using a stateless model. We suspect this is because states of very different prosocial value -'I just ate the fish' vs. 'I let the fish swim to my partner' -are aliased in the observation space. Policy gradient with standard batch baselining produced converged policies for both Coins and Fishery. We trained Coins for 100,000 games and Fishery for 40,000 games.

For the tournament, agents play against opponents they have never trained against. The CCC statistics are computed at test time by rolling out a batch of 32 games for CC and 32 games for CD, updating the rollouts by one step per game step. Alternatively, the statistics (in particular, the defect threshold) could be pre-computed once for the longest game length of interest, and used in subsequent interactions.

6.4. PONG PLAYER DILEMMA TRAINING:

We use the ALE environment modified for 2-player play as proposed in Tampuu et al. (2017) , with modified rewards of +1 for scoring a point and -2 for being scored on.

We train policies directly from pixels, using the pytorch-a3c package https://github.com/ ikostrikov/pytorch-a3c.

Policies are trained directly from pixels via A3C (Mnih et al., 2016) . Inputs are rescaled to 42 × 42 and normalized, and we augment the state with the difference between successive frames. We use 38 threads for A3C, over a total of 38,000 games (1,000 per thread). We use the default settings from pytorch-a3c: a discount rate of 0.99, learning rate of 0.0001, 20-step returns, and entropy regularization weight of 0.01.

The policy is implemented as a convolutional neural network with four layers, following pytorch-a3c. Each layer uses a 3 × 3 kernel with stride 2, followed by ELU. The network has two heads for the actor and critic. We elide the LSTM layer used in the pytorch-a3c library, as we found it to be unnecessary.

6.5. EXPERIMENT: COINS:

We show that CCC maintains cooperation in the Coins game from Lerer & Peysakhovich (2017) . In Coins two agents, Red and Blue, live on an 8 × 8 grid and move around in all cardinal directions5 . 

:

In an ideal world we may want to construct a full posterior using Bayesian methods. However, this is often computationally difficult in practice.

Cooperation returns when CCC returns to a time averaged payoff above the threshold, this means a partner can accelerate this process by taking actions to give the CCC agent extra payoff. We refer to this process as 'giving flowers to apologize.'

For simplicity for this experiment we use the πC and πD strategies trained in the standard PPD for the risky PPD, this is because the risky PPD is the same (in expectation) as the PPD.

We use a larger grid size so the payoffs are not directly comparable to those reported inLerer & Peysakhovich (2017)

Figures and Tables:

Figure 2: In the Pong Player's Dilemma selfish training leads to agents that try hard to score and thus end up with bad payoffs. Cooperators learn to gently hit the ball back and forth. CCC agents behave like a cooperators when faced with cooperators and prevent themselves from being exploited by defectors. Panel B shows example PPD games between different strategies with brightness of a pixel indicating proportion of time ball spends in that location. Panels C and D present comparisons of strategies in the PPD and Risky PPD.In PPD, CCC achieves similar performance to the more expensive amTFT. In the finite length risky PPD, however, CCC loses both its ability to incentivize cooperation and to avoid exploitation.

Figure 4: Tournament result for Fishery, Coins, PPD, and Risky PPD. Each cell shows the average total payoff of an agent playing the row strategy against a partner playing the column strategy.

Peer review (iclr2018):
 This paper studies learning to play two-player general-sum games with state (Markov games) with imperfect information. The idea is to learn to cooperate (think prisoner*s dilemma) but in more complex domains. Generally, in repeated prisoner*s dilemma, one can punish one*s opponent for noncooperation. In this paper, they design an apporach to learn to cooperate in a more complex game, like a hybrid pong meets prisoner*s dilemma game. This is fun but I did not find it particularly surprising from a game-theoretic or from a deep learning point of view. From a game-theoretic point of view, the paper begins with a game-theoretic analysis of a cooperative strategy for these markov games with imperfect information. It is basically a straightforward generalization of the idea of punishing, which is common in "folk theorems" from game theory, to give a particular equilibrium for cooperating in Markov games. Many Markov games do not have a cooperative equilibrium, so this paper restricts attention to those that do. Even in games where there is a cooperative solution that maximizes the total welfare, it is not clear why players would choose to do so. When the game is symmetric, this might be "the natural" solution but in general it is far from clear why all players would want to maximize the total payoff. The paper follows with some fun experiments implementing these new game theory notions. Unfortunately, since the game theory was not particularly well-motivated, I did not find the overall story compelling. It is perhaps interesting that one can make deep learning learn to cooperate with imperfect information, but one could have illustrated the game theory equally well with other techniques. In contrast, the paper "Coco-Q: Learning in Stochastic Games with Side Payments" by Sodomka et. al. is an example where they took a well-motivated game theoretic cooperative solution concept and explored how to implement that with reinforcement learning. I would think that generalizing such solution concepts to stochastic games and/or deep learning might be more interesting. It should also be noted that I was asked to review another ICLR submission entitled "MAINTAINING COOPERATION IN COMPLEX SOCIAL DILEMMAS USING DEEP REINFORCEMENT LEARNING" which amazingly introduced the same "Pong Player’s Dilemma" game as in this paper. Notice the following suspiciously similar paragraphs from the two papers: From "MAINTAINING COOPERATION IN COMPLEX SOCIAL DILEMMAS USING DEEP REINFORCEMENT LEARNING": We also look at an environment where strategies must be learned from raw pixels. We use the method of Tampuu et al. (2017) to alter the reward structure of Atari Pong so that whenever an agent scores a point they receive a reward of 1 and the other player receives −2. We refer to this game as the Pong Player’s Dilemma (PPD). In the PPD the only (jointly) winning move is not to play. However, a fully cooperative agent can be exploited by a defector. From "CONSEQUENTIALIST CONDITIONAL COOPERATION IN SOCIAL DILEMMAS WITH IMPERFECT INFORMATION": To demonstrate this we follow the method of Tampuu et al. (2017) to construct a version of Atari Pong which makes the game into a social dilemma. In what we call the Pong Player’s Dilemma (PPD) when an agent scores they gain a reward of 1 but the partner receives a reward of −2. Thus, in the PPD the only (jointly) winning move is not to play, but selfish agents are again tempted to defect and try to score points even though this decreases total social reward. We see that CCC is a successful, robust, and simple strategy in this game.