SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.10967 · 2024

Dreaming of Many Worlds: Learning Contextual World Models Aids Zero-Shot Generalization

arXiv · PDF · Open in the Atlas

Code that ran

8 of 8 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 0 have no contract verdict; 8 failures of our instrument; 0 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/2403.10967.json · badge: /api/ran/2403.10967.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
sai-prasanna/dreaming_of_many_worlds canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
binning Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sai-prasanna/dreaming_of_many_worlds/dreamerv3_compat/scores/plot.py
code served (permissive licence) · get_code("bdb3813f6efd9a11")
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 numpy as np

# Construct valid arguments for the binning function
xs = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
ys = np.array([10.0, 20.0, 30.0, 40.0, 50.0])
borders = np.array([0.0, 2.5, 5.0, 7.5])

ARGS = {
    'xs': xs,
    'ys': ys,
    'borders': borders,
    'reducer': np.nanmean,
    'fill': 'nan'
}
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 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
create_torch_dataset Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/eval_utils/eval_script.py
code served (permissive licence) · get_code("9d31e5ee6ecb95e4")
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 LatentsDataset. 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 os
import pickle
import tempfile
import numpy as np

# Create a temporary directory structure with mock data
temp_dir = tempfile.mkdtemp()
seed_dir = os.path.join(temp_dir, 'seeds', 'seed_0')
os.makedirs(seed_dir, exist_ok=True)

# Create mock ctx2latent_v1.pkl file with the expected structure
mock_data = []
for context_id in range(3):
    context_dict = {
        'context': {
            'gravity': np.array(9.8 + context_id * 0.1, dtype=np.float32),
            'length': np.array(1.0 + context_id * 0.05, dtype=np.float32)
        },
        'episodes': []
    }
    
    # Create 10 episodes per context
    for ep_id in range(10):
        episode = {
            'image': np.random.randn(5, 64).astype(np.float32),  # T=5, d=64
            'imagined': np.random.randn(5, 1536).astype(np.float32),  # T=5, d=1536 for latents
            'obs': np.random.randn(5, 32).astype(np.float32),
            'posterior': np.random.randn(5, 256).astype(np.float32)
        }
        context_dict['episodes'].append(episode)
    
    mock_data.append(context_dict)

# Save the mock data
pkl_path = os.path.join(seed_dir, 'ctx2latent_v1.pkl')
with open(pkl_path, 'wb') as f:
    pickle.dump(mock_data, f)

# Define the ARGS dictionary
ARGS = {
    'latent_dir': temp_dir
}
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 LatentsDataset — a LatentsDataset 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
create_torch_dataset Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/eval_utils/eval_script_all_latents.py
code served (permissive licence) · get_code("ecf13fd5c36d3cdb")
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 LatentsDataset. 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 os
import pickle
import numpy as np
import tempfile
import shutil

# Create a temporary directory structure with mock data
temp_dir = tempfile.mkdtemp()
seed_dir = os.path.join(temp_dir, 'seed_0')
os.makedirs(seed_dir)

# Create mock ctx2latent_v1.pkl data
mock_data = []
for context_id in range(10):
    per_context_dict = {
        'context': {
            'gravity': 9.8,
            'length': float(context_id + 1)
        },
        'episodes': []
    }
    for ep_id in range(10):
        episode = {
            'image': np.random.randn(5, 1536),
            'imagined': np.random.randn(5, 1536),
            'obs': np.random.randn(5, 1536),
            'posterior': np.random.randn(5, 1536)
        }
        per_context_dict['episodes'].append(episode)
    mock_data.append(per_context_dict)

# Save the mock data
pkl_file = os.path.join(seed_dir, 'ctx2latent_v1.pkl')
with open(pkl_file, 'wb') as f:
    pickle.dump(mock_data, f)

ARGS = {
    'latent_dir': temp_dir,
    'target': 'length'
}
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 LatentsDataset — a LatentsDataset 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
get_act Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/dreamerv3_compat/dreamerv3/nets.py
code served (permissive licence) · get_code("03dd934385b4d240")
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 custom_jvp. 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 jax
import jax.numpy as jnp

def get_act(name):
    if callable(name):
        return name
    elif name == 'none':
        return lambda x: x
    elif name == 'mish':
        return lambda x: x * jnp.tanh(jax.nn.softplus(x))
    elif hasattr(jax.nn, name):
        return getattr(jax.nn, name)
    else:
        raise NotImplementedError(name)

# Test with string name 'relu'
ARGS = {
    'name': 'relu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type custom_jvp — a custom_jvp output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a custom_jvp 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
linear_schedule Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/contextual_mbrl/baseline/model.py
code served (permissive licence) · get_code("2df73e2474aca4ca")
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 numpy as np
from typing import Callable, Union

torch.manual_seed(0)

# The function linear_schedule takes initial_value which can be a float or str
# It returns a function that takes progress_remaining (float) and returns float
# The function uses: float(initial_value) and multiplies progress_remaining by it

ARGS = {
    "initial_value": 0.001
}
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 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
load_file Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/eval_utils/eval_script.py
code served (permissive licence) · get_code("a93c90885a6fd3ec")
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 pickle
import tempfile
import os

# Create a temporary file and write some pickled data to it
temp_dir = tempfile.mkdtemp()
temp_file = os.path.join(temp_dir, "test_pickle.pkl")

# Create sample data to pickle
sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3, 4],
    "key3": {"nested": "dict"}
}

# Write the pickled data to the temporary file
with open(temp_file, 'wb') as f:
    pickle.dump(sample_data, f)

# Define ARGS with the file path
ARGS = {
    "file_path": temp_file
}
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 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
plots Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/dreamerv3_compat/scores/plot.py
code served (permissive licence) · get_code("02a86e713fbde0a9")
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 matplotlib.pyplot as plt
import numpy as np
from matplotlib import ticker

ARGS = {
    "amount": 6,
    "cols": 4,
    "size": (2, 2.3),
    "xticks": 4,
    "yticks": 5,
    "grid": (1, 1),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy — 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
reduce Ran
ran; our contract draft was wrong, not the code
sai-prasanna/dreaming_of_many_worlds/dreamerv3_compat/scores/plot.py
code served (permissive licence) · get_code("3712b709b2e95945")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import warnings
import numpy as np

# Create test data for the reduce function
values = np.array([1.0, 2.0, np.nan, 4.0, 5.0])

# Define the reducer function (using default np.nanmean)
reducer = np.nanmean

# Create ARGS dict with all parameters
ARGS = {
    "values": values,
    "reducer": reducer,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 1 the same month, 5 later) and 3 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_act 9 other papers
5 dated earlier, 3 the same month, 1 later
2303.03226 (2023-03)
Safe Reinforcement Learning via Probabilistic Logic Shields
2305.14343 (2023-05)
Video Prediction Models as Rewards for Reinforcement Learning
2306.11488 (2023-06)
Informed POMDP: Leveraging Additional Information in Model-Based RL
and 6 more not named here
binning 1 other paper
1 later
2508.20294 (2025-08)
Dynamics-Aligned Latent Imagination in Contextual World Models for Zero-Shot Generalization
linear_schedule 1 other paper
1 later
2508.20294 (2025-08)
Dynamics-Aligned Latent Imagination in Contextual World Models for Zero-Shot Generalization
plots 1 other paper
1 later
2508.20294 (2025-08)
Dynamics-Aligned Latent Imagination in Contextual World Models for Zero-Shot Generalization
reduce 1 other paper
1 later
2508.20294 (2025-08)
Dynamics-Aligned Latent Imagination in Contextual World Models for Zero-Shot Generalization

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

Zero-shot generalization (ZSG) to unseen dynamics is a major challenge for creating generally capable embodied agents. To address the broader challenge, we start with the simpler setting of contextual reinforcement learning (cRL), assuming observability of the context values that parameterize the variation in the system's dynamics, such as the mass or dimensions of a robot, without making further simplifying assumptions about the observability of the Markovian state. Toward the goal of ZSG to unseen variation in context, we propose the contextual recurrent state-space model (cRSSM), which introduces changes to the world model of Dreamer (v3) (Hafner et al., 2023). This allows the world model to incorporate context for inferring latent Markovian states from the observations and modeling the latent dynamics. Our approach is evaluated on two tasks from the CARL benchmark suite, which is tailored to study contextual RL. Our experiments show that such systematic incorporation of the context improves the ZSG of the policies trained on the "dreams" of the world model. We further find qualitatively that our approach allows Dreamer to disentangle the latent state from context, allowing it to extrapolate its dreams to the many worlds of unseen contexts. The code for all our experiments is available at https://github.com/sai-prasanna/dreaming_of_many_worlds.

For agents

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

get_harvested_code_for_paper("2403.10967")
get_code_for_paper("2403.10967")
have("2403.10967")

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

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

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

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

Connect an agent — have() is free.