SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2303.07109 · ICLR · 2023

Transformer-based World Models Are Happy With 100k Interactions

Tobias Uelwer, Stefan Harmeling, Marc Höftmann, Jan Robine

arXiv · PDF · Open in the Atlas

Code that ran

16 of 25 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 6 have no contract verdict; 8 failures of our instrument; 9 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/2303.07109.json · badge: /api/ran/2303.07109.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
jrobine/twm canonical (classifier label)
classifier basis: classifier_2025
16 ran · 9 no recorded run
FunctionStatusWhere it lives
AdamOptim Ran
ran on a synthesized input · constructed an object; no result was computed
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("006d91bc0bd061db")
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, AdamOptim: 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
from torch import nn, optim

torch.manual_seed(0)

# Create a simple neural network model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Instantiate the model
model = SimpleModel()

# Create a dummy loss tensor (scalar)
dummy_input = torch.randn(2, 4)
dummy_target = torch.randn(2, 3)
output = model(dummy_input)
loss = nn.MSELoss()(output, dummy_target)

# Define ARGS dictionary with all parameters for AdamOptim.__init__
ARGS = {
    'parameters': model.parameters(),
    'lr': 0.001,
    'betas': (0.9, 0.999),
    'eps': 1e-08,
    'weight_decay': 0,
    'grad_clip': 1.0
}
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 AdamOptim — 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 AdamOptim 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
PositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("e1c8c42def7db040")
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, PositionalEncoding: 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 math
import torch
from torch import nn

torch.manual_seed(0)

ARGS = {
    'dim': 4,
    'max_length': 8,
    'dropout_p': 0.1,
    'batch_first': False,
}
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 PositionalEncoding — 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 PositionalEncoding 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
RelativeMultiheadSelfAttention Ran
ran on a synthesized input · constructed an object; no result was computed
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("ea267d5f625dc1ca")
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, RelativeMultiheadSelfAttention: 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)

# Define the module
dim = 8
head_dim = 4
num_heads = 2
dropout_p = 0.1

model = nn.Module()

# Setup input tensors
tgt_length = 3
batch_size = 2
src_length = 5
pos_len = 7

x = torch.randn(tgt_length, batch_size, dim)
pos_encodings = torch.randn(pos_len, dim)
u_bias = torch.randn(1, 1, num_heads, head_dim)
v_bias = torch.randn(1, 1, num_heads, head_dim)

# Optional: attention mask (2D format)
attn_mask = torch.zeros(tgt_length, src_length, dtype=torch.bool)

# Optional: memory from previous steps
mems = torch.randn(2, batch_size, dim)

ARGS = {
    "dim": dim,
    "head_dim": head_dim,
    "num_heads": num_heads,
    "dropout_p": dropout_p,
}
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 RelativeMultiheadSelfAttention — 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 RelativeMultiheadSelfAttention 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
TransformerXLDecoder Ran
ran on a synthesized input · constructed an object; no result was computed
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("425555f50f17e87d")
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, TransformerXLDecoder: 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
import math

torch.manual_seed(0)

# Create a minimal decoder layer that satisfies the usage in TransformerXLDecoder
class MinimalDecoderLayer(nn.Module):
    def __init__(self, dim=4, num_heads=2, head_dim=2, dropout_p=0.1):
        super().__init__()
        self.dim = dim
        self.num_heads = num_heads
        self.head_dim = head_dim
        self.dropout_p = dropout_p
        # Minimal parameters to satisfy deepcopy
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, x, pos_enc, u_bias, v_bias, attn_mask=None, mems=None):
        # x: (seq_len, batch, dim)
        # pos_enc: (seq_len, batch, dim) or similar
        # u_bias: (num_heads, head_dim)
        # v_bias: (num_heads, head_dim)
        # mems: memory tensor
        # Return: (output, attention)
        batch_size = x.shape[1]
        seq_len = x.shape[0]
        
        # Simple pass-through with minimal computation
        out = self.linear(x)
        
        # Create dummy attention (batch, seq_len, seq_len, num_heads)
        attention = torch.ones(batch_size, seq_len, seq_len, self.num_heads)
        
        return out, attention

# Instantiate decoder layer
decoder_layer = MinimalDecoderLayer(dim=4, num_heads=2, head_dim=2, dropout_p=0.1)

# Create input tensors
batch_size = 2
seq_len = 3
dim = 4
max_length = 10
mem_length = 5
num_layers = 2

x = torch.randn(seq_len, batch_size, dim)
positions = torch.arange(seq_len)
attn_mask = None

ARGS = {
    'decoder_layer': decoder_layer,
    'num_layers': num_layers,
    'max_length': max_length,
    'mem_length': mem_length,
    'batch_first': False,
}
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 TransformerXLDecoder — 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 TransformerXLDecoder 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
TransformerXLDecoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("fdc181c488b365db")
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, TransformerXLDecoderLayer: 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)

# Small dimensions for testing
dim = 4
feedforward_dim = 8
head_dim = 2
num_heads = 2
activation = 'relu'
dropout_p = 0.1
layer_norm_eps = 1e-5

# Create the module instance to test
module = nn.TransformerEncoderLayer(
    d_model=dim,
    nhead=num_heads,
    dim_feedforward=feedforward_dim,
    dropout=dropout_p,
    batch_first=False
)

# Setup test tensors
# x shape: (tgt_length, batch_size, dim)
tgt_length = 3
batch_size = 2
x = torch.randn(tgt_length, batch_size, dim)

# pos_encodings shape: (pos_len, dim)
pos_len = 5
pos_encodings = torch.randn(pos_len, dim)

# u_bias and v_bias shape: (1, num_heads, head_dim) for broadcasting
u_bias = torch.randn(1, num_heads, head_dim)
v_bias = torch.randn(1, num_heads, head_dim)

# Optional attention mask: (tgt_length, src_length) or (batch_size, tgt_length, src_length)
attn_mask = None  # Can be None or a mask tensor

# Optional memory: (mem_length, batch_size, dim)
mems = None  # Can be None or a tensor

ARGS = {
    'dim': dim,
    'feedforward_dim': feedforward_dim,
    'head_dim': head_dim,
    'num_heads': num_heads,
    'activation': activation,
    'dropout_p': dropout_p,
    'layer_norm_eps': layer_norm_eps,
}
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 TransformerXLDecoderLayer — 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 TransformerXLDecoderLayer 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
_MultilayerModule Ran
ran on a synthesized input · constructed an object; no result was computed
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("8cfa03dabb18e3af")
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, _MultilayerModule: 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
import math

torch.manual_seed(0)

ARGS = {
    'layer_prefix': 'layer_',
    'ndim': 1,
    'in_dim': 4,
    'num_layers': 3,
    'nonlinearity': 'relu',
    'param': None,
    'norm': None,
    'dropout_p': 0.0,
    'pre_activation': False,
    'post_activation': True,
    'weight_initializer': 'kaiming_uniform',
    'bias_initializer': 'zeros',
    'final_bias_init': None,
}
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 _MultilayerModule — 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 _MultilayerModule 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
_calculate_gain Ran
ran, honoured the contract we drafted
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("d25a054b95990a84")
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 float, 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

torch.manual_seed(0)

# The function _calculate_gain takes two parameters:
# 1. nonlinearity: str - the type of nonlinearity
# 2. param: optional parameter (None or a number)

# Test with 'elu' nonlinearity which gets converted internally
ARGS = {
    'nonlinearity': 'elu',
    'param': None
}
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 float, 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_initializer Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("a7250d5b635dd398")
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 function. 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 math

torch.manual_seed(0)

# Test with different initializer names and nonlinearity/param combinations
ARGS = {
    'name': 'kaiming_uniform',
    'nonlinearity': 'relu',
    'param': None
}

# Additional test cases can be created by modifying ARGS:
# For 'xavier_uniform':
# ARGS = {'name': 'xavier_uniform', 'nonlinearity': 'tanh', 'param': None}

# For 'orthogonal':
# ARGS = {'name': 'orthogonal', 'nonlinearity': 'silu', 'param': None}

# For 'zeros':
# ARGS = {'name': 'zeros', 'nonlinearity': None, 'param': None}

# For 'elu' with param:
# ARGS = {'name': 'kaiming_uniform', 'nonlinearity': 'elu', 'param': 1.0}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
combine_metrics Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("ab154d639b4e4ae3")
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 dict. 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)

# Build test data for combine_metrics
# The function expects:
# - metrics: a list of dicts, each dict maps keys to scalars or 0-d/1-d tensors
# - prefix: None or a list of prefixes to apply to each metrics dict

metrics_list = [
    {
        'loss': 0.5,
        'accuracy': torch.tensor(0.85),
        'f1': torch.tensor([0.92])
    },
    {
        'loss': 0.45,
        'accuracy': torch.tensor(0.88),
        'f1': torch.tensor([0.94])
    }
]

prefix_list = ['train_', 'val_']

ARGS = {
    'metrics': metrics_list,
    'prefix': prefix_list
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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_activation Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("5439c3b62dbdc1fc")
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 ReLU. 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
from torch import nn

torch.manual_seed(0)

# The function takes two parameters: nonlinearity and param
# nonlinearity: a string specifying the activation type
# param: an optional parameter for certain activation functions

ARGS = {
    'nonlinearity': 'relu',
    'param': None
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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_norm_1d Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("4e5362cab16fd0f9")
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 BatchNorm1d. 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    'norm': 'batch_norm',
    'k': 4
}
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 BatchNorm1d — a BatchNorm1d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BatchNorm1d 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_norm_2d Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("84eae076a18b163d")
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 BatchNorm2d. 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)

ARGS = {
    'norm': 'batch_norm',
    'c': 4,
    'h': None,
    'w': None,
}
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 BatchNorm2d — a BatchNorm2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BatchNorm2d 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
init_ Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("fd4dd5bdc9742fc0")
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 SimpleModel. 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
from torch import nn
import math

torch.manual_seed(0)

# Create a simple model with Linear and Conv2d layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.conv = nn.Conv2d(3, 5, kernel_size=3)
    
    def forward(self, x):
        return x

mod = SimpleModel()

ARGS = {
    'mod': mod,
    'weight_initializer': 'kaiming_uniform',
    'bias_initializer': 'zeros',
    'nonlinearity': 'relu',
    'param': None
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
same_batch_shape Ran
ran, violated the contract we drafted
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("7e4ce9c6f41f3336")
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 bool, 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

torch.manual_seed(0)

# Create sample tensors with consistent batch dimensions
# Using distinct sizes: batch=2, feature dims vary to avoid ambiguity
tensor1 = torch.randn(2, 4, 5)      # shape (2, 4, 5)
tensor2 = torch.randn(2, 4, 3)      # shape (2, 4, 3)
tensor3 = torch.randn(2, 4, 7)      # shape (2, 4, 7)

# All tensors have same first ndim=2 dimensions: (2, 4)
tensors = [tensor1, tensor2, tensor3]

ARGS = {
    "tensors": tensors,
    "ndim": 2
}
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 bool, 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
same_batch_shape_time_offset Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("165f8bc0355a9865")
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 bool, 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

torch.manual_seed(0)

# The function checks that a and b are at least 2D tensors
# and compares their shapes: a.shape[:2] == (b.shape[0], b.shape[1] + offset)
# This means a has shape (batch_size, time_size, ...) and b has shape (batch_size, time_size_b, ...)
# where batch_size == b.shape[0] and time_size == b.shape[1] + offset

batch_size = 2
time_b = 3
offset = 1
time_a = time_b + offset  # time_a = 4

# Create tensor a with shape (batch_size, time_a, feature_dim)
a = torch.randn(batch_size, time_a, 4)

# Create tensor b with shape (batch_size, time_b, feature_dim)
b = torch.randn(batch_size, time_b, 4)

ARGS = {
    "a": a,
    "b": b,
    "offset": offset,
}
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 bool, 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
update_metrics Ran
ran; our contract draft was wrong, not the code
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("6f69e804fca3263d")
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 dict. 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)

# metrics is a dict that will be updated
metrics = {}

# new_metrics is a dict with string keys and values that are either int, float, or 0-d/1-d tensors
new_metrics = {
    'loss': torch.tensor(0.5),
    'accuracy': torch.tensor([0.85]),
    'count': 5,
    'rate': 0.95
}

# prefix is optional string to prepend to keys
prefix = 'train_'

ARGS = {
    'metrics': metrics,
    'new_metrics': new_metrics,
    'prefix': prefix
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
CNN Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("173854afd0798188")
How it ran

no invocation recorded.

DynamicsModel Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("c61718d72bba4f72")
How it ran

no invocation recorded.

MLP Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("103a05c5c1b23236")
How it ran

no invocation recorded.

ObservationModel Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("430454696696dc84")
How it ran

no invocation recorded.

PredictionNet Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("34a08d167acd0d24")
How it ran

no invocation recorded.

TransposeCNN Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("82ffe40472f6c427")
How it ran

no invocation recorded.

WorldModel Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("dd79139c2de865e1")
How it ran

no invocation recorded.

_kaiming_uniform_ Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("426051c1e209bfef")
How it ran

no invocation recorded.

check_no_grad Not yet run
unverified (harvested, no recorded run)
jrobine/twm/twm/world_model.py
code served (permissive licence) · get_code("862742223d0ec96a")
How it ran

no invocation recorded.

Also present in other papers' code

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

Deep neural networks have been successful in many reinforcement learning settings. However, compared to human learners they are overly data hungry. To build a sample-efficient world model, we apply a transformer to real-world episodes in an autoregressive manner: not only the compact latent states and the taken actions but also the experienced or predicted rewards are fed into the transformer, so that it can attend flexibly to all three modalities at different time steps. The transformer allows our world model to access previous states directly, instead of viewing them through a compressed recurrent state. By utilizing the Transformer-XL architecture, it is able to learn long-term dependencies while staying computationally efficient. Our transformer-based world model (TWM) generates meaningful, new experience, which is used to train a policy that outperforms previous model-free and model-based reinforcement learning algorithms on the Atari 100k benchmark.

For agents

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

get_harvested_code_for_paper("2303.07109")
get_code_for_paper("2303.07109")
have("2303.07109")

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

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

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

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

Connect an agent — have() is free.