TL;DR
Teaching an AI from pre-recorded logs is easy when the data is great, and miserable when 97% of it is mediocre. This paper introduces the Distribution Corrected Decision Transformer (DCDT), a method that mathematically un-skews imbalanced datasets so sequence-modeling RL agents can find needles of expert behavior in haystacks of noisy, suboptimal actions. By fixing both how the agent evaluates actions and how it copies them, DCDT boosts performance by 33% over prior state-of-the-art methods on heavily skewed benchmarks.
What Problem Does This Paper Address?
In offline reinforcement learning (RL), agents must learn optimal behavior strictly from static, pre-collected datasets—no live trial-and-error allowed. Recently, the Decision Transformer (DT) reframed RL as a sequence-modeling problem (much like GPT predicts text): feed the model a desired future return and past states, and it predicts the next action.
Here is the catch: in the real world, expert demonstrations are expensive, while mediocre logs are cheap and plentiful. When datasets are heavily imbalanced—dominated by clumsy trajectories with only a tiny fraction of high-return examples—standard DTs get pulled toward the suboptimal majority.
Recent variants (like Q-Transformer) try to fix this by strapping on a value-estimating "critic" (a Q-function learned via Temporal-Difference, or TD, learning) to nudge the Transformer toward better actions. However, the authors point out a fundamental paradox: the critic itself is trained on the same skewed dataset. Because standard TD learning focuses on the most frequent transitions, the critic becomes biased and unreliable—an "unreliable compass" trying to guide the policy.
Methods
To fix both the compass and the traveler, the authors propose Distribution Corrected Decision Transformer (DCDT). Everything hinges on estimating an importance weight (or density ratio): how much more likely a state-action pair is to appear under an optimal policy compared to the skewed dataset.
What is new versus standard:
- Double-KL Regularized Dual Optimization (New): Because we don't know the optimal policy in advance, the authors use Lagrangian duality (building on the DICE family of RL estimators) to solve for these weights via a clean, closed-form convex optimization problem. Crucially, instead of using a single Kullback-Leibler (KL) penalty to keep the policy close to the dataset, they introduce a double-KL objective:
- One KL term pulls the distribution toward a small reference subset of high-return trajectories (for optimality).
- A second KL term anchors it to the full offline dataset (to prevent dangerous out-of-distribution hallucinations).
- Dual-Level Correction (New): Prior methods only used density weights to filter behavioral cloning. DCDT applies the learned weights twice:
- Weighted TD Learning: It re-weights the Bellman error when training the Q-function (built on standard Clipped Double Q-learning), forcing the critic to be accurate on regions that actually matter for optimal behavior.
- Weighted Policy Extraction: It uses the exact same weights to prioritize high-quality transitions in the Decision Transformer’s behavioral cloning loss, alongside Q-value maximization.
Datasets
The authors evaluate DCDT on custom-mixed, highly imbalanced regimes built from the standard D4RL benchmark, alongside illustrative navigation tasks:
- Gym-MuJoCo Locomotion (
hopper,halfcheetah,walker2d,ant): Large pools of "random" or "medium" data mixed with either 200 ("+Expert") or just 30 ("+Few-Expert", ~3% of the data) expert trajectories. - Adroit Manipulation (
pen,door,hammer,relocate): High-dimensional robotic hand tasks mixing "cloned" or variable "human" demonstrations with expert trajectories. - Maze2D (
open,umaze,medium,large) & Four Rooms: 2D navigation tasks mixing 20 expert paths with 100 random trajectories (under sparse and dense rewards) to test trajectory "stitching."
Key Insights and Ideas
- Fixing the critic is half the battle: Ablations prove that re-weighting policy training and re-weighting Q-learning provide additive gains. Correcting one without the other leaves significant performance on the table.
- Why Double-KL enables "stitching": In a 2D Four Rooms maze, relying only on high-return alignment copies the single clean expert route, while relying only on dataset support wanders aimlessly. Combining both allows the model to lock onto the goal and stitch together alternative valid shortcuts hidden inside the noisy data.
- Dual beats Primal in imbalanced regimes: Standard RL methods often compute weights directly from learned Q-values ("primal" advantage weighting). Under severe imbalance, Q-values collapse and produce noisy weights. Enforcing conservation of flow across states (the Bellman flow constraint) in the dual space is far more stable, yielding a 17.4% average boost over primal weighting.
- No expert labels? No problem: If a dataset has no distinct high-quality subset, you can simply set the first KL weight ($\alpha_1$) to zero. The math gracefully reduces to a purely reward-driven correction that still beats prior DT baselines.
Key Results
- Overall SOTA on Imbalanced Suites: Across all six imbalanced Gym and Adroit dataset configurations, DCDT achieves the highest average score, improving normalized returns by 33% over Q-Transformer (QT).
- Extreme Dilution Robustness: In the brutal Gym
Random + Few-Expertsetting (~3% expert data), QT drops to an average score of 62.16, while DCDT maintains 101.00 (e.g., jumping from 31.47 to 130.08 onant). - Complex Manipulation: On Adroit
Cloned + Expert, DCDT scores 125.70 on average, outperforming both value-guided DTs (VDT at 84.88, QT at 75.86) and pure distribution-correction baselines (ReCOIL at 90.25). - Minimal Compute Overhead: Despite adding an extra dual network to estimate weights, DCDT adds only ~6% wall-clock training time and 1.4% peak memory over QT.
Limitations and Future Work
Not discussed in the paper. (Note: Within the provided main text, the authors do not include a dedicated limitations or future work section, though they note a theoretical gap between idealized oracle weights—which can be unbounded—and their practical regularized estimator, which they bridge via finite-sample bounds in the Appendix.)
Summary updated