SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.08419 · 2023

Mediated Multi-Agent Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 5 have no contract verdict; 1 failure of our instrument; 3 no recorded run), 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/2306.08419.json · badge: /api/ran/2306.08419.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
dimonenka/mediatedmarl canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
advantage Ran
ran on a synthesized input
dimonenka/mediatedmarl/pgg-iter/utils/loss.py
code served (permissive licence) · get_code("8c7e3cef3fc79db6")
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 Tensor, 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 torch
import numpy as np

torch.manual_seed(0)

# The function 'advantage' takes a single parameter A and returns it unchanged
# A appears to be an advantage tensor (commonly used in RL algorithms)
# We'll create a small tensor to represent advantages

A = torch.randn(2, 4)  # Small batch of advantages (batch_size=2, feature_dim=4)

ARGS = {
    "A": A
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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 (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
entropyLoss Ran
ran on a synthesized input
dimonenka/mediatedmarl/pgg-iter/utils/loss.py
code served (permissive licence) · get_code("45199345175f1284")
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 Tensor, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# The function takes prob and logProb tensors
# It expects them to be 2D (batch_size, dim)
# It computes (prob * logProb).sum(1).mean()
# - sum(1) sums along dimension 1 (across features)
# - mean() takes mean across the batch

# Create small tensors with distinct dimensions
batch_size = 2
feature_dim = 4

# prob: probability distribution (should be normalized, non-negative)
prob = torch.rand(batch_size, feature_dim)
prob = prob / prob.sum(1, keepdim=True)  # normalize to sum to 1

# logProb: log probabilities (should be negative or zero)
logProb = torch.log(prob + 1e-8)  # add small epsilon to avoid log(0)

ARGS = {
    "prob": prob,
    "logProb": logProb,
}
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 Tensor, 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
get_one_hot Ran
ran; our contract draft was wrong, not the code
dimonenka/mediatedmarl/pgg-iter/utils/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from Yikai-Wang/SPR-LNL, is pointer only (licence: NONE) · get_code("b215cd24009a0d36")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from Yikai-Wang/SPR-LNL, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

gini Ran
ran on a synthesized input
dimonenka/mediatedmarl/pgg-iter/utils/utils.py
code served (permissive licence) · get_code("a03a48883c66fa38")
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

# The gini function takes a single parameter 'array' which should be a numpy array
# The function flattens it, handles negative values, sorts it, and computes the Gini coefficient
# We need to provide a valid numpy array

# Create a small test array with positive values
test_array = np.array([[1.0, 2.0, 3.0, 4.0],
                       [5.0, 6.0, 7.0, 8.0]])

ARGS = {
    "array": test_array
}
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 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
iter_log Ran
ran on a synthesized input
dimonenka/mediatedmarl/tabular-games/env/log.py
code served (permissive licence) · get_code("6e54c0e702e14c93")
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. 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 torch
import torch.nn as nn
import numpy as np
import wandb

torch.manual_seed(0)

class SimplePolicy:
    def __init__(self, action_dim=2):
        self.probs = torch.tensor([[0.6, 0.4]], dtype=torch.float32)

class SimpleAgent(nn.Module):
    def __init__(self, input_dim=5, action_dim=2):
        super().__init__()
        self.net = nn.Linear(input_dim, action_dim)
        self.entropy_coef = 0.01
        self.device = torch.device('cpu')
        self.dtype = torch.float32
    
    def get_policy(self, obs):
        return SimplePolicy(action_dim=2)

class SimpleMediator(nn.Module):
    def __init__(self, input_dim=7, action_dim=2):
        super().__init__()
        self.net = nn.Linear(input_dim, action_dim)
        self.entropy_coef = 0.02
        self.device = torch.device('cpu')
        self.dtype = torch.float32
    
    def get_policy(self, obs):
        return SimplePolicy(action_dim=2)

class SimpleController(nn.Module):
    def __init__(self, num_agents=2):
        super().__init__()
        self.agents = [SimpleAgent() for _ in range(num_agents)]
        self.mediator = SimpleMediator()
        self.device = torch.device('cpu')
        self.dtype = torch.float32
    
    def _tensorify(self, inputs):
        tensors = [torch.tensor(x, dtype=self.dtype, device=self.device) if isinstance(x, (list, np.ndarray)) else x for x in inputs]
        concatenated = torch.cat([t.flatten() if t.dim() > 0 else t.unsqueeze(0) for t in tensors]).unsqueeze(0)
        return concatenated

controller = SimpleController(num_agents=2)

reward = [np.array([0.5, 0.7]), np.array([0.6, 0.8])]

pick_mediator = [np.array([0.3, 0.4]), np.array([0.35, 0.45])]

wandb.init(mode="disabled")

ARGS = {
    "controller": controller,
    "reward": reward,
    "pick_mediator": pick_mediator,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, wandb — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
valueLoss Ran
ran on a synthesized input
dimonenka/mediatedmarl/pgg-iter/utils/loss.py
code served (permissive licence) · get_code("8eb17d4e4bf84d61")
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 Tensor, 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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# The function valueLoss takes two parameters: v (predicted values) and returns (target returns)
# Both should be tensors that can be compared via MSE loss
# They should have the same shape

# Create small sample tensors
batch_size = 2
value_dim = 4

# Predicted values from a value function
v = torch.randn(batch_size, value_dim)

# Target returns (same shape as v)
returns = torch.randn(batch_size, value_dim)

ARGS = {
    "v": v,
    "returns": returns
}
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 Tensor, 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
env_creator Not yet run
unverified (harvested, no recorded run)
dimonenka/mediatedmarl/pgg-iter/utils/env_wrapper.py
code served (permissive licence) · get_code("a6a0a871de1b151c")
How it ran

no invocation recorded.

pd_log Not yet run
unverified (harvested, no recorded run)
dimonenka/mediatedmarl/tabular-games/env/log.py
code served (permissive licence) · get_code("74edcdc9a82ac74b")
How it ran

no invocation recorded.

process_webm Not yet run
unverified (harvested, no recorded run)
dimonenka/mediatedmarl/pgg-iter/utils/utils.py
code served (permissive licence) · get_code("51ce584eab92598f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

FunctionAlso present inEarliest-datedOthers named
get_one_hot 2 other papers
2 dated earlier
1909.10364 (2019-09)
Class-dependent Compression of Deep Neural Networks
2203.07788 (2022-03)
Scalable Penalized Regression for Noise Detection in Learning with Noisy Labels

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

The majority of Multi-Agent Reinforcement Learning (MARL) literature equates the cooperation of self-interested agents in mixed environments to the problem of social welfare maximization, allowing agents to arbitrarily share rewards and private information. This results in agents that forgo their individual goals in favour of social good, which can potentially be exploited by selfish defectors. We argue that cooperation also requires agents' identities and boundaries to be respected by making sure that the emergent behaviour is an equilibrium, i.e., a convention that no agent can deviate from and receive higher individual payoffs. Inspired by advances in mechanism design, we propose to solve the problem of cooperation, defined as finding socially beneficial equilibrium, by using mediators. A mediator is a benevolent entity that may act on behalf of agents, but only for the agents that agree to it. We show how a mediator can be trained alongside agents with policy gradient to maximize social welfare subject to constraints that encourage agents to cooperate through the mediator. Our experiments in matrix and iterative games highlight the potential power of applying mediators in MARL.

For agents

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

get_harvested_code_for_paper("2306.08419")
get_code_for_paper("2306.08419")
have("2306.08419")

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

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

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

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

Connect an agent — have() is free.