Module 5. Learning from fixed data: imitation, deep Q-methods, and offline RL
Choose your answers and select “Check”. Numbers accept a decimal point, comma, or simple fraction. Answers and drafts are saved in this browser and shared between RU/EN.
Use the author’s worked answers to review open questions and code tasks yourself. Code does not run on this site.
Checked: 0 / 5 · Correct: 0
Question P01 · Terminal transition versus external truncation
A transition has reward , , and .
- Compute the DQN target after a true terminal trap.
- Compute the target when collection stops at an external time limit, is observed, and the task could continue.
- Explain why a single
done=Trueflag can corrupt learning.
Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.
Question P02 · Map the support of a fixed log
At state , a log contains 900 left transitions, 100 up transitions, and no right or down transitions. A Q-network outputs
in the order left, up, right, down.
Which actions are empirically supported? What does a naive greedy policy choose? What extra assumption would be required to trust right?
Question P03 · Replay memory is not a fixed offline dataset
Two systems train from one million transitions.
- System A keeps interacting, evicts old replay entries, and adds new ones.
- System B receives one immutable file and never runs the environment while training.
Both use the same DQN target. Which system is offline RL, and why does the common local loss not make the regimes equivalent?
Question P04 · What feedback standard DAgger requires
For each signal, decide whether it is sufficient for a standard DAgger iteration:
Why does the phrase “feedback on current-policy behavior” not make all four algorithms identical?
Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.
Question P05 · Find the sign error in a CQL penalty
The function below operates on one state. q_values contains all action values and logged_action is the dataset action.
import numpy as np
def cql_penalty_bad(q_values: np.ndarray, logged_action: int) -> float:
q = np.asarray(q_values, dtype=float)
return float(np.log(np.exp(q).sum()) + q[logged_action])
- Find the sign error.
- Make the computation numerically stable.
- Explain why this term alone is not a full CQL algorithm.
Question P06 · An expectile above the mean
For one state, dataset-action values are . Let and .
- Compute the weighted squared residuals.
- Which way will move?
- Why is this not the same as taking the maximum 4?
Question P07 · One FQE target
At the next state, the evaluation policy chooses two actions with probabilities . The target Q-model outputs . The transition has , , and is non-terminal.
- Compute the FQE target.
- Compare it with a Q-learning target.
- What changes at a true terminal?
Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.
Question P08 · A Decision Transformer target outside the data
Training return-to-go values lie between and . Deployment requests .
Name three possible outcomes. Which one is guaranteed by the DT training loss, and how should the regime be tested?
Question P09 · Causal leakage in Decision Transformer
A preprocessing pipeline feeds current return-to-go, state, the current correct action, and asks the model to predict that same action.
Why is training accuracy misleading? What causal shift is required?
Question P10 · Match data to method
Match each dataset to the most direct baseline objective: SFT/BC, classical offline RL, DPO, or ILQL.
- a prompt and one demonstration response without reward;
- preferred/rejected response pairs;
- prefix–token sequences with an outcome reward;
- environment transitions .
For each, name one object absent from the other settings.
Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.
Question P11 · Hidden tests for a behavior-support mask
A student implements
def behavior_support_mask(probabilities, threshold):
"""Return a Boolean mask for actions whose behavior probability is supported."""
Propose at least six hidden tests that reject return probabilities > 0 and constant masks.
Question P12 · Report an internal experiment without overclaiming
In one pinned run, naive offline DQN solved no episodes while CQL and IQL solved all episodes. Choose the defensible statement and reject the others.
Only your selection or numeric part is checked automatically. Compare your reasoning with the author’s worked answer.