How to Provably Improve Return Conditioned Supervised Learning?

Zhishuai Liu, Yu Yang, Ruhan Wang, Pan Xu, Dongruo Zhou

TL;DR

Return-Conditioned Supervised Learning (RCSL) avoids the training instabilities of offline reinforcement learning by treating policy learning as supervised sequence modeling, but it traditionally lacks the ability to "stitch" together the best fragments of different suboptimal trajectories. This paper introduces Reinforced RCSL ($R^2\text{CSL}$), a framework that discards the standard trajectory-consistency assumption and instead conditions policies at each step on the in-distribution optimal return-to-go. This simple modification provably guarantees stitching ability without requiring unstable dynamic programming.

What Problem Does This Paper Address?

Offline reinforcement learning (RL) learns policies from static datasets without environment interaction. Standard methods rely on dynamic programming (DP) via temporal difference (TD) learning, which allows "stitching"—combining the best segments of multiple suboptimal trajectories into an optimal one. However, TD-learning is notoriously unstable and sensitive to hyperparameters.

Return-Conditioned Supervised Learning (RCSL) methods, like Decision Transformer (DT) and RvS, reframe offline RL as supervised learning: conditioning actions on the current state and a target Return-to-Go (RTG). While stable and straightforward, RCSL historically fails at stitching. Because traditional RCSL enforces step-to-step return consistency along a single observed trajectory, its policy cannot outperform the best individual trajectory present in the dataset.

The authors ask: Can we improve return-conditioned supervised learning to have provable stitching ability without falling back to full dynamic programming?

Methods

To unlock stitching, the authors propose Reinforced RCSL ($R^2\text{CSL}$):

  1. Discarding Consistency: Classical RCSL assumes that test-time target returns satisfy $f(s_h, h) = f(s_{h+1}, h+1) + r_h$. $R^2\text{CSL}$ drops this constraint, allowing the conditioning target to change dynamically at every timestep.
  2. In-Distribution Optimal RTG: At inference, rather than decrementing the return along a single trajectory, the agent looks ahead at each state $s_h$ and selects $f^\star(s, h)$—the maximum return-to-go achievable within the offline dataset from that state.
  3. Quantile vs. Expectile Regression: To estimate $f^\star(s, h)$ from data:
  4. Expectile regression (asymmetric $L_2$ loss) introduces bias when $\alpha \neq 1$, often outputting non-existent, out-of-distribution returns that hurt performance.
  5. Quantile regression (asymmetric $L_1$ loss) is robust to noise; the authors prove that with sufficient samples and $\alpha > 1 - \tilde{c}/2$ (where $\tilde{c}$ is the dataset coverage of the optimal RTG), quantile regression exactly recovers $f^\star$.
  6. Multi-Step Stitching Extension: The authors also show that iteratively relabeling dataset RTGs backwards for $H-1$ passes establishes a formal bridge between RCSL and dynamic programming, recovering the optimal value function $V^{\star, \beta}$ in deterministic environments.

Datasets

The authors evaluate $R^2\text{CSL}$ across:

  • PointMaze (Simulated Navigation): A custom 2D navigation task specifically designed to test trajectory stitching under varying proportions of optimal sub-trajectories (coverage factor $\tilde{c} \in \{1\%, 10\%\}$).
  • D4RL Benchmark:
  • Gym-MuJoCo: Continuous locomotion tasks (HalfCheetah, Hopper, Walker2d) across medium, medium-replay, and medium-expert datasets.
  • AntMaze: Maze navigation tasks (umaze, umaze-diverse, medium-play, medium-diverse) that strictly require stitching fragments of undirected exploration.

Key Insights and Ideas

  • Stitching Without Dynamic Programming: Standard RCSL is limited because it blindly commits to the target return of a single trajectory from start to finish. Re-evaluating the best local return-to-go at each timestep allows the policy to jump onto higher-value trajectories observed from that state.
  • The Failure Mode of Expectile Regression: While expectile regression is common in recent offline RL algorithms, asymmetric $L_2$ penalties pull the estimate toward an expectation across modes. In discrete return distributions, this predicts returns that never occurred in the dataset, leading to out-of-distribution action queries. Quantile regression avoids this by predicting valid distribution percentiles.
  • Finite-Sample Guarantees: The paper proves sample complexity bounds for $R^2\text{CSL}$ in tabular and general function approximation settings, matching classical RCSL rates while converging to a strictly superior stitched policy.

Key Results

  • PointMaze Navigation: When optimal sub-paths made up only $1\%$ of the dataset, selecting $\alpha = 0.99$ in quantile regression reliably stitched disjoint trajectories to reach the goal, whereas lower $\alpha$ values failed.
  • D4RL Gym Benchmarks:
  • RvS Integration: $R^2\text{CSL}$-Quantile achieved an aggregate score of 601.91, substantially outperforming vanilla RvS across fixed target ratios (523.66 at 0.9 ratio, 502.68 at 1.1 ratio).
  • Decision Transformer (DT) Integration: DT-$R^2\text{CSL}$ scored 688.22 (expectile) and 687.83 (quantile) total, improving upon vanilla DT (672.6).
  • Hybrid DP Variants: When combined with Q-value regularization (DP-$R^2\text{CSL}$), scores reached 764.55, approaching the state-of-the-art QT baseline (808.2).
  • AntMaze: DT-$R^2\text{CSL}$ achieved a total score of 141.0 vs. vanilla DT's 112.2, demonstrating successful stitching on tasks where naive supervised learning typically fails completely (e.g., scoring $>2.4$ vs $0.0$ on medium-play and medium-diverse).

Limitations and Future Work

  • Stochastic Environments: Like all return-conditioned supervised learning methods, $R^2\text{CSL}$ struggles when transitions are stochastic. A high observed return might reflect environment luck rather than optimal actions, leading to suboptimality. Extending provable guarantees to stochastic MDPs remains an open theoretical problem.
  • Sample Complexity Rate: The derived finite-sample bound scales as $\mathcal{O}(N^{-1/4})$, which is looser than the standard $\mathcal{O}(N^{-1/2})$ rate typical in offline RL analysis; closing this theoretical gap is left for future work.

Summary updated

BibTeX
@inproceedings{liu2025how,
  author = {Zhishuai Liu and Yu Yang and Ruhan Wang and Pan Xu and Dongruo Zhou},
  title = {{How to Provably Improve Return Conditioned Supervised Learning?}},
  booktitle = {ARLET @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=CHOZxT3mHo},
}
Figure