Reinforcement Learning Introduction
- 15Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
In the context of reinforcement learning, what does the quality function Q(s,a) represent?
In the context of reinforcement learning, what does the quality function Q(s,a) represent?
15 questions
- 1
In the context of reinforcement learning, what does the quality function Q(s,a) represent?
- A
The value of being in state s when following the optimal policy
- B
The expected cumulative future reward starting from state s and taking action a
- C
The probability of transitioning to a new state given action a
- D
The immediate reward received after taking action a in state s
Correct answer
BThe expected cumulative future reward starting from state s and taking action a
Explanation
The quality function Q(s,a) is defined as the expected cumulative reward (including both immediate and future discounted rewards) when starting in state s, taking action a, and then following an optimal policy thereafter.
- A
- 2
What key assumption do dynamic programming methods like value iteration make that model-free methods do not?
- A
That the agent can explore all states equally
- B
That the environment is deterministic
- C
That the reward function is known and the state transition probabilities are known
- D
That the discount factor is set to 1
Correct answer
CThat the reward function is known and the state transition probabilities are known
Explanation
Dynamic programming methods assume access to a model of the Markov decision process, specifically the state transition probabilities p(s′∣s,a) and the reward function R(s,a). Model-free methods learn directly from experience without this model.
- A
- 3
What is a defining characteristic of Monte Carlo learning in reinforcement learning?
- A
It uses a model of the environment to simulate future rewards
- B
It only works for continuous state spaces
- C
It requires completing an entire episode before updating value estimates
- D
It updates value estimates after every time step using the Bellman equation
Correct answer
CIt requires completing an entire episode before updating value estimates
Explanation
Monte Carlo learning is an episodic method that waits until the end of an episode to compute the cumulative reward, then updates the value function for all visited states using that total reward. It does not update incrementally during the episode.
- A
- 4
In Monte Carlo learning, how is the cumulative reward typically distributed among the states visited during an episode?
- A
Reward is weighted by the time elapsed since each state
- B
Reward is divided equally among all states visited
- C
Reward is assigned only to the first state
- D
All reward is assigned only to the final state
Correct answer
BReward is divided equally among all states visited
Explanation
In the simplest Monte Carlo approach, the total cumulative reward is divided equally among every state visited during the episode, updating each state's value with an average of the total reward.
- A
- 5
What is the main advantage of Monte Carlo learning over other model-free methods?
- A
It requires less memory
- B
It converges faster than temporal difference methods
- C
It has no bias in its estimates
- D
It can learn from incomplete episodes
Correct answer
CIt has no bias in its estimates
Explanation
Monte Carlo learning provides unbiased estimates of the value function because it uses actual returns (cumulative rewards) from full episodes. However, it is sample-inefficient and has high variance.
- A
- 6
In temporal difference (TD) learning, what is the TD target used to update the value function V(sk)?
- A
The maximum possible reward from state sk
- B
The immediate reward rk plus the discounted value of the next state γV(sk+1)
- C
The cumulative reward over the entire episode
- D
The average reward over all previous episodes
Correct answer
BThe immediate reward rk plus the discounted value of the next state γV(sk+1)
Explanation
The TD target for a one-step update is rk+γV(sk+1), which is an estimate of the true value based on the actual reward observed and the current estimate of the next state's value. The difference between this target and the current estimate V(sk) is the TD error.
- A
- 7
How does the TD(0) algorithm update the value function after each step?
- A
V(sk)←maxaQ(sk,a)
- B
V(sk)←V(sk)+α(rk+γV(sk+1)−V(sk))
- C
V(sk)←V(sk)+α(Gk−V(sk)) where Gk is the total return
- D
V(sk)←N1∑i=1NGk(i) where N is number of episodes
Correct answer
BV(sk)←V(sk)+α(rk+γV(sk+1)−V(sk))
Explanation
TD(0) uses the update rule: V(sk)←V(sk)+α(rk+γV(sk+1)−V(sk)), where the term in parentheses is the TD error. This bootstraps from the current estimate of the next state's value.
- A
- 8
What is the relationship between TD learning and Monte Carlo learning as the number of steps n increases?
- A
TD learning becomes more biased
- B
TD learning becomes independent of the discount factor
- C
TD learning becomes on-policy
- D
TD learning converges to Monte Carlo learning
Correct answer
DTD learning converges to Monte Carlo learning
Explanation
As n approaches infinity (or the end of the episode), the n-step TD target becomes the full cumulative return, making the update identical to Monte Carlo learning. Monte Carlo is the limiting case of TD learning.
- A
- 9
In TD(λ) learning, how are the different n-step returns combined?
- A
They are averaged equally
- B
Only the largest n is used
- C
They are weighted by λn with a normalization factor
- D
They are weighted by λ for each step, using a geometric weighting
Correct answer
DThey are weighted by λ for each step, using a geometric weighting
Explanation
TD(λ) uses a geometric weighting with parameter λ∈[0,1] to combine all n-step returns. The weights decay with n, giving more importance to shorter-term predictions.
- A
- 10
What distinguishes Q-learning from SARSA in terms of the update rule for the Q-function?
- A
Q-learning requires a model of the environment, while SARSA does not
- B
Q-learning updates only the value function, not the Q-function
- C
Q-learning uses rk+γmaxaQ(sk+1,a) as the TD target, while SARSA uses rk+γQ(sk+1,ak+1)
- D
Q-learning uses the same action for the next state as SARSA
Correct answer
CQ-learning uses rk+γmaxaQ(sk+1,a) as the TD target, while SARSA uses rk+γQ(sk+1,ak+1)
Explanation
The key difference is that Q-learning uses the maximum over actions of the Q-function at the next state (making it off-policy), while SARSA uses the Q-value of the actual action taken (making it on-policy). Both use a TD(0)-style update but with different targets.
- A
- 11
Why is Q-learning considered off-policy?
- A
It requires a separate behavior policy and target policy
- B
It cannot learn from experiences generated by a suboptimal policy
- C
It only uses the current policy to select actions
- D
It learns the optimal policy regardless of the actions taken during exploration
Correct answer
DIt learns the optimal policy regardless of the actions taken during exploration
Explanation
Q-learning is off-policy because it directly approximates the optimal action-value function Q∗, independent of the policy being followed to generate experience. It can learn from actions taken by any policy, even random ones, as long as it uses the max operator in the target.
- A
- 12
In the context of reinforcement learning, what does the term 'on-policy' mean for SARSA?
- A
The algorithm only updates the policy after the episode ends
- B
The algorithm can learn from any past experience regardless of the policy used
- C
The algorithm uses a separate target network
- D
The algorithm must use the current policy to select actions for both the current and next step
Correct answer
DThe algorithm must use the current policy to select actions for both the current and next step
Explanation
SARSA is on-policy because it evaluates and improves the same policy that is used to generate experience. The TD target uses the actual next action ak+1 taken by the current policy, so if the policy changes, the updates become invalid.
- A
- 13
What is a practical advantage of SARSA over Q-learning during training?
- A
SARSA often yields safer behavior because it avoids exploratory risky actions
- B
SARSA requires less memory
- C
SARSA can learn from off-policy data
- D
SARSA converges faster to the optimal policy
Correct answer
ASARSA often yields safer behavior because it avoids exploratory risky actions
Explanation
Because SARSA is on-policy and follows its current policy (which may be more conservative), it tends to take fewer risky exploratory actions, making it safer in applications like autonomous driving. Q-learning's off-policy nature with epsilon-greedy exploration can lead to dangerous actions during learning.
- A
- 14
What is the epsilon-greedy strategy commonly used in Q-learning?
- A
With probability ϵ choose a random action; with probability 1−ϵ choose the best action according to current Q
- B
Always choose the action with the highest Q-value
- C
With probability ϵ choose the best action; otherwise choose a random action
- D
Gradually increase ϵ over time
Correct answer
AWith probability ϵ choose a random action; with probability 1−ϵ choose the best action according to current Q
Explanation
In epsilon-greedy, the agent selects a random action with probability ϵ (to explore) and the greedy action (with highest Q-value) with probability 1−ϵ (to exploit). Often ϵ is decayed over time to shift from exploration to exploitation.
- A
- 15
How does the TD error in temporal difference learning relate to biological learning mechanisms?
- A
It is analogous to the release of dopamine, which strengthens connections between neurons that fired just before a reward
- B
It is equivalent to synaptic long-term depression
- C
It is unrelated to biology; it is purely a mathematical construct
- D
It models the firing rate of motor neurons
Correct answer
AIt is analogous to the release of dopamine, which strengthens connections between neurons that fired just before a reward
Explanation
Research has shown that the TD error signal closely corresponds to dopamine neuron activity in the brain. When actual reward differs from predicted reward, dopamine is released, which strengthens synaptic connections for recently active neurons, facilitating learning.
- A

Ask anything
We've read this whole study set, so questions about it get the best answers.