SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.10125 · NeurIPS · 2022

Proximal Learning With Opponent-Learning Awareness

Jakob Foerster, Stephen Zhao, Roger Grosse, Chris Lu

arXiv · PDF · Open in the Atlas

Code that ran

7 of 20 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 13 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-23; 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/2210.10125.json · badge: /api/ran/2210.10125.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
silent-zebra/pola canonical (classifier label)
classifier basis: classifier_2025
7 ran · 12 no recorded run
alshedivat/lola predecessor (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
bin_inttensor_from_int Ran
ran, honoured the contract we drafted
silent-zebra/pola/LOLA_exact.py
code served (permissive licence) · get_code("85d7bd3c92bc8523")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 1, dtype family float, shape (8,) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T00:44:53Z). 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

torch.manual_seed(0)

# The function takes two parameters:
# x: an integer to convert to binary
# n: the number of bits to pad/fill to

ARGS = {
    "x": 42,
    "n": 8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (8,) — shape (8,) 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_bin_matrix Ran
ran, honoured the contract we drafted
silent-zebra/pola/LOLA_exact.py
code served (permissive licence) · get_code("d21cebee917ab27f")
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) and returned Tensor, ndim 2, dtype family float, shape (8, 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 torch

torch.manual_seed(0)

ARGS = {
    "n": 4,
    "size": 8
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (8, 4) — shape (8, 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
build_p_vector Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
silent-zebra/pola/LOLA_exact.py
code served (permissive licence) · get_code("321a0e5deba583ee")
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) and returned Tensor, ndim 1, dtype family float, shape (2,) 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

torch.manual_seed(0)

# Analyze the function:
# - n: used in reshape(size, n) - should be an integer
# - size: used in repeat(size) and reshape(size, n) - should be an integer
# - pc: a tensor that gets repeat(size).reshape(size, n) - should be 1D tensor of length n
# - bin_mat: a tensor used in element-wise operations with pc reshaped, dim=1 for prod
#           should have shape (size, n) to match pc after reshape

n = 4
size = 2

# pc should be a 1D tensor of length n
pc = torch.tensor([0.3, 0.5, 0.7, 0.2])

# bin_mat should be shape (size, n) = (2, 4)
bin_mat = torch.tensor([
    [1.0, 0.0, 1.0, 0.0],
    [0.0, 1.0, 0.0, 1.0]
])

ARGS = {
    "n": n,
    "size": size,
    "pc": pc,
    "bin_mat": bin_mat
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
kl_div_jax Ran
ran, honoured the contract we drafted
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("70a992b1af899b2d")
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 ArrayImpl, ndim 0, dtype family float, 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 jax.numpy as jnp

# Create small probability distributions for KL divergence computation
# KL divergence expects probability distributions (non-negative, sum to 1)
# Using batch_size=2, dim=4

# Current distribution (predicted probabilities)
curr = jnp.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=jnp.float32)

# Target distribution (ground truth probabilities)
target = jnp.array([
    [0.05, 0.15, 0.3, 0.5],
    [0.1, 0.2, 0.3, 0.4]
], dtype=jnp.float32)

ARGS = {
    "curr": curr,
    "target": target
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, 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
magic_box Ran
ran, honoured the contract we drafted
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("f4166f1f2230b2e7")
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) and returned ArrayImpl, ndim 2, dtype family float, shape (2, 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 jax
import jax.numpy as jnp

# Create a small input tensor for the magic_box function
# The function takes x and applies exp(x - stop_gradient(x))
# stop_gradient(x) returns x but blocks gradients, so the result is exp(0) = 1
x = jnp.array([[1.0, 2.0, 3.0, 4.0],
                [5.0, 6.0, 7.0, 8.0]], dtype=jnp.float32)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
rev_kl_div_jax Ran
ran, honoured the contract we drafted
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("54e852578016625d")
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 ArrayImpl, ndim 0, dtype family float, 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 jax
import jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small valid probability distributions for curr and target
# Shape: (batch_size=2, dim=4)
# These should be valid probability distributions (sum to 1, all positive)
curr_data = np.array([
    [0.4, 0.3, 0.2, 0.1],
    [0.25, 0.25, 0.25, 0.25]
], dtype=np.float32)

target_data = np.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.1, 0.1, 0.3, 0.5]
], dtype=np.float32)

# Convert to jax arrays
curr = jnp.array(curr_data)
target = jnp.array(target_data)

ARGS = {
    "curr": curr,
    "target": target,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 0, dtype family float, 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
reverse_cumsum Ran
ran; our contract draft was wrong, not the code
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("61e0eb0133131d4c")
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) and returned ArrayImpl, ndim 2, dtype family float, shape (2, 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 jax.numpy as jnp

# Create a small test array
x = jnp.array([[1.0, 2.0, 3.0, 4.0],
                [5.0, 6.0, 7.0, 8.0]])

# Define axis parameter
axis = 1

ARGS = {
    "x": x,
    "axis": axis
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
ExactLOLA Not yet run
unverified (harvested, no recorded run)
alshedivat/lola/lola/exact.py
code served (permissive licence) · get_code("0c013af22fc97f3a")
How it ran

no invocation recorded.

act Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("80d4ccc33bef2e8a")
How it ran

no invocation recorded.

act_w_iter_over_obs Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("2d3d1538bb6f1ad4")
How it ran

no invocation recorded.

dice_objective Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("77647113e31f6449")
How it ran

no invocation recorded.

dice_objective_plus_value_loss Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("ed1c009c2edc43b1")
How it ran

no invocation recorded.

do_env_rollout Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("62939c089f70f346")
How it ran

no invocation recorded.

env_step Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("4d53c9d04908d6ae")
How it ran

no invocation recorded.

get_gae_advantages Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("9e8f3bdffe71694b")
How it ran

no invocation recorded.

get_init_hidden_states Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("42a79b923fa6137e")
How it ran

no invocation recorded.

get_policies_for_states Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("ea546e2113020484")
How it ran

no invocation recorded.

in_lookahead Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("ce0d8c80b05c9add")
How it ran

no invocation recorded.

update_gae_with_delta_backwards Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("2f998934ffa142d3")
How it ran

no invocation recorded.

value_loss Not yet run
unverified (harvested, no recorded run)
silent-zebra/pola/jax_files/POLA_dice_jax.py
code served (permissive licence) · get_code("063b9d334804c7ce")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 20 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 20 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-23.

Repositories linked to this paper

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

Abstract

Learning With Opponent-Learning Awareness (LOLA) (Foerster et al. [2018a]) is a multi-agent reinforcement learning algorithm that typically learns reciprocity-based cooperation in partially competitive environments. However, LOLA often fails to learn such behaviour on more complex policy spaces parameterized by neural networks, partly because the update rule is sensitive to the policy parameterization. This problem is especially pronounced in the opponent modeling setting, where the opponent's policy is unknown and must be inferred from observations; in such settings, LOLA is ill-specified because behaviourally equivalent opponent policies can result in non-equivalent updates. To address this shortcoming, we reinterpret LOLA as approximating a proximal operator, and then derive a new algorithm, proximal LOLA (POLA), which uses the proximal formulation directly. Unlike LOLA, the POLA updates are parameterization invariant, in the sense that when the proximal objective has a unique optimum, behaviourally equivalent policies result in behaviourally equivalent updates. We then present practical approximations to the ideal POLA update, which we evaluate in several partially competitive environments with function approximation and opponent modeling. This empirically demonstrates that POLA achieves reciprocity-based cooperation more reliably than LOLA.

For agents

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

get_harvested_code_for_paper("2210.10125")
get_code_for_paper("2210.10125")
have("2210.10125")

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

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

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

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

Connect an agent — have() is free.