Papers › Offline Reinforcement Learning as One Big Sequence Modeling Problem

Offline Reinforcement Learning as One Big Sequence Modeling Problem

3 Jun 2021NeurIPS 2021 12arXiv:2106.02039archive 2025-07-28

Michael Janner, Qiyang Li, Sergey Levine

Reinforcement learning (RL) is typically concerned with estimating stationary policies or single-step models, leveraging the Markov property to factorize problems in time. However, we can also view RL as a generic sequence modeling problem, with the goal being to produce a sequence of actions that leads to a sequence of high rewards. Viewed in this way, it is tempting to consider whether high-capacity sequence prediction models that work well in other domains, such as natural-language processing, can also provide effective solutions to the RL problem. To this end, we explore how RL can be tackled with the tools of sequence modeling, using a Transformer architecture to model distributions over trajectories and repurposing beam search as a planning algorithm. Framing RL as sequence modeling problem simplifies a range of design decisions, allowing us to dispense with many of the components common in offline RL algorithms. We demonstrate the flexibility of this approach across long-horizon dynamics prediction, imitation learning, goal-conditioned RL, and offline RL. Further, we show that this approach can be combined with existing model-free algorithms to yield a state-of-the-art planner in sparse-reward, long-horizon tasks.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 28 code samples harvested from 2 repositories linked to this paper: 23 ran (of which 0 constructed an object rather than computing a result; 21 with no instrument failure: 1 honoured, 0 violated, 20 with no contract checked; 2 where Syntology's instrument failed) · 5 unverified. Where Syntology's instrument failed: 2 where our contract draft was wrong; failures of Syntology's instrument, not of the code.

By repository: official repository: 21 samples from 1 repository, 16 ran (14 with no instrument failure; 2 where Syntology's instrument failed); community (archive-listed): 7 samples from 1 repository, 7 ran (7 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written between 2026-09-22 and 2026-09-26 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

JannerM/trajectory-transformer officialmentioned in papermentioned on GitHubpytorchMITSyntology: 21 samples, 16 ran (2 instrument-failed) · 5 unverified report
howuhh/faster-trajectory-transformer mentioned on GitHubpytorchMITSyntology: 7 samples, 7 ran (0 instrument-failed) · 0 unverified report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

28 samples harvested: 23 ran (of which 0 constructed an object rather than computing a result; 21 with no instrument failure: 1 honoured, 0 violated, 20 with no contract checked; 2 where Syntology's instrument failed) · 5 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · honoured contract
2ran · our draft was wrong
20ran
5unverified

Licence: 1 of the 28 samples is pointer only, meaning Syntology does not serve that copy's text. For that sample, this paper's copy is under a permissive licence and cleared, but the stored copy of the same code that Syntology serves is not; the licence label's tooltip gives Syntology's recorded reason. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 2 repositories linked to this paper, official or community; the list below is grouped by repository, each group headed by its name and what it is to the paper. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

JannerM/trajectory-transformer official repository 21 samples, 16 ran (2 instrument-failed) · 5 unverified
add_stop_token trajectory/models/embeddings.py ran MIT (permissive) · f0bbd8cb02e1d63f · report fixture: signature tokens:ndarray/2/float · returned ndarray · level recorded 2026-09-26
ant_preprocess_fn trajectory/datasets/preprocessing.py ran MIT (permissive) · 0164e9415395d715 · report fixture: signature observations:Tensor/2/float · returned Tensor · level recorded 2026-09-26
extract_actions trajectory/search/utils.py ran MIT (permissive) · 9c84ff02a4f59c05 · report fixture: signature x:Tensor/2/float, observation_dim:int/0/int, action_dim:int/0/int, t:int/0/int · returned Tensor · level recorded 2026-09-25
filter_cdf trajectory/search/sampling.py ran fingerprinted MIT (permissive) · c2129c72e2f07f7f · report fixture: signature logits:Tensor/2/float, threshold:float/0/float · returned Tensor · level recorded 2026-09-25
flatten in 178 papers
census: 4 implementations from 7 papers, 4 distinct outputs across 4 buckets, one shared input per bucket
trajectory/models/mlp.py ran MIT (permissive) · 12754b16911ecee4 · report fixture: signature condition_dict:dict/0/? · returned Tensor · level recorded 2026-09-25
get_activation in 218 papers trajectory/models/mlp.py ran · our draft was wrong MIT (permissive) · 308e4d2dcc2d67f2 · report fixture: signature params:dict/0/? · returned function · level recorded 2026-09-24
load_environment in 5 papers trajectory/datasets/d4rl.py ran MIT (permissive) · 8368faab224d9322 · report fixture: signature name:str/0/str · returned CartPoleEnv · level recorded 2026-09-25
make_weights trajectory/models/embeddings.py ran MIT (permissive) · 73db3cbbc056327e · report fixture: signature N:int/0/int, weights:list/1/float · returned ndarray · level recorded 2026-09-26
normalize in 638 papers
census: 70 implementations from 82 papers, 51 distinct outputs across 11 buckets, one shared input per bucket
trajectory/utils/arrays.py ran fingerprinted MIT (permissive) · e256f0dfb18dd284 · report fixture: signature x:Tensor/2/float · returned Tensor · level recorded 2026-09-25
qlearning_dataset_with_timeouts trajectory/datasets/d4rl.py ran MIT (permissive) · 47b8a48fc0f2ac80 · report fixture: signature env:MockEnv/0/?, dataset:NoneType/0/?, terminate_on_end:bool/0/bool · returned dict · level recorded 2026-09-25
round_to_multiple trajectory/search/sampling.py ran fingerprinted MIT (permissive) · 35aa466eb16f5e15 · report fixture: signature x:int/0/int, N:int/0/int · returned int · level recorded 2026-09-25
segment in 11 papers trajectory/datasets/sequence.py ran MIT (permissive) · 48bd963796baa6f4 · report fixture: signature observations:ndarray/2/float, terminals:ndarray/1/bool, max_path_length:int/0/int · returned tuple · level recorded 2026-09-25
to_np in 63 papers
census: 8 implementations from 14 papers, 2 distinct outputs across 2 buckets, one shared input per bucket this sample: bucket 1 of 2, arg 1: rank 2, kind float, dtype float32
trajectory/utils/arrays.py ran · honoured contract MIT (permissive) here; the stored copy is pointer only · 0e8d8251e66ab160 · report fixture: signature x:Tensor/2/float · returned ndarray · level recorded 2026-09-22
to_torch in 53 papers
census: 5 implementations from 6 papers, 2 distinct outputs across 2 buckets, one shared input per bucket
trajectory/utils/arrays.py ran MIT (permissive) · 429e141abcf66681 · report fixture: signature x:ndarray/2/float, dtype:dtype/0/?, device:str/0/str · returned Tensor · level recorded 2026-09-25
top_k_logits in 36 papers
census: 6 implementations from 10 papers, 4 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
trajectory/search/sampling.py ran · our draft was wrong fingerprinted MIT (permissive) · 0f0021cdea13e4da · report fixture: signature logits:Tensor/2/float, k:int/0/int · returned Tensor · level recorded 2026-09-22
vmap trajectory/datasets/preprocessing.py ran MIT (permissive) · 3e098abac7794b97 · report fixture: signature fn:callable/0/? · returned function · level recorded 2026-09-25
beam_plan trajectory/search/core.py unverified MIT (permissive) · f3d303190e64c4e4 · report
beam_search in 25 papers trajectory/search/core.py unverified MIT (permissive) · c6b3fddb40879156 · report
kitchen_preprocess_fn trajectory/datasets/preprocessing.py unverified MIT (permissive) · d3a9e7f0b010aa47 · report
make_prefix in 11 papers trajectory/search/utils.py unverified MIT (permissive) · 6dafa63552e84e1c · report
update_context in 5 papers trajectory/search/utils.py unverified MIT (permissive) · 6ba529c9388c1d12 · report
howuhh/faster-trajectory-transformer community (archive-listed) 7 samples, 7 ran (0 instrument-failed) · 0 unverified
create_env in 6 papers trajectory/utils/env.py ran MIT (permissive) · 36bb7ea2ef4a54a3 · report fixture: signature name:str/0/str · returned CartPoleEnv · level recorded 2026-09-24
d4rl_dataset trajectory/datasets/get_d4rl.py ran MIT (permissive) · 730393eba4e1cb7a · report fixture: signature env:MockEnv/0/? · returned dict · level recorded 2026-09-24
join_trajectory trajectory/datasets/d4rl_dataset.py ran MIT (permissive) · 8fe2aea76aedd71b · report fixture: signature states:ndarray/2/float, actions:ndarray/2/float, rewards:ndarray/2/float, discount:float/0/float · returned ndarray · level recorded 2026-09-24
round_to_multiple trajectory/utils/common.py ran fingerprinted MIT (permissive) · e58135c9c7b6ed0e · report fixture: signature number:int/0/int, multiple:int/0/int · returned int · level recorded 2026-09-24
segment in 11 papers trajectory/datasets/d4rl_dataset.py ran MIT (permissive) · 53c137a7abd88735 · report fixture: signature states:list/1/ndarray, actions:list/1/ndarray, rewards:list/1/ndarray, terminals:list/1/Tensor · returned tuple · level recorded 2026-09-24
top_k_logits in 36 papers
census: 6 implementations from 10 papers, 4 distinct outputs on one shared input
trajectory/utils/common.py ran fingerprinted MIT (permissive) · c7cbcd467cc49a53 · report fixture: signature logits:Tensor/2/float, k:int/0/int · returned Tensor · level recorded 2026-09-24
weight_decay_groups trajectory/utils/common.py ran MIT (permissive) · ae1cccd21623b2cc · report fixture: signature model:callable/0/?, whitelist_modules:tuple/1/callable, blacklist_modules:tuple/1/callable, blacklist_named:NoneType/0/? · returned dict · level recorded 2026-09-24

Tasks

Imitation LearningOffline RLReinforcement LearningReinforcement Learning (RL)reinforcement-learning

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections