SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2506.08460 · ICLR · 2025

MOBODY: Model Based Off-Dynamics Offline Reinforcement Learning

Pan Xu, Yu Yang, Anqi Liu, Yihong Guo

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; 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/2506.08460.json · badge: /api/ran/2506.08460.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
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning canonical (classifier label)
classifier basis: classifier_2025
5 ran · 1 no recorded run
FunctionStatusWhere it lives
BaseDynamics Ran
ran on a synthesized input · constructed an object; no result was computed
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning/algo/dynamics/mobody_dynamics.py
code served (permissive licence) · get_code("caa10a0a0d97cef6")
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, BaseDynamics: 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 numpy as np

torch.manual_seed(0)

# Define a minimal nn.Module for the model
class MinimalDynamicsModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(8, 4)
    
    def forward(self, x):
        return self.fc(x)

# Create the model instance
model = MinimalDynamicsModel()

# Create an optimizer
optim = torch.optim.Adam(model.parameters(), lr=0.001)

# Construct ARGS dictionary
ARGS = {
    'model': model,
    'optim': optim
}
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 BaseDynamics — 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 BaseDynamics 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
Classifier Ran
ran on a synthesized input · constructed an object; no result was computed
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning/algo/dynamics/mobody_dynamics.py
code served (permissive licence) · get_code("7e4ece61f52b7dcb")
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, Classifier: 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 Classifier class and MLPNetwork class as provided
class MLPNetwork(nn.Module):
    def __init__(self, input_dim, output_dim, hidden_size=256):
        super(MLPNetwork, self).__init__()
        self.network = nn.Sequential(
            nn.Linear(input_dim, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, hidden_size),
            nn.ReLU(),
            nn.Linear(hidden_size, output_dim)
        )

    def forward(self, x):
        return self.network(x)

class Classifier(nn.Module):
    def __init__(self, state_dim, action_dim, hidden_size=256, gaussian_noise_std=1.0):
        super(Classifier, self).__init__()
        self.action_dim = action_dim
        self.gaussian_noise_std = gaussian_noise_std
        self.sa_classifier = MLPNetwork(state_dim + action_dim, 2, hidden_size)
        self.sas_classifier = MLPNetwork(2 * state_dim + action_dim, 2, hidden_size)

    def forward(self, state_batch, action_batch, nextstate_batch, with_noise):
        sas = torch.cat([state_batch, action_batch, nextstate_batch], -1)
        if with_noise:
            sas += torch.randn_like(sas, device=state_batch.device) * self.gaussian_noise_std
        sas_logits = torch.nn.Softmax()(self.sas_classifier(sas))
        sa = torch.cat([state_batch, action_batch], -1)
        if with_noise:
            sa += torch.randn_like(sa, device=state_batch.device) * self.gaussian_noise_std
        sa_logits = torch.nn.Softmax()(self.sa_classifier(sa))
        return (sas_logits, sa_logits)

# Construct arguments for the Classifier constructor
state_dim = 4
action_dim = 3
hidden_size = 128
gaussian_noise_std = 0.5

ARGS = {
    'state_dim': state_dim,
    'action_dim': action_dim,
    'hidden_size': hidden_size,
    'gaussian_noise_std': gaussian_noise_std
}
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 Classifier — 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 Classifier 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
StandardScaler Ran
ran on a synthesized input · constructed an object; no result was computed
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning/algo/dynamics/mobody_dynamics.py
code served (permissive licence) · get_code("ee90eeff8bf4f09b")
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, StandardScaler: 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 numpy as np

torch.manual_seed(0)

ARGS = {
    "mu": None,
    "std": None,
}
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 StandardScaler — 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 StandardScaler 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
eval_policy Ran
ran, honoured the contract we drafted
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning/train_mobody.py
code served (permissive licence) · get_code("1dbd30f3f1fdb2d2")
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 float, ndim 0, dtype family float, shape () 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 numpy as np
import torch
import torch.nn as nn

torch.manual_seed(0)

# Mock environment
class MockEnv:
    def __init__(self):
        self.state_dim = 4
        self.action_dim = 3
        self.step_count = 0
    
    def reset(self):
        return np.random.randn(self.state_dim).astype(np.float32)
    
    def step(self, action):
        next_state = np.random.randn(self.state_dim).astype(np.float32)
        reward = float(np.random.randn())
        done = self.step_count >= 2
        self.step_count += 1
        return next_state, reward, done, {}

# Mock policy
class MockPolicy(nn.Module):
    def __init__(self, state_dim, action_dim):
        super().__init__()
        self.fc = nn.Linear(state_dim, action_dim)
    
    def select_action(self, state, policy_distribution):
        state_tensor = torch.tensor(state, dtype=torch.float32).unsqueeze(0)
        action = self.fc(state_tensor).squeeze(0).detach().numpy()
        return action

# Mock dynamics model
class MockDynamics(nn.Module):
    def __init__(self, state_dim, action_dim):
        super().__init__()
        self.state_dim = state_dim
        self.action_dim = action_dim
        self.fc = nn.Linear(state_dim + action_dim, state_dim + 1)
    
    def step(self, state, action, flag):
        combined = torch.cat([state, action], dim=1)
        output = self.fc(combined)
        next_obs = output[:, :self.state_dim]
        reward = output[:, self.state_dim:self.state_dim+1]
        terminal = torch.zeros(state.shape[0], 1)
        info = {}
        return next_obs, reward, terminal, info

# Mock policy distribution
class MockPolicyDistribution:
    pass

# Create instances
env = MockEnv()
policy = MockPolicy(state_dim=4, action_dim=3)
policy_distribution = MockPolicyDistribution()
dynamics = MockDynamics(state_dim=4, action_dim=3)

ARGS = {
    'policy': policy,
    'env': env,
    'policy_distribution': policy_distribution,
    'eval_episodes': 2,
    'eval_cnt': 1,
    'dynamics': dynamics,
    'eval_trg': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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
eval_policy_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning/train_mobody.py
code served (permissive licence) · get_code("4230be62a25f23d0")
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 float64, ndim 0, 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 numpy as np
import torch
import torch.nn as nn

torch.manual_seed(0)

# Mock policy class
class MockPolicy(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def select_action(self, state, policy_distribution):
        # state shape: (eval_episodes, state_dim)
        # returns action of shape (eval_episodes, action_dim)
        batch_size = state.shape[0]
        return np.random.randn(batch_size, 3).astype(np.float32)

# Mock environment class
class MockEnv:
    def __init__(self, state_dim=4, action_dim=3, num_episodes=2):
        self.state_dim = state_dim
        self.action_dim = action_dim
        self.num_episodes = num_episodes
        self.step_count = 0
    
    def reset(self):
        # Returns initial state of shape (num_episodes, state_dim)
        self.step_count = 0
        return np.random.randn(self.num_episodes, self.state_dim).astype(np.float32)
    
    def step(self, action):
        # action shape: (num_episodes, action_dim)
        # returns: next_state, reward, done, info
        batch_size = action.shape[0]
        next_state = np.random.randn(batch_size, self.state_dim).astype(np.float32)
        reward = np.random.randn(batch_size).astype(np.float32)
        done = np.zeros(batch_size, dtype=bool)
        self.step_count += 1
        # Mark episodes as done after a few steps
        if self.step_count >= 3:
            done = np.ones(batch_size, dtype=bool)
        return next_state, reward, done, {}

# Mock dynamics model
class MockDynamics(nn.Module):
    def __init__(self, state_dim=4, action_dim=3):
        super().__init__()
        self.state_dim = state_dim
        self.action_dim = action_dim
        self.linear = nn.Linear(state_dim + action_dim, state_dim + 1)
        self._penalty_coef = 0.1
    
    def step(self, state, action, training):
        # state shape: (batch, state_dim)
        # action shape: (batch, action_dim)
        batch_size = state.shape[0]
        next_obs = torch.randn(batch_size, self.state_dim)
        reward = torch.randn(batch_size, 1)
        terminal = torch.zeros(batch_size, 1)
        penalty = torch.randn(batch_size)
        info = {'penalty': penalty}
        return next_obs, reward, terminal, info

# Mock policy distribution
class MockPolicyDistribution:
    pass

# Construct arguments
policy = MockPolicy()
env = MockEnv(state_dim=4, action_dim=3, num_episodes=2)
policy_distribution = MockPolicyDistribution()
dynamics = MockDynamics(state_dim=4, action_dim=3)

ARGS = {
    'policy': policy,
    'env': env,
    'policy_distribution': policy_distribution,
    'eval_episodes': 2,
    'eval_cnt': 0,
    'dynamics': dynamics,
    'eval_trg': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
MOBODYEnsembleDynamics Not yet run
unverified (harvested, no recorded run)
guoyihonggyh/mobody-model-based-off-dynamics-offline-reinforcement-learning/algo/dynamics/mobody_dynamics.py
code served (permissive licence) · get_code("c131f3054ca3eed8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 5 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
BaseDynamics
brick of this paper's assembly: helper
5 other papers
4 dated earlier, 1 later · 3 only as an assembly brick
2005.13239 (2020-05)
MOPO: Model-based Offline Policy Optimization
2102.08363 (2021-02)
COMBO: Conservative Offline Model-Based Policy Optimization
2204.12581 (2022-04)
RAMBO-RL: Robust Adversarial Model-Based Offline Reinforcement Learning
and 2 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-23.

Repositories linked to this paper

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

Abstract

We study off-dynamics offline reinforcement learning, where the goal is to learn a policy from offline source and limited target datasets with mismatched dynamics. Existing methods either penalize the reward or discard source transitions occurring in parts of the transition space with high dynamics shift. As a result, they optimize the policy using data from low-shift regions, limiting exploration of high-reward states in the target domain that do not fall within these regions. Consequently, such methods often fail when the dynamics shift is significant or the optimal trajectories lie outside the low-shift regions. To overcome this limitation, we propose MOBODY, a Model-Based Off-Dynamics Offline RL algorithm that optimizes a policy using learned target dynamics transitions to explore the target domain, rather than only being trained with the low dynamics-shift transitions. For the dynamics learning, built on the observation that achieving the same next state requires taking different actions in different domains, MOBODY employs separate action encoders for each domain to encode different actions to the shared latent space while sharing a unified representation of states and a common transition function. We further introduce a target Q-weighted behavior cloning loss in policy optimization to avoid out-of-distribution actions, which push the policy toward actions with high target-domain Q-values, rather than high source domain Q-values or uniformly imitating all actions in the offline dataset. We evaluate MOBODY on a wide range of MuJoCo and Adroit benchmarks, demonstrating that it outperforms state-ofthe-art off-dynamics RL baselines as well as policy learning methods based on different dynamics learning baselines, with especially pronounced improvements in challenging scenarios where existing methods struggle.

For agents

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

get_harvested_code_for_paper("2506.08460")
get_code_for_paper("2506.08460")
have("2506.08460")

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

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

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

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

Connect an agent — have() is free.