SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.04635 · 2020

Learning to Play No-Press Diplomacy with Best Response Policy Iteration

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2006.04635.json · badge: /api/ran/2006.04635.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
deepmind/diplomacy canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
area_from_province_id_and_area_index Ran
ran on a synthesized input
deepmind/diplomacy/environment/observation_utils.py
code served (permissive licence) · get_code("b24176c20052074e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# First, let's understand the function requirements
# area_from_province_id_and_area_index takes:
# - province_id: an integer between 0 and SINGLE_COASTED_PROVINCES + BICOASTAL_PROVINCES - 1
# - area_index: an integer that is 0 for main area, or 1 or 2 for coasts in bicoastal provinces

# The function looks up these values in _prov_and_area_id_to_area dictionary
# which is pre-populated by the province_id_and_area_index function

# Let's compute the valid ranges:
SINGLE_COASTED_PROVINCES = 72
BICOASTAL_PROVINCES = 3
NUM_AREAS = SINGLE_COASTED_PROVINCES + 3 * BICOASTAL_PROVINCES  # 72 + 9 = 81

# Valid province_ids: 0 to 74 (72 + 3)
# Valid area_indices: 0 for single coasted, 0-2 for bicoastal

# Build the lookup dictionary just like in the code
def province_id_and_area_index(area):
    if area < SINGLE_COASTED_PROVINCES:
        return (area, 0)
    province_id = SINGLE_COASTED_PROVINCES + (area - SINGLE_COASTED_PROVINCES) // 3
    area_index = (area - SINGLE_COASTED_PROVINCES) % 3
    return (province_id, area_index)

_prov_and_area_id_to_area = {province_id_and_area_index(area): area for area in range(NUM_AREAS)}

# Now let's create valid test cases
# Case 1: A single coasted province (province_id=0, area_index=0)
# This maps to area 0
province_id_1 = 0
area_index_1 = 0

# Case 2: A bicoastal province (province_id=72, area_index=1)
# This should be in the dictionary
province_id_2 = 72
area_index_2 = 1

# Verify these are in the dictionary
assert (province_id_1, area_index_1) in _prov_and_area_id_to_area
assert (province_id_2, area_index_2) in _prov_and_area_id_to_area

ARGS = {
    "province_id": 0,
    "area_index": 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
bits_between Ran
ran on a synthesized input
deepmind/diplomacy/environment/action_utils.py
code served (permissive licence) · get_code("9f265ecb735864f7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

def bits_between(number: int, start: int, end: int):
    """Returns bits between positions start and end from number."""
    return number % (1 << end) // (1 << start)

ARGS = {
    "number": 255,
    "start": 2,
    "end": 6,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_adjacency Ran
ran on a synthesized input
deepmind/diplomacy/environment/province_order.py
code served (permissive licence) · get_code("5522024f643ab7c5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (5, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct a minimal MDF content string that will be parsed by build_adjacency
# The format requires:
# - Lines 0-3: header (skipped)
# - Lines 4 to -1: province definitions and adjacencies
# - Last line: footer (skipped)

mdf_content = """# Header line 1
# Header line 2
# Header line 3
# Header line 4
PAR AMY FLT ENG GAS SPA SPA/NC
GAS AMY FLT PAR ENG
ENG AMY FLT PAR GAS SPA
SPA AMY FLT GAS ENG SPA/NC
SPA/NC FLT PAR SPA
# Footer
"""

ARGS = {
    "mdf_content": mdf_content,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (5, 5) — shape (5, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
normalize_adjacency Ran
ran on a synthesized input
deepmind/diplomacy/network/network.py
code served (permissive licence) · get_code("05f90563b3dd36e0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small adjacency matrix (4x4) without self-connections
# This represents a simple graph with 4 nodes
adjacency = np.array([
    [0., 1., 1., 0.],
    [1., 0., 1., 1.],
    [1., 1., 0., 1.],
    [0., 1., 1., 0.]
], dtype=np.float32)

ARGS = {
    "adjacency": adjacency
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
province_id_and_area_index Ran
ran on a synthesized input
deepmind/diplomacy/environment/observation_utils.py
code served (permissive licence) · get_code("e048ad2e34eeb6d7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Test valid arguments for province_id_and_area_index

ARGS = {
    "area": 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
province_type_from_id Ran
ran on a synthesized input
deepmind/diplomacy/environment/observation_utils.py
code served (permissive licence) · get_code("10951c3c4da89184")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ProvinceType. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import enum

ProvinceID = int

class ProvinceType(enum.Enum):
    LAND = 0
    SEA = 1
    COASTAL = 2
    BICOASTAL = 3

def province_type_from_id(province_id: ProvinceID) -> ProvinceType:
    """Returns the ProvinceType for the province."""
    if province_id < 14:
        return ProvinceType.LAND
    elif province_id < 33:
        return ProvinceType.SEA
    elif province_id < 72:
        return ProvinceType.COASTAL
    elif province_id < 75:
        return ProvinceType.BICOASTAL
    else:
        raise ValueError('Invalid ProvinceID (too large)')

ARGS = {
    "province_id": 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ProvinceType — a ProvinceType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ProvinceType output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_mdf_content Not yet run
unverified (harvested, no recorded run)
deepmind/diplomacy/environment/province_order.py
code served (permissive licence) · get_code("dacef2d6e84f8c06")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent advances in deep reinforcement learning (RL) have led to considerable progress in many 2-player zero-sum games, such as Go, Poker and Starcraft. The purely adversarial nature of such games allows for conceptually simple and principled application of RL methods. However real-world settings are many-agent, and agent interactions are complex mixtures of common-interest and competitive aspects. We consider Diplomacy, a 7-player board game designed to accentuate dilemmas resulting from many-agent interactions. It also features a large combinatorial action space and simultaneous moves, which are challenging for RL algorithms. We propose a simple yet effective approximate best response operator, designed to handle large combinatorial action spaces and simultaneous moves. We also introduce a family of policy iteration methods that approximate fictitious play. With these methods, we successfully apply RL to Diplomacy: we show that our agents convincingly outperform the previous state-of-the-art, and game theoretic equilibrium analysis shows that the new process yields consistent improvements.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2006.04635")
get_code_for_paper("2006.04635")
have("2006.04635")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2006.04635.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2006.04635.svg)](https://syntology.ai/paper/2006.04635)

Connect an agent — have() is free.