SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.08393 · ICLR · 2024

NfgTransformer: Equivariant Representation Learning for Normal-form Games

Nicolas Heess, Ian Gemp, Luke Marris, Siqi Liu, Georgios Piliouras

arXiv · PDF · Open in the Atlas

Code that ran

8 of 19 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, 1 violated it and 0 have no contract verdict; 2 failures of our instrument; 11 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/2402.08393.json · badge: /api/ran/2402.08393.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
QB3/discrating canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
google-deepmind/nfg_transformer canonical (classifier label)
classifier basis: classifier_2025
2 ran · 11 no recorded run
FunctionStatusWhere it lives
_to_joint_actions Ran
ran, honoured the contract we drafted
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("90eee19a6858abd2")
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 4, dtype family float, shape (2, 3, 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 action embeddings for multiple players
# Each player has a different number of actions with different embedding dimensions
player_1_actions = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0],
    [9.0, 10.0, 11.0, 12.0]
], dtype=jnp.float32)

player_2_actions = jnp.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.6, 0.7, 0.8]
], dtype=jnp.float32)

action_embeddings = [player_1_actions, player_2_actions]

ARGS = {
    "action_embeddings": action_embeddings
}
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 4, dtype family float, shape (2, 3, 2, 4) — shape (2, 3, 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
attend Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("fc685f4567c883f5")
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, 20) 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

# Set seed for reproducibility
jax.config.update('jax_default_prng_impl', 'threefry2x32')

# Define small tensor dimensions
q_indices = 2
kv_indices = 3
num_heads = 4
head_dim = 5

# Create query tensor: [q_indices, num_heads, head_dim]
q = jnp.ones((q_indices, num_heads, head_dim), dtype=jnp.float32)

# Create key tensor: [kv_indices, num_heads, head_dim]
k = jnp.ones((kv_indices, num_heads, head_dim), dtype=jnp.float32)

# Create value tensor: [kv_indices, num_heads, head_dim]
v = jnp.ones((kv_indices, num_heads, head_dim), dtype=jnp.float32)

# Create attention mask: [q_indices, kv_indices]
# True means attend, False means mask out
attention_mask = jnp.ones((q_indices, kv_indices), dtype=jnp.bool_)

ARGS = {
    "q": q,
    "k": k,
    "v": v,
    "attention_mask": attention_mask,
}
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, 20) — shape (2, 20) 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
get_energy Ran
ran, honoured the contract we drafted
QB3/discrating/discrating/utils.py
code served (permissive licence) · get_code("af09e632468fd34f")
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

# Create small numpy arrays with distinct dimensions
# us: n_features x n_components
# vs: n_features x n_components
n_features = 5
n_components = 3

us = np.random.randn(n_features, n_components)
vs = np.random.randn(n_features, n_components)

ARGS = {
    "us": us,
    "vs": vs
}
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
get_main_component Ran
ran, honoured the contract we drafted
QB3/discrating/discrating/utils_plot.py
code served (permissive licence) · get_code("f96895b69fb5eab8")
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 (2, 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 numpy as np

# Construct a small square matrix for testing
# The function computes A @ A, then gets eigenvalues and eigenvectors
# We need a 2D square matrix
A = np.array([[1.0, 0.5], [0.5, 2.0]], dtype=np.float64)

ARGS = {
    "A": A
}
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 (2, 2) — shape (2, 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
projection_plane Ran
ran, honoured the contract we drafted
QB3/discrating/discrating/utils_plot.py
code served (permissive licence) · get_code("5940a263a759090e")
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 float; 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.

import numpy as np

# Create small numpy arrays for the function parameters
x = np.array([1.0, 2.0, 3.0, 4.0])
u = np.array([0.5, 0.5, 0.5, 0.5])
v = np.array([1.0, 0.0, 1.0, 0.0])

ARGS = {
    "x": x,
    "u": u,
    "v": v
}
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 tuple, ndim 1, dtype family float — 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
rotate Ran
ran, violated the contract we drafted
QB3/discrating/discrating/utils_plot.py
code served (permissive licence) · get_code("60ca657d098223c8")
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 2, dtype family float; 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.

import numpy as np

# Create small numpy arrays for u and v
# The function expects 1D arrays since it accesses shape[0]
u = np.array([1.0, 2.0, 3.0, 4.0])
v = np.array([0.5, 1.5, 2.5, 3.5])

ARGS = {
    "u": u,
    "v": v
}
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 tuple, ndim 2, dtype family float — 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
squared_loss Ran
ran, honoured the contract we drafted
QB3/discrating/discrating/utils.py
code served (permissive licence) · get_code("deb49abf6e0d418f")
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 float64, ndim 0, dtype family float; 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.

import numpy as np
from scipy.sparse import csc_matrix, lil_matrix

np.random.seed(0)

# Create small test matrices
n_features = 4
n_components = 3

# Create us and vs matrices (n_features x n_components)
us = np.random.randn(n_features, n_components).astype(np.float64)
vs = np.random.randn(n_features, n_components).astype(np.float64)

# Create a sparse matrix A (n_features x n_features)
A_dense = np.random.randn(n_features, n_features)
A_sparse = csc_matrix(A_dense)

# Create a dense matrix A for testing the non-sparse path
A_dense_test = np.random.randn(n_features, n_features).astype(np.float64)

# Create an optional mask
mask = np.random.rand(n_features, n_features) > 0.5
mask = mask.astype(np.float64)

# Test with sparse A and no mask
ARGS = {
    "A": A_sparse,
    "us": us,
    "vs": vs,
    "mask": None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
squared_loss_sparse Ran
ran; our contract draft was wrong, not the code
QB3/discrating/discrating/utils.py
code served (permissive licence) · get_code("afe10bed08a1252d")
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 float64, ndim 0, dtype family float; 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.

import numpy as np
import scipy.sparse as sp

# Create small test matrices
n_features = 4
n_components = 3

# Create us and vs - these are the factor matrices
us = np.random.randn(n_features, n_components).astype(np.float64)
vs = np.random.randn(n_features, n_components).astype(np.float64)

# Create a sparse matrix A with some non-zero entries
# Using a small 4x4 sparse matrix with a few non-zero values
A_dense = np.array([
    [0.5, 0.0, 0.3, 0.0],
    [0.0, 0.8, 0.0, 0.0],
    [0.2, 0.0, 0.0, 0.6],
    [0.0, 0.0, 0.4, 0.0]
], dtype=np.float64)
A = sp.csr_matrix(A_dense)

# Create a mask (optional parameter)
mask = np.ones((n_features, n_features), dtype=np.float64)
mask[0, 0] = 0.5  # Give it some variation

ARGS = {
    "A": A,
    "us": us,
    "vs": vs,
    "mask": mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
Attention Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("98ce511a0e4fa8fa")
How it ran

no invocation recorded.

CrossAttention Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("32711727edad3841")
How it ran

no invocation recorded.

Dense Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("68b110bcde6505cc")
How it ran

no invocation recorded.

NfgTransformer Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("804b2063b11271f3")
How it ran

no invocation recorded.

NfgTransformerBlock Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("cb256f313e907f48")
How it ran

no invocation recorded.

SelfAttention Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("82aeead71a0a530e")
How it ran

no invocation recorded.

attend Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("56c9eecffbda9cab")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

conv_1d Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("6c49dd5b70757c14")
How it ran

no invocation recorded.

conv_1d Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("58bb57a72c820895")
How it ran

no invocation recorded.

layer_norm Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("662a6c7691ca6ce4")
How it ran

no invocation recorded.

layer_norm Not yet run
unverified (harvested, no recorded run)
google-deepmind/nfg_transformer/nfg_transformer/network.py
code served (permissive licence) · get_code("8cb271e59820a9a9")
How it ran

no invocation recorded.

Also present in other papers' code

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

Normal-form games (NFGs) are the fundamental model of strategic interaction. We study their representation using neural networks. We describe the inherent equivariance of NFGs -any permutation of strategies describes an equivalent game -as well as the challenges this poses for representation learning. We then propose the NfgTransformer 1 architecture that leverages this equivariance, leading to state-of-the-art performance in a range of game-theoretic tasks including equilibrium-solving, deviation gain estimation and ranking, with a common approach to NFG representation. We show that the resulting model is interpretable and versatile, paving the way towards deep learning systems capable of gametheoretic reasoning when interacting with humans and with each other.

For agents

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

get_harvested_code_for_paper("2402.08393")
get_code_for_paper("2402.08393")
have("2402.08393")

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

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

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

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

Connect an agent — have() is free.