SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.05427 · NeurIPS · 2024

Decision Mamba: A Multi-Grained State Space Model with Self-Evolution Regularization for Offline RL

Chen, Xiang Deng, Qi Lv, Michael Wang, Liqiang Nie

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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, 1 violated it and 0 have no contract verdict; 7 failures of our instrument; 1 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2406.05427.json · badge: /api/ran/2406.05427.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
aopolin-lv/DecisionMamba canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
Toshihiro-Ota/decision-mamba canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
discount_cumsum Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aopolin-lv/DecisionMamba/experiment-d4rl/experiment.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from bkkgbkjb/oppo, is pointer only (licence: NONE) · get_code("0161b27cbe3cc58d")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from bkkgbkjb/oppo, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

add_hook Ran
ran; our contract draft was wrong, not the code
aopolin-lv/DecisionMamba/experiment-d4rl/visualize.py
code served (permissive licence) · get_code("f219cb4953f6a929")
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 torch
from torch import nn

torch.manual_seed(0)

# Create a minimal mixer module
class Mixer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Create a layer with a mixer
class Layer(nn.Module):
    def __init__(self):
        super().__init__()
        self.mixer = Mixer()
    
    def forward(self, x):
        return self.mixer(x)

# Create a backbone with layers
class Backbone(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([
            Layer(),
            Layer(),
            Layer()
        ])
    
    def forward(self, x):
        for layer in self.layers:
            x = layer(x)
        return x

# Create a transformer_model with backbone
class TransformerModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.backbone = Backbone()
    
    def forward(self, x):
        return self.backbone(x)

# Create the main model
class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.transformer_model = TransformerModel()
    
    def forward(self, x):
        return self.transformer_model(x)

# Build the model
model = Model()

ARGS = {
    'model': model
}
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 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
add_hook_group Ran
ran; our contract draft was wrong, not the code
aopolin-lv/DecisionMamba/experiment-d4rl/visualize.py
code served (permissive licence) · get_code("167ed5cb9b55d213")
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 torch
from torch import nn

torch.manual_seed(0)

# Build a minimal mixer layer with the required structure
class MixerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Build a backbone with layers
class Backbone(nn.Module):
    def __init__(self, num_layers=2):
        super().__init__()
        self.layers = nn.ModuleList([
            self._make_layer() for _ in range(num_layers)
        ])
    
    def _make_layer(self):
        layer = nn.Module()
        layer.mixer_group = MixerLayer()
        return layer

# Build a transformer model with backbone
class TransformerModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.backbone = Backbone(num_layers=2)
    
    def forward(self, x):
        return x

# Build the main model
class MainModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.transformer_model = TransformerModel()
    
    def forward(self, x):
        return x

model = MainModel()

ARGS = {
    'model': model
}
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 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
evaluate_episode_rtg Ran
ran; our contract draft was wrong, not the code
Toshihiro-Ota/decision-mamba/gym/util/trainer.py
code served (permissive licence) · get_code("0b9a2957d531f968")
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. 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 numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create a minimal environment mock
class MockEnv:
    def __init__(self, state_dim, act_dim):
        self.state_dim = state_dim
        self.act_dim = act_dim
        self.step_count = 0
    
    def reset(self):
        return np.random.randn(self.state_dim).astype(np.float32)
    
    def step(self, action):
        self.step_count += 1
        state = np.random.randn(self.state_dim).astype(np.float32)
        reward = np.random.randn()
        done = self.step_count >= 5
        info = {}
        return state, reward, done, info

# Create a minimal model that implements get_action
class MockModel(nn.Module):
    def __init__(self, state_dim, act_dim):
        super().__init__()
        self.state_dim = state_dim
        self.act_dim = act_dim
        self.linear = nn.Linear(state_dim, act_dim)
    
    def get_action(self, states, actions, returns_to_go, timesteps):
        # states shape: (seq_len, state_dim)
        # returns_to_go shape: (1, seq_len)
        # timesteps shape: (1, seq_len)
        # actions shape: (seq_len, act_dim)
        batch_size = states.shape[0]
        action = self.linear(states[-1:])  # Get action for last state
        return action

state_dim = 4
act_dim = 3
env = MockEnv(state_dim, act_dim)
model = MockModel(state_dim, act_dim)

state_mean = np.zeros(state_dim, dtype=np.float32)
state_std = np.ones(state_dim, dtype=np.float32)

ARGS = {
    'env': env,
    'state_dim': state_dim,
    'act_dim': act_dim,
    'model': model,
    'max_ep_len': 10,
    'scale': 1000.0,
    'target_return': 100.0,
    'mode': 'normal',
    'state_mean': state_mean,
    'state_std': state_std,
    'device': 'cpu'
}
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 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
get_config_class_from_processor_class Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aopolin-lv/DecisionMamba/transformers/utils/create_dummy_models.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from takagi97/OXA-Fine-tuning, is pointer only (licence: NONE) · get_code("3d999b95009c7537")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from takagi97/OXA-Fine-tuning, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_optimizer Ran
ran; our contract draft was wrong, not the code
aopolin-lv/DecisionMamba/experiment-d4rl/utils.py
code served (permissive licence) · get_code("c7fc1727fb00a10b")
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 AdamW. 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
from torch import optim
from transformers.trainer_pt_utils import get_parameter_names
from transformers.pytorch_utils import ALL_LAYERNORM_LAYERS

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Linear(4, 8)
        self.group_layer1 = nn.Linear(8, 6)
        self.group_layer2 = nn.LayerNorm(6)
        self.other_layer = nn.Linear(6, 3)
        self.other_bias = nn.Parameter(torch.randn(3))
        
    def forward(self, x):
        x = self.embedding(x)
        x = self.group_layer1(x)
        x = self.group_layer2(x)
        x = self.other_layer(x)
        return x

model = SimpleModel()

# Ensure all parameters require gradients
for param in model.parameters():
    param.requires_grad = True

ARGS = {
    'args': {
        'pretrained_lm': True,
        'weight_decay': 0.01,
        'learning_rate': 1e-4,
        'group_learning_rate': 5e-5,
    },
    'model': model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AdamW — a AdamW output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamW 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_processor_types_from_config_class Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
aopolin-lv/DecisionMamba/transformers/utils/create_dummy_models.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from takagi97/OXA-Fine-tuning, is pointer only (licence: NONE) · get_code("0c0b81b081919d8e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from takagi97/OXA-Fine-tuning, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

str_to_bool Ran
ran, violated the contract we drafted
aopolin-lv/DecisionMamba/experiment-d4rl/utils.py
code served (permissive licence) · get_code("7b11f2a122671aa8")
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

ARGS = {
    'value': 'true'
}
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
get_architectures_from_config_class Not yet run
unverified (harvested, no recorded run)
aopolin-lv/DecisionMamba/transformers/utils/create_dummy_models.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from takagi97/OXA-Fine-tuning, is pointer only (licence: NONE) · get_code("b176efb26f72e507")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from takagi97/OXA-Fine-tuning, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 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
get_config_class_from_processor_class 27 other papers
11 dated earlier, 14 later, 2 same year, order not determinable
2007.07779 (2020-07)
AdapterHub: A Framework for Adapting Transformers
2308.12219 (2023-08)
Diffusion Language Models Can Perform Many Tasks with Scaling and Instruction-Finetuning
2311.07468 (2023-11)
An Analysis and Mitigation of the Reversal Curse
and 24 more not named here
get_architectures_from_config_class 25 other papers
10 dated earlier, 14 later, 1 same year, order not determinable
2308.12219 (2023-08)
Diffusion Language Models Can Perform Many Tasks with Scaling and Instruction-Finetuning
2311.07468 (2023-11)
An Analysis and Mitigation of the Reversal Curse
2312.15710 (2023-12)
Alleviating Hallucinations of Large Language Models through Induced Hallucinations
and 22 more not named here
get_processor_types_from_config_class 25 other papers
10 dated earlier, 14 later, 1 same year, order not determinable
2308.12219 (2023-08)
Diffusion Language Models Can Perform Many Tasks with Scaling and Instruction-Finetuning
2311.07468 (2023-11)
An Analysis and Mitigation of the Reversal Curse
2312.15710 (2023-12)
Alleviating Hallucinations of Large Language Models through Induced Hallucinations
and 22 more not named here
discount_cumsum 17 other papers
16 dated earlier, 1 later
2106.01345 (2021-06)
Decision Transformer: Reinforcement Learning via Sequence Modeling
2110.06206 (2021-10)
StARformer: Transformer with State-Action-Reward Representations for Visual Reinforcement Learning
2111.10364 (2021-11)
Generalized Decision Transformer for Offline Hindsight Information Matching
and 14 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

While the conditional sequence modeling with the transformer architecture has demonstrated its effectiveness in dealing with offline reinforcement learning (RL) tasks, it is struggle to handle out-of-distribution states and actions. Existing work attempts to address this issue by data augmentation with the learned policy or adding extra constraints with the value-based RL algorithm. However, these studies still fail to overcome the following challenges: (1) insufficiently utilizing the historical temporal information among inter-steps, (2) overlooking the local intrastep relationships among return-to-gos (RTGs), states and actions, (3) overfitting suboptimal trajectories with noisy labels. To address these challenges, we propose Decision Mamba (DM), a novel multi-grained state space model (SSM) with a selfevolving policy learning strategy. DM explicitly models the historical hidden state to extract the temporal information by using the mamba architecture. To capture the relationship among RTG-state-action triplets, a fine-grained SSM module is designed and integrated into the original coarse-grained SSM in mamba, resulting in a novel mamba architecture tailored for offline RL. Finally, to mitigate the overfitting issue on noisy trajectories, a self-evolving policy is proposed by using progressive regularization. The policy evolves by using its own past knowledge to refine the suboptimal actions, thus enhancing its robustness on noisy demonstrations. Extensive experiments on various tasks show that DM outperforms other baselines substantially.

For agents

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

get_harvested_code_for_paper("2406.05427")
get_code_for_paper("2406.05427")
have("2406.05427")

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

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

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

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

Connect an agent — have() is free.