Unit 9 of 11 · about 4 hours · derive, implement
Direct, model-based, doubly robust and Fitted Q Evaluation estimators
Weights alone are too noisy and models alone are too trusting. This unit combines them, then measures estimators the way they are actually used: to rank and select policies.
You'll be able to
- Derive the doubly robust estimator as model plus importance-weighted residual, with its either-side correctness condition.
- Implement Fitted Q Evaluation as iterated supervised regression and compare it with IS estimates against a known truth.
- Judge estimators by rank correlation and selection regret, not by one point error.
Covers
Read
In this order, only the parts listed
0 of 3 done
- The doubly robust estimator and its variance analysisDoubly Robust Off-policy Value Evaluation for Reinforcement Learning
Sections 1-3 of arXiv:1511.03722v3: the bandit estimator with Equation 8, the sequential extension, unbiasedness when either the behavior policy is known or the model is correct, and the variance analysis
- FQE inside constrained batch policy learningBatch Policy Learning under Constraints (Fitted Q Evaluation)
Algorithm 3 of arXiv:1903.08738v1: the iterated target with supervised regression per round; read with the surrounding section on the three estimator families (importance weighting, direct methods, doubly robust)
- DOPE: ranking metrics and the method comparisonBenchmarks for Deep Off-Policy Evaluation
Sections 3.2 and 4-5 of arXiv:2103.16596v1: absolute error versus rank correlation and selection regret, the FQE, DR, and IS implementations compared, and Figure 7 with the reported scatter of estimate against ground truth
Focus on
- Doubly robust adds an importance-weighted residual onto a model prediction: when the model is right the residual averages out, and when the weights are right the residual fixes the model. Either side being correct keeps the estimate unbiased; neither side rescues missing support.
- FQE never touches a weight: it regresses a Q-function onto targets built with the target policy's own actions, round after round. Its error is Bellman error plus function-approximation error plus coverage error, compounded over iterations.
- The three families trade differently: weighting is unbiased but noisy, direct methods are quiet but biased by model error, and doubly robust inherits the better side per state when at least one side is right.
- Selection needs ordering, not accuracy: a biased estimator that ranks policies correctly selects well with a bad point error, while an unbiased but noisy one can pick a loser. The benchmark reports both, and the ranking metrics decide.
Common mistakes · 3
- Claiming double robustness against bad models and bad coverage at once. The guarantee needs one correct side; an unsupported action breaks the weight side and an unverifiable region breaks the model side together.
- Iterating FQE many rounds to squeeze the regression loss. Each round fits the previous round's errors too, so late iterations can compound model bias; monitor selection metrics across rounds, not just training loss.
- Reporting the smallest absolute error as the best selector. Rank correlation and regret measure the selection job; a low-error estimator that inverts two close policies fails it.
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.When is the doubly robust estimator unbiased?Answer
When either the behavior policy (hence the weights) is known or the model is correct. One correct side suffices; both wrong means no guarantee. With both sides estimated, the paper's claim is asymptotic: either correctly specified side gives consistency.
2.Ratio 2, reward 1, model value 0.6. What do the model, IS, and doubly robust estimates give?Answer
Model 0.6, IS 2.0, doubly robust 0.6 + 2(1 - 0.6) = 1.4. The residual correction pulls the model toward the weighted evidence without inheriting its full variance.
3.Write the FQE target for one transition.Answer
Immediate cost plus discounted next value under the evaluated policy's own action, regressed with supervised learning each round until the iteration budget runs out.
4.Two estimators: A has half the absolute error of B but ranks the top two policies backwards. Which selects better?Answer
B, if its ranking is right: selection pays regret on the chosen policy, and the inverted top pair is exactly what regret punishes. Report rank correlation and regret alongside error.
You're done when
Your hand doubly robust number matches code, your FQE loop beats IS on ranking while you can still name its bias source, and every estimator you report carries all three metrics.
Only when you can do this without notes.
Leads to
Notes
Resources · 3 for this unit, 11 more in the section
- 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.
Also in this 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.
- 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.
- 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. - 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. - 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.