Discovering Learning Rules that Shape Others
Organizations: King’s College London London, United Kingdom · Harvard University Cambridge, MA, United States · University College London London, United Kingdom
Abstract
In general-sum games, self-interested learners can reach outcomes that are poor for everyone, which has motivated methods that shape the opponent's learning. Methods like Learning with Opponent-Learning Awareness (LOLA), which differentiates through the opponent's learning process, and Model-Free Opponent Shaping (M-FOS), which uses model-free optimisation methods for long-horizon opponent shaping, have enabled mutual cooperation and exploitation of learners. However, these methods require access to the opponent's parameters, policy, rewards or learning rule during deployment. In single-agent reinforcement learning, update rules discovered by meta-learning have achieved state-of-the-art results (e.g. DiscoRL). These rules are separate from the policy they train and read only the agent's own experience. We hereby extend this framework to general-sum settings by introducing Discovered Update Rule for Opponent Shaping (DUOS). To the best of our knowledge, this is the first method to discover an update rule for an agent in general-sum games. DUOS meta-trains the rule to maximise the agent's expected return over its lifetime, and updates an inner network using the agent's own experience. We show that our discovered rule exhibits behaviour consistent with opponent shaping without reading opponent policies or parameters, and ranks 1st in normalised mean score and 1st in self-play among tournament entrants.
Figures & tables
| Cooperate | Defect | |
|---|---|---|
| Cooperate | ||
| Defect |
| Method | IPD | IMP | Chicken | Stag Hunt | Coin | Matrix mean | Five-game mean | Rank |
| \method (ours) | 1.000 | 0.841 | 0.829 | 0.727 | 0.680 | 0.849 | 0.815 [0.78, 0.85] | 1 |
| SHAPER | 0.631 | 1.000 | 0.032 | 0.902 | 1.000 | 0.641 | 0.713 [0.64, 0.78] | 2 |
| M-FOS | 0.583 | 0.646 | 0.000 | 1.000 | 0.844 | 0.557 | 0.614 [0.57, 0.66] | 3 |
| NL | 0.150 | 0.000 | 0.868 | 0.637 | 0.302 | 0.414 | 0.391 [0.35, 0.43] | 4 |
| LOLA-OM | 0.659 | 0.350 | 0.690 | 0.868 | – | 0.642 | – | – |
| POLA-OM* | 0.386 | 0.708 | 0.005 | 0.925 | – | 0.506 | – | – |
| Method | IPD | Chicken | Stag Hunt | Coin | Matrix mean | Four-game mean | Rank |
| \method (ours) | 1.000 | 1.000 | 0.883 | 1.000 | 0.961 | 0.971 [0.969, 0.973] | 1 |
| Reciprocator | 0.621 | 0.804 | 0.000 | 0.954 | 0.475 | 0.595 [0.590, 0.601] | 2 |
| NL | 0.031 | 0.848 | 0.101 | 0.900 | 0.327 | 0.470 [0.465, 0.476] | 3 |
| M-FOS | 0.005 | 0.073 | 0.970 | 0.774 | 0.349 | 0.456 [0.396, 0.499] | 4 |
| SHAPER | 0.327 | 0.000 | 1.000 | 0.000 | 0.442 | 0.332 [0.274, 0.364] | 5 |
| LOLA-OM | 0.428 | 0.516 | 0.554 | – | 0.499 | – | – |
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Row vs. column | M-FOS | M-FOS-H | SHAPER | COALA-PG* | LOLA-OM | POLA-OM* | NL | Reciprocator | \method | Mean score | Rank |
|---|---|---|---|---|---|---|---|---|---|---|---|
| M-FOS | – | 1.05 | 1.42 | 1.25 | 1.66 | 1.43 | 3.88 | 2.61 | 2.00 | 1.91 | 4 |
| M-FOS-H | 1.04 | – | 1.38 | 1.26 | 1.36 | 1.11 | 3.13 | 2.45 | 2.09 | 1.73 | 6 |
| SHAPER | 1.35 | 1.29 | – | 1.34 | 1.92 | 1.61 | 3.53 | 2.39 | 2.13 | 1.94 | 3 |
| COALA-PG* | 1.18 | 1.13 | 1.36 | – | 1.46 | 1.36 | 2.02 | 2.18 | 1.62 | 1.54 | 9 |
| LOLA-OM | 1.53 | 1.31 | 1.77 | 1.37 | – | 1.34 | 2.90 | 2.72 | 2.76 | 1.96 | 2 |
| POLA-OM* | 1.36 | 1.09 | 1.59 | 1.36 | 1.39 | – | 3.75 | 2.28 | 1.48 | 1.79 | 5 |
| Row vs. column | M-FOS | M-FOS-H | SHAPER | LOLA-OM | POLA-OM* | NL | \method | Mean score | Rank |
|---|---|---|---|---|---|---|---|---|---|
| M-FOS | – | 0.04 | 0.35 | 0.16 | 0.12 | 0.47 | 0.06 | 0.01 | 5 |
| M-FOS-H | 0.04 | – | 0.15 | 0.04 | 0.05 | 0.40 | 0.01 | 0.04 | 3 |
| SHAPER | 0.35 | 0.15 | – | 0.11 | 0.01 | 0.13 | 0.01 | 0.12 | 1 |
| LOLA-OM | 0.16 | 0.04 | 0.11 | – | 0.02 | 0.02 | 0.16 | 0.08 | 6 |
| POLA-OM* | 0.12 | 0.05 | 0.01 | 0.02 | – | 0.00 | 0.00 | 0.03 | 4 |
| NL | 0.47 | 0.40 | 0.13 | 0.02 | 0.00 | – | 0.19 | 0.20 | 7 |
| Row vs. column | M-FOS | SHAPER | LOLA-OM | POLA-OM* | NL | Reciprocator | \method | Mean score | Rank |
|---|---|---|---|---|---|---|---|---|---|
| M-FOS | – | 0.06 | 0.38 | 0.15 | 3.91 | 3.23 | 0.30 | 1.34 | 7 |
| SHAPER | 0.26 | – | 0.23 | 0.11 | 3.92 | 3.29 | 0.27 | 1.35 | 5 |
| LOLA-OM | 0.11 | 0.06 | – | 0.40 | 3.18 | 2.65 | 2.54 | 1.49 | 4 |
| POLA-OM* | 0.09 | 0.03 | 0.51 | – | 3.87 | 2.83 | 0.73 | 1.34 | 6 |
| NL | 0.98 | 0.98 | 2.34 | 1.04 | – | 2.08 | 1.74 | 1.53 | 2 |
| Reciprocator | 0.82 | 0.82 | 2.36 | 0.81 | 2.69 | – | 1.83 | 1.56 | 1 |
| Row vs. column | M-FOS | SHAPER | LOLA-OM | POLA-OM* | NL | Reciprocator | \method | Mean score | Rank |
|---|---|---|---|---|---|---|---|---|---|
| M-FOS | – | 3.97 | 3.77 | 3.89 | 3.93 | 2.91 | 3.57 | 3.67 | 1 |
| SHAPER | 3.97 | – | 3.63 | 3.91 | 3.82 | 2.82 | 3.34 | 3.58 | 3 |
| LOLA-OM | 3.83 | 3.68 | – | 3.51 | 3.74 | 3.07 | 3.47 | 3.55 | 4 |
| POLA-OM* | 3.92 | 3.93 | 3.53 | – | 3.76 | 2.91 | 3.57 | 3.60 | 2 |
| NL | 3.94 | 3.85 | 3.73 | 3.75 | – | 2.26 | 2.49 | 3.34 | 6 |
| Reciprocator | 3.33 | 3.12 | 3.15 | 2.95 | 1.92 | – | 2.06 | 2.76 | 7 |
| Row vs. column | M-FOS | SHAPER | NL (PPO) | Reciprocator | \method | Mean score | Rank |
|---|---|---|---|---|---|---|---|
| M-FOS | – | 0.298 | 0.411 | 0.567 | 0.097 | 0.194 | 2 |
| SHAPER | 0.032 | – | 0.534 | 0.643 | 0.127 | 0.334 | 1 |
| NL (PPO) | 0.447 | 0.754 | – | 0.259 | 0.216 | 0.289 | 4 |
| Reciprocator | 0.618 | 0.865 | 0.272 | – | 0.482 | 0.559 | 5 |
| \method (ours) | 0.119 | 0.373 | 0.230 | 0.454 | 0.014 | 0.048 | 3 |
| Method | IPD | IMP | Chicken | Stag Hunt | Coin | Matrix mean | Five-game mean |
| \method (ours) | 1.000 | 0.841 | 1.000 | 0.787 | 0.680 | 0.907 | 0.862 [0.84, 0.88] |
| M-FOS | 0.583 | 0.646 | 0.000 | 1.000 | 0.844 | 0.557 | 0.614 [0.57, 0.66] |
| NL | 0.150 | 0.000 | 0.196 | 0.596 | 0.302 | 0.236 | 0.249 [0.21, 0.29] |
| LOLA-OM | 0.659 | 0.350 | 0.842 | 0.905 | – | 0.689 | – |
| POLA-OM* | 0.386 | 0.708 | 0.040 | 0.920 | – | 0.514 | – |
| SHAPER | 0.631 | 1.000 | – | – | 1.000 | – | – |
| Chicken | Stag Hunt | |||
|---|---|---|---|---|
| Method | without | with | without | with |
| M-FOS | 1.60 (6) | 1.34 (7) | 3.61 (1) | 3.67 (1) |
| SHAPER | – | 1.35 (5) | – | 3.58 (3) |
| LOLA-OM | 1.78 (2) | 1.49 (4) | 3.52 (3) | 3.55 (4) |
| POLA-OM* | 1.60 (5) | 1.34 (6) | 3.54 (2) | 3.60 (2) |
| NL | 1.64 (4) | 1.53 (2) | 3.24 (5) | 3.34 (6) |
| Game | With PSRO | Pre-PSRO | Difference | |
|---|---|---|---|---|
| IPD | 50 | 2.182 (1) | 2.162 (1) | +0.020 [ 0.151, +0.191] |
| 10 | 1.945 (1) | 1.922 (3) | +0.023 [ 0.024, +0.069] | |
| IMP | 50 | 0.073 (2) | 0.029 (4) | +0.043 [+0.022, +0.065] |
| 10 | 0.054 (2) | 0.031 (2) | +0.023 [+0.009, +0.037] | |
| Chicken | 50 | 1.520 (3) | 1.531 (2) | 0.011 [ 0.055, +0.034] |
| 10 | 1.362 (2) | 1.367 (2) | 0.005 [ 0.032, +0.023] |
| Baseline | Check | Target | Ours | Outcome | Tournament |
|---|---|---|---|---|---|
| M-FOS, IPD | Table 8 (authors’ payoffs), 2 seeds | M-FOS , NL | M-FOS , , NL , | pass | entrant |
| M-FOS, IMP | Table 5, authors’ code (B) vs ours at lr 0.002 (C) | 0.20, B , | B 0.194, C 0.194 | pass | entrant (lr 0.002) |
| M-FOS, Chicken | Table 12 | M-FOS above NL | M-FOS 3.94, NL 0.99 (5/5 seeds) | pass | entrant |
| M-FOS, Stag Hunt | no paper result | n/r | M-FOS 3.93, NL 3.95 | – | entrant |
| M-FOS, meta-self-play | self-play, | n/r | IPD 2.988, IMP 0.012 | – | self-play only |
| SHAPER, IPD | recovery, 3 seeds | 3.15 | 2.967 | fail | entrant (flagged) |
| Baseline | Check | Target | Ours | Outcome | Tournament |
|---|---|---|---|---|---|
| POLA-OM* | POLA’s steps in our payoff units | , , | – | entrant | |
| LOLA-OM | LOLA’s Table 3 (exact LOLA, authors’ payoffs) | n/r (paper , ) | LOLA , NL | match | entrant |
| POLA-OM* | Outer POLA vs authors’ code, Fig. 3 and Table 3 | n/r | within , both reproduced | match | entrant |
| Reciprocator, IPD | shaping gate, 8 seeds | paper formula 0/8, released code 8/8 | pass (code) | entrant (code) | |
| COALA-PG*, pure shaping | Fig. 5A | return | 1.376, 1.401 | pass | entrant (IPD) |
| COALA-PG*, mixed pool | Fig. 5C | recovery | 0.035 | fail | – |
| Baseline | Check | Target | Ours | Outcome | Tournament |
|---|---|---|---|---|---|
| M-FOS, authors’ code | updates 951–1000, 3 seeds | M-FOS , NL in seeds | 70.89 / , 2/3 seeds | pass (stronger) | – |
| M-FOS, pax | same, not gated | n/r | M-FOS 113.55, 105.21, 75.94 | – | entrant (flagged) |
| M-FOS, meta-self-play | authors’ code, self-play, 3 seeds | in seeds | 8.74, 14.44, 22.42 | fail | – |
| M-FOS, meta-self-play, pax | self-play, 3 seeds, not gated | n/r | 29.95, 25.98, | – | self-play only |
| SHAPER | paper’s ES budget | n/r | 3/3 seeds completed | – | entrant |
| Reciprocator | NL own-coin rate, 4 seeds | in seeds, mean , controls | 0.617 (4/4), controls 0.473, 0.531 | uninformative | entrant (flagged) |
| Hyperparameter | Value |
|---|---|
| Rounds per match | 20 |
| Matches per training lifetime | 100 |
| Objective horizons | 10, 25, 50, 100 |
| Discount | 0.96 |
| Meta-network GRU units | 32 |
| Meta-network MLP hidden units | 64, 64 |
| Hyperparameter | Value |
|---|---|
| Steps per episode | 16 |
| Episodes per lifetime | 16 |
| Parallel games | 512 |
| Inner network hidden units | 32, 32 |
| Adam second moment | from the gradient |
| Advantage | return minus ridge baseline |
| Hyperparameter | Value |
|---|---|
| Actor and critic hidden units | 256 |
| M-FOS-H GRU units | 16 |
| Learning rate | |
| Learning rate, IMP | † |
| PPO epochs | 4 |
| PPO clip | 0.2 |
| Hyperparameter | Value |
| Convolution channels | 16, 16 |
| Linear and GRU units | 16, 16 |
| Learning rate | |
| PPO epochs | 16 |
| PPO clip | 0.2 |
| Entropy coefficient | 0.01 |
| Hyperparameter | Value |
| GRU units | 16 † |
| ES population | 1,000 |
| Generations | 1,000 † |
| ES learning rate | 0.1 † |
| Perturbation scale | 0.04 |
| Opponents per candidate | 10 |
| Hyperparameter | Value |
| Linear and GRU units | 16, 16 |
| ES population | 4,000 |
| Generations | 3,000 |
| ES learning rate | 0.1 † |
| Perturbation scale | 0.04 |
| L2 penalty | 0.1 |
| Hyperparameter | Value |
|---|---|
| LOLA-OM step size | 1 |
| LOLA-OM look-ahead step | 1 |
| LOLA-OM discount | 0.96, 0.9, 0.96, 0.96 |
| POLA-OM* inner step ( ) | 1, 2.5, 1.25, 1.25 |
| POLA-OM* outer step ( ) | 0.06, 0.15, 0.075, 0.075 |
| POLA-OM* KL weight ( ) | 0.5, 0.2, 0.4, 0.4 |
| Hyperparameter | Value |
| Hawk width, heads | 32, 2 |
| PPO iterations | 3,000 |
| Meta-batch | 128 |
| Inner batch | 16 |
| Matches rounds per lifetime (meta-episode) | |
| Optimiser steps per iteration | 1 † |
| Hyperparameter | Value |
|---|---|
| Matrix games | |
| Reciprocal reward weight | 5.0 |
| Hidden units | 2 |
| Learning rate | 0.005 |
| Discount | 0.96 |
| PPO epochs, clip, entropy | 10, 0.1, 0.02 |
| Hyperparameter | Value |
|---|---|
| Matrix games (NL) | |
| Step size on (25 on of Eq. ( 1 )) | 1 |
| Discount | 0.96 |
| Coin Game (PPO NL) | |
| Convolution channels | 16, 16 |
| Linear units | 16 |
| Setting | Value |
| Matrix games | |
| Matches per lifetime | 50 |
| Matches per lifetime , secondary | 10 |
| Rounds per match | 20 |
| Lifetimes per pair of training seeds (IMP: per seat order) | 128 |
| Trained seeds ( \method , M-FOS, M-FOS-H, COALA-PG*) | 5 |
| Method | Own trajectory | Opponent’s actions | Opponent’s policy | Opponent’s payoffs | Assumed learning rule | Extra |
|---|---|---|---|---|---|---|
| Matrix games | ||||||
| \method | last match a | observed | no | no | no | own payoffs, own table |
| M-FOS | no | no | table b | no | no | own table |
| M-FOS-H | last match c | observed | no | no | no | own table |
| SHAPER | every round d | observed | no | no | no | none |
| COALA-PG* | every round d | observed | no | no | no | none |
| Opponent | Control | PSRO | [95% CI] | Seeds PSRO better |
|---|---|---|---|---|
| M-FOS | 0.020 | +0.124 | +0.144 [+0.057, +0.231] | 5/5 |
| M-FOS-H | 0.199 | +0.026 | +0.225 [+0.145, +0.305] | 5/5 |
| SHAPER | 0.092 | +0.019 | +0.111 [+0.065, +0.158] | 5/5 |
| Pairings won (all 6 IMP opponents) | 3/6 | 6/6 |
| Game | Measure | Trained | Zero-shot | [95% CI] | Seeds |
|---|---|---|---|---|---|
| Chicken | Tournament score | 2.105 | 1.810 | +0.295 [+0.218, +0.371] | 5/5 |
| Rank (of 6) | 3 | 1 | – | – | |
| Own return vs M-FOS | 0.979 | 0.108 | +0.871 [+0.857, +0.886] | 5/5 | |
| Margin vs M-FOS | 2.893 | 0.195 | 2.697 [ 2.753, 2.642] | 0/5 | |
| Self-play return | 2.903 | 2.920 | 0.017 [ 0.033, 0.001] | 0/5 | |
| Exploitability | 0.885 | 0.020 | +0.865 [+0.849, +0.880] | 0/5 |
| Opponent | IPD | IMP | Chicken | Stag Hunt | Coin |
|---|---|---|---|---|---|
| M-FOS | 0.268 (0/5) | +0.124 (4/5) | 0.195 (0/5) | +0.141 (5/5) | 0.216 (0/3) |
| M-FOS-H | 0.260 (0/5) | +0.026 (3/5) | – | – | – |
| SHAPER | 0.201 (0/5) | +0.019 (4/5) | 0.206 (0/5) | +0.120 (5/5) | 0.500 (0/3) |
| COALA-PG* | 0.017 (2/5) | – | – | – | – |
| LOLA-OM | 0.182 (0/5) | +0.313 (5/5) | 0.102 (0/5) | +0.092 (5/5) | – |
| POLA-OM* | 0.197 (0/5) | +0.004 (4/5) | 0.219 (0/5) | +0.065 (5/5) | – |
| Measure | Actual | Frozen | [95% CI] |
|---|---|---|---|
| NL cooperation, last match | 0.929 0.010 | 0.141 0.019 | 0.788 [ 0.823, 0.754] |
| \method reward per round, last match | 4.387 0.017 | 1.371 0.051 | 3.016 [ 3.172, 2.861] |
| \method reward per round, lifetime | 3.961 0.024 | 1.421 0.046 | 2.540 [ 2.721, 2.358] |
| NL reward per round, lifetime | 0.900 0.030 | 1.145 0.023 | +0.245 [+0.209, +0.281] |