SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1810.02912 · 2018

Actor-Attention-Critic for Multi-Agent Reinforcement Learning

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 2 have no contract verdict; 4 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/1810.02912.json · badge: /api/ran/1810.02912.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
shariqiqbal2810/MAAC canonical (classifier label)
classifier basis: census
4 ran · 0 no recorded run
parnika31/MACAAC community (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
FunctionStatusWhere it lives
gumbel_softmax_sample Ran
ran on a synthesized input
shariqiqbal2810/MAAC/utils/misc.py
code served (permissive licence) · get_code("77260fe089db715e")
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 torch.nn.functional as F
from torch.autograd import Variable

torch.manual_seed(0)

# Create logits tensor: shape (batch_size=2, num_classes=4)
logits = torch.randn(2, 4)

# Set temperature for Gumbel-Softmax
temperature = 0.5

# Set dimension for softmax operation
dim = 1

ARGS = {
    "logits": logits,
    "temperature": temperature,
    "dim": dim
}
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 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
make_circle Ran
ran; our contract draft was wrong, not the code
parnika31/MACAAC/multiagent/rendering.py
code served (permissive licence) · get_code("f8dd361d2679d007")
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 FilledPolygon. 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 math

# Mock OpenGL functions since we don't have a display context
def glColor4f(*args):
    pass

def glLineWidth(width):
    pass

def glBegin(mode):
    pass

def glVertex3f(x, y, z):
    pass

def glEnd():
    pass

GL_QUADS = 7
GL_POLYGON = 9
GL_TRIANGLES = 4
GL_LINE_LOOP = 2
GL_LINE_STRIP = 3

# Include the provided classes
class Attr(object):
    def enable(self):
        raise NotImplementedError
    
    def disable(self):
        pass

class Color(Attr):
    def __init__(self, vec4):
        self.vec4 = vec4
    
    def enable(self):
        glColor4f(*self.vec4)

class LineWidth(Attr):
    def __init__(self, stroke):
        self.stroke = stroke
    
    def enable(self):
        glLineWidth(self.stroke)

class Geom(object):
    def __init__(self):
        self._color = Color((0, 0, 0, 1.0))
        self.attrs = [self._color]
    
    def render(self):
        for attr in reversed(self.attrs):
            attr.enable()
        self.render1()
        for attr in self.attrs:
            attr.disable()
    
    def render1(self):
        raise NotImplementedError
    
    def add_attr(self, attr):
        self.attrs.append(attr)
    
    def set_color(self, r, g, b, alpha=1):
        self._color.vec4 = (r, g, b, alpha)

class FilledPolygon(Geom):
    def __init__(self, v):
        Geom.__init__(self)
        self.v = v
    
    def render1(self):
        if len(self.v) == 4:
            glBegin(GL_QUADS)
        elif len(self.v) > 4:
            glBegin(GL_POLYGON)
        else:
            glBegin(GL_TRIANGLES)
        for p in self.v:
            glVertex3f(p[0], p[1], 0)
        glEnd()
        color = (self._color.vec4[0] * 0.5, self._color.vec4[1] * 0.5, self._color.vec4[2] * 0.5, self._color.vec4[3] * 0.5)
        glColor4f(*color)
        glBegin(GL_LINE_LOOP)
        for p in self.v:
            glVertex3f(p[0], p[1], 0)
        glEnd()

class PolyLine(Geom):
    def __init__(self, v, close):
        Geom.__init__(self)
        self.v = v
        self.close = close
        self.linewidth = LineWidth(1)
        self.add_attr(self.linewidth)
    
    def render1(self):
        glBegin(GL_LINE_LOOP if self.close else GL_LINE_STRIP)
        for p in self.v:
            glVertex3f(p[0], p[1], 0)
        glEnd()
    
    def set_linewidth(self, x):
        self.linewidth.stroke = x

def make_circle(radius=10, res=30, filled=True):
    points = []
    for i in range(res):
        ang = 2 * math.pi * i / res
        points.append((math.cos(ang) * radius, math.sin(ang) * radius))
    if filled:
        return FilledPolygon(points)
    else:
        return PolyLine(points, True)

ARGS = {
    "radius": 5,
    "res": 16,
    "filled": True
}
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 FilledPolygon — a FilledPolygon output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FilledPolygon 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
make_env Ran
ran on a synthesized input
shariqiqbal2810/MAAC/utils/make_env.py
code served (permissive licence) · get_code("0fb08f714e49a890")
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 MockMultiAgentEnv. 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 numpy as np

# Mock the scenario and environment classes
class MockEntity:
    def __init__(self):
        self.state = type('obj', (object,), {'p_pos': np.array([0.0, 0.0]), 'p_vel': np.array([0.0, 0.0])})()
        self.action = type('obj', (object,), {'u': np.array([0.0, 0.0])})()

class MockAgent(MockEntity):
    def __init__(self):
        super().__init__()
        self.movable = True
        self.silent = False

class MockLandmark(MockEntity):
    def __init__(self):
        super().__init__()
        self.movable = False

class MockWorld:
    def __init__(self):
        self.agents = [MockAgent(), MockAgent()]
        self.landmarks = [MockLandmark()]
        self.dt = 0.1
        self.dim_c = 0
        self.collaborative = False

class MockScenario:
    def make_world(self):
        return MockWorld()
    
    def reset_world(self, world):
        pass
    
    def reward(self, agent, world):
        return 0.0
    
    def observation(self, agent, world):
        return np.array([0.0, 0.0, 0.0, 0.0])
    
    def benchmark_data(self, agent, world):
        return {}

class MockScenarioModule:
    @staticmethod
    def load(scenario_path):
        class ScenarioWrapper:
            Scenario = MockScenario
        return ScenarioWrapper()

# Mock the MultiAgentEnv class
class MockMultiAgentEnv:
    def __init__(self, world, reset_callback=None, reward_callback=None, 
                 observation_callback=None, post_step_callback=None, 
                 info_callback=None, discrete_action=False):
        self.world = world
        self.reset_callback = reset_callback
        self.reward_callback = reward_callback
        self.observation_callback = observation_callback
        self.post_step_callback = post_step_callback
        self.info_callback = info_callback
        self.discrete_action = discrete_action
        self.n = len(world.agents) if hasattr(world, 'agents') else 2
        self.observation_space = [4] * self.n
        self.action_space = [2] * self.n
    
    def reset(self):
        if self.reset_callback:
            self.reset_callback(self.world)
        return [self.observation_callback(agent, self.world) for agent in self.world.agents]
    
    def step(self, actions):
        for i, agent in enumerate(self.world.agents):
            agent.action.u = actions[i]
        if self.post_step_callback:
            self.post_step_callback(self.world)
        rewards = [self.reward_callback(agent, self.world) for agent in self.world.agents]
        obs = [self.observation_callback(agent, self.world) for agent in self.world.agents]
        dones = [False] * len(self.world.agents)
        infos = [self.info_callback(agent, self.world) if self.info_callback else {} 
                 for agent in self.world.agents]
        return obs, rewards, dones, infos

# Patch the imports in the function's namespace
import sys
from types import ModuleType

multiagent_env_module = ModuleType('multiagent.environment')
multiagent_env_module.MultiAgentEnv = MockMultiAgentEnv
sys.modules['multiagent.environment'] = multiagent_env_module
sys.modules['multiagent'] = ModuleType('multiagent')
sys.modules['multiagent'].environment = multiagent_env_module

old_scenarios_module = ModuleType('multiagent.scenarios')
old_scenarios_module.load = MockScenarioModule.load
sys.modules['multiagent.scenarios'] = old_scenarios_module
sys.modules['multiagent'].scenarios = old_scenarios_module

new_scenarios_module = ModuleType('envs.mpe_scenarios')
new_scenarios_module.load = MockScenarioModule.load
sys.modules['envs.mpe_scenarios'] = new_scenarios_module
sys.modules['envs'] = ModuleType('envs')
sys.modules['envs'].mpe_scenarios = new_scenarios_module

ARGS = {
    'scenario_name': 'simple_spread',
    'benchmark': False,
    'discrete_action': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
envs, multiagent, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockMultiAgentEnv — a MockMultiAgentEnv output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockMultiAgentEnv 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
make_polygon Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
parnika31/MACAAC/multiagent/rendering.py
code served (permissive licence) · get_code("ea4edded084fb348")
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 FilledPolygon. 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.

# Mock OpenGL functions since we can't use actual OpenGL
def glColor4f(*args):
    pass

def glBegin(mode):
    pass

def glEnd():
    pass

def glVertex3f(x, y, z):
    pass

def glLineWidth(width):
    pass

GL_QUADS = 0x0007
GL_POLYGON = 0x0009
GL_TRIANGLES = 0x0004
GL_LINE_LOOP = 0x0002
GL_LINE_STRIP = 0x0003

# Define the classes from the function
class Attr(object):
    def enable(self):
        raise NotImplementedError

    def disable(self):
        pass

class Color(Attr):
    def __init__(self, vec4):
        self.vec4 = vec4

    def enable(self):
        glColor4f(*self.vec4)

class LineWidth(Attr):
    def __init__(self, stroke):
        self.stroke = stroke

    def enable(self):
        glLineWidth(self.stroke)

class Geom(object):
    def __init__(self):
        self._color = Color((0, 0, 0, 1.0))
        self.attrs = [self._color]

    def render(self):
        for attr in reversed(self.attrs):
            attr.enable()
        self.render1()
        for attr in self.attrs:
            attr.disable()

    def render1(self):
        raise NotImplementedError

    def add_attr(self, attr):
        self.attrs.append(attr)

    def set_color(self, r, g, b, alpha=1):
        self._color.vec4 = (r, g, b, alpha)

class FilledPolygon(Geom):
    def __init__(self, v):
        Geom.__init__(self)
        self.v = v

    def render1(self):
        if len(self.v) == 4:
            glBegin(GL_QUADS)
        elif len(self.v) > 4:
            glBegin(GL_POLYGON)
        else:
            glBegin(GL_TRIANGLES)
        for p in self.v:
            glVertex3f(p[0], p[1], 0)
        glEnd()
        color = (self._color.vec4[0] * 0.5, self._color.vec4[1] * 0.5, self._color.vec4[2] * 0.5, self._color.vec4[3] * 0.5)
        glColor4f(*color)
        glBegin(GL_LINE_LOOP)
        for p in self.v:
            glVertex3f(p[0], p[1], 0)
        glEnd()

class PolyLine(Geom):
    def __init__(self, v, close):
        Geom.__init__(self)
        self.v = v
        self.close = close
        self.linewidth = LineWidth(1)
        self.add_attr(self.linewidth)

    def render1(self):
        glBegin(GL_LINE_LOOP if self.close else GL_LINE_STRIP)
        for p in self.v:
            glVertex3f(p[0], p[1], 0)
        glEnd()

    def set_linewidth(self, x):
        self.linewidth.stroke = x

def make_polygon(v, filled=True):
    if filled:
        return FilledPolygon(v)
    else:
        return PolyLine(v, True)

# Create test arguments
vertices = [(0.0, 0.0), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)]

ARGS = {
    'v': vertices,
    'filled': True
}
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 FilledPolygon — a FilledPolygon output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FilledPolygon 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
onehot_from_logits Ran
ran; our contract draft was wrong, not the code
shariqiqbal2810/MAAC/utils/misc.py
code served (permissive licence) · get_code("e47eaea5616287c6")
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
from torch.autograd import Variable
import numpy as np

torch.manual_seed(0)

# Create a batch of logits with shape (batch_size=2, num_actions=4)
logits = torch.randn(2, 4)

# Create arguments dict
ARGS = {
    "logits": logits,
    "eps": 0.1,
    "dim": 1
}
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
sample_gumbel Ran
ran; our contract draft was wrong, not the code
shariqiqbal2810/MAAC/utils/misc.py
code served (permissive licence) · get_code("43c7e814609746ee")
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 (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
from torch.autograd import Variable

torch.manual_seed(0)

ARGS = {
    "shape": (2, 4),
    "eps": 1e-20,
    "tens_type": torch.FloatTensor,
}
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 (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
get_display Not yet run
unverified (harvested, no recorded run)
parnika31/MACAAC/multiagent/rendering.py
code served (permissive licence) · get_code("5d8ce3d017e5f6d8")
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, 5 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 4 later) and 2 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
make_circle 4 other papers
4 later
2007.03102 (2020-07)
Natural Emergence of Heterogeneous Strategies in Artificially Intelligent Competitive Teams
2008.02840 (2020-08)
Assisted Perception: Optimizing Observations to Communicate State
2011.00401 (2020-11)
The MAGICAL Benchmark for Robust Imitation
and 1 more not named here
get_display 3 other papers
3 later
2006.07869 (2020-06)
Benchmarking Multi-Agent Deep Reinforcement Learning Algorithms in Cooperative Tasks
2008.02840 (2020-08)
Assisted Perception: Optimizing Observations to Communicate State
2505.05262 (2025-05)
Enhancing Cooperative Multi-Agent Reinforcement Learning with State Modelling and Adversarial Exploration
make_polygon 3 other papers
3 later
2007.03102 (2020-07)
Natural Emergence of Heterogeneous Strategies in Artificially Intelligent Competitive Teams
2008.02840 (2020-08)
Assisted Perception: Optimizing Observations to Communicate State
2505.05262 (2025-05)
Enhancing Cooperative Multi-Agent Reinforcement Learning with State Modelling and Adversarial Exploration
sample_gumbel 2 other papers
1 dated earlier, 1 later
1706.02275 (2017-06)
Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments
2006.09447 (2020-06)
Agent Modelling under Partial Observability for Deep Reinforcement Learning
onehot_from_logits 1 other paper
1 dated earlier
1706.02275 (2017-06)
Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments

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-24.

Repositories linked to this paper

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

Abstract

Reinforcement learning in multi-agent scenarios is important for real-world applications but presents challenges beyond those seen in single-agent settings. We present an actor-critic algorithm that trains decentralized policies in multi-agent settings, using centrally computed critics that share an attention mechanism which selects relevant information for each agent at every timestep. This attention mechanism enables more effective and scalable learning in complex multi-agent environments, when compared to recent approaches. Our approach is applicable not only to cooperative settings with shared rewards, but also individualized reward settings, including adversarial settings, as well as settings that do not provide global states, and it makes no assumptions about the action spaces of the agents. As such, it is flexible enough to be applied to most multi-agent learning problems.

For agents

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

get_harvested_code_for_paper("1810.02912")
get_code_for_paper("1810.02912")
have("1810.02912")

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

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

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

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

Connect an agent — have() is free.