MauryaHub PYQ Practice

Reinforcement Learning · End Term · Jan 2026 · FN

Reinforcement Learning · End Term · Jan 2026 FN

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

21 / 22 published solutions

Question 2 MCQ · 0.0 marks

**INSTRUCTIONS:** This paper contains bonus questions marked with **[Bonus]** at the beginning of the question. These questions carry 0 marks toward the regular total of 30 and do not contribute to the End Term score. However, correct answers will earn additional bonus marks, which will be added to your final score in accordance with the grading policy. Attempting these questions is optional, and there is no penalty for incorrect or unattempted bonus questions.
6406536959552.
Instructions has been mentioned above.
6406536959553.
This Instructions is just for a reference & not for an evaluation.

Published solution

**1. Acknowledge the exam instructions:** This 0-mark administrative question confirms that the candidate has read the bonus-question instructions above. **Answer: A — Instructions has been mentioned above.** A: **Correct:** Standard acknowledgment option for the exam instructions. B: **Incorrect:** Standard instructions require selecting Option A.

Report a correction for Q2

Question 3 MCQ · 1.0 marks

An option
Source diagram or notation
is defined as a triple. Which of the following correctly lists **all three** components of an option?
6406536959554.
State space, action space, reward function
6406536959555.
Initiation set, option policy, termination function
6406536959556.
Value function, behaviour policy, discount factor
6406536959557.
Transition model, reward model, termination condition

Published solution

**1. Recall the definition of an Option in Hierarchical RL:** In the Options framework (Sutton, Precup & Singh, 1999), an option \( \omega \) is formally defined as a triple \( \langle \mathcal{I}_\omega,\ \pi_\omega,\ \beta_\omega \rangle \): 1. **Initiation set (\( \mathcal{I}_\omega \subseteq \mathcal{S} \)):** the set of states where the option can be invoked. 2. **Option policy (\( \pi_\omega \)):** the intra-option policy mapping states to actions. 3. **Termination function (\( \beta_\omega \)):** the probability of the option terminating in each state. **Answer: B — Initiation set, option policy, termination function.** A: **Incorrect:** State space, action space, and reward function define an MDP, not an option. B: **Correct:** An option is defined by the triple: initiation set, option policy, and termination function. C: **Incorrect:** Value function and discount factor are not components of an option tuple. D: **Incorrect:** Option definitions do not consist of an environment transition/reward model.

Report a correction for Q3

Question 4 MCQ · 1.0 marks

In DDPG, target networks are updated via soft updates
Source diagram or notation
with
Source diagram or notation
. The primary reason for this slow update is:
6406536959558.
To prevent the actor from updating faster than the critic
6406536959559.
To stabilise training by preventing the TD target from changing too rapidly
6406536959560.
To ensure the replay buffer contains on-policy data
6406536959561.
To match the learning rate of the actor and critic networks

Published solution

**1. Understand Polyak soft updates in DDPG:** Updating target network weights slowly via \( \theta' \leftarrow \tau \theta + (1 - \tau)\theta' \) with \( \tau \ll 1 \) keeps the bootstrap TD target \( y = r + \gamma Q_{\phi'}(s', \mu_{\theta'}(s')) \) nearly stationary across updates, **stabilising critic training by preventing the TD target from changing too rapidly**. **Answer: B — To stabilise training by preventing the TD target from changing too rapidly.** A: **Incorrect:** Both actor and critic target networks use soft updates to stabilize TD bootstrapping, not to throttle the online actor relative to the critic. B: **Correct:** Slowly tracking the online parameters prevents feedback oscillations in the bootstrap TD target. C: **Incorrect:** The replay buffer stores off-policy transitions regardless of \( \tau \). D: **Incorrect:** \( \tau \) is the target interpolation rate, separate from the optimizer learning rates.

Report a correction for Q4

Question 5 MCQ · 1.0 marks

DDPG uses an experience replay buffer. What is the direct consequence of using an experience replay buffer
6406536959562.
The policy gradient estimate becomes unbiased
6406536959563.
The algorithm becomes on-policy
6406536959564.
Temporal correlations between consecutive samples are broken
6406536959565.
The critic no longer requires a target network

Published solution

**1. Understand the purpose of the Experience Replay Buffer in DDPG (and DQN):** Consecutive transitions \( (s_t, a_t, r_t, s_{t+1}) \) collected along a trajectory are strongly correlated in time, which violates the i.i.d. assumption of stochastic gradient descent. Storing transitions in a replay buffer and sampling random mini-batches uniformly **breaks the temporal correlations between consecutive samples**. **Answer: C — Temporal correlations between consecutive samples are broken.** A: **Incorrect:** Function approximation in the critic still introduces bias into the deterministic policy gradient. B: **Incorrect:** Using a replay buffer makes the algorithm *off-policy*, not on-policy. C: **Correct:** Random uniform sampling from the replay buffer decorrelates sequential trajectory transitions. D: **Incorrect:** Both experience replay and target networks are needed for stable training in DDPG.

Report a correction for Q5

Question 6 MCQ · 1.0 marks

Compared to the policy gradient, the DPG theorem requires integration over:
6406536959566.
Both state and action spaces
6406536959567.
State space only
6406536959568.
Action space only
6406536959569.
Neither — it requires only a single action sample per state

Published solution

**1. Compare Stochastic Policy Gradient (SPG) vs. Deterministic Policy Gradient (DPG):** - **Stochastic Policy Gradient (SPG):** \( \nabla_\theta J(\theta) = \int_{\mathcal{S}} \rho^\pi(s) \int_{\mathcal{A}} \pi_\theta(a \mid s) \nabla_\theta \ln \pi_\theta(a \mid s) Q^\pi(s, a) \, da \, ds \) integrates over **both state and action spaces**. - **Deterministic Policy Gradient (DPG):** \( \nabla_\theta J(\theta) = \int_{\mathcal{S}} \rho^\mu(s) \nabla_\theta \mu_\theta(s) \nabla_a Q^\mu(s, a)|_{a=\mu_\theta(s)} \, ds \) integrates over the **state space only**. **Answer: B — State space only.** A: **Incorrect:** Integrating over both state and action spaces is required by the stochastic policy gradient, not DPG. B: **Correct:** Because the policy \( a = \mu_\theta(s) \) is deterministic, the expectation in DPG is taken over the state distribution \( \rho^\mu(s) \) only. C: **Incorrect:** There is no integral over the action space in DPG. D: **Incorrect:** DPG still takes an expectation (integral) over the state space.

Report a correction for Q6

Question 7 MCQ · 0.0 marks

**[Bonus]** The TRPO surrogate objective is defined as
Source diagram or notation
where
Source diagram or notation
is an importance-sampling ratio. Why is it justified to optimise
Source diagram or notation
instead of the true objective
Source diagram or notation
6406536959570.Source diagram or notation
is exactly equal to
Source diagram or notation
for all
Source diagram or notation
6406536959571.Source diagram or notation
is a first-order approximation of
Source diagram or notation
, accurate when
Source diagram or notation
is close to
Source diagram or notation
--- precisely the regime enforced by the KL constraint
6406536959572.Source diagram or notation
is an unbiased estimator of
Source diagram or notation
under any policy
6406536959573.
The surrogate eliminates the need for a value function baseline

Published solution

**1. Understand the TRPO surrogate objective \( L_{\theta_{\text{old}}}(\theta) \):** The surrogate objective \( L_{\theta_{\text{old}}}(\theta) \) replaces the intractable new-policy state visitation distribution \( \rho^\pi(s) \) with the old policy's state distribution \( \rho^{\pi_{\text{old}}}(s) \). By Kakade & Langford's performance difference lemma and Schulman et al. (2015), \( L_{\theta_{\text{old}}}(\theta) \) matches \( J(\theta) \) to **first order** around \( \theta_{\text{old}} \), making it an accurate local approximation whenever \( \pi_\theta \) remains close to \( \pi_{\text{old}} \) — which is guaranteed by the trust-region KL constraint \( \bar{D}_{\text{KL}}(\pi_{\text{old}} \| \pi_\theta) \le \delta \). **Answer: B — \( L_{\theta_{\text{old}}}(\theta) \) is a first-order approximation of \( J(\theta) \), accurate when \( \pi_\theta \) is close to \( \pi_{\text{old}} \) --- precisely the regime enforced by the KL constraint.** A: **Incorrect:** \( L_{\theta_{\text{old}}}(\theta) \) uses the old state distribution \( \rho^{\pi_{\text{old}}} \), so it diverges from \( J(\theta) \) when \( \theta \) moves far from \( \theta_{\text{old}} \). B: **Correct:** \( L_{\theta_{\text{old}}}(\theta) \) and \( J(\theta) \) share the same value and gradient at \( \theta = \theta_{\text{old}} \), and the KL constraint keeps \( \theta \) inside the region where this first-order approximation is valid. C: **Incorrect:** Because it uses \( \rho^{\pi_{\text{old}}} \) instead of \( \rho^{\pi_\theta} \), it is a local approximation, not an exact unbiased estimator for arbitrary policies. D: **Incorrect:** TRPO still estimates advantages \( \hat{A}^{\pi_{\text{old}}}(s, a) \) using a value function baseline.

Report a correction for Q7

Question 8 MSQ · 1.0 marks

Which are known limitations or failure modes of DDPG?
6406536959574.
High sensitivity to hyperparameters such as learning rate and architecture
6406536959575.
Inability to handle continuous action spaces
6406536959576.
Brittle training that may diverge without careful tuning
6406536959577.
Deterministic policy requires explicit exploration noise during training

Published solution

**1. Identify the known limitations of DDPG:** - **Option A:** DDPG is highly sensitive to hyperparameters (learning rates, Polyak \( \tau \), exploration noise, network architecture). **True.** - **Option B:** False! DDPG was specifically designed to handle continuous action spaces. - **Option C:** Training can be brittle and unstable (due to critic overestimation and moving targets). **True.** - **Option D:** Because the actor \( \mu_\theta(s) \) is deterministic, external exploration noise must be added explicitly during training. **True.** **Answer: A, C, and D.** A: **Correct:** DDPG is well known for its sensitivity to hyperparameter settings. B: **Incorrect:** DDPG is designed specifically for continuous action spaces. C: **Correct:** DDPG training is often brittle and can diverge without careful tuning. D: **Correct:** A deterministic policy requires explicit external noise to explore.

Report a correction for Q8

Question 9 MSQ · 2.0 marks

Which are not valid estimators of the advantage function
Source diagram or notation
?
6406536959578.Source diagram or notation
6406536959579.Source diagram or notation
6406536959580.Source diagram or notation
6406536959581.Source diagram or notation

Published solution

**1. Check each candidate estimator of the Advantage function \( A^\pi(s_t, a_t) = Q^\pi(s_t, a_t) - V^\pi(s_t) \):** - **Option A (\( r_t + \gamma V(s_{t+1}) - V(s_t) \)):** The 1-step TD residual \( \delta_t \), which is an unbiased estimator of \( A^\pi(s_t, a_t) \) when \( V = V^\pi \). Valid. - **Option B (\( G_t - V(s_t) \)):** Monte Carlo advantage estimate, which is an unbiased estimator of \( A^\pi(s_t, a_t) \). Valid. - **Option C (\( Q(s_t, a_t) - V(s_t) \)):** Direct definition of the advantage function. Valid. - **Option D (\( V(s_t) - Q(s_t, a_t) \) or \( r_t + \gamma V(s_t) - V(s_{t+1}) \)):** Has the **wrong sign** (negates the advantage, or swaps \( s_t \) and \( s_{t+1} \)), so it is **not** a valid estimator of \( A^\pi(s_t, a_t) \). **Answer: D.** A: **Incorrect:** The 1-step TD error \( r_t + \gamma V(s_{t+1}) - V(s_t) \) is a standard valid advantage estimator. B: **Incorrect:** The Monte Carlo return minus baseline \( G_t - V(s_t) \) is a valid advantage estimator. C: **Incorrect:** \( Q(s_t, a_t) - V(s_t) \) is the exact definition of the advantage function. D: **Correct:** Reverses the sign/terms of the advantage function and is therefore NOT a valid estimator.

Report a correction for Q9

Question 10 MSQ · 3.0 marks

Recall standard control algorithms in RL, like Q-Learning, SARSA, Expected SARSA, etc., involve a maximisation step in constructing their target policies. For example: In Q-Learning, the target is:
Source diagram or notation
Which of the following statements are correct? **Select all that apply.**
6406536959582.Source diagram or notation
6406536959583.Source diagram or notation
6406536959584.Source diagram or notation
6406536959585.Source diagram or notation
6406536959586.Source diagram or notation
6406536959587.Source diagram or notation

Published solution

**1. Analyze Maximization Bias and Double Q-Learning (same core concepts as Paper 1617 Q#10):** - **Option B:** Standard Q-learning suffers from maximization (overestimation) bias because the same noisy Q-values are used both to select and to evaluate the maximizing action. **True.** - **Option C:** Double Q-learning eliminates maximization bias by using one network/table \( Q_1 \) to select the argmax action and an independent network/table \( Q_2 \) to evaluate it. **True.** - **Option E:** Even with zero-mean noise on true equal action values, \( \mathbb{E}[\max_a Q(s',a)] > \max_a \mathbb{E}[Q(s',a)] \). **True.** - **Option F:** Clipped Double Q-learning in TD3 addresses this overestimation bias in continuous control. **True.** **Answer: B, C, E, and F.** A: **Incorrect:** Q-learning exhibits overestimation bias, not underestimation bias. B: **Correct:** Reusing the same estimator to select and evaluate the greedy action causes positive maximization bias. C: **Correct:** Double Q-learning decouples action selection (\( Q_1 \)) from action evaluation (\( Q_2 \)). D: **Incorrect:** Averaging inside a single `max` operator does not remove maximization bias. E: **Correct:** By Jensen's inequality, the expectation of the maximum of noisy estimates exceeds the maximum of the expectations. F: **Correct:** TD3 uses twin critics to mitigate overestimation bias in actor-critic methods.

Report a correction for Q10

Question 11 NAT · 1.0 marks

An option
Source diagram or notation
is initiated in state
Source diagram or notation
and executes for
Source diagram or notation
steps with rewards
Source diagram or notation
and
Source diagram or notation
. What is the cumulative discounted return of this option?

Published solution

**1. Set up the cumulative discounted return for the 3-step option:** Given rewards \( r_1 = 1, r_2 = 2, r_3 = 1 \) and discount factor \( \gamma = 0.9 \): \[ G = r_1 + \gamma r_2 + \gamma^2 r_3 \] **2. Calculate:** \[ G = 1 + 0.9(2) + (0.9)^2(1) = 1 + 1.8 + 0.81 = 3.61 \] **Answer: 3.61.**

Report a correction for Q11

Question 12 NAT · 0.0 marks

**[Bonus]** Consider an agent in state
Source diagram or notation
that executes action
Source diagram or notation
. The transition is stochastic: the environment transitions to one of two possible next states according to the following distribution:
Source diagram or notation
with associated immediate rewards:
Source diagram or notation
The Q-value estimates of two independent estimators
Source diagram or notation
and
Source diagram or notation
at each possible next state are given in the tables below.
Source diagram or notation
**Additional parameters:**
Source diagram or notation
Using Double Q-learning with
Source diagram or notation
for action selection and
Source diagram or notation
for action evaluation, compute the expected Double Q-learning target
Source diagram or notation
for updating
Source diagram or notation
:
Source diagram or notation
Round your final answer to **2 decimal places**.

Published solution

**1. Find the greedy action under \( Q_1 \) and evaluate it under \( Q_2 \) at each next state:** - **At next state \( s_1 \) (probability \( 0.6 \), immediate reward \( r_1 = 1 \)):** - \( a^*_1 = \arg\max_a Q_1(s_1, a) = a_1 \) (since \( Q_1(s_1, a_1) = 3.0 > Q_1(s_1, a_2) = 2.0 \)). - Evaluate under \( Q_2 \): \( Q_2(s_1, a_1) = 2.0 \). - Target for \( s_1 \): \( 1 + 0.9(2.0) = 2.8 \). - **At next state \( s_2 \) (probability \( 0.4 \), immediate reward \( r_2 = 3 \)):** - \( a^*_2 = \arg\max_a Q_1(s_2, a) = a_2 \) (since \( Q_1(s_2, a_2) = 4.0 > Q_1(s_2, a_1) = 2.5 \)). - Evaluate under \( Q_2 \): \( Q_2(s_2, a_2) = 1.0 \). - Target for \( s_2 \): \( 3 + 0.9(1.0) = 3.9 \). **2. Compute the expected Double Q-learning target \( Y \):** \[ Y = 0.6(2.8) + 0.4(3.9) = 1.68 + 1.56 = 3.24 \] **Answer: 3.24.**

Report a correction for Q12

Question 13 MCQ · 2.0 marks

Ganesh is designing a robot arm controller with a 6-dimensional continuous action space. He initially uses a stochastic policy
Source diagram or notation
with the standard policy gradient(SPG):
Source diagram or notation
Karthik suggests switching to the Deterministic Policy Gradient (DPG) with policy
Source diagram or notation
:
Source diagram or notation
Karthik argues that DPG is strictly more sample-efficient here. However, Ganesh notices that the current DPG implementation uses only on-policy data sampled under
Source diagram or notation
, and that the robot operates in a noisy, stochastic environment where some states are rarely visited under the greedy policy. Based on the above data, answer the given subquestions.
Why is DPG generally more sample-efficient than SPG in high-dimensional continuous action spaces?
6406536959590.
DPG avoids computing
Source diagram or notation
, which is numerically unstable in high dimensions
6406536959591.
DPG’s gradient integrates over the state space only, whereas SPG integrates over both state and action spaces - requiring far more samples to estimate accurately when
Source diagram or notation
is large
6406536959592.
DPG uses a target network which reduces gradient variance automatically
6406536959593.
DPG enforces determinism, which eliminates exploration noise and thus requires fewer environment interactions

Published solution

**1. Compare sample efficiency of DPG vs. SPG in high-dimensional action spaces:** In a 6-dimensional (or high-dimensional) continuous action space \( \mathcal{A} \subseteq \mathbb{R}^6 \), **Stochastic Policy Gradient (SPG)** must integrate over both the state space \( \mathcal{S} \) and the 6-dimensional action space \( \mathcal{A} \), requiring many action samples to reduce gradient variance. By contrast, **Deterministic Policy Gradient (DPG)** integrates over the **state space only**, making it significantly more sample-efficient when \( \dim(\mathcal{A}) \) is large. **Answer: B — DPG’s gradient integrates over the state space only, whereas SPG integrates over both state and action spaces - requiring far more samples to estimate accurately when \( \dim(\mathcal{A}) \) is large.** A: **Incorrect:** Computing \( \nabla_\theta \ln \pi_\theta \) for a Gaussian policy is simple and numerically stable. B: **Correct:** Avoiding integration over the high-dimensional action space \( \mathcal{A} \) makes DPG much more sample-efficient than SPG. C: **Incorrect:** Vanilla DPG does not inherently include target networks (those were added in DDPG). D: **Incorrect:** DPG still requires exploration noise via a behavior policy during training.

Report a correction for Q13

Question 14 MSQ · 2.0 marks

Ganesh is designing a robot arm controller with a 6-dimensional continuous action space. He initially uses a stochastic policy
Source diagram or notation
with the standard policy gradient(SPG):
Source diagram or notation
Karthik suggests switching to the Deterministic Policy Gradient (DPG) with policy
Source diagram or notation
:
Source diagram or notation
Karthik argues that DPG is strictly more sample-efficient here. However, Ganesh notices that the current DPG implementation uses only on-policy data sampled under
Source diagram or notation
, and that the robot operates in a noisy, stochastic environment where some states are rarely visited under the greedy policy. Based on the above data, answer the given subquestions.
Ganesh’s on-policy DPG implementation is likely to suffer from which of the following problems? Select all that apply.
6406536959594.
Poor coverage of the state space — the greedy policy may never visit states needed for accurate
Source diagram or notation
estimation
6406536959595.
Maximization bias, because the greedy policy always selects the action with highest estimated
Source diagram or notation
6406536959596.
The DPG theorem technically requires an off-policy behaviour policy to ensure sufficient state coverage; on-policy data violates this
6406536959597.
Insufficient exploration, since
Source diagram or notation
is deterministic and produces no stochastic variation in actions
6406536959598.
The action-value gradient
Source diagram or notation
cannot be computed on-policy

Published solution

**1. Analyze why purely on-policy DPG fails in a stochastic/sparse environment:** - **Option A (Poor state-space coverage):** Because \( \mu_\theta(s) \) is greedy/deterministic, rolling out \( \mu_\theta \) on-policy may never visit states and actions needed to learn accurate \( Q_w(s, a) \) gradients. **True.** - **Option B:** Maximization bias is a critic bootstrapping issue, not the distinct problem of on-policy vs. off-policy DPG exploration. - **Option C:** To ensure adequate exploration and state-action space coverage, DPG is formulated as an **off-policy** actor-critic algorithm following a stochastic behavior policy \( \beta(a \mid s) \). **True.** - **Option D (Insufficient exploration):** Because \( \mu_\theta(s) \) is deterministic, it produces zero action variation on its own in a given state. **True.** - **Option E:** False, \( \nabla_a Q_w(s, a)|_{a=\mu_\theta(s)} \) is computed analytically from the differentiable critic network \( Q_w \). **Answer: A, C, and D.** A: **Correct:** A deterministic policy without exploration noise fails to cover the state-action space needed to train the critic \( Q_w \). B: **Incorrect:** The core failure mode described in the passage is lack of exploration in on-policy deterministic rollouts. C: **Correct:** Practical DPG requires an off-policy stochastic behavior policy to explore sufficiently. D: **Correct:** \( \mu_\theta(s) \) is deterministic and generates no exploratory variation in actions. E: **Incorrect:** \( \nabla_a Q_w(s,a) \) is computed by backpropagating through the critic network \( Q_w \) and does not require off-policy data to evaluate at a point.

Report a correction for Q14

Question 15 NAT · 0.0 marks

Ganesh is designing a robot arm controller with a 6-dimensional continuous action space. He initially uses a stochastic policy
Source diagram or notation
with the standard policy gradient(SPG):
Source diagram or notation
Karthik suggests switching to the Deterministic Policy Gradient (DPG) with policy
Source diagram or notation
:
Source diagram or notation
Karthik argues that DPG is strictly more sample-efficient here. However, Ganesh notices that the current DPG implementation uses only on-policy data sampled under
Source diagram or notation
, and that the robot operates in a noisy, stochastic environment where some states are rarely visited under the greedy policy. Based on the above data, answer the given subquestions.
**[Bonus]** Ganesh adds Gaussian exploration noise
Source diagram or notation
,
Source diagram or notation
, with
Source diagram or notation
. The DPG actor update for a single sample is:
Source diagram or notation
Given
Source diagram or notation
, and for a particular state
Source diagram or notation
:
Source diagram or notation
Compute the
Source diagram or notation
-norm of the parameter update vector
Source diagram or notation
. Round to 4 decimal places.

Published solution

**1. Set up the single-sample DPG actor update:** \[ \Delta \theta = \alpha \nabla_\theta \mu_\theta(s_t) \nabla_a Q_w(s_t, a)\big|_{a = \mu_\theta(s_t)} \] **2. Substitute the given values:** With \( \alpha = 0.005 \), \( \nabla_a Q_w = 3.0 \), and \( \nabla_\theta \mu_\theta(s_t) = [1.2, 0.8]^T \): \[ \Delta \theta = 0.005 \times 3.0 \times \begin{bmatrix} 1.2 \\ 0.8 \end{bmatrix} = 0.015 \times \begin{bmatrix} 1.2 \\ 0.8 \end{bmatrix} = \begin{bmatrix} 0.018 \\ 0.012 \end{bmatrix} \] **3. Compute the \( L_2 \)-norm \( \|\Delta \theta\|_2 \):** \[ \|\Delta \theta\|_2 = \sqrt{(0.018)^2 + (0.012)^2} = \sqrt{0.000324 + 0.000144} = \sqrt{0.000468} \approx 0.021633 \approx 0.0216 \] **Answer: 0.0216.**

Report a correction for Q15

Question 16 MSQ · 3.0 marks

A Bernoulli-logistic unit is a stochastic neuron whose output
Source diagram or notation
follows a Bernoulli distribution:
Source diagram or notation
The unit receives a feature vector
Source diagram or notation
as input. Let
Source diagram or notation
denote the action preference for action
Source diagram or notation
in state
Source diagram or notation
under policy parameter
Source diagram or notation
. Assume that difference in action preferences is a linear function of the input:
Source diagram or notation
The softmax (exponential soft-max) policy converts preferences to probabilities:
Source diagram or notation
The REINFORCE (Monte Carlo policy gradient) update rule is:
Source diagram or notation
where
Source diagram or notation
is the return from time
Source diagram or notation
, and
Source diagram or notation
is called the eligibility vector. Based on the above data, answer the given subquestions.
Applying the softmax distribution to the Bernoulli-logistic unit, which of the following correctly expresses
Source diagram or notation
?
6406536959600.Source diagram or notation
6406536959601.Source diagram or notation
6406536959602.Source diagram or notation
6406536959603.Source diagram or notation

Published solution

**1. Derive \( \pi_\theta(1 \mid s) \) for the Bernoulli-logistic unit:** We are given the softmax policy over \( a \in \{0, 1\} \) and preference difference \( h(s, 1, \theta) - h(s, 0, \theta) = \theta^T \mathbf{x}(s) \): \[ \pi_\theta(1 \mid s) = \frac{e^{h(s, 1, \theta)}}{e^{h(s, 0, \theta)} + e^{h(s, 1, \theta)}} \] Dividing numerator and denominator by \( e^{h(s, 1, \theta)} \) gives: \[ \pi_\theta(1 \mid s) = \frac{1}{1 + e^{-(h(s, 1, \theta) - h(s, 0, \theta))}} = \frac{1}{1 + e^{-\theta^T \mathbf{x}(s)}} = \sigma(\theta^T \mathbf{x}(s)) \] Equivalently, dividing numerator and denominator by \( e^{h(s, 0, \theta)} \) gives: \[ \pi_\theta(1 \mid s) = \frac{e^{\theta^T \mathbf{x}(s)}}{1 + e^{\theta^T \mathbf{x}(s)}} \] These two equivalent forms match **Options A and C**. **Answer: A and C.** A: **Correct:** Dividing top and bottom of the softmax by \( e^{h(s,1,\theta)} \) yields the logistic sigmoid \( \frac{1}{1 + e^{-\theta^T \mathbf{x}(s)}} \). B: **Incorrect:** \( \frac{1}{1 + e^{\theta^T \mathbf{x}(s)}} \) is \( \pi_\theta(0 \mid s) \), not \( \pi_\theta(1 \mid s) \). C: **Correct:** Multiplying top and bottom of \( \frac{1}{1 + e^{-\theta^T \mathbf{x}(s)}} \) by \( e^{\theta^T \mathbf{x}(s)} \) gives \( \frac{e^{\theta^T \mathbf{x}(s)}}{1 + e^{\theta^T \mathbf{x}(s)}} \). D: **Incorrect:** \( \frac{e^{-\theta^T \mathbf{x}(s)}}{1 + e^{-\theta^T \mathbf{x}(s)}} \) is \( \pi_\theta(0 \mid s) \).

Report a correction for Q16

Question 17 MSQ · 0.0 marks

A Bernoulli-logistic unit is a stochastic neuron whose output
Source diagram or notation
follows a Bernoulli distribution:
Source diagram or notation
The unit receives a feature vector
Source diagram or notation
as input. Let
Source diagram or notation
denote the action preference for action
Source diagram or notation
in state
Source diagram or notation
under policy parameter
Source diagram or notation
. Assume that difference in action preferences is a linear function of the input:
Source diagram or notation
The softmax (exponential soft-max) policy converts preferences to probabilities:
Source diagram or notation
The REINFORCE (Monte Carlo policy gradient) update rule is:
Source diagram or notation
where
Source diagram or notation
is the return from time
Source diagram or notation
, and
Source diagram or notation
is called the eligibility vector. Based on the above data, answer the given subquestions.
**[Bonus]** The Monte Carlo REINFORCE update for the Bernoulli-logistic unit upon receipt of return
Source diagram or notation
is:
Source diagram or notation
Which of the following statements about this update are correct? Select all that apply.
6406536959604.
When
Source diagram or notation
, the eligibility vector is
Source diagram or notation
, so the update reinforces
Source diagram or notation
in the direction of
Source diagram or notation
when
Source diagram or notation
6406536959605.
When
Source diagram or notation
, the eligibility vector is
Source diagram or notation
, meaning the update decreases
Source diagram or notation
(i.e. makes action 1 less likely) when
Source diagram or notation
6406536959606.
The magnitude of the update is larger when the selected action is surprising (low probability), since
Source diagram or notation
is large when
Source diagram or notation
and
Source diagram or notation
is large when
Source diagram or notation
6406536959607.
The update is an unbiased estimate of
Source diagram or notation
only if the episode is generated on-policy under
Source diagram or notation
6406536959608.
Subtracting a baseline
Source diagram or notation
from
Source diagram or notation
changes the direction of the gradient update, introducing bias to improve convergence speed

Published solution

**1. Evaluate each statement about the REINFORCE update \( \Delta \theta_t = \alpha G_t (A_t - \sigma(\theta^T \mathbf{x}(S_t))) \mathbf{x}(S_t) \):** - **Option A:** When \( A_t = 1 \), the eligibility vector is \( (1 - \sigma(\theta^T \mathbf{x}(S_t))) \mathbf{x}(S_t) \), which moves \( \theta \) in the direction of \( +\mathbf{x}(S_t) \) when \( G_t > 0 \). **True.** - **Option B:** When \( A_t = 0 \), the eligibility vector is \( -\sigma(\theta^T \mathbf{x}(S_t)) \mathbf{x}(S_t) \), which decreases \( \theta^T \mathbf{x}(S_t) \) (making action 1 less likely and action 0 more likely) when \( G_t > 0 \). **True.** - **Option C:** The factor \( |A_t - \sigma| \) is large when a low-probability ('surprising') action is selected (\( 1 - \sigma \) is large when \( A_t = 1, \sigma \approx 0 \), and \( \sigma \) is large when \( A_t = 0, \sigma \approx 1 \)). **True.** - **Option D:** The Monte Carlo REINFORCE update is an unbiased estimate of \( \nabla_\theta J(\theta) \) only if the episode is generated on-policy under \( \pi_\theta \). **True.** - **Option E:** Subtracting a state-dependent baseline \( b(S_t) \) does NOT introduce bias. **False.** **Answer: A, B, C, and D.** A: **Correct:** When \( A_t = 1 \) and \( G_t > 0 \), \( (1 - \sigma) > 0 \), reinforcing \( \theta \) along \( +\mathbf{x}(S_t) \). B: **Correct:** When \( A_t = 0 \) and \( G_t > 0 \), the negative scalar \( -\sigma \) pushes \( \theta \) along \( -\mathbf{x}(S_t) \), reducing \( \sigma(\theta^T \mathbf{x}) \). C: **Correct:** Surprising actions have a large discrepancy \( |A_t - \sigma| \), producing a larger update magnitude. D: **Correct:** On-policy sampling under \( \pi_\theta \) is required for unbiasedness. E: **Incorrect:** A state-only baseline \( b(S_t) \) has zero expectation when multiplied by the score function and introduces no bias.

Report a correction for Q17

Question 18 MSQ · 2.0 marks

Vivek implements the REINFORCE (Monte Carlo policy gradient) algorithm for a text-generation task modelled as an episodic MDP. The policy is a neural network
Source diagram or notation
parameterised by
Source diagram or notation
. At each episode's end, he collects the full trajectory
Source diagram or notation
and computes the return:
Source diagram or notation
The REINFORCE gradient estimator is:
Source diagram or notation
After 1000 episodes, he observes that the gradient variance is extremely high and training is unstable. Neel suggests adding a baseline
Source diagram or notation
:
Source diagram or notation
He claims: "Subtracting
Source diagram or notation
reduces variance without biasing the gradient, as long as
Source diagram or notation
does not depend on
Source diagram or notation
.'' Based on the above data, answer the given subquestions.
Why does REINFORCE exhibit high gradient variance, particularly in long-horizon tasks like text generation?
6406536959609.
The log-probability
Source diagram or notation
is numerically unstable for large neural networks
6406536959610.Source diagram or notation
accumulates rewards over the entire future horizon; in long episodes with noisy rewards,
Source diagram or notation
has large variance, which directly scales the gradient estimate
6406536959611.
Monte Carlo rollouts are biased estimators of the true return
6406536959612.
The policy gradient theorem does not hold for episodic tasks with discount factor
Source diagram or notation

Published solution

**1. Explain why REINFORCE has high gradient variance in long-horizon tasks:** Because the Monte Carlo return \( G_t = \sum_{k=t}^T \gamma^{k-t} R_k \) sums rewards across the entire remaining trajectory, any randomness in transitions, actions, and rewards over a long horizon accumulates into a very large variance in \( G_t \), which directly scales \( \nabla_\theta \ln \pi_\theta(a_t \mid s_t) \). **Answer: B — \( G_t \) accumulates rewards over the entire future horizon; in long episodes with noisy rewards, \( G_t \) has large variance, which directly scales the gradient estimate.** A: **Incorrect:** Log-probabilities are numerically stabilized via log-softmax; the variance comes from \( G_t \). B: **Correct:** Summing rewards over a long trajectory makes the empirical return \( G_t \) high-variance. C: **Incorrect:** Monte Carlo returns are *unbiased* (though high-variance) estimators of \( Q^\pi \). D: **Incorrect:** The policy gradient theorem holds for episodic MDPs with \( \gamma = 1 \).

Report a correction for Q18

Question 19 NAT · 2.0 marks

Vivek implements the REINFORCE (Monte Carlo policy gradient) algorithm for a text-generation task modelled as an episodic MDP. The policy is a neural network
Source diagram or notation
parameterised by
Source diagram or notation
. At each episode's end, he collects the full trajectory
Source diagram or notation
and computes the return:
Source diagram or notation
The REINFORCE gradient estimator is:
Source diagram or notation
After 1000 episodes, he observes that the gradient variance is extremely high and training is unstable. Neel suggests adding a baseline
Source diagram or notation
:
Source diagram or notation
He claims: "Subtracting
Source diagram or notation
reduces variance without biasing the gradient, as long as
Source diagram or notation
does not depend on
Source diagram or notation
.'' Based on the above data, answer the given subquestions.
For a single timestep
Source diagram or notation
in an episode, the following values are observed:
Source diagram or notation
Compute the parameter update
Source diagram or notation
and report
Source diagram or notation
. Round to 4 decimal places.

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 MSQ · 2.0 marks

Vivek implements the REINFORCE (Monte Carlo policy gradient) algorithm for a text-generation task modelled as an episodic MDP. The policy is a neural network
Source diagram or notation
parameterised by
Source diagram or notation
. At each episode's end, he collects the full trajectory
Source diagram or notation
and computes the return:
Source diagram or notation
The REINFORCE gradient estimator is:
Source diagram or notation
After 1000 episodes, he observes that the gradient variance is extremely high and training is unstable. Neel suggests adding a baseline
Source diagram or notation
:
Source diagram or notation
He claims: "Subtracting
Source diagram or notation
reduces variance without biasing the gradient, as long as
Source diagram or notation
does not depend on
Source diagram or notation
.'' Based on the above data, answer the given subquestions.
Neel claims that any function
Source diagram or notation
not depending on
Source diagram or notation
is a valid zero-bias baseline. Which of the following statements are correct justifications or counter-examples to this claim?
6406536959614.Source diagram or notation
for any
Source diagram or notation
independent of
Source diagram or notation
, since
Source diagram or notation
6406536959615.
If
Source diagram or notation
, the baseline perfectly cancels the return and the gradient becomes zero — a degenerate case
6406536959616.
A baseline that depends on both
Source diagram or notation
and
Source diagram or notation
(e.g.
Source diagram or notation
) still leaves the gradient unbiased
6406536959617.
Using
Source diagram or notation
introduces bias because
Source diagram or notation
is estimated, not known exactly

Published solution

**1. Justify why a state-dependent baseline \( b(s_t) \) introduces zero bias:** Because \( b(s_t) \) does not depend on the action \( a_t \), it factors out of the expectation over \( a_t \sim \pi_\theta(\cdot \mid s_t) \): \[ \mathbb{E}_{a_t \sim \pi_\theta}\!\left[ b(s_t) \nabla_\theta \ln \pi_\theta(a_t \mid s_t) \right] = b(s_t) \sum_{a} \pi_\theta(a \mid s_t) \frac{\nabla_\theta \pi_\theta(a \mid s_t)}{\pi_\theta(a \mid s_t)} = b(s_t) \nabla_\theta \sum_a \pi_\theta(a \mid s_t) = b(s_t) \nabla_\theta(1) = 0 \] This matches **Option A**. **Answer: A.** A: **Correct:** Uses the identity \( \mathbb{E}_{a_t}[\nabla_\theta \ln \pi_\theta(a_t \mid s_t)] = \nabla_\theta \sum_a \pi_\theta(a \mid s_t) = \nabla_\theta(1) = 0 \). B: **Incorrect:** \( G_t \) depends on the action \( a_t \) and future trajectory, so \( b(s_t) = G_t \) is not a state-only function and would bias the gradient to zero. C: **Incorrect:** An action-dependent baseline \( b(s_t, a_t) \) cannot be factored out of the sum over \( a_t \) and generally introduces bias. D: **Incorrect:** Even an approximate state-value function \( \hat{V}(s_t) \) has zero expectation when multiplied by the score function, so it introduces no bias.

Report a correction for Q20

Question 21 MCQ · 2.0 marks

Lalit uses two algorithms to learn option values in a given programming assignment: Algorithm A — SMDP Q-Learning: Updates
Source diagram or notation
only at option termination using the full option return:
Source diagram or notation
Algorithm B — Intra-Option Q-Learning: Updates
Source diagram or notation
at every primitive step using the one-step consistency condition:
Source diagram or notation
Source diagram or notation
where
Source diagram or notation
is the termination probability at the next state. The agent runs in a corridor with 5 states
Source diagram or notation
. Option
Source diagram or notation
has intra-option policy: move right always.
Source diagram or notation
if
Source diagram or notation
, else
Source diagram or notation
. Currently:
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
, agent moves from
Source diagram or notation
to
Source diagram or notation
. Based on the above data, answer the given subquestions.
What is the key advantage of Intra-Option Q-Learning (Algorithm B) over SMDP Q-Learning (Algorithm A)?
6406536959618.
It requires no knowledge of the termination function
Source diagram or notation
6406536959619.
It updates
Source diagram or notation
at every time step rather than only at termination, making more efficient use of experience — especially for long-duration options
6406536959620.
It converges to a globally optimal policy, whereas SMDP Q-learning only converges locally
6406536959621.
It eliminates the need for a high-level policy by learning all options simultaneously

Published solution

**1. Compare Intra-Option Q-Learning (Algorithm B) vs. SMDP Q-Learning (Algorithm A):** Unlike SMDP Q-Learning (which waits until an option terminates to perform a single update for the state where the option was initiated), **Intra-Option Q-Learning updates \( Q_\Omega \) at every primitive time step** using one-step bootstrapping, making much more efficient use of experience—especially for long-duration options. **Answer: B — It updates \( Q_\Omega \) at every time step rather than only at termination, making more efficient use of experience — especially for long-duration options.** A: **Incorrect:** Intra-Option Q-Learning explicitly uses the termination probability \( \beta_\omega(s_{t+1}) \) in \( U_\omega(s_{t+1}) \). B: **Correct:** Updating option values at every primitive step extracts far more information per transition than waiting for option termination. C: **Incorrect:** Both SMDP Q-learning and Intra-Option Q-learning converge to the optimal option-value function \( Q^*_\Omega \). D: **Incorrect:** A policy over options is still used to select options.

Report a correction for Q21

Question 22 NAT · 2.0 marks

Lalit uses two algorithms to learn option values in a given programming assignment: Algorithm A — SMDP Q-Learning: Updates
Source diagram or notation
only at option termination using the full option return:
Source diagram or notation
Algorithm B — Intra-Option Q-Learning: Updates
Source diagram or notation
at every primitive step using the one-step consistency condition:
Source diagram or notation
Source diagram or notation
where
Source diagram or notation
is the termination probability at the next state. The agent runs in a corridor with 5 states
Source diagram or notation
. Option
Source diagram or notation
has intra-option policy: move right always.
Source diagram or notation
if
Source diagram or notation
, else
Source diagram or notation
. Currently:
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
, agent moves from
Source diagram or notation
to
Source diagram or notation
. Based on the above data, answer the given subquestions.
Using Algorithm B (Intra-Option Q-Learning) and the values from the comprehension section, compute the TD error
Source diagram or notation
for the transition
Source diagram or notation
. Round your answer to 4 decimal places. Note:
Source diagram or notation
(the option does not terminate at
Source diagram or notation
).
Source diagram or notation

Published solution

**1. Set up the Intra-Option Q-Learning TD error \( \delta_t \) for \( s_1 \to s_2 \):** Given: - Immediate reward: \( r = 0.5 \), discount factor: \( \gamma = 0.9 \) - Current option-value estimates: \( Q_\Omega(s_1, \omega_{\text{right}}) = 3.0 \), \( Q_\Omega(s_2, \omega_{\text{right}}) = 4.0 \) - At \( s_2 \), the option does not terminate: \( \beta_{\omega_{\text{right}}}(s_2) = 0 \). **2. Calculate \( U_{\omega_{\text{right}}}(s_2) \) and \( \delta_t \):** \[ U_{\omega_{\text{right}}}(s_2) = (1 - 0) Q_\Omega(s_2, \omega_{\text{right}}) + 0 = 4.0 \] \[ \delta_t = r + \gamma U_{\omega_{\text{right}}}(s_2) - Q_\Omega(s_1, \omega_{\text{right}}) = 0.5 + 0.9(4.0) - 3.0 = 0.5 + 3.6 - 3.0 = 1.1 \] **Answer: 1.1.**

Report a correction for Q22

Question 23 NAT · 2.0 marks

Lalit uses two algorithms to learn option values in a given programming assignment: Algorithm A — SMDP Q-Learning: Updates
Source diagram or notation
only at option termination using the full option return:
Source diagram or notation
Algorithm B — Intra-Option Q-Learning: Updates
Source diagram or notation
at every primitive step using the one-step consistency condition:
Source diagram or notation
Source diagram or notation
where
Source diagram or notation
is the termination probability at the next state. The agent runs in a corridor with 5 states
Source diagram or notation
. Option
Source diagram or notation
has intra-option policy: move right always.
Source diagram or notation
if
Source diagram or notation
, else
Source diagram or notation
. Currently:
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
, agent moves from
Source diagram or notation
to
Source diagram or notation
. Based on the above data, answer the given subquestions.
Using the value of
Source diagram or notation
computed in previous sub-question, calculate the updated value of
Source diagram or notation
. Round your answer to 4 decimal places.
Source diagram or notation

Published solution

**1. Apply the Intra-Option Q-Learning update rule:** With \( Q_\Omega(s_1, \omega_{\text{right}}) = 3.0 \), learning rate \( \alpha = 0.1 \), and TD error \( \delta_t = 1.1 \): \[ Q_\Omega^{\text{new}}(s_1, \omega_{\text{right}}) = Q_\Omega(s_1, \omega_{\text{right}}) + \alpha \delta_t = 3.0 + 0.1(1.1) = 3.0 + 0.11 = 3.11 \] **Answer: 3.11.**

Report a correction for Q23