D4RL Is a Benchmark of Offline RL Failure Modes
A JeTech research note on D4RL, dataset quality, normalized scores, Minari, and what trading research should borrow from the benchmark.
Summary
D4RL stands for Datasets for Deep Data-Driven Reinforcement Learning. It is a benchmark suite for offline RL.
The focus is the dataset. In online RL, the agent interacts with the environment. In D4RL, the agent receives a fixed dataset and must learn without new interaction.
D4RL is often treated like an ImageNet-style benchmark for offline RL. A better description is a collection of offline RL failure modes: narrow data, biased behavior, mixed-quality trajectories, multi-task data, and trajectory stitching. The benchmark was designed because older offline RL evaluations did not expose these difficulties well.
JeTech should borrow the dataset discipline, not the leaderboard. D4RL teaches us how to define datasets, compare algorithms, normalize scores, and fix evaluation protocols.
The Problem D4RL Addressed
Offline RL is practical:
existing dataset
-> train policy
-> avoid dangerous online explorationResearch comparison was messy. If each paper uses different datasets, preprocessing, environments, and evaluation, we cannot isolate algorithm quality. D4RL provided common datasets and protocols.
The BAIR D4RL article explains the motivation: real-world datasets are hard to evaluate, while simple simulator datasets miss offline RL's hardest issues. D4RL keeps evaluation in simulation but designs datasets to mimic practical data problems.
Dataset Types
D4RL is not just a pile of transitions. Its dataset collection modes are part of the benchmark.
| Dataset type | Offline RL difficulty |
|---|---|
| Random | weak reward signal, few good trajectories |
| Medium | room for improvement, but support is narrow |
| Medium-replay | mixed quality from replay buffers |
| Medium-expert | medium and strong behavior mixed |
| Expert | easy for BC, hard for improvement due to narrow support |
| Human/demo | non-Markovian and suboptimal behavior |
| Multi-task | requires trajectory stitching |
Trading has similar categories.
| D4RL idea | Trading equivalent |
|---|---|
| random dataset | random exposure and rebalance |
| medium dataset | simple trend following or mean reversion |
| expert dataset | hindsight or oracle-like actions, with leakage risk |
| medium-expert mix | multiple synthetic action labelers |
| replay dataset | trajectories from past candidate policies |
| multi-task dataset | symbols, regimes, horizons mixed |
JeTech's synthetic action labeler mix mirrors this problem. Random actions provide support but weak reward. Oracle-like actions create leakage risk. Trend, reversion, random, and volatility-aware labelers should be mixed.
Task Families
D4RL includes several domains:
| Family | Examples | Purpose |
|---|---|---|
| Gym locomotion | HalfCheetah, Hopper, Walker2d | dense-reward continuous control |
| AntMaze / Maze2D | navigation | trajectory stitching and sparse reward |
| Adroit | dexterous manipulation | high-dimensional actions and demonstrations |
| Kitchen | multi-task manipulation | subtask composition |
| CARLA / Flow | driving and traffic | sequential decision problems |
Algorithm rankings change by family. A method that works on dense locomotion may fail on sparse navigation. Trading has the same issue: a bull-market winner can fail in a sideways or high-volatility regime.
JeTech should benchmark by:
symbol x regime x horizon x cost x algorithmOne average score is not enough.
Normalized Score
D4RL uses normalized score:
normalized_score = 100 * (policy_return - random_return)
/ (expert_return - random_return)This makes task scores more comparable. Trading cannot copy it directly because expert return and random return depend on costs, leverage, and horizon.
JeTech can adapt the idea:
| D4RL | JeTech equivalent |
|---|---|
| random return | random exposure baseline |
| expert return | hindsight upper bound or simple-strategy upper band |
| normalized return | baseline-adjusted Sharpe, Calmar, drawdown score |
| episode return | cost-adjusted portfolio return |
| success rate | real gate pass rate |
The goal is to stop comparing raw Sharpe in isolation. A policy can raise Sharpe by increasing turnover and still lose net value after costs.
D4RL Limitations
It Is Not a Finance Benchmark
D4RL focuses on robotics, locomotion, and navigation. It does not model non-stationarity, heavy tails, regime shifts, transaction costs, slippage, borrow costs, or liquidity constraints.
D4RL success does not imply trading success. It is useful for implementation sanity checks and algorithm understanding.
D4RL Has Ecosystem Migration Issues
The Farama D4RL repository now points users toward Minari. The Minari announcement explains that D4RL datasets are moving into a standard offline RL dataset API.
For JeTech, Minari matters as an API and metadata pattern. It should not become a production dependency for trading research unless we need it for benchmark experiments.
Scores Hide Implementation Differences
Offline RL is sensitive to preprocessing and hyperparameters. CORL and A Clean Slate for Offline RL matter because they reduce implementation noise.
To compare IQL and ReBRAC, JeTech should fix:
| Area | Requirement |
|---|---|
| synthetic paths | same world model samples |
| action labelers | same trajectory generation policy |
| reward | same costs and drawdown penalty |
| model capacity | same encoder where possible |
| training budget | same gradient steps or wall-clock budget |
| real gate | same periods, symbols, costs |
D3RL vs D4RL
The names are easy to confuse.
| Name | Identity | Role |
|---|---|---|
| D4RL | benchmark dataset suite | evaluate offline RL algorithms |
| d3rlpy | Python offline/deep RL library | train algorithms through a library API |
d3rlpy can run algorithms such as CQL, IQL, BCQ, and TD3+BC. D4RL is the benchmark dataset suite. For JeTech implementation details, CORL remains the closer reference. d3rlpy is useful for API ideas and sanity experiments.
A JeTech Internal D4RL
JeTech needs a finance-specific D4RL-style benchmark. The important part is dataset cards, not the name.
dataset card
symbol set
date range
market regime tags
observation schema
action labeler mix
reward formula
transaction cost
leverage cap
train/validation/test split
world model version
generation seed
quality metricsDataset types should be explicit:
| Internal dataset type | Description |
|---|---|
random-v1 | exposure support check |
trend-medium-v1 | simple momentum labeler |
reversion-medium-v1 | contrarian labeler |
mixed-medium-v1 | random, trend, reversion mix |
stress-tail-v1 | crash and volatility-spike oversampling |
regime-mix-v1 | bull, bear, range, high-vol balance |
candidate-replay-v1 | trajectories from past candidate policies |
With this structure, algorithm research becomes cleaner. We can compare IQL, ReBRAC, CQL, TD3+BC, and Diffusion-QL on the same dataset, then see how rankings change when the dataset changes.
Research Position
D4RL is not the scoreboard JeTech should optimize. It is a design reference for building our own scoreboard.
We should keep three ideas:
1. Compare algorithms on fixed datasets. 2. Store dataset quality and collection policy as metadata. 3. Fix evaluation protocols and normalized comparisons.
We should reject one idea: that a D4RL leaderboard predicts trading policy quality. The final judge is the real market gate.