Learning to Cooperate with Emergent Reputation and Consequence Reasoning
Abstract
Indirect reciprocity provides a theoretical foundation for understanding the emergence of cooperation, wherein individuals build reputations to facilitate future interactions. Recent work has applied reinforcement learning with reputations to study norm-compliance dynamics, but existing approaches remain limited by their dependence on predetermined norms. This restricts their applicability in realistic settings with private assessments, underspecified norms, and heterogeneous environments. We present Learning with Emergent Reputation and Consequence Reasoning (LERC), a framework that enables agents to jointly learn norms and behavioural strategies from interaction experience. In LERC, agents anticipate how their actions influence future reputational responses and downstream interactions, capturing the feedback between behaviour and social evaluation through consequence-aware reasoning. An attention-based representation further supports context-sensitive reputation assignment. Analytically, we prove that consequence-aware reasoning enlarges the basin of attraction for cooperative equilibria once reputations stabilise. Empirically, LERC outperforms norm-based methods and recent baselines, achieving context-sensitive evaluation and sustained cooperation. These findings show that reputation-based cooperation can emerge in learning agents without centralised coordination or predefined norms.
Training Environments
LERC is evaluated on below social dilemma environments that capture different cooperation challenges.
Iterated Matrix Game. Agents repeatedly choose to cooperate or defect. Mutual cooperation yields the highest collective payoff, but individual incentives favour defection. We evaluate beyond pairwise interactions, extending to N-agent group settings across multiple social dilemma structures to test generalisation of emergent cooperation.
Additional experimental settings:
Coin Game. Agents navigate a grid to collect coins of their own colour while avoiding collecting the opponent's coins. We also scale this testbed beyond the standard two-agent setting to larger grids and more agents, assessing the robustness of reputation-based coordination under increased spatial and social complexity.
Additional experimental settings:
Melting Pot Commons Harvest Open. Harvest is a higher-dimensional sequential social dilemma built around shared apple patches. Once a patch is exhausted, it stops regrowing, so short-term over-harvesting can reduce future return for everyone. We use this environment to test whether LERC can sustain cooperation under longer-horizon resource pressure.
Analytical Support for Consequence Reasoning
We provide analytical support for consequence reasoning with three competing strategies: unconditional cooperation, unconditional defection and reputation-based discrimination. At the reputation fixed point, the reputation update admits a unique limit under any initial aggregate reputation (Theorem 4.2). Building on this convergence result, consequence-aware reasoning with ω > 0 enlarges the basin of attraction for the cooperative equilibrium (Corollary 4.3). In contrast, the reputation-only baseline with ω = 0 converges to full defection. The simplex visualisations below show this mechanism under the image-score norm.
LERC with consequence reasoning
Reputation-only baseline under IS norm
Evolutionary dynamics on the strategy simplex under the IS norm. Consequence-aware reasoning (left) shifts the equilibrium away from full defection towards cooperative strategies. The reputation-only baseline (right) converges to full defection. Arrows and colour represent the direction and magnitude of evolutionary dynamics. Each corner of the simplex corresponds to a monomorphic population. Solid circles indicate stable equilibria, while open circles represent unstable equilibria.
Node labels: ALLC = always cooperate; ALLD = always defect; DISC = discriminate based on reputation.
Experimental Results
Matrix Game
LERC consistently outperforms IPPO across payoff combinations, revealing an emergent pattern of cooperation that covers broad regions of the payoff space with smooth behavioural transitions. Compared with fixed-norm baselines, LERC achieves competitive performance without access to predefined norms, and maintains effectiveness beyond pairwise settings in group interaction scenarios.
Cooperation level across payoff configurations. LERC (left) achieves higher cooperation with smooth transitions, while IPPO (right) converges to defection.
Learning curves for selected payoff settings showing stable cooperation growth, and performance comparison against fixed-norm variants (RL-SS, RL-IS, RL-SH).
Comparison of pairwise and group interactions in the matrix game.
| Metric / Payoff Combination | Pairwise Interaction | Group Interaction | ||
|---|---|---|---|---|
| LERC | CR-IM | LERC(N2) | CR-IM(N2) | |
| Cooperation Level | ||||
| (1.0, 0.0) | 0.889 ± 0.087 | 0.887 ± 0.051 | 0.681 ± 0.059 | 0.652 ± 0.024 |
| (1.1, -0.1) | 0.758 ± 0.146 | 0.771 ± 0.174 | 0.355 ± 0.029 | 0.157 ± 0.160 |
| Cooperation Reputation | ||||
| (1.0, 0.0) | 0.805 ± 0.056 | 0.803 ± 0.124 | 0.631 ± 0.075 | 0.597 ± 0.041 |
| (1.1, -0.1) | 0.805 ± 0.102 | 0.799 ± 0.090 | 0.738 ± 0.027 | 0.705 ± 0.155 |
| Defection Reputation | ||||
| (1.0, 0.0) | 0.504 ± 0.134 | 0.428 ± 0.145 | 0.296 ± 0.024 | 0.307 ± 0.029 |
| (1.1, -0.1) | 0.478 ± 0.199 | 0.443 ± 0.166 | 0.418 ± 0.034 | 0.316 ± 0.162 |
| Cooperation-Based Reputation | ||||
| (1.0, 0.0) | 0.822 ± 0.046 | 0.800 ± 0.124 | 0.646 ± 0.070 | 0.597 ± 0.047 |
| (1.1, -0.1) | 0.797 ± 0.131 | 0.830 ± 0.106 | 0.718 ± 0.026 | 0.460 ± 0.243 |
| Defection-Based Reputation | ||||
| (1.0, 0.0) | 0.186 ± 0.125 | 0.240 ± 0.255 | 0.398 ± 0.067 | 0.397 ± 0.050 |
| (1.1, -0.1) | 0.422 ± 0.193 | 0.233 ± 0.101 | 0.501 ± 0.021 | 0.341 ± 0.194 |
LERC generalises beyond pairwise play: in group interactions, LERC sustains cooperation at (1.1, -0.1) where CR-IM collapses (0.355 vs 0.157), and retains higher cooperation reputation across both payoff settings.
Coin Game
LERC outperforms all baselines in the coin game, achieving over 70% own-coin collection ratio, slightly higher than Adalign. LOLA reaches around 60%, while other baselines, including the reputation-based method LR2, IPPO and COMA, fail to sustain cooperative behaviour. LERC maintains its advantage when scaled to larger grids and more agents, validating the robustness of reputation-based coordination under increased complexity.
Own-coin ratio, episode reward, and total coins collected over training. LERC consistently leads across all metrics.
Comparison performance in coin game under various punishment level (Ppen).
| Metric | Methods | ||||||
|---|---|---|---|---|---|---|---|
| LERC | LR2 | AdAlign | LOLA | COMA | IPPO | CR-IM | |
| Own Coin | |||||||
| Ppen = -2 | 0.74 ± 0.06 | 0.55 ± 0.03 | 0.70 ± 0.03 | 0.58 ± 0.07 | 0.44 ± 0.10 | 0.51 ± 0.02 | 0.68 ± 0.02 |
| Ppen = -1 | 0.55 ± 0.04 | 0.52 ± 0.01 | 0.51 ± 0.06 | 0.51 ± 0.05 | 0.46 ± 0.12 | 0.49 ± 0.01 | 0.58 ± 0.03 |
| Reward | |||||||
| Ppen = -2 | 8.64 ± 3.05 | 1.34 ± 1.48 | 6.92 ± 1.79 | 3.32 ± 3.43 | -1.34 ± 2.05 | 0.40 ± 0.78 | 5.42 ± 1.19 |
| Ppen = -1 | 12.38 ± 3.56 | 9.50 ± 2.67 | 6.30 ± 4.83 | 3.26 ± 4.91 | -0.86 ± 2.98 | 12.81 ± 0.22 | 10.01 ± 5.43 |
| Coins | |||||||
| Ppen = -2 | 34.50 ± 4.87 | 49.05 ± 2.10 | 43.47 ± 8.77 | 31.54 ± 11.52 | 12.12 ± 10.75 | 51.04 ± 0.40 | 29.79 ± 4.77 |
| Ppen = -1 | 43.54 ± 11.74 | 40.69 ± 12.42 | 24.77 ± 17.99 | 30.40 ± 12.46 | 14.87 ± 12.55 | 52.00 ± 0.32 | 41.21 ± 9.37 |
| Own Rep. | |||||||
| Ppen = -2 | 0.64 ± 0.11 | 0.62 ± 0.18 | — | — | — | — | 0.57 ± 0.16 |
| Ppen = -1 | 0.53 ± 0.12 | 0.53 ± 0.19 | — | — | — | — | 0.61 ± 0.09 |
| Other Rep. | |||||||
| Ppen = -2 | 0.07 ± 0.07 | 0.59 ± 0.18 | — | — | — | — | 0.06 ± 0.05 |
| Ppen = -1 | 0.20 ± 0.04 | 0.53 ± 0.20 | — | — | — | — | 0.20 ± 0.08 |
LERC leads on Own Coin ratio and episode Reward at the harsher punishment level (Ppen = -2), while IPPO accumulates the most coins by collecting indiscriminately. Dashes indicate baselines that do not expose a reputation signal.
Coin Game Scalability Demonstrations
2 Agents · 3×3 Grid
3 Agents · 4×4 Grid
LERC maintains cooperative coin collection as the number of agents and grid size increase, demonstrating scalability beyond the standard two-agent setting.
Coin Game League Evaluation
To assess cross-strategy robustness, we conduct a full pairwise league evaluation in the coin game. Each policy is paired with every other policy across seeds and evaluation episodes. Each cell reports two episode rewards: the upper value for the row agent and the lower value for the column agent. Blue shading denotes positive reward and red shading denotes negative reward.
LERC shows the strongest league performance. In self-play, it attains the highest mutual reward, indicating stable cooperation between two LERC agents. Against heterogeneous partners, LERC keeps positive rewards in most pairings and is the only policy that achieves positive joint reward when paired with IPPO. It also remains clearly positive against LOLA and COMA. These results indicate that LERC resists exploitation while maintaining cooperative collection behaviour across the league.
Full pairwise league evaluation among LERC and baseline policies in the coin game. Each cell reports two episode rewards: the upper value for the row agent and the lower value for the column agent. Blue and red shading indicate positive and negative rewards. Values are averaged over 10 seeds with 10 evaluation episodes per pairing.
Commons Harvest Open
Normalised reward and Gini coefficient evaluated in Commons Harvest Open under self-play.
We validate LERC in Commons Harvest Open, reporting episode reward normalised via min-max scaling between random agent and highest exploiter performance, alongside the Gini coefficient to measure payoff distribution among agents in apple collection. Results indicate that LERC not only promotes efficient resource harvesting but also maintains equitable payoff distribution.
We also render evaluation trajectories to inspect learned behaviour. In self-play with seven copies of each evaluated policy, LERC agents harvest sustainably and allow apple patches to regrow across the episode. In contrast, IPPO agents consume resources aggressively, leading to full patch depletion by the middle of the episode.
Evaluation trajectories in Commons Harvest Open. LERC agents (top row) maintain sustainable harvesting and preserve apple regrowth throughout the episode. IPPO agents (bottom row) rapidly exhaust the shared resource. The evaluated scenario includes a fixed population of 7 copies of the policy.
Ablation Studies
We isolate the contribution of each LERC component by training four reduced variants. CR removes the interaction measure, IM removes consequence reasoning, CR-IM replaces the attention head with a generic action evaluation module, and Repu drops both consequence reasoning and structured evaluation. Across matrix games and the coin game, removing any component degrades performance, with the attention mechanism proving critical for context-sensitive evaluation.
Cooperation level across payoff combinations in matrix games. The full LERC agent consistently outperforms its ablation variants, and removing any single component degrades performance. The IPPO row at the bottom anchors the comparison.
| LERC | CR | IM | CR-IM | Repu | |
|---|---|---|---|---|---|
| Own Coin | 0.74 ± 0.06 | 0.65 ± 0.10 | 0.59 ± 0.10 | 0.68 ± 0.02 | 0.58 ± 0.06 |
| Reward | 8.6 ± 3.1 | 5.3 ± 4.1 | 3.4 ± 4.0 | 5.4 ± 1.2 | 3.2 ± 2.5 |
| Coins | 34.5 ± 4.9 | 32.6 ± 4.3 | 33.5 ± 5.8 | 29.8 ± 4.8 | 35.2 ± 3.2 |
| Own Rep. | 0.64 ± 0.15 | 0.64 ± 0.15 | 0.56 ± 0.09 | 0.57 ± 0.16 | 0.81 ± 0.10 |
| Other Rep. | 0.07 ± 0.07 | 0.09 ± 0.11 | 0.13 ± 0.06 | 0.07 ± 0.05 | 0.10 ± 0.18 |
Coin game metrics under each ablation variant. LERC retains the highest own-coin ratio and episode reward, with attention-based evaluation contributing most to behavioural discrimination.