Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.
22 / 24 published solutions
Question 155 NAT · 3.0 marks
A model has 1,000,000 parameters. LoRA is applied to a 100 x 100 parameter matrix in the model
and results in 400 new LoRA parameters. What will be the rank (r) of the LoRA matrices?
A published solution is not available for this question yet.
**Note:**
For numerical answer type questions, enter your answer correct upto two decimal places without
rounding up or off unless stated otherwise.
6406533952802.
Instructions has been mentioned above.
6406533952803.
This Instructions is just for a reference & not for an evaluation.
Published solution
**1. Review the numerical answer instructions:**
Question 157 states the formatting instructions for numerical answer type questions. Selecting **"Instructions has been mentioned above."** acknowledges these instructions.
**Answer: Option A**
A: **Correct:** Acknowledges the exam instructions stated above.
B: **Incorrect:** Standard exam procedure requires selecting the first option to confirm the instructions.
For on policy SARSA update rule for Q(s, a), s, a, s′, a′ are needed. When is a′ computed/sampled?
6406533952804.
before updating Q(s, a)
6406533952805.
after updating Q(s, a)
6406533952806.
before and after updating Q(s, a), but only later value is used.
6406533952807.
before and after updating Q(s, a), but only the earlier value is used.
6406533952808.
None of these.
Published solution
**1. Recall the on-policy SARSA update rule and algorithm flow:**
The SARSA update for state-action value $Q(s, a)$ is:
$$Q(s, a) \leftarrow Q(s, a) + \alpha\big[r + \gamma Q(s', a') - Q(s, a)\big]$$
Because $Q(s', a')$ is required inside the TD target to perform the update of $Q(s, a)$, the next action $a'$ in state $s'$ must be sampled from the current policy **before updating $Q(s, a)$** (and that exact sampled action $a'$ is then executed on the next time step).
**Answer: Option A**
A: **Correct:** In SARSA, $a'$ is sampled from the policy at state $s'$ before computing the TD error and updating $Q(s, a)$.
B: **Incorrect:** $Q(s, a)$ cannot be updated without first knowing $a'$, because $Q(s', a')$ appears in the update target.
C: **Incorrect:** Sampling $a'$ twice would violate the on-policy SARSA algorithm, which executes the same $a'$ used in the update.
D: **Incorrect:** $a'$ is sampled once before the update and then directly taken at the next step.
E: **Incorrect:** Option A is accurate.
**1. Evaluate each statement about $\text{TD}(\lambda)$ learning:**
- **Option A:** $\text{TD}(\lambda)$ uses an **exponentially decaying** ($(1-\lambda)\lambda^{n-1}$) weighted average of $n$-step returns (the $\lambda$-return), and in its backward-view implementation updates at every step using eligibility traces rather than a generic arbitrary weighted average.
- **Option B:** In the backward view (online $\text{TD}(\lambda)$), updates can be performed at every step using eligibility traces; moreover, $\lambda = 1$ corresponds to $\text{TD}(1)$ (Monte Carlo equivalence in offline/episodic updates).
- **Option C:** When $\lambda = 0$, the $\lambda$-return $G_t^\lambda = (1 - \lambda)\sum_{n=1}^\infty \lambda^{n-1} G_{t:t+n}$ places $100\%$ of the weight on the 1-step return $G_{t:t+1} = R_{t+1} + \gamma V(S_{t+1})$, and the eligibility trace decays immediately to $0$ after one step. Thus, **$\text{TD}(\lambda)$ with $\lambda = 0$ reduces to one-step TD learning ($\text{TD}(0)$)**. (**Correct**)
- **Option D:** $\lambda = 0.5$ is not guaranteed to always converge faster than $\text{TD}(0)$ across all environments and learning rates.
**Answer: Option C**
A: **Incorrect:** Only the specific $(1-\lambda)\lambda^{n-1}$ geometric weighting defines the forward view of $\text{TD}(\lambda)$, and Option C is the exact, unambiguous property.
B: **Incorrect:** Online backward-view $\text{TD}(\lambda)$ updates on every step, not only at the end of an episode.
C: **Correct:** Setting $\lambda = 0$ in $\text{TD}(\lambda)$ gives $\text{TD}(0)$, which is one-step TD learning.
D: **Incorrect:** The optimal value of $\lambda$ for convergence speed depends on the task and step size.
The eligibility trace is used to store past observations and actions.
6406533952814.
The eligibility trace determines the learning rate for updating the value
estimates.
6406533952815.
The eligibility trace helps in determining which state-action pairs are eligible
for updates.
6406533952816.
The eligibility trace maintains a history of rewards received in each state.
Published solution
**1. Understand the role of the eligibility trace $e_t(s)$ or $e_t(s, a)$ in $\text{TD}(\lambda)$:**
In the backward view of $\text{TD}(\lambda)$, an **eligibility trace** is a short-term memory vector/table that tracks how recently and frequently each state (or state-action pair) has been visited, **determining which states or state-action pairs are eligible for credit assignment (updates)** when a TD error $\delta_t$ occurs, and by what proportion.
**Answer: Option C**
A: **Incorrect:** Eligibility traces store a single decaying recency/frequency scalar per state-action pair (or parameter), not a full replay buffer of past observations.
B: **Incorrect:** The learning rate $\alpha$ is a separate hyperparameter; the trace scales the TD error based on recency/frequency of visits.
C: **Correct:** The eligibility trace tracks recently visited state-action pairs to determine which pairs are eligible for updates when a TD error occurs.
D: **Incorrect:** Eligibility traces record state/action visitation recency (decayed by $\gamma\lambda$), not a history of rewards.
What is a key advantage of using n-step TD prediction over one-step TD prediction?
6406533952817.
n-step TD prediction requires less memory and computational resources.
6406533952818.
n-step TD prediction can handle delayed rewards and credit assignment over
multiple time steps.
6406533952819.
n-step TD prediction converges faster to the optimal policy.
6406533952820.
n-step TD prediction guarantees convergence to the optimal value function for
any choice of the learning rate.
Published solution
**1. Compare $n$-step TD prediction with one-step $\text{TD}(0)$ prediction:**
- One-step TD updates $V(S_t)$ using only the immediate next reward $R_{t+1}$ and the bootstrap estimate $\gamma V(S_{t+1})$, so reward information propagates backward by only one state per visit.
- **$n$-step TD prediction** uses the $n$-step return $G_{t:t+n} = R_{t+1} + \gamma R_{t+2} + \dots + \gamma^{n-1}R_{t+n} + \gamma^n V(S_{t+n})$, allowing it to **handle delayed rewards and assign credit over multiple ($n$) time steps** at once.
**Answer: Option B**
A: **Incorrect:** $n$-step TD actually requires *more* memory than 1-step TD because it must store the last $n$ states and rewards.
B: **Correct:** Looking $n$ steps ahead allows $n$-step TD to propagate delayed rewards and assign credit across $n$ time steps in a single update.
C: **Incorrect:** TD prediction evaluates a fixed policy; it does not by itself find an optimal policy.
D: **Incorrect:** Too large a learning rate $\alpha$ can cause $n$-step TD to diverge.
Consider a reinforcement learning agent navigating a complex environment with sparse rewards.
Which of the following statements accurately describes a key advantage of using Double Q-
learning in this scenario?
6406533952821.
Double Q-learning helps to reduce the variance in action value estimates,
leading to more stable learning.
6406533952822.
Double Q-learning is guaranteed to converge to the optimal policy even with
non-linear function approximation.
6406533952823.
Double Q-learning requires fewer samples to achieve the same level of
performance compared to traditional Q-learning.
6406533952824.
Double Q-learning is less sensitive to hyperparameter tuning, making it easier
to train in complex environments.
Published solution
**1. Recall the motivation and mechanism of Double Q-learning:**
Standard Q-learning suffers from **maximization bias** (overestimation of action values) because it uses the same noisy estimates both to *select* the maximizing action and to *evaluate* its value ($\max_{a'} Q(s', a')$).
**Double Q-learning** maintains two independent estimates $Q_1$ and $Q_2$, using one to select the greedy action and the other to evaluate it, which eliminates maximization bias and **reduces the variance/instability in action-value estimates, leading to more stable learning**.
**Answer: Option A**
A: **Correct:** By decoupling action selection from action evaluation, Double Q-learning mitigates overestimation and reduces variance/instability in action-value estimates.
B: **Incorrect:** No Q-learning variant is guaranteed to converge to the global optimum under general non-linear function approximation.
C: **Incorrect:** Because Double Q-learning splits updates between two Q-tables/networks, it typically requires at least as many samples as standard Q-learning.
D: **Incorrect:** Double Q-learning still requires standard hyperparameter tuning.
**1. Analyze the Copter Bird problem setting:**
In this easy variant of Copter Bird, the obstacles (pipes) are placed **quite far away from each other**, and the bird has a low horizontal velocity.
- Consequently, across most time steps (when the bird is flying in open space far from any obstacle), the **choice of action (UP, DOWN, or do nothing) has very little immediate effect on the expected return**; what matters most is the value of the **state** $V(s)$ itself, whereas action advantages $A(s, a)$ only matter near the pipe gaps.
- **Dueling DQN** explicitly decomposes $Q(s, a) = V(s) + \big(A(s, a) - \frac{1}{|\mathcal{A}|}\sum_{a'} A(s, a')\big)$ into a state-value stream $V(s)$ and an advantage stream $A(s, a)$, allowing the network to learn the value of states $V(s)$ efficiently without having to wait to experience every action in every state!
**Answer: Option D**
A: **Incorrect:** Expected SARSA is a tabular/general update rule rather than the deep architecture specifically designed for states where actions rarely affect value.
B: **Incorrect:** Standard DQN must learn $Q(s, a)$ separately for each action even when actions make little difference far from obstacles.
C: **Incorrect:** Double DQN addresses overestimation bias, whereas Dueling DQN addresses state-value estimation when many states are action-agnostic.
D: **Correct:** Dueling DQN separates state value $V(s)$ from action advantage $A(s, a)$, which excels in environments where actions do not significantly affect outcomes across many time steps.
**1. Understand the linear approximator view of a Deep Q-Network (DQN):**
- The network has 3 layers of nodes with IDs **`0` (input layer, 3 nodes)**, **`1` (hidden layer, 4 nodes)**, and **`2` (output layer, 2 nodes for the action values $Q(s, a)$)**.
- In the linear function approximator view of a DQN, the final output layer (layer `2`) computes a linear combination of the learned feature representation $\phi(s)$:
$$Q(s, a) = w_a^T \phi(s)$$
- These state features $\phi(s)$ are the activations produced by the **penultimate layer (the last hidden layer before the output layer)**, which is **layer `1`**.
**Answer: 1**
Based on the above data, answer the given subquestions.
What is the estimate of V (B) returned by first-visit MC?
Published solution
**1. Compute the return $G$ from the first (and only) visit to state $B$ in each of the 8 episodes:**
In all 8 episodes, state $B$ is visited once right before termination, so the return from $B$ is simply the immediate terminal reward after $B$:
- Episode 1 (`A, 2, B, 0`): return from $B$ is $0$
- Episode 2 (`A, 0, B, 1`): return from $B$ is $1$
- Episode 3 (`A, 2, B, 0`): return from $B$ is $0$
- Episode 4 (`A, 2, B, 0`): return from $B$ is $0$
- Episode 5 (`B, 1`): return from $B$ is $1$
- Episode 6 (`B, 0`): return from $B$ is $0$
- Episode 7 (`B, 1`): return from $B$ is $1$
- Episode 8 (`B, 3`): return from $B$ is $3$
**2. Average the 8 returns for $V(B)$:**
$$V(B) = \frac{0 + 1 + 0 + 0 + 1 + 0 + 1 + 3}{8} = \frac{6}{8} = 0.75$$
**Answer: 0.75**
Based on the above data, answer the given subquestions.
What is the estimate of V (B) returned by batch TD(0)?
Published solution
**1. Understand Batch $\text{TD}(0)$ (Certainty-Equivalence / Maximum Likelihood MDP):**
Batch $\text{TD}(0)$ converges to the exact value function of the empirical Markov chain formed by the observed transitions.
- From state $B$, all $8$ transitions go directly to the terminal state with rewards $0, 1, 0, 0, 1, 0, 1, 3$.
- Therefore, the batch $\text{TD}(0)$ estimate of $V(B)$ is the average immediate reward from $B$:
$$V(B) = \frac{0 + 1 + 0 + 0 + 1 + 0 + 1 + 3}{8} = \frac{6}{8} = 0.75$$
**Answer: 0.75**
Based on the above data, answer the given subquestions.
What is the estimate of V (A) returned by batch TD(0)?
Published solution
**1. Compute the Batch $\text{TD}(0)$ estimate of $V(A)$ ($\gamma = 0.8$):**
Batch $\text{TD}(0)$ satisfies the certainty-equivalence Bellman equation using the empirical transition probabilities and empirical mean reward from state $A$, bootstrapping on the batch $\text{TD}(0)$ estimate $V(B) = 0.75$:
- In all $4$ episodes starting at $A$, state $A$ transitions $100\%$ of the time to state $B$, with rewards $2, 0, 2, 2$.
- The average immediate reward from $A$ is:
$$\bar{R}(A) = \frac{2 + 0 + 2 + 2}{4} = \frac{6}{4} = 1.5$$
- Bootstrapping on $V(B) = 0.75$ with discount factor $\gamma = 0.8$:
$$V(A) = \bar{R}(A) + \gamma V(B) = 1.5 + 0.8(0.75) = 1.5 + 0.6 = 2.10$$
**Answer: 2.10**
Based on the above data, answer the given subquestions.
V (s) is a linear function approximator.
6406533952834.
TRUE
6406533952835.
FALSE
Published solution
**1. Check the definition of a linear function approximator:**
A value function approximator $V(s; w)$ is **linear** if it is a linear function of the **weight vector $w = (w_0, w_1, w_2, w_3)^T$**, i.e., if it can be written as the inner product of $w$ and a feature vector $\phi(s)$:
$$V(s; w) = w_0 + w_1 s + w_2 s^2 + w_3 s^3 = \sum_{i=0}^3 w_i \phi_i(s) = w^T \phi(s)$$
where $\phi(s) = (1, s, s^2, s^3)^T$.
Even though the features $\phi_i(s) = s^i$ are polynomial (non-linear) in the scalar state $s$, $V(s; w)$ is strictly linear in the parameters $w$. Thus, the statement is **TRUE**.
**Answer: Option A**
A: **Correct:** Linearity of a function approximator means linearity in the learnable parameters $w$, and $V(s; w) = w^T (1, s, s^2, s^3)$ is linear in $w$.
B: **Incorrect:** Non-linearity in the state variable $s$ (polynomial features $s^2, s^3$) does not make the approximator non-linear in $w$.
Based on the above data, answer the given subquestions.
6406533952836.6406533952837.6406533952838.
Published solution
**1. Understand the semi-gradient $\text{TD}(0)$ update:**
Given the $\text{TD}(0)$ error:
$$\delta = \underbrace{r}_{\text{①}} + \underbrace{\gamma V(S'; w)}_{\text{②}} - \underbrace{V(S; w)}_{\text{③}}$$
In **semi-gradient** $\text{TD}(0)$, when computing the gradient of the squared TD error $\delta^2$ with respect to $w$, we treat the **TD target $U_t = r + \gamma V(S'; w)$** as a fixed constant target (ignoring the dependence of $V(S'; w)$ on $w$) and only differentiate $-V(S; w)$:
$$\frac{1}{2}\nabla_w \delta^2 \approx -\delta \nabla_w V(S; w)$$
Therefore, both **① ($r$)** and **② ($\gamma V(S'; w)$)** are treated as constants, while **③ ($V(S; w)$)** is differentiated with respect to $w$.
**Answer: Options A, B**
A: **Correct:** The reward $r$ (①) does not depend on $w$ and is a constant during gradient computation.
B: **Correct:** In semi-gradient TD(0), the bootstrap term $\gamma V(S'; w)$ (②) is held constant (stop-gradient) when differentiating $\delta^2$.
C: **Incorrect:** $V(S; w)$ (③) is the current state's value estimate, which IS differentiated with respect to $w$.
Based on the above data, answer the given subquestions.
6406533952852.
The optimal Policy
6406533952853.
Uniform Random Policy
6406533952854.
Insufficient Information
Published solution
**1. Analyze the REINFORCE update when $b$ is a very large positive scalar ($b \gg r_t$):**
From Question 174, for the sampled action $a_t = a_i$, the components of the score function $\frac{\nabla \pi(\Theta, a_i)}{\pi(\Theta, a_i)}$ are:
- $1 - \pi(\Theta, a_i) > 0$ for the chosen action $a_i$, and
- $-\pi(\Theta, a_j) < 0$ for all unchosen actions $a_j$ ($j \ne i$).
When $b$ is a very large positive scalar such that $r_t - b < 0$ is always **negative** on every step:
- The update for the chosen action $a_i$ is $\Delta \theta_i = \alpha(r_t - b)(1 - \pi(\Theta, a_i)) < 0$, which **decreases** the preference $\theta_i$ of whichever action was just taken!
- The update for every other action $a_j$ ($j \ne i$) is $\Delta \theta_j = \alpha(r_t - b)(-\pi(\Theta, a_j)) > 0$, which **increases** the preferences of the actions not taken!
**2. Conclude the limiting policy:**
Because any action with a higher probability of being selected gets penalized more frequently and pushed down while less-probable actions get pushed up, the action probabilities are driven toward equality ($\pi(\Theta, a_1) = \dots = \pi(\Theta, a_n) = \frac{1}{n}$), converging to the **Uniform Random Policy**.
**Answer: Option B**
A: **Incorrect:** Because $r_t - b < 0$ is always negative, taken actions are penalized rather than reinforced toward the optimal arm.
B: **Correct:** Since $r_t - b < 0$ penalizes whichever action is sampled and boosts unsampled actions, higher-probability actions are pushed down until the policy converges to a Uniform Random Policy.
C: **Incorrect:** The limiting behavior is well-determined from the softmax gradient equations.
Based on the above data, answer the given subquestions.
6406533952855.
Yes
6406533952856.
No
Published solution
**1. Analyze the theoretical validity of making the step size $\alpha$ depend on the current reward $r_t$:**
In stochastic gradient ascent (REINFORCE), the unbiasedness of the policy gradient relies on the step size $\alpha_t$ being conditionally independent of the stochastic sample return/reward $r_t$ given the current parameters $\theta_t$:
$$\mathbb{E}[\alpha \cdot r_t \nabla \ln \pi_\theta(a_t)] = \alpha \, \mathbb{E}[r_t \nabla \ln \pi_\theta(a_t)] = \alpha \nabla J(\theta)$$
If $\alpha(r_t)$ is a function of the random reward $r_t$ (e.g., increasing $\alpha$ when $r_t$ is high), then $\alpha(r_t) r_t$ nonlinearly distorts the reward function (effectively optimizing a distorted objective $\mathbb{E}[\alpha(r_t)r_t]$ rather than $\mathbb{E}[r_t]$) and biases the gradient estimate, so it is **not a valid** way to guarantee convergence to the optimal policy of the original problem (**No**).
**Answer: Option B**
A: **Incorrect:** Making $\alpha$ depend on the stochastic reward $r_t$ introduces bias into the stochastic gradient update and changes the objective function.
B: **Correct:** In stochastic approximation, the learning rate $\alpha$ must not depend on the noisy sample reward $r_t$; otherwise the gradient estimate becomes biased.
Based on the above data, answer the given subquestions.
What is the value of d (i.e. the length of the discretized state vector)?
Published solution
**1. Sum the total number of tiles across the 3 grid-tilings:**
In tile coding, each tile in each grid-tiling corresponds to one binary feature (component) in the discretized state vector $\hat{s} \in \{0, 1\}^d$.
We have 3 grid-tilings:
- **Blue tiling:** $2 \times 2 = 4$ tiles
- **Black tiling:** $3 \times 3 = 9$ tiles
- **Brown tiling:** $4 \times 4 = 16$ tiles
**2. Compute the total length $d$ of the binary feature vector:**
$$d = 4 + 9 + 16 = 29$$
**Answer: 29**
Based on the above data, answer the given subquestions.
Published solution
**1. Determine how many tiles are active (ON) for any state $s \in \mathbb{R}^2$:**
- Each of the 3 grid-tilings (Blue $2 \times 2$, Black $3 \times 3$, and Brown $4 \times 4$) partitions the bounded state space into non-overlapping tiles.
- Therefore, any continuous state $s \in \mathbb{R}^2$ falls into **exactly 1 tile** in the Blue tiling, **exactly 1 tile** in the Black tiling, and **exactly 1 tile** in the Brown tiling.
- Thus, for any state $s$, the number of ON bits (1s) in $\hat{s}$ is constant and equal to the number of tilings:
$$1 + 1 + 1 = 3$$
**Answer: 3**