KAIST and CMU's QCS Fixes Offline AI Training, Scoring 90.3 on D4RL
A new NeurIPS paper shows how to blend return-conditioned supervised learning with Q-functions by weighting the Q-aid based on how good each trajectory is.
ProTakeaways
- QCS combines RCSL stability with Q-function stitching via return-weighted loss integration in offline RL.
- Q-functions over-generalize on expert data because near-identical actions produce nearly flat Q-surfaces across the action space.
- NTK analysis confirms expert-trained Q-networks cannot distinguish actions, while medium-data networks generalize locally.
- Loss adds
lambda*(R*-R(tau))*Q(s,pi(s))to RCSL, weighting Q-aid inversely to trajectory quality. - Beats SOTA on D4RL MuJoCo (90.3 avg) and AntMaze large-diverse (77.3 vs IQL 47.5).
- Code and details at the QCS project page; paper on arXiv.
Offline reinforcement learning has two dominant camps that each solve half the problem. Return-conditioned supervised learning (RCSL) methods like Decision Transformer train stably by treating RL as sequence prediction, but they cannot stitch together good pieces from bad trajectories. Q-learning can stitch, but it goes haywire when trained on near-optimal data. A team from KAIST and CMU has a clean fix: Q-Aided Conditional Supervised Learning (QCS), which adaptively mixes the two based on how good each trajectory in the dataset actually is.
The result is a method that significantly outperforms prior value-based methods, RCSL, and combined methods across the datasets on the standard D4RL benchmarks, and in several cases beats the best trajectory that exists in the training data.
Two methods, opposite failure modes
The paper starts with a clean diagnostic. The authors train a Decision Transformer (RCSL) and a max-Q policy on both expert and medium-replay datasets and compare them. RCSL crushes on expert data (110 on hopper-expert) but collapses on medium-replay. Max-Q does the opposite, scoring 92 on hopper-medium-replay but essentially 0 on the expert version.
Why the flip? RCSL is imitation with a return knob. Give it a dataset of optimal demonstrations and it happily mimics them. Give it a pile of mediocre trajectories with a few good segments buried inside, and it has no mechanism to splice those segments together. It picks the action tied to the highest return-to-go it has seen from a state, even if a completely different action leads to a better long-term path through a different trajectory.
A Q-function, in principle, solves that through dynamic programming: the Bellman backup propagates value across trajectory boundaries, letting the policy pick the action with the highest expected return even if that specific sub-path was never observed end-to-end. So why does it fail on expert data?
The over-generalization trap
This is the paper's most interesting contribution. When you train a Q-function on expert data, all the in-sample actions for a given state are packed into a tiny region of the action space and have nearly identical Q-values. A neural network fitting this ends up learning a function that is essentially flat across the action dimension. The nearly identical value at the in-sample actions is extrapolated to OOD actions, yielding a nearly flat Q-value over the entire action space for each given state.
The authors verify this two ways. First, on a toy 1D car environment, they show that regressing a Q-network onto expert data produces heatmaps where Q is a function of state only, with action essentially ignored. On medium data, the same network recovers the true Q surface accurately.

Second, they use the Neural Tangent Kernel (NTK) to formalize this. The NTK measures how a gradient update at one state-action pair changes predictions at another. On expert data, the normalized NTK stays high across the entire action space, meaning the network cannot distinguish actions. On medium data, NTK values decay with action distance, indicating proper local generalization. Inspecting the network weights confirms it: for expert data, the action-column weights of the first layer are driven to zero.

The QCS recipe
The fix follows directly from the diagnosis. You want the Q-function's help exactly when the trajectory is bad (RCSL is unreliable, Q generalizes properly), and you want to ignore it when the trajectory is good (RCSL is reliable, Q is over-generalized). The paper turns this into a loss function:
L_QCS(phi) = E_tau[ (1/K) * sum_j (
||a_{t+j} - pi(tau_{t:t+j})||^2 # RCSL term
- lambda * (R* - R(tau)) * Q_IQL(s_{t+j}, pi(...)) # Q-aid term
)]
The weight lambda * (R* - R(tau)) is the whole trick. R(tau) is the return of the full trajectory the sub-sequence was sampled from. R* is the optimal return (either known or approximated by the max return in the dataset). When a sub-trajectory comes from a near-optimal trajectory, the weight vanishes and the policy just does RCSL. When it comes from garbage, the Q-aid term dominates and pulls the policy toward actions the Q-function ranks highly.
Two implementation notes matter. The Q-function is pretrained with Implicit Q-Learning and then frozen, avoiding the instability of joint actor-critic training. And the weight uses full trajectory return R(tau), not the return-to-go used inside RCSL, because RTG decreases along a trajectory and would incorrectly downweight later timesteps of optimal paths.
The numbers
On D4RL MuJoCo, QCS averages 90.3 across nine datasets, versus 83.1 for the best value-based baseline (SQL), 82.4 for the best combined method (CGDT), and 82.2 for the best pure RCSL (Decision ConvFormer). The gains are concentrated where you'd expect: on medium-replay datasets full of suboptimal trajectories, QCS gains 10+ points over the closest baseline on halfcheetah and walker2d.
The AntMaze results are more striking. This benchmark tests long-horizon stitching with sparse rewards, where RCSL methods traditionally flatline. On antmaze-large-diverse, DT scores 0.5 and Decision ConvFormer scores 12.3. QCS-G hits 77.3, roughly matching or beating POR (73.4) and doubling IQL (47.5).
What it's good for and where it doesn't help
QCS is a drop-in replacement for offline RL algorithms when you have a static dataset of mixed quality and need a policy that can do better than the best trajectory in that dataset. Practical scenarios include robotic manipulation logs, autonomous driving fleet data, and healthcare treatment histories where trajectories are heterogeneous.
- Best fit: datasets with many suboptimal trajectories mixed with a few good ones, where stitching matters
- Marginal fit: pure expert datasets, where plain RCSL already saturates
- Overhead: requires pretraining a Q-function with IQL before the policy phase (about 215 minutes total on their benchmarks, comparable to CQL)
- Sensitivity: mostly robust to
lambdaacross 0.2 to 1.5, though walker2d-medium degrades at larger values
The project page hosts code and additional materials. The method plugs into existing RCSL backbones, and the authors test it on Decision Transformer, Decision ConvFormer, and plain MLP variants with only minor differences in performance, so you can pick whatever fits your existing pipeline.