SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.01528 · ICML · 2022

Large Batch Experience Replay

Matthieu Geist, Thibault Lahire, Emmanuel Rachelson

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 4 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/2110.01528.json · badge: /api/ran/2110.01528.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
sureli/laber canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
xavierchanglingli/regularized-optimal-experience-replay community
Papers with Code archive
2 ran · 4 no recorded run
FunctionStatusWhere it lives
Actor Ran
ran on a synthesized input · constructed an object; no result was computed
sureli/laber/LaBER/continuous/LABER_SAC.py
code served (permissive licence) · get_code("508f079e9d0ccf91")
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 an instance of its own class, Actor: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

ARGS = {
    "state_dim": 4,
    "action_dim": 3,
}
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 Actor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Actor 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
Batch Ran
ran on a synthesized input · constructed an object; no result was computed
xavierchanglingli/regularized-optimal-experience-replay/sac_learner.py
code served (permissive licence) · get_code("f9a1b229fd3fdc31")
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 an instance of its own class, Batch: the run constructed the object and did not call it, so no result was computed. 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 numpy as np
from dataclasses import dataclass

@dataclass
class Batch:
    observations: np.ndarray
    actions: np.ndarray
    rewards: np.ndarray
    masks: np.ndarray
    next_observations: np.ndarray
    priority: np.ndarray

# Create small numpy arrays with distinct dimensions
batch_size = 2
obs_dim = 4
action_dim = 3
reward_dim = 1

observations = np.random.randn(batch_size, obs_dim).astype(np.float32)
actions = np.random.randn(batch_size, action_dim).astype(np.float32)
rewards = np.random.randn(batch_size, reward_dim).astype(np.float32)
masks = np.random.randint(0, 2, size=(batch_size, 1)).astype(np.float32)
next_observations = np.random.randn(batch_size, obs_dim).astype(np.float32)
priority = np.random.rand(batch_size).astype(np.float32)

ARGS = {
    "observations": observations,
    "actions": actions,
    "rewards": rewards,
    "masks": masks,
    "next_observations": next_observations,
    "priority": priority,
}
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 Batch — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Batch 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
Critic Ran
ran on a synthesized input · constructed an object; no result was computed
sureli/laber/LaBER/continuous/LABER_SAC.py
code served (permissive licence) · get_code("4949a32e6cb9c3c5")
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 an instance of its own class, Critic: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

class Critic(nn.Module):

    def __init__(self, state_dim, action_dim):
        super(Critic, self).__init__()
        self.l1 = nn.Linear(state_dim + action_dim, 256)
        self.l2 = nn.Linear(256, 256)
        self.l3 = nn.Linear(256, 1)

    def forward(self, state, action):
        x = torch.cat((state, action), dim=1)
        x = torch.nn.functional.relu(self.l1(x))
        x = torch.nn.functional.relu(self.l2(x))
        return self.l3(x)


# Create arguments for Critic.__init__
state_dim = 4
action_dim = 3

ARGS = {
    "state_dim": state_dim,
    "action_dim": action_dim,
}

# Test instantiation
critic = Critic(**ARGS)

# Test forward pass with tiny tensors
batch_size = 2
state = torch.randn(batch_size, state_dim)
action = torch.randn(batch_size, action_dim)
output = critic(state, action)
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 Critic — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Critic 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
LABER_SAC Ran
ran on a synthesized input · constructed an object; no result was computed
sureli/laber/LaBER/continuous/LABER_SAC.py
code served (permissive licence) · get_code("4fe1a6b8253ee0a5")
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 an instance of its own class, LABER_SAC: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Normal
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

class ReplayBuffer:
    def __init__(self, state_dim, action_dim, max_size=1000):
        self.state_dim = state_dim
        self.action_dim = action_dim
        self.max_size = max_size
        self.ptr = 0
        self.size = 0
        
        self.states = torch.zeros((max_size, state_dim), dtype=torch.float32)
        self.actions = torch.zeros((max_size, action_dim), dtype=torch.float32)
        self.next_states = torch.zeros((max_size, state_dim), dtype=torch.float32)
        self.rewards = torch.zeros((max_size, 1), dtype=torch.float32)
        self.dones = torch.zeros((max_size, 1), dtype=torch.float32)
    
    def add(self, state, action, next_state, reward, done):
        self.states[self.ptr] = torch.FloatTensor(state)
        self.actions[self.ptr] = torch.FloatTensor(action)
        self.next_states[self.ptr] = torch.FloatTensor(next_state)
        self.rewards[self.ptr] = reward
        self.dones[self.ptr] = 1 - done
        
        self.ptr = (self.ptr + 1) % self.max_size
        self.size = min(self.size + 1, self.max_size)
    
    def sample(self, batch_size):
        indices = np.random.randint(0, self.size, size=batch_size)
        return (
            self.states[indices],
            self.actions[indices],
            self.next_states[indices],
            self.rewards[indices],
            self.dones[indices]
        )

state_dim = 4
action_dim = 3
replay_buffer = ReplayBuffer(state_dim, action_dim, max_size=1024)

for i in range(512):
    state = np.random.randn(state_dim)
    action = np.random.randn(action_dim)
    next_state = np.random.randn(state_dim)
    reward = np.random.randn(1)[0]
    done = False
    replay_buffer.add(state, action, next_state, reward, done)

ARGS = {
    "state_dim": state_dim,
    "action_dim": action_dim,
    "discount": 0.99,
    "tau": 0.005,
    "policy_freq": 2
}
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 LABER_SAC — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LABER_SAC 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_state Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sureli/laber/MinAtar_experiments/agents/dqn_LABER.py
code served (permissive licence) · get_code("acd5bcd47c0df9f6")
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 4, dtype family float, shape (1, 4, 2, 3) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')

def get_state(s):
    return torch.tensor(s, device=device).permute(2, 0, 1).unsqueeze(0).float()

# The function takes a single parameter 's' which is converted to a tensor,
# permuted from (H, W, C) to (C, H, W), and unsqueezed to add batch dimension.
# So 's' should be a 3D array-like with shape (height, width, channels)

s_value = [
    [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]],
    [[13, 14, 15, 16], [17, 18, 19, 20], [21, 22, 23, 24]]
]

ARGS = {
    's': s_value
}
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 4, dtype family float, shape (1, 4, 2, 3) — shape (1, 4, 2, 3) 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
grad_norm Ran
ran; our contract draft was wrong, not the code
xavierchanglingli/regularized-optimal-experience-replay/sac_learner.py
code served (permissive licence) · get_code("7f72e8b477521aba")
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 jax
import jax.numpy as jnp
import flax.linen as nn

class SimpleModel(nn.Module):
    @nn.compact
    def __call__(self, obs, action):
        x = jnp.concatenate([obs, action], axis=-1)
        x = nn.Dense(8)(x)
        x = nn.relu(x)
        output = nn.Dense(1)(x)
        return output

model = SimpleModel()

# Initialize model parameters
key = jax.random.PRNGKey(0)
obs_dummy = jnp.ones((2, 4))
action_dummy = jnp.ones((2, 3))
params = model.init(key, obs_dummy, action_dummy)['params']

# Create batch data
obs = jnp.ones((2, 4))
action = jnp.ones((2, 3))

ARGS = {
    'model': model,
    'params': params,
    'obs': obs,
    'action': action,
    'lambda_': 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
flax, jax — 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
world_dynamics Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sureli/laber/MinAtar_experiments/agents/dqn_LABER.py
code served (permissive licence) · get_code("a6eed9bf6f077596")
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 tuple. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 random
import numpy

torch.manual_seed(0)

# Create a minimal policy network
class PolicyNet(nn.Module):
    def __init__(self, num_actions):
        super().__init__()
        self.fc = nn.Linear(4, num_actions)
    
    def forward(self, x):
        # x shape: (batch, channels, height, width)
        # Flatten and pass through linear layer
        batch_size = x.shape[0]
        x_flat = x.view(batch_size, -1)
        return self.fc(x_flat)

# Create a minimal environment
class MockEnv:
    def __init__(self):
        self._state = numpy.random.randint(0, 256, (84, 84, 3), dtype=numpy.uint8)
    
    def state(self):
        return self._state
    
    def act(self, action):
        # Return reward and terminated flag
        self._state = numpy.random.randint(0, 256, (84, 84, 3), dtype=numpy.uint8)
        reward = random.random()
        terminated = False
        return reward, terminated

# Set up arguments
num_actions = 4
replay_start_size = 50
policy_net = PolicyNet(num_actions)
env = MockEnv()

# Create initial state
s = torch.tensor(env.state(), device='cpu').permute(2, 0, 1).unsqueeze(0).float()

ARGS = {
    't': 10,
    'replay_start_size': replay_start_size,
    'num_actions': num_actions,
    's': s,
    'env': env,
    'policy_net': policy_net
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — 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
Model Not yet run
unverified (harvested, no recorded run)
xavierchanglingli/regularized-optimal-experience-replay/sac_learner.py
code served (permissive licence) · get_code("a02561f614036415")
How it ran

no invocation recorded.

_update_jit_laber Not yet run
unverified (harvested, no recorded run)
xavierchanglingli/regularized-optimal-experience-replay/sac_learner.py
code served (permissive licence) · get_code("406850d16892ed44")
How it ran

no invocation recorded.

target_update Not yet run
unverified (harvested, no recorded run)
xavierchanglingli/regularized-optimal-experience-replay/sac_learner.py
code served (permissive licence) · get_code("e85be23fbac3d092")
How it ran

no invocation recorded.

update Not yet run
unverified (harvested, no recorded run)
xavierchanglingli/regularized-optimal-experience-replay/sac_learner.py
code served (permissive licence) · get_code("33815b2ad6fcd3d0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 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_state 2 other papers
2 dated earlier
1207.4708 (2012-07)
The Arcade Learning Environment: An Evaluation Platform for General Agents
1903.03176 (2019-03)
MinAtar: An Atari-Inspired Testbed for Thorough and Reproducible Reinforcement Learning Experiments
world_dynamics 2 other papers
2 dated earlier
1207.4708 (2012-07)
The Arcade Learning Environment: An Evaluation Platform for General Agents
1903.03176 (2019-03)
MinAtar: An Atari-Inspired Testbed for Thorough and Reproducible Reinforcement Learning Experiments
update
brick of this paper's assembly: helper
1 other paper
1 later
2310.17966 (2023-10)
Train Once, Get a Family: State-Adaptive Balances for Offline-to-Online Reinforcement Learning

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

Several algorithms have been proposed to sample non-uniformly the replay buffer of deep Reinforcement Learning (RL) agents to speed-up learning, but very few theoretical foundations of these sampling schemes have been provided. Among others, Prioritized Experience Replay appears as a hyperparameter sensitive heuristic, even though it can provide good performance. In this work, we cast the replay buffer sampling problem as an importance sampling one for estimating the gradient. This allows deriving the theoretically optimal sampling distribution, yielding the best theoretical convergence speed. Elaborating on the knowledge of the ideal sampling scheme, we exhibit new theoretical foundations of Prioritized Experience Replay. The optimal sampling distribution being intractable, we make several approximations providing good results in practice and introduce, among others, LaBER (Large Batch Experience Replay), an easy-to-code and efficient method for sampling the replay buffer. LaBER, which can be combined with Deep Q-Networks, distributional RL agents or actor-critic methods, yields improved performance over a diverse range of Atari games and PyBullet environments, compared to the base agent it is implemented on and to other prioritization schemes.

For agents

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

get_harvested_code_for_paper("2110.01528")
get_code_for_paper("2110.01528")
have("2110.01528")

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

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

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

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

Connect an agent — have() is free.