SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2503.18938 · ICML · 2025

AdaWorld: Learning Adaptable World Models with Latent Actions

Chuang Gan, Yilun Du, Siyuan Zhou, Jun Zhang, Shenyuan Gao

arXiv · PDF · Open in the Atlas

Code that ran

8 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 4 failures of our instrument; 6 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2503.18938.json · badge: /api/ran/2503.18938.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
little-podi/adaworld marked official in Papers with Code
Papers with Code archive
8 ran · 6 no recorded run
FunctionStatusWhere it lives
PositionalEncoding Ran
ran on a synthesized input
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("8c5678a9a3911e1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float; no output shape is stated. 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 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
import torch.nn as nn
import math

class PositionalEncoding(nn.Module):

    def __init__(self, model_dim: int, max_len: int=5000) -> None:
        super(PositionalEncoding, self).__init__()
        pe = torch.zeros(max_len, model_dim)
        position = torch.arange(0, max_len).float().unsqueeze(1)
        exponent = torch.arange(0, model_dim, 2).float() * -(math.log(10000.0) / model_dim)
        div_term = torch.exp(exponent)
        pe[:, 0::2] = torch.sin(position * div_term)
        pe[:, 1::2] = torch.cos(position * div_term)
        self.pos_enc = pe

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return x + self.pos_enc[:x.shape[2]].cuda()

INIT_ARGS = {
    'model_dim': 8,
    'max_len': 100
}

ARGS = {
    'x': torch.randn(2, 3, 12, 8)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("8ad0a69c31d2ece7")
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, RotaryEmbedding: 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
from torch import Tensor

torch.manual_seed(0)

# Helper functions used in the code
def exists(val) -> bool:
    return val is not None

def rotate_half(x) -> Tensor:
    from einops import rearrange
    x = rearrange(x, '... (d r) -> ... d r', r=2)
    x1, x2 = x.unbind(dim=-1)
    x = torch.stack((-x2, x1), dim=-1)
    return rearrange(x, '... d r -> ... (d r)')

def apply_rotary_emb(freqs, t, start_index=0, scale=1.0, seq_dim=-2):
    dtype = t.dtype
    if t.ndim == 3:
        seq_len = t.shape[seq_dim]
        freqs = freqs[-seq_len:]
    rot_dim = freqs.shape[-1]
    end_index = start_index + rot_dim
    assert rot_dim <= t.shape[-1], f'Feature dimension {t.shape[-1]} is not of sufficient size to rotate in all the positions {rot_dim}'
    t_left = t[..., :start_index]
    t_middle = t[..., start_index:end_index]
    t_right = t[..., end_index:]
    t_transformed = t_middle * freqs.cos() * scale + rotate_half(t_middle) * freqs.sin() * scale
    out = torch.cat([t_left, t_transformed, t_right], dim=-1)
    return out.type(dtype)

# Build arguments for RotaryEmbedding constructor
ARGS = {
    'dim': 8,  # embedding dimension (must be even)
    'custom_freqs': None,  # no custom frequencies
    'freqs_for': 'lang',  # use language frequencies
    'theta': 10000,  # base theta for frequency computation
    'max_freq': 10,  # max frequency for pixel mode
    'num_freqs': 1,  # number of constant frequencies
    'learned_freq': False,  # don't learn frequencies
    'use_xpos': False,  # don't use extrapolatable positional embeddings
    'xpos_scale_base': 512,  # xpos scale base
    'interpolate_factor': 1.0,  # no interpolation
    'theta_rescale_factor': 1.0,  # no theta rescaling
    'seq_before_head_dim': False,  # sequence dimension is -2 (after head)
    'cache_if_possible': True,  # cache frequencies if possible
    'cache_max_seq_len': 8192,  # max cache sequence length
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RotaryEmbedding — 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 RotaryEmbedding 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
apply_rotary_emb Ran
ran; our contract draft was wrong, not the code
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("2f3566324cb2f780")
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, 4, 16) 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
from einops import rearrange

torch.manual_seed(0)

# The function apply_rotary_emb takes:
# - freqs: a tensor of frequencies (used with .cos(), .sin(), indexing with [-seq_len:])
# - t: a tensor to be rotated (3D or other, with shape checks)
# - start_index: integer offset
# - scale: float scaling factor
# - seq_dim: integer dimension index

# Create a small frequency tensor
# freqs should be 1D or have shape compatible with the last dimension of t
# It's indexed as freqs[-seq_len:] and used with .cos() and .sin()
freqs = torch.randn(8)  # frequency embedding, will be sliced

# Create t as a 3D tensor (batch=2, seq=4, features=16)
# The function checks rot_dim <= t.shape[-1], so features must be >= rot_dim
# freqs.shape[-1] will be 8, so t's last dim must be >= 8
t = torch.randn(2, 4, 16)  # (batch, seq_len, feature_dim)

# start_index determines where rotation begins in the feature dimension
start_index = 0

# scale is a float multiplier
scale = 1.0

# seq_dim is the dimension along which sequence length is measured
seq_dim = -2  # The sequence dimension in a 3D tensor

ARGS = {
    'freqs': freqs,
    't': t,
    'start_index': start_index,
    'scale': scale,
    'seq_dim': seq_dim
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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, 4, 16) — shape (2, 4, 16) 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
default Ran
ran, honoured the contract we drafted
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("846d368f28a9e305")
How it ran

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

import torch

torch.manual_seed(0)

def exists(val) -> bool:
    return val is not None

def default(val, d) -> torch.Tensor:
    return val if exists(val) else d

# Construct arguments for the `default` function
# Parameters: val, d
# The function returns val if val is not None, otherwise returns d
# Both can be tensors or None

val_tensor = torch.randn(2, 4)
default_tensor = torch.randn(2, 4)

ARGS = {
    "val": val_tensor,
    "d": default_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 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
exists Ran
ran, violated the contract we drafted
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("220f3bbcd151f23c")
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)

ARGS = {
    "val": 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 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
patchify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("039179bb223e6c09")
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, 3, 16, 16) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from einops import rearrange

torch.manual_seed(0)

# The function patchify takes:
# - videos: Tensor of shape (B, T, H, W, C)
# - size: int (patch size)

# Create a sample video tensor
# B=2 (batch), T=3 (time), H=8 (height), W=9 (width), C=4 (channels)
# Using distinct dimensions so they're identifiable
videos = torch.randn(2, 3, 8, 9, 4)

# Patch size
size = 2

ARGS = {
    "videos": videos,
    "size": size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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, 3, 16, 16) — shape (2, 3, 16, 16) 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
rotate_half Ran
ran; our contract draft was wrong, not the code
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("a61b41823e31cfae")
How it ran

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

import torch
from torch import Tensor
from einops import rearrange

torch.manual_seed(0)

# The function rotate_half takes a single parameter x which is a Tensor
# It uses einops rearrange to reshape, unbind, stack, and rearrange again
# The tensor needs to have an even last dimension (d r format where r=2)

# Create a small tensor with batch=2, last dimension=4 (so d=2, r=2)
x = torch.randn(2, 4)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
unpatchify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("141935b085e62f1f")
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 5, dtype family float, shape (2, 3, 5, 7, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from einops import rearrange

torch.manual_seed(0)

# Understanding the function:
# - patches: Tensor with shape that will be rearranged
# - size: int used as hp and wp (patch size)
# - h_out: int, output height
# - w_out: int, output width
# The function rearranges patches from (b, t, hn*wn, hp*wp*c) to (b, t, hn*hp, wn*wp, c)
# then crops to [:, :, :h_out, :w_out]

# Let's construct valid inputs:
# size = 2 (patch size)
# h_out = 5 (desired output height)
# w_out = 7 (desired output width)
# h_pad = -5 % 2 = 1, so hn = (5+1)//2 = 3
# wn can be anything, let's say 4, so wn*size = 8, w_pad = -7 % 2 = 1, w_total = 8
# So wn = (7+1)//2 = 4

size = 2
h_out = 5
w_out = 7

h_pad = -h_out % size  # = 1
hn = (h_out + h_pad) // size  # = 3

w_pad = -w_out % size  # = 1
wn = (w_out + w_pad) // size  # = 4

# Now we need patches of shape (b, t, hn*wn, hp*wp*c)
# hp = size = 2, wp = size = 2, c can be anything, let's say 3
# So we need (b, t, 3*4, 2*2*3) = (b, t, 12, 12)
b = 2
t = 3
c = 3

patches = torch.randn(b, t, hn * wn, size * size * c)

ARGS = {
    'patches': patches,
    'size': size,
    'h_out': h_out,
    'w_out': w_out,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 5, dtype family float, shape (2, 3, 5, 7, 3) — shape (2, 3, 5, 7, 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
LatentActionModel Not yet run
unverified (harvested, no recorded run)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("a2023a6877be4d73")
How it ran

no invocation recorded.

SelfAttention Not yet run
unverified (harvested, no recorded run)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("b1d5f5dfa4ddac49")
How it ran

no invocation recorded.

SpatioBlock Not yet run
unverified (harvested, no recorded run)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("b40b953448d6ee7a")
How it ran

no invocation recorded.

SpatioTemporalBlock Not yet run
unverified (harvested, no recorded run)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("738a3cb5f1d4148e")
How it ran

no invocation recorded.

SpatioTemporalTransformer Not yet run
unverified (harvested, no recorded run)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("cc694583cfd5d77d")
How it ran

no invocation recorded.

SpatioTransformer Not yet run
unverified (harvested, no recorded run)
little-podi/adaworld/lam/lam/modules/lam.py
code served (permissive licence) · get_code("eff93e60a0b14d72")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

World models aim to learn action-controlled future prediction and have proven essential for the development of intelligent agents. However, most existing world models rely heavily on substantial action-labeled data and costly training, making it challenging to adapt to novel environments with heterogeneous actions through limited interactions. This limitation can hinder their applicability across broader domains. To overcome this limitation, we propose AdaWorld, an innovative world model learning approach that enables efficient adaptation. The key idea is to incorporate action information during the pretraining of world models. This is achieved by extracting latent actions from videos in a self-supervised manner, capturing the most critical transitions between frames. We then develop an autoregressive world model that conditions on these latent actions. This learning paradigm enables highly adaptable world models, facilitating efficient transfer and learning of new actions even with limited interactions and finetuning. Our comprehensive experiments across multiple environments demonstrate that AdaWorld achieves superior performance in both simulation quality and visual planning.

For agents

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

get_harvested_code_for_paper("2503.18938")
get_code_for_paper("2503.18938")
have("2503.18938")

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

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

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

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

Connect an agent — have() is free.