Trajectory Stitching for Offline Reinforcement Learning

582 concepts254 papers1 proposal

The fundamental promise of offline reinforcement learning (RL) is the ability to learn optimal behavior from suboptimal, static datasets. In a perfect world, an agent could look at a collection of failed attempts and mediocre demonstrations and somehow extract a path to success. The mechanism that enables this is trajectory stitching: the ability to synthesize a globally optimal path by combining segments from different suboptimal trajectories that intersect in the state space.

As noted in D4RL: Datasets for Deep Data-Driven Reinforcement Learning, stitching is a critical bottleneck. If an agent cannot stitch, it is forever limited to the performance of the single best trajectory in its training set.

The Divide Between Supervised and Value-Based Learning

The research landscape is currently split by how models handle this composition of experience. Traditional dynamic programming and temporal difference (TD) methods, such as Conservative Q-Learning for Offline Reinforcement Learning, naturally perform stitching. By propagating values across overlapping transitions, these methods build a global map of the environment's rewards.

In contrast, Return-Conditioned Supervised Learning (RCSL)—the logic behind the Decision Transformer—often struggles with this task. Brandfonbrener et al. reveal that while RCSL is stable and easy to scale, it requires nearly deterministic environments and high-quality data coverage. Because these models treat RL as a sequence modeling problem, they are often constrained by the complete trajectories present in the training data, preventing the discovery of superior paths that were never explicitly demonstrated.

This limitation is further explored by Omori et al., who argue that in sparse-reward settings, Transformer-based architectures frequently fail to demonstrate effective stitching, sometimes performing worse than simple data-filtering strategies like Filtered Behavior Cloning.

Why Stitching Fails

The failure to stitch often stems from a lack of "connective tissue" in the data or the model's representation.

  1. Unique Histories: In partially observable environments, stitching fails because observation histories are often unique. As the authors of Offline RL with Observation Histories: Analyzing and Improving Sample Complexity explain, if an agent cannot recognize that two different paths have reached functionally equivalent points, it cannot bridge them.
  2. Optimistic Stitching: When guided by biased reward functions, agents may perform "optimistic stitching"—creating unrealistic, physically ungrounded paths that fail during real-world execution, a problem addressed by Tu et al. through trajectory return regularization.
  3. Data Gaps: Fragmented trajectories often leave gaps in the state space. Dukkipati et al. point out that failing to bridge these disconnected regions prevents the agent from synthesizing a cohesive global policy.

Generative and Hierarchical Solutions

To overcome these hurdles, researchers are moving toward generative and hierarchical architectures that explicitly facilitate the connection of disparate data segments.

Diffusion-based Planning: Generative models have proven highly effective at stitching. Venkatraman et al. introduce Latent Diffusion-Constrained Q-learning (LDCQ), which reasons in a temporally abstract latent space to connect transition points between disparate sequences. Similarly, Kim proposes iterative sub-trajectory stitching using conditional diffusion, which circumvents the need for global trajectory optimization by combining suboptimal segments into high-quality plans.

Hierarchical Decomposition: Breaking tasks into subgoals allows for more flexible stitching. Shin et al. developed the Guider framework, which uses a high-level policy to generate reachable "stepping stones." This allows a low-level controller to solve complex tasks that were never successfully completed in the original dataset. Ma et al. further this by reinterpreting the Decision Transformer as a hierarchical model, replacing static prompts with optimized value estimates that allow the model to target the maximum achievable value from its current state.

Bridging the Gap with Data Augmentation

Another promising direction involves "forcing" the model to learn multi-step reachability through combinatorial generalization. Ghugare et al. introduce a temporal data augmentation technique that creates new training triplets from disjoint trajectories. By identifying waypoint states and swapping goals, the model learns to connect experiences it never saw together.

Similarly, Lei et al. use a dynamics model to identify intersection points between disparate trajectories, creating synthetic training pairs that enable an agent to link separate sequences of behavior.

Conclusion

Trajectory stitching is what separates simple imitation from true reinforcement learning. Whether through the geometric regularizers proposed by Giammarino et al. or the distributional successor features of Zhu et al., the goal remains the same: enabling agents to look at a fragmented past and imagine a coherent, optimal future. As these methods mature, the ability to solve multi-stage tasks from "messy" offline data—as demonstrated by the IRIS framework in Mandlekar et al.—will be the key to deploying robust autonomous systems in the real world.

History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_trajectory_stitching_b24d503f,
  title = {trajectory stitching},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/trajectory-stitching/rdr_b24d503f849c40abb19fb83df3817bc7},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-26},
}

This exact version (version 1, frozen text):

@misc{lacuna_trajectory_stitching_b24d503f_v1,
  title = {trajectory stitching},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/trajectory-stitching/rdr_b24d503f849c40abb19fb83df3817bc7/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-26},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake