Unit 11 of 11 · about 4 hours · implement, measure
Normalization consistency, abstention and fallback, and online audit of estimators
Offline work ends in a deployment decision, not a leaderboard number. This unit turns support limits into running guards: consistent preprocessing, abstention with fallback, and an audit that cannot leak into selection.
You'll be able to
- Apply one frozen normalization from logged data through deployment, with its version recorded.
- Define a support-based abstention rule with a fallback policy and a data-collection trigger.
- Run an online audit of the section estimators against simulator truth after selection is frozen.
Covers
Read
In this order, only the parts listed
0 of 3 done
- Minari dataset standards and basic usageMinari Offline Datasets
Dataset Standards: observation and action spaces, episode and step records, and versioned dataset ids; Basic Usage (https://minari.farama.org/content/basic_usage/): iterating episodes with their recorded spaces (pages read 2026-10-14)
Read the standards as a contract your pipeline must satisfy: the spaces and version you train against are the spaces and version you deploy against.
- Homework 1: the normalized interfaceStanford CS224R Spring 2026 - Imitation and Offline RL
Environment section: 4-D normalized observations with the target position action in [0, 1]; Problems 1 and 3: the same interface under cloning and under DAgger aggregation
- Control Laboratory: the offline-data stretchReinforcement Learning Control Laboratory - Offline Stretch
Stretch goals: add offline data with off-policy estimates calibrated against simulator truth
Focus on
- Fit every normalization statistic once on the logged data, freeze it, and apply the identical transform at deployment. Refitting on deployment batches or normalizing splits separately silently moves the support boundary your earlier diagnostics certified.
- Abstention needs a numeric rule: a support or density test on the state-action pair that routes failures to a fallback policy (for example the cloning baseline on supported regions) and logs the event as a data-collection trigger.
- The fallback policy is itself a claim that needs support evidence: it is only safer where its own training distribution covers the abstention region, so characterize its coverage too instead of assuming safety.
- Online ground truth audits estimators after selection is frozen. The audit compares importance and fitted-value estimates against simulator returns on held-out policies; nothing it reveals may change a choice.
Common mistakes · 3
- Normalizing with running deployment statistics. The transform becomes a function of the deployment stream, so training and deployment see different mappings and the support test certifies nothing.
- Treating abstention rate as a safety metric by itself. A policy that abstains everywhere is useless and one that never abstains may be blind; report abstention with fallback return and trigger counts.
- Auditing on the selection policies and stopping. The audit must include held-out policies the estimators never saw during selection, or it measures memory instead of generalization.
Try it yourself
Closed-book, before checking anything
Quiz yourself
Answer first, then mark it. Missed ones go to Review.
0 got · 0 missed
1.Why must normalization statistics be frozen from the logged data?Answer
The policy and every support diagnostic were certified under one fixed mapping. A refitted mapping moves states across the certified boundary, so earlier coverage claims no longer apply to the deployed inputs.
2.State a complete abstention rule in one sentence each for test, fallback, and trigger.Answer
Test: route to fallback when the pair's support score falls below the threshold set on held-out logged data. Fallback: execute the cloning baseline restricted to supported regions. Trigger: log the event with state, score, and version for the next collection round.
3.What may the online audit change?Answer
Nothing about selection. It scores the frozen estimators against simulator truth and records where they fail; any change it suggests belongs to a new documented study round.
4.The fallback is plain behavior cloning. Is the deployed system now safe?Answer
Only where cloning itself has support evidence. The fallback needs its own coverage characterization over the abstention region; outside that, the system must escalate or stop, not silently proceed.
Practice
- Minari tutorial: PointMaze D4RL dataset creation
Recreate the maze dataset pipeline on CPU: waypoint planner, controller with action noise, the truncation callback that splits continuing episodes, and dataset creation with id, algorithm name, code permalink, and author recorded
CPU-scale; needs Gymnasium-Robotics with MuJoCo. Treat it as the collection-trigger drill: a versioned dataset built by a known controller, with the identity fields your audit trail will later require.
You're done when
Your pipeline applies one frozen normalization end to end, abstains on a demonstrated unsupported region with fallback and trigger logs, and your audit table separates selection policies from held-out ones.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 11 more in the section
- Stanford CS224R Spring 2026 - Imitation and Offline RLStanford University · primary
Study Lecture 02 (imitation: behavior cloning, covariate shift, DAgger) and Lecture 07 (offline RL). Homework 1 (behavior cloning, flow matching and DAgger on a small Flappy Bird environment) runs on CPU; Homework 3 (AWAC, IQL and a stitching study) runs on cloud GPUs, so read it for the losses. Follow the Stanford honor code for course materials.
- Minari Offline DatasetsFarama Foundation · support
Use Minari as the dataset source for offline experiments: it serves Gymnasium-native datasets that download without login (start with a small MuJoCo set such as
mujoco/invertedpendulum/expert-v0). Record the dataset id and version with every result. - Reinforcement Learning Control Laboratory - Offline StretchRoadmap-Final · support
Add the project offline-data stretch only after online control passes. Calibrate importance or fitted-value estimates against simulator truth and expose one support-mismatch failure before hiding online access.
Also in this section
- Berkeley CS 185/285 Deep Reinforcement Learning (Spring 2026) - Imitation and Offline RLUC Berkeley · required
Slides are public at https://rail.eecs.berkeley.edu/deeprlcourse/static/slides/lec-N.pdf; current videos are not, and the public Fall 2023 playlist numbers lectures differently. Study Lectures 2 and 3 (behavioral cloning) and Lectures 17 and 18 (offline RL). Homework 1 (MSE and flow-matching action-chunk policies) runs on a laptop CPU; Homework 5 (SAC+BC, IQL and FQL on OGBench) needs a GPU, so debug on the smallest task and treat full 1M-step sweeps as optional.
- Offline Reinforcement Learning: Tutorial, Review and PerspectivesLevine et al. · required
Study the problem definition, distribution-shift failure, policy constraints, uncertainty and model-based/model-free taxonomy. Use it to state which offline assumptions each implementation relies on.
- Implicit Q-LearningKostrikov et al. · required
Derive the expectile value loss, Q target and advantage-weighted policy update. Implement fixed-batch loss tests and compare IQL with behavior cloning across dataset quality and coverage.
- Conservative Q-Learning for Offline Reinforcement LearningKumar et al. (NeurIPS 2020) · support
Read the conservative regularizer and the lower-bound argument. Implement the regularizer on a fixed batch and show how it lowers Q-values on actions the dataset does not contain.
- DAggerRoss, Gordon and Bagnell · support
Read the no-regret reduction and interactive data-aggregation loop. Demonstrate compounding error in a controlled imitation task, then show exactly what additional expert queries change.
- Generative Adversarial Imitation LearningHo and Ermon (NeurIPS 2016) · support
Read the occupancy-measure view of imitation and the discriminator-as-reward construction. State what GAIL needs that behavior cloning does not (environment interaction) and what it recovers instead of a reward.
- Cal-QL: Calibrated Offline RL Pre-Training for Efficient Online Fine-TuningNakamoto et al. (NeurIPS 2023) · support
Read why conservative values cause an initial dip when online fine-tuning starts and how calibration bounds the values. Measure the first online episodes after offline training with and without the fix.
- Doubly Robust Off-policy Value Evaluation for Reinforcement LearningJiang and Li (ICML 2016) · support
Read the per-decision importance-sampling estimator, the doubly robust form and its variance analysis. Implement ordinary, weighted and doubly robust estimates on logged trajectories from a small MDP whose true value you can compute.
- Batch Policy Learning under Constraints (Fitted Q Evaluation)Le, Voloshin and Yue (ICML 2019) · support
Read the Fitted Q Evaluation algorithm and its role inside the constrained learner. Implement FQE on your logged data and compare it with the importance-sampling estimates against the true value.
- Benchmarks for Deep Off-Policy EvaluationFu et al. (ICLR 2021) · support
Read the evaluation protocol and the metrics for estimator quality and offline model selection (rank correlation, regret of the selected policy). Use them to judge your estimators instead of one point error.
- Hands-on Modern RL - Offline RL and Imitation ConceptsWalking Labs · support
Use the offline data and distribution-shift page and the imitation chapter as pre-reading for BCQ, CQL, IQL, behavior cloning, DAgger and GAIL. They have no runnable offline or imitation scripts and no off-policy evaluation. Pin commit 9231bab of walkinglabs/hands-on-modern-rl; its
code/chapterNNfolders do not follow the site chapter numbers.