Deep & Advanced RL
Level: 2 (Recall: definitions, standard textbook problems, short derivations) Time Limit: 30 minutes Total Marks: 40
Q1. State the DQN loss function used to train the Q-network, defining every symbol. Explain briefly why a target network with parameters is used instead of the online parameters . (4 marks)
Q2. Explain the purpose of experience replay in DQN. List two concrete benefits it provides during training. (3 marks)
Q3. In standard DQN the TD target is . Write the Double DQN target and state, in one sentence, what problem it fixes. (4 marks)
Q4. Describe the Dueling DQN architecture. Write the aggregation equation that combines the value stream and advantage stream , and state why the mean-subtraction term is required. (4 marks)
Q5. State the REINFORCE policy-gradient update rule. Starting from the policy gradient theorem explain in one line how REINFORCE estimates . (4 marks)
Q6. Define the advantage function in terms of and . Explain in two sentences how the actor–critic method uses the critic to reduce variance compared to REINFORCE. (4 marks)
Q7. Write the PPO clipped surrogate objective, defining the probability ratio and the clipping parameter . State why clipping is preferred over TRPO's hard KL constraint. (5 marks)
Q8. Soft Actor-Critic (SAC) optimizes a maximum-entropy objective. Write the entropy-regularized objective it maximizes and state, in one sentence, the practical benefit of the entropy term. (4 marks)
Q9. Numerical / short computation: Given a single episode with rewards and discount factor , compute the discounted return (return from the first step) used by REINFORCE. Show working. (4 marks)
Q10. Distinguish between model-based and model-free RL in one sentence each, and give one example algorithm of each type. Briefly explain what reward shaping does for sparse-reward problems. (4 marks)
End of paper.
Answer keyMark scheme & solutions
Q1. (4 marks) Loss:
- = replay buffer; = online network params; = target network params; = discount factor. (2 marks: 1 for loss form, 1 for symbol definitions)
- Target network reasoning: the bootstrap target depends on the network's own predictions; if the target used it would shift every gradient step, causing a "moving target" and unstable/diverging training. Freezing (updated periodically) stabilizes the target. (2 marks)
Q2. (3 marks)
- Purpose: store past transitions in a buffer and sample mini-batches randomly for updates. (1 mark)
- Benefits (any two, 1 each): (i) breaks temporal correlation between consecutive samples → data closer to i.i.d.; (ii) improves data efficiency by reusing transitions many times; (iii) smooths the training distribution / reduces variance. (2 marks)
Q3. (4 marks) Double DQN target: i.e. the online network selects the action, the target network evaluates it. (3 marks)
- Fixes the overestimation bias of the operator caused by using the same network to both select and evaluate the action. (1 mark)
Q4. (4 marks)
- Architecture: a shared feature backbone splits into two streams — a scalar value stream and a per-action advantage stream . (1.5 marks)
- Aggregation: (1.5 marks)
- Mean subtraction is needed for identifiability: and are unidentifiable up to a constant; forcing the advantages to have zero mean makes the decomposition unique and stabilizes learning. (1 mark)
Q5. (4 marks) REINFORCE update: where . (3 marks)
- REINFORCE replaces with the Monte-Carlo return (an unbiased sample estimate of ). (1 mark)
Q6. (4 marks)
- Advantage: . (2 marks)
- Variance reduction: the critic estimates as a baseline, so the actor is updated using (or a TD error) rather than the raw high-variance return ; subtracting the state-dependent baseline lowers gradient variance without adding bias. (2 marks)
Q7. (5 marks)
- = probability ratio; = clip range (e.g. 0.2); = advantage estimate. (3 marks)
- Clipping preferred because it enforces a "trust region" with only first-order updates (simple SGD), avoiding TRPO's expensive second-order/conjugate-gradient computation of the KL constraint. (2 marks)
Q8. (4 marks) SAC objective: where is the policy entropy and the temperature. (3 marks)
- Benefit: the entropy bonus encourages exploration and robustness, preventing premature convergence to deterministic policies. (1 mark)
Q9. (4 marks) (Working: 2 marks; correct value 2.62: 2 marks)
Q10. (4 marks)
- Model-free: learns a policy/value function directly from experience without modeling the environment (e.g. DQN or PPO). (1 mark)
- Model-based: learns/uses a model of transition dynamics and reward to plan or generate imagined data (e.g. Dyna-Q or MBPO). (1 mark)
- Reward shaping: adds an auxiliary shaping reward (ideally potential-based ) to give denser feedback and guide the agent toward goals in sparse-reward tasks without changing the optimal policy. (2 marks)
[
{"claim":"Discounted return G1 = 1 + 0.9*0 + 0.81*2 = 2.62","code":"r1,r2,r3,g=1,0,2,0.9; G1=r1+g*r2+g**2*r3; result = abs(G1-2.62)<1e-9"},
{"claim":"Dueling mean-subtraction preserves Q sum invariance: subtracting mean of advantages leaves aggregation consistent","code":"import sympy as sp; A=[sp.Symbol('a%d'%i) for i in range(3)]; V=sp.Symbol('V'); mean=sum(A)/3; Q=[V+(a-mean) for a in A]; result = sp.simplify(sum(Q) - (3*V + (sum(A)-3*mean)))==0"},
{"claim":"Double DQN action selection by online net differs structurally from vanilla max (checked via symbolic distinctness of two Q tables)","code":"import sympy as sp; qon=[sp.Integer(1),sp.Integer(3)]; qtar=[sp.Integer(5),sp.Integer(2)]; a_star=0 if qon[0]>qon[1] else 1; ddqn=qtar[a_star]; vanilla=max(qtar); result = (ddqn==2) and (vanilla==5) and (ddqn!=vanilla)"},
{"claim":"PPO clip bounds ratio into [1-eps,1+eps] for eps=0.2","code":"eps=0.2; r=1.5; clipped=min(max(r,1-eps),1+eps); result = abs(clipped-1.2)<1e-9"}
]