SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.04799 · 2021

Pretraining Representations for Data-Efficient Reinforcement Learning

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 1 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 1 failure of our instrument; 2 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/2106.04799.json · badge: /api/ran/2106.04799.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
mila-iqia/SGI canonical (classifier label)
classifier basis: census
11 ran · 2 no recorded run
FunctionStatusWhere it lives
count_parameters Ran
ran, honoured the contract we drafted
mila-iqia/SGI/src/utils.py
code served (permissive licence) · get_code("f6b944f50d3f15ae")
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 int, ndim 0, dtype family int, 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)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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 int, ndim 0, dtype family int, 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
delete_ind_from_array Ran
ran on a synthesized input
mila-iqia/SGI/src/rlpyt_utils.py
code served (permissive licence) · get_code("61a60f9cfd573aa4")
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, 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 numpy as np

# Create a small numpy array
array = np.array([[1, 2, 3, 4],
                  [5, 6, 7, 8],
                  [9, 10, 11, 12]], dtype=np.float32)

# Index to delete
ind = 1

ARGS = {
    "array": array,
    "ind": ind
}
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, 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
delete_ind_from_tensor Ran
ran on a synthesized input
mila-iqia/SGI/src/rlpyt_utils.py
code served (permissive licence) · get_code("8e94ba500fb8f42e")
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 (1, 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)

# Create a small tensor with batch size 2 and dimension 4
tensor = torch.randn(2, 4)

# Create an index to delete (0, 1, or another valid index)
ind = 0

ARGS = {
    "tensor": tensor,
    "ind": ind,
}
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 (1, 4) — shape (1, 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
discount_return_n_step Ran
ran on a synthesized input
mila-iqia/SGI/src/efficient_sampling_offline_dataset.py
code served (permissive licence) · get_code("92193540e742439a")
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 3, 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 torch

torch.manual_seed(0)

# Create small tensors with distinct dimensions for clarity
# Time dimension: 5, Batch dimension: 2
T = 5
B = 2

# reward: time-major, shape [T] or [T, B]
reward = torch.randn(T, B, dtype=torch.float32)

# done: time-major, same shape as reward
done = torch.bernoulli(torch.full((T, B), 0.3)).float()

# n_step: number of steps for n-step return
n_step = 3

# discount: discount factor
discount = 0.99

# return_dest: optional destination tensor (not used in function body, so None is fine)
return_dest = None

# done_n_dest: optional destination tensor (not used in function body, so None is fine)
done_n_dest = None

# do_truncated: whether to compute truncated returns at the end
do_truncated = False

ARGS = {
    "reward": reward,
    "done": done,
    "n_step": n_step,
    "discount": discount,
    "return_dest": return_dest,
    "done_n_dest": done_n_dest,
    "do_truncated": do_truncated,
}
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 tuple, ndim 3, 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
exp_distance Ran
ran on a synthesized input
mila-iqia/SGI/src/scrl.py
code served (permissive licence) · get_code("4050f8e6605a852d")
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 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
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# x and y should have the same shape for the function to work
# Let's use batch size 2 and feature dimension 4
x = torch.randn(2, 4)
y = torch.randn(2, 4)

# t is a temperature parameter (scalar)
t = torch.tensor(0.5)

ARGS = {
    "x": x,
    "y": y,
    "t": t
}
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 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
grouper Ran
ran; our contract draft was wrong, not the code
mila-iqia/SGI/src/offline_dataset.py
pointer only (licence: MIT); the stored copy get_code serves, from CJReinforce/JOWA, is pointer only (licence: GPL-3.0) · get_code("2444d9ba3dc707f5")
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 CJReinforce/JOWA, and GPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

maybe_transform Ran
ran on a synthesized input
mila-iqia/SGI/src/models.py
code served (permissive licence) · get_code("859eff6ebe1d7425")
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 4, dtype family float, shape (2, 4, 3, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple transform that processes images
class SimpleTransform(nn.Module):
    def forward(self, image):
        # Apply a simple transformation (e.g., multiply by 2)
        return image * 2

transform = SimpleTransform()

# Create a sample image tensor with shape (batch, channels, height, width)
# Using distinct sizes: batch=2, channels=4, height=3, width=5
image = torch.randn(2, 4, 3, 5)

ARGS = {
    "image": image,
    "transform": transform,
    "p": 0.8
}
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 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 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
norm_dist Ran
ran on a synthesized input
mila-iqia/SGI/src/scrl.py
code served (permissive licence) · get_code("129a64cdda027059")
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 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)

# Create small tensors with distinct dimensions
# x and y need to be normalized along the last dimension
# t is a scalar that multiplies the distance
x = torch.randn(2, 4)  # batch_size=2, feature_dim=4
y = torch.randn(2, 4)  # batch_size=2, feature_dim=4
t = torch.tensor(0.5)  # scalar temperature parameter

ARGS = {
    "x": x,
    "y": y,
    "t": t
}
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 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
sanitize_batch Ran
ran on a synthesized input
mila-iqia/SGI/src/rlpyt_buffer.py
code served (permissive licence) · get_code("371be3f7fd66e816")
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 Batch. 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

torch.manual_seed(0)

class Batch:
    def __init__(self):
        # Time steps x batch size
        self.done = torch.zeros(5, 3, dtype=torch.bool)
        # Set one done flag to True to trigger the logic
        self.done[2, 1] = True
        
        # all_observation: time steps x batch size x obs_dim
        self.all_observation = torch.randn(5, 3, 4)
        
        # all_reward: time steps x batch size
        self.all_reward = torch.randn(5, 3)
        
        # return_: time steps x batch size
        self.return_ = torch.randn(5, 3)
        
        # done_n: time steps x batch size
        self.done_n = torch.zeros(5, 3, dtype=torch.bool)

batch = Batch()

ARGS = {
    "batch": batch
}
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 Batch — a Batch output has no array shape of its own; none 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
select_at_indexes Ran
ran on a synthesized input
mila-iqia/SGI/src/utils.py
code served (permissive licence) · get_code("983a035f6286cecf")
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 3, dtype family float, shape (2, 3, 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 torch

torch.manual_seed(0)

# Create indexes tensor with shape (2, 3)
# These will be indices into the last dimension of tensor
indexes = torch.tensor([[0, 1, 2], [1, 2, 0]])

# Create tensor with shape (2, 3, 4, 5)
# Leading dimensions (2, 3) match indexes.shape
# Remaining dimensions (4, 5) will be preserved
tensor = torch.randn(2, 3, 4, 5)

ARGS = {
    "indexes": indexes,
    "tensor": tensor,
}
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 3, dtype family float, shape (2, 3, 5) — shape (2, 3, 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
shuffle_batch_dim Ran
ran on a synthesized input
mila-iqia/SGI/src/offline_dataset.py
code served (permissive licence) · get_code("067b295e116b1fe5")
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 numpy as np
import tempfile
import os

torch.manual_seed(0)

# Create temporary directory for mmap files
temp_dir = tempfile.mkdtemp()

# Parameters for the tensors
T = 5  # time dimension
B = 4  # batch dimension
obs_dim = 3
action_dim = 2

# Create observations as a list of numpy arrays with mmap (since obs_on_disk=True)
obs_files = []
observations = []
for i in range(2):  # num_sources = 2
    obs_array = np.random.randn(T, B, obs_dim).astype(np.float32)
    obs_file = os.path.join(temp_dir, f'obs_{i}.npy')
    np.save(obs_file, obs_array)
    obs_mmap = np.load(obs_file, mmap_mode='r+')
    obs_mmap.filename = obs_file
    observations.append(obs_mmap)
    obs_files.append(obs_file)

# Create rewards as a list of tensors
rewards = [torch.randn(T, B) for _ in range(2)]

# Create actions as a list of tensors
actions = [torch.randn(T, B, action_dim) for _ in range(2)]

# Create dones as a list of tensors
dones = [torch.randint(0, 2, (T, B)).float() for _ in range(2)]

ARGS = {
    'observations': observations,
    'rewards': rewards,
    'actions': actions,
    'dones': dones,
    'obs_on_disk': True,
    'chunk_num': 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 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
calculate_returns Not yet run
unverified (harvested, no recorded run)
mila-iqia/SGI/src/scrl.py
code served (permissive licence) · get_code("5b01aec46fcf1f84")
How it ran

no invocation recorded.

get_augmentation Not yet run
unverified (harvested, no recorded run)
mila-iqia/SGI/src/utils.py
code served (permissive licence) · get_code("9139d90ffb041630")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 2 later) and 11 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
count_parameters 180 other papers
36 dated earlier, 7 the same month, 137 later · 8 only as an assembly brick
1705.08415 (2017-05)
Supervised Community Detection with Line Graph Neural Networks
1707.01926 (2017-07)
Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting
1808.09367 (2018-08)
Deriving Machine Attention from Human Rationales
and 177 more not named here
grouper 4 other papers
1 dated earlier, 3 later
1904.05146 (2019-04)
DeepSphere: towards an equivariant graph-based spherical CNN
2406.06037 (2024-06)
Investigating Pre-Training Objectives for Generalization in Vision-Based Reinforcement Learning
2410.00564 (2024-10)
Scaling Offline Model-Based RL via Jointly-Optimized World-Action Model Pretraining
and 1 more not named here

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

Data efficiency is a key challenge for deep reinforcement learning. We address this problem by using unlabeled data to pretrain an encoder which is then finetuned on a small amount of task-specific data. To encourage learning representations which capture diverse aspects of the underlying MDP, we employ a combination of latent dynamics modelling and unsupervised goal-conditioned RL. When limited to 100k steps of interaction on Atari games (equivalent to two hours of human experience), our approach significantly surpasses prior work combining offline representation pretraining with task-specific finetuning, and compares favourably with other pretraining methods that require orders of magnitude more data. Our approach shows particular promise when combined with larger models as well as more diverse, task-aligned observational data -- approaching human-level performance and data-efficiency on Atari in our best setting. We provide code associated with this work at https://github.com/mila-iqia/SGI.

For agents

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

get_harvested_code_for_paper("2106.04799")
get_code_for_paper("2106.04799")
have("2106.04799")

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

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

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

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

Connect an agent — have() is free.