Program Equilibria: Code-Based Strategic Interaction
- Program equilibria are a generalization of Nash equilibrium where strategies are computer programs that inspect opponents’ source code to decide actions.
- Key methods include proof-based and simulation-based bots, ensuring cooperation through recursive reasoning and probabilistic decision rules.
- SDP-based techniques and MPEC frameworks provide tractable solutions for optimizing equilibria in both two-player dilemmas and multi-agent systems.
Program equilibria generalize Nash equilibrium to settings in which strategies are themselves computer programs capable of inspecting and simulating the opponents’ source code prior to selecting actions. This paradigm models interactions among mutually transparent agents, including AI systems and contractual institutions. Major frameworks include the paper of “program games” for classical dilemmas such as the Prisoner’s Dilemma, multi-agent generalizations, simulation-based approaches for robustness, and mathematical programs with equilibrium constraints (MPECs) for optimization problems. Conceptual advances focus on guaranteeing robust cooperative outcomes, characterizing equilibria under informational and computational constraints, and providing SDP-based solution methods for polynomial program games.
1. Formal Definitions and Program Game Structures
In a two-player program game for the Prisoner’s Dilemma, each player submits a program , which, given read access to the opponent’s source code , outputs either (cooperate) or (defect) (Oesterheld, 2022). These programs are assumed (almost surely) to halt; otherwise, non-termination is interpreted as . The payoff is given by , where and is the standard payoff function with .
Generalizing to players, let $G = \bigl(N, \{\A_i\}_{i \in N}, \{u_i\}_{i \in N}\bigr)$ be an -player normal-form game with finite actions. A program for player is a function
$p_i \colon \bigl(\Pi_{-i} \times [r]^{\infty}\bigr) \to \A_i$
where denotes a random bitstream (sources of randomness may be independent or shared among players for coordination) (Cooper et al., 19 Dec 2024). Program equilibria are profiles such that no player benefits from unilaterally switching to a different halting program.
2. Types of Program Equilibria: Fair Bots and Simulation-Based Strategies
The literature distinguishes proof-based bots (which inspect opponent code for provable cooperation), simulation-based bots (which actively run opponent programs on simulated inputs), and hybrids. Two principal constructions are:
- -Grounded Fair Bot (GFB): On input opponent , with probability return , otherwise invoke and copy GFB (Oesterheld, 2022). This introduces randomization and ensures almost sure halting.
- Proof-Based Fair Bot (PFB): On input opponent , return if and only if (PFB) is provable within Peano arithmetic (), else return (Oesterheld, 2022).
Simulation-based strategies (e.g., -GroundedBot) generalize GFB: players simulate opponents on truncated random streams, halting with probability , and select actions via policies based on accumulated simulated histories (Cooper et al., 19 Dec 2024). These are robust to code obfuscation and enable extension to the multi-player case.
3. Existence and Characterization of Cooperative Program Equilibria
For the two-player Prisoner’s Dilemma, several robust cooperative Nash equilibria have been formally established:
- is a Nash equilibrium yielding , as the recursion ensures mutual cooperation almost surely.
- constitutes an equilibrium yielding , established via Löb’s theorem: implies (Oesterheld, 2022).
- also achieves cooperation, as can provably infer the cooperative tendency embedded in .
These constructions are compatible, supporting families of robust cooperative equilibria that tolerate syntactic and algorithmic variation.
In -player settings, simulation-based program equilibria are characterized as follows:
- With shared randomness (correlated program game), a folk theorem holds: any feasible and strictly individually rational payoff vector can be supported by a program equilibrium of correlated -GroundedBots. Coordination on triggers and punishment is enabled by shared random cutoffs (Cooper et al., 19 Dec 2024).
- With private randomness (uncorrelated program game), stricter constraints apply. The attainable payoffs are those strictly dominating the best mixtures under undetectable deviations, as codified by a penalty parameter that controls the detection trade-off. If utilities are additively separable, the set of feasible equilibria is widened (Cooper et al., 19 Dec 2024).
4. Compatibility, Generalizations, and Limits
Syntactically distinct strategies (randomized grounding vs. proof-search) are shown to be compatible and jointly support cooperative outcomes. Proof-based bots can cooperate with any GFB program via Löb-style arguments, and multi-parameter mixtures of GFBs are stable. PrudentBot variants using extended consistency (e.g., ), and probabilistic proof requirements, also integrate into this robust equilibrium family (Oesterheld, 2022).
Key limitations arise in multi-agent settings without shared randomness. The impossibility of full folk theorem enforcement: in the pirates’ dilemma (three players, strictly Pareto-optimal payoffs), cooperation cannot be sustained by simulationist programs because unobservable deviations elude collective punishment (Cooper et al., 19 Dec 2024). Coordination failure in private random times is fundamental.
5. Mathematical Programs with Equilibrium Constraints (MPECs)
A related but distinct instantiation involves optimization under equilibrium or complementarity constraints (MPECs), especially when data is polynomial. Formally, for , one minimizes subject to semialgebraic constraints and complementarity (). Equilibrium can be expressed via a lower-level value function (Jiao et al., 2019).
Global minimizers are found using moment–sum-of-squares (SOS) hierarchies, solved by semidefinite programming (SDP). Each relaxation corresponds to a truncated moment matrix and localizing matrices indexed by degree. The sequence of SDP solutions converges monotonically to the global minimum under Archimedean (compactness) conditions. Experiments demonstrate computational feasibility for small examples; matrix size is the main bottleneck (Jiao et al., 2019).
| Program Type | Halting Guarantee | Syntactic Robustness | Multi-Player Generality |
|---|---|---|---|
| Proof-Based Fair Bot (PFB) | Yes | Low–Medium | 2-player |
| -Grounded Fair Bot | Yes | High | 2-player (original) |
| -GroundedBot | Yes | High | -player (Cooper et al., 19 Dec 2024) |
6. Illustrative Examples and Applications
In the canonical one-shot Prisoner’s Dilemma (), correlated -GroundedBots with grim-trigger policies support mutual cooperation for small ; a single deviation triggers punishment with probability , implying approximately optimal payoffs (Cooper et al., 19 Dec 2024).
The trust game demonstrates mixed-strategy equilibrium with uncorrelated -GroundedBots: mixing greedy and charitable responses enforces a stable equilibrium indistinguishable from true mixed strategies, with detection and punishment dependent on random stopping (Cooper et al., 19 Dec 2024).
Polynomial MPECs are solved by SDP relaxations, as evidenced by small-scale benchmarks in (Jiao et al., 2019). Realistic use is currently limited to problems with and relaxation order .
7. Implications for AI, Multi-Agent Systems, and Economic Mechanisms
The program equilibrium paradigm expands the set of attainable cooperative solutions in strategic settings once agents have transparent access to each other’s source code. Randomization, proof-based reasoning, and simulation protocols are mutually compatible, suggesting robust frameworks for multi-agent trust and commitment without requiring identical implementations. The necessity of shared randomness for full coordination in -player games is fundamental. SDP-based techniques for polynomial games with equilibrium and complementarity constraints provide tractable global optimization methods for small to medium scale problems. These developments underpin advances in programmatic contract design, AI alignment, and mechanism design in transparent agent environments (Oesterheld, 2022, Cooper et al., 19 Dec 2024, Jiao et al., 2019).