1. Home
  2. Explore
  3. Computer Science
  4. Reinforcement Learning Introduction

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Reinforcement Learning Introduction

  • 15Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Markov Decision Processes and Quality Function

In the context of reinforcement learning, what does the quality function Q(s,a)Q(s,a)Q(s,a) represent?

15 questions

  1. 1

    In the context of reinforcement learning, what does the quality function Q(s,a)Q(s,a)Q(s,a) represent?

    1. A

      The value of being in state sss when following the optimal policy

    2. B

      The expected cumulative future reward starting from state sss and taking action aaa

    3. C

      The probability of transitioning to a new state given action aaa

    4. D

      The immediate reward received after taking action aaa in state sss

    Correct answer
    B

    The expected cumulative future reward starting from state sss and taking action aaa

    Explanation

    The quality function Q(s,a)Q(s,a)Q(s,a) is defined as the expected cumulative reward (including both immediate and future discounted rewards) when starting in state sss, taking action aaa, and then following an optimal policy thereafter.

  2. 2

    What key assumption do dynamic programming methods like value iteration make that model-free methods do not?

    1. A

      That the agent can explore all states equally

    2. B

      That the environment is deterministic

    3. C

      That the reward function is known and the state transition probabilities are known

    4. D

      That the discount factor is set to 1

    Correct answer
    C

    That 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)p(s'|s,a)p(s′∣s,a) and the reward function R(s,a)R(s,a)R(s,a). Model-free methods learn directly from experience without this model.

  3. 3

    What is a defining characteristic of Monte Carlo learning in reinforcement learning?

    1. A

      It uses a model of the environment to simulate future rewards

    2. B

      It only works for continuous state spaces

    3. C

      It requires completing an entire episode before updating value estimates

    4. D

      It updates value estimates after every time step using the Bellman equation

    Correct answer
    C

    It 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.

  4. 4

    In Monte Carlo learning, how is the cumulative reward typically distributed among the states visited during an episode?

    1. A

      Reward is weighted by the time elapsed since each state

    2. B

      Reward is divided equally among all states visited

    3. C

      Reward is assigned only to the first state

    4. D

      All reward is assigned only to the final state

    Correct answer
    B

    Reward 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.

  5. 5

    What is the main advantage of Monte Carlo learning over other model-free methods?

    1. A

      It requires less memory

    2. B

      It converges faster than temporal difference methods

    3. C

      It has no bias in its estimates

    4. D

      It can learn from incomplete episodes

    Correct answer
    C

    It 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.

  6. 6

    In temporal difference (TD) learning, what is the TD target used to update the value function V(sk)V(s_k)V(sk​)?

    1. A

      The maximum possible reward from state sks_ksk​

    2. B

      The immediate reward rkr_krk​ plus the discounted value of the next state γV(sk+1)\gamma V(s_{k+1})γV(sk+1​)

    3. C

      The cumulative reward over the entire episode

    4. D

      The average reward over all previous episodes

    Correct answer
    B

    The immediate reward rkr_krk​ plus the discounted value of the next state γV(sk+1)\gamma V(s_{k+1})γV(sk+1​)

    Explanation

    The TD target for a one-step update is rk+γV(sk+1)r_k + \gamma V(s_{k+1})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)V(s_k)V(sk​) is the TD error.

  7. 7

    How does the TD(0) algorithm update the value function after each step?

    1. A

      V(sk)←max⁡aQ(sk,a)V(s_k) \leftarrow \max_a Q(s_k, a)V(sk​)←maxa​Q(sk​,a)

    2. B

      V(sk)←V(sk)+α(rk+γV(sk+1)−V(sk))V(s_k) \leftarrow V(s_k) + \alpha (r_k + \gamma V(s_{k+1}) - V(s_k))V(sk​)←V(sk​)+α(rk​+γV(sk+1​)−V(sk​))

    3. C

      V(sk)←V(sk)+α(Gk−V(sk))V(s_k) \leftarrow V(s_k) + \alpha (G_k - V(s_k))V(sk​)←V(sk​)+α(Gk​−V(sk​)) where GkG_kGk​ is the total return

    4. D

      V(sk)←1N∑i=1NGk(i)V(s_k) \leftarrow \frac{1}{N} \sum_{i=1}^N G_k^{(i)}V(sk​)←N1​∑i=1N​Gk(i)​ where NNN is number of episodes

    Correct answer
    B

    V(sk)←V(sk)+α(rk+γV(sk+1)−V(sk))V(s_k) \leftarrow V(s_k) + \alpha (r_k + \gamma V(s_{k+1}) - V(s_k))V(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))V(s_k) \leftarrow V(s_k) + \alpha (r_k + \gamma V(s_{k+1}) - V(s_k))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.

  8. 8

    What is the relationship between TD learning and Monte Carlo learning as the number of steps nnn increases?

    1. A

      TD learning becomes more biased

    2. B

      TD learning becomes independent of the discount factor

    3. C

      TD learning becomes on-policy

    4. D

      TD learning converges to Monte Carlo learning

    Correct answer
    D

    TD learning converges to Monte Carlo learning

    Explanation

    As nnn approaches infinity (or the end of the episode), the nnn-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.

  9. 9

    In TD(λ\lambdaλ) learning, how are the different nnn-step returns combined?

    1. A

      They are averaged equally

    2. B

      Only the largest nnn is used

    3. C

      They are weighted by λn\lambda^{n}λn with a normalization factor

    4. D

      They are weighted by λ\lambdaλ for each step, using a geometric weighting

    Correct answer
    D

    They are weighted by λ\lambdaλ for each step, using a geometric weighting

    Explanation

    TD(λ\lambdaλ) uses a geometric weighting with parameter λ∈[0,1]\lambda \in [0,1]λ∈[0,1] to combine all nnn-step returns. The weights decay with nnn, giving more importance to shorter-term predictions.

  10. 10

    What distinguishes Q-learning from SARSA in terms of the update rule for the Q-function?

    1. A

      Q-learning requires a model of the environment, while SARSA does not

    2. B

      Q-learning updates only the value function, not the Q-function

    3. C

      Q-learning uses rk+γmax⁡aQ(sk+1,a)r_k + \gamma \max_a Q(s_{k+1}, a)rk​+γmaxa​Q(sk+1​,a) as the TD target, while SARSA uses rk+γQ(sk+1,ak+1)r_k + \gamma Q(s_{k+1}, a_{k+1})rk​+γQ(sk+1​,ak+1​)

    4. D

      Q-learning uses the same action for the next state as SARSA

    Correct answer
    C

    Q-learning uses rk+γmax⁡aQ(sk+1,a)r_k + \gamma \max_a Q(s_{k+1}, a)rk​+γmaxa​Q(sk+1​,a) as the TD target, while SARSA uses rk+γQ(sk+1,ak+1)r_k + \gamma Q(s_{k+1}, a_{k+1})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.

  11. 11

    Why is Q-learning considered off-policy?

    1. A

      It requires a separate behavior policy and target policy

    2. B

      It cannot learn from experiences generated by a suboptimal policy

    3. C

      It only uses the current policy to select actions

    4. D

      It learns the optimal policy regardless of the actions taken during exploration

    Correct answer
    D

    It 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∗Q^*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.

  12. 12

    In the context of reinforcement learning, what does the term 'on-policy' mean for SARSA?

    1. A

      The algorithm only updates the policy after the episode ends

    2. B

      The algorithm can learn from any past experience regardless of the policy used

    3. C

      The algorithm uses a separate target network

    4. D

      The algorithm must use the current policy to select actions for both the current and next step

    Correct answer
    D

    The 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+1a_{k+1}ak+1​ taken by the current policy, so if the policy changes, the updates become invalid.

  13. 13

    What is a practical advantage of SARSA over Q-learning during training?

    1. A

      SARSA often yields safer behavior because it avoids exploratory risky actions

    2. B

      SARSA requires less memory

    3. C

      SARSA can learn from off-policy data

    4. D

      SARSA converges faster to the optimal policy

    Correct answer
    A

    SARSA 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.

  14. 14

    What is the epsilon-greedy strategy commonly used in Q-learning?

    1. A

      With probability ϵ\epsilonϵ choose a random action; with probability 1−ϵ1-\epsilon1−ϵ choose the best action according to current Q

    2. B

      Always choose the action with the highest Q-value

    3. C

      With probability ϵ\epsilonϵ choose the best action; otherwise choose a random action

    4. D

      Gradually increase ϵ\epsilonϵ over time

    Correct answer
    A

    With probability ϵ\epsilonϵ choose a random action; with probability 1−ϵ1-\epsilon1−ϵ choose the best action according to current Q

    Explanation

    In epsilon-greedy, the agent selects a random action with probability ϵ\epsilonϵ (to explore) and the greedy action (with highest Q-value) with probability 1−ϵ1-\epsilon1−ϵ (to exploit). Often ϵ\epsilonϵ is decayed over time to shift from exploration to exploitation.

  15. 15

    How does the TD error in temporal difference learning relate to biological learning mechanisms?

    1. A

      It is analogous to the release of dopamine, which strengthens connections between neurons that fired just before a reward

    2. B

      It is equivalent to synaptic long-term depression

    3. C

      It is unrelated to biology; it is purely a mathematical construct

    4. D

      It models the firing rate of motor neurons

    Correct answer
    A

    It 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.

Question 1 of 15
Question 1 of 15

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent