SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.04220 · NeurIPS · 2023

Look Beneath the Surface: Exploiting Fundamental Symmetry for Sample-Efficient Offline RL

Xianyuan Zhan, Li Jiang, Peng Cheng, Zhihao Wu, Wenjia Zhang, Shoucheng Song, Han Wang, Youfang Lin

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 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; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 0 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/2306.04220.json · badge: /api/ran/2306.04220.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
pcheng2/tsrl canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
FunctionStatusWhere it lives
Full_network Ran
ran on a synthesized input · constructed an object; no result was computed
pcheng2/tsrl/TDM/tdm_nn.py
code served (permissive licence) · get_code("acda2158876f4fbd")
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, Full_network: 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 the autoencoder network
class AutoencoderNetwork(nn.Module):
    def __init__(self, state_dim, act_dim, latent_dim, latent_s_dim):
        super().__init__()
        self.state_dim = state_dim
        self.act_dim = act_dim
        self.latent_dim = latent_dim
        self.latent_s_dim = latent_s_dim
        
        # Encoder: takes state (state_dim) and outputs latent representation
        self.encoder = nn.Linear(state_dim, latent_dim)
        
        # State decoder: latent_s_dim -> state_dim
        self.s_decoder = nn.Linear(latent_s_dim, state_dim)
        
        # Action decoder: latent_a_dim -> act_dim
        self.a_decoder = nn.Linear(latent_dim - latent_s_dim, act_dim)
    
    def forward(self, x):
        # x shape: (batch, state_dim)
        z = self.encoder(x)  # (batch, latent_dim)
        z_s = z[:, :self.latent_s_dim]  # (batch, latent_s_dim)
        z_a = z[:, self.latent_s_dim:]  # (batch, latent_a_dim)
        
        s_decoded = self.s_decoder(z_s)  # (batch, state_dim)
        a_decoded = self.a_decoder(z_a)  # (batch, act_dim)
        
        return z, s_decoded, a_decoded

# Define forward dynamics network
class ForwardDynamicsNetwork(nn.Module):
    def __init__(self, latent_dim, latent_s_dim):
        super().__init__()
        self.net = nn.Linear(latent_dim, latent_s_dim)
    
    def forward(self, z):
        # z shape: (batch, latent_dim)
        # output: (batch, latent_s_dim) - predicts change in state latent
        return self.net(z)

# Define backward dynamics network
class BackwardDynamicsNetwork(nn.Module):
    def __init__(self, latent_dim, latent_s_dim):
        super().__init__()
        self.net = nn.Linear(latent_dim, latent_s_dim)
    
    def forward(self, z):
        # z shape: (batch, latent_dim)
        # output: (batch, latent_s_dim)
        return self.net(z)

# Set up dimensions
state_dim = 4
act_dim = 3
latent_dim = 5
latent_s_dim = 2

# Create network instances
ae_network = AutoencoderNetwork(state_dim, act_dim, latent_dim, latent_s_dim)
fwd_net = ForwardDynamicsNetwork(latent_dim, latent_s_dim)
bwd_net = BackwardDynamicsNetwork(latent_dim, latent_s_dim)

# Create parameters dictionary
params = {
    'device': 'cpu',
    'state_dim': state_dim,
    'act_dim': act_dim,
    'latent_out': latent_dim,
    'latent_s_dim': latent_s_dim,
    'activation': 'relu'
}

ARGS = {
    'ae_network': ae_network,
    'fwd_net': fwd_net,
    'bwd_net': bwd_net,
    'params': params
}
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 Full_network — 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 Full_network 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
create_feed_dictionary Ran
ran; our contract draft was wrong, not the code
pcheng2/tsrl/TDM/tdm.py
code served (permissive licence) · get_code("5bedad9f259fcfb3")
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 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 numpy as np
import torch

torch.manual_seed(0)

# Create sample data dictionary with required keys
# Each array should have shape (batch_size, feature_dim)
batch_size = 2
state_dim = 4
action_dim = 3
next_state_dim = 4

data = {
    's': np.random.randn(batch_size, state_dim).astype(np.float32),
    'act': np.random.randn(batch_size, action_dim).astype(np.float32),
    'sp': np.random.randn(batch_size, next_state_dim).astype(np.float32),
    'next_act': np.random.randn(batch_size, action_dim).astype(np.float32),
    'da': np.random.randn(batch_size, action_dim).astype(np.float32),
    'ds': np.random.randn(batch_size, state_dim).astype(np.float32),
    'dsp': np.random.randn(batch_size, next_state_dim).astype(np.float32),
}

# Create params dictionary with device
params = {
    'device': 'cpu'
}

# Create optional idxs parameter (None will use all indices)
idxs = None

ARGS = {
    'data': data,
    'params': params,
    'idxs': idxs
}
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 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
define_loss Ran
ran; our contract draft was wrong, not the code
pcheng2/tsrl/TDM/tdm.py
code served (permissive licence) · get_code("35a7369651f4ed1c")
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 tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create data_dic with required keys
batch_size = 2
state_dim = 4
action_dim = 3
delta_dim = 5

data_dic = {
    's': torch.randn(batch_size, state_dim),
    'act': torch.randn(batch_size, action_dim),
    'ds': torch.randn(batch_size, delta_dim),
    'dsp': torch.randn(batch_size, delta_dim),
}

# Create results_dic with required keys
results_dic = {
    'state_decode': torch.randn(batch_size, state_dim),
    'act_decode': torch.randn(batch_size, action_dim),
    'dz_s': torch.randn(batch_size, delta_dim),
    'fwd_dyna_predict': torch.randn(batch_size, delta_dim),
    'dz_s_decode': torch.randn(batch_size, delta_dim),
    'dz_sp': torch.randn(batch_size, delta_dim),
    'bwd_dyna_predict': torch.randn(batch_size, delta_dim),
    'dz_sp_decode': torch.randn(batch_size, delta_dim),
    'dyna_consist': torch.randn(batch_size, delta_dim),
    'consist': torch.randn(batch_size, delta_dim),
}

# Create params dict with all required loss weights and thresholds
params = {
    'pre_train_epoch': 5,
    'loss_weight_state_decoder': 1.0,
    'loss_weight_act_decoder': 1.0,
    'loss_weight_dynamic_z_s': 1.0,
    'loss_weight_dynamic_z_s_decode': 1.0,
    'losss_model_consist': 1.0,
}

epoch = 10
validation = False

ARGS = {
    'data_dic': data_dic,
    'results_dic': results_dic,
    'params': params,
    'epoch': epoch,
    'validation': validation,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, 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

Also present in other papers' code

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

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

Offline reinforcement learning (RL) offers an appealing approach to real-world tasks by learning policies from pre-collected datasets without interacting with the environment. However, the performance of existing offline RL algorithms heavily depends on the scale and state-action space coverage of datasets. Real-world data collection is often expensive and uncontrollable, leading to small and narrowly covered datasets and posing significant challenges for practical deployments of offline RL. In this paper, we provide a new insight that leveraging the fundamental symmetry of system dynamics can substantially enhance offline RL performance under small datasets. Specifically, we propose a Time-reversal symmetry (T-symmetry) enforced Dynamics Model (TDM), which establishes consistency between a pair of forward and reverse latent dynamics. TDM provides both well-behaved representations for small datasets and a new reliability measure for OOD samples based on compliance with the T-symmetry. These can be readily used to construct a new offline RL algorithm (TSRL) with less conservative policy constraints and a reliable latent space data augmentation procedure. Based on extensive experiments, we find TSRL achieves great performance on small benchmark datasets with as few as 1% of the original samples, which significantly outperforms the recent offline RL algorithms in terms of data efficiency and generalizability.

For agents

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

get_harvested_code_for_paper("2306.04220")
get_code_for_paper("2306.04220")
have("2306.04220")

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

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

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

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

Connect an agent — have() is free.