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

Study methods

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

Deep Reinforcement Learning

  • 21Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Reinforcement Learning Basics

What is the fundamental difference between classic supervised learning and reinforcement learning?

21 questions

  1. 1

    What is the fundamental difference between classic supervised learning and reinforcement learning?

    1. A

      Reinforcement learning is only applicable to games while supervised learning is used for images.

    2. B

      Supervised learning optimizes accuracy while reinforcement learning optimizes speed.

    3. C

      Supervised learning uses neural networks while reinforcement learning uses decision trees.

    4. D

      Supervised learning requires labeled data while reinforcement learning relies on trial and error with rewards.

    Correct answer
    D

    Supervised learning requires labeled data while reinforcement learning relies on trial and error with rewards.

    Explanation

    Supervised learning learns from labeled examples, while reinforcement learning learns by interacting with an environment and receiving rewards or penalties based on actions.

  2. 2

    In reinforcement learning, what does the agent aim to maximize?

    1. A

      The number of actions taken before reaching a terminal state.

    2. B

      The immediate reward at each time step.

    3. C

      The cumulative discounted reward over time, called the return.

    4. D

      The accuracy of the policy on a fixed dataset.

    Correct answer
    C

    The cumulative discounted reward over time, called the return.

    Explanation

    The goal in RL is to maximize the total discounted return, which is the sum of discounted future rewards.

  3. 3

    Why might observation differ from the true state in a reinforcement learning environment?

    1. A

      The observation is always a compressed representation of the state.

    2. B

      The agent has incomplete information due to hidden elements or fog of war.

    3. C

      The state is defined only in terms of rewards, not visual input.

    4. D

      The environment intentionally corrupts the observation to make learning harder.

    Correct answer
    B

    The agent has incomplete information due to hidden elements or fog of war.

    Explanation

    In partially observable environments like strategy games, the agent only sees part of the full state, leading to observation being a subset of the true state.

  4. 4

    What is the role of the discount factor gamma in reinforcement learning?

    1. A

      It scales the reward values to be between 0 and 1.

    2. B

      It controls the importance of future rewards relative to immediate rewards.

    3. C

      It determines the probability of taking random actions during exploration.

    4. D

      It sets the learning rate for gradient descent updates.

    Correct answer
    B

    It controls the importance of future rewards relative to immediate rewards.

    Explanation

    Gamma (0 to 1) discounts future rewards, making immediate rewards more valuable and reflecting time preference or uncertainty about the future.

  5. 5

    In the recycling game example, why would the agent not benefit from moving back and forth between states 3 and 4?

    1. A

      There is a time limit before the garbage collector arrives, terminating the episode.

    2. B

      The game rules prevent revisiting previous states.

    3. C

      The discount factor would reduce the value of repeated small rewards.

    4. D

      The agent would quickly deplete its energy resources.

    Correct answer
    A

    There is a time limit before the garbage collector arrives, terminating the episode.

    Explanation

    The garbage collector comes in 3 minutes, and each state transition takes a minute, limiting the number of moves and preventing indefinite back-and-forth.

  6. 6

    What does a Q-table represent in Q-learning?

    1. A

      The expected return for taking a specific action in a specific state.

    2. B

      The probability of selecting each action in a given state.

    3. C

      The immediate reward received after each action.

    4. D

      The number of times each state-action pair has been visited.

    Correct answer
    A

    The expected return for taking a specific action in a specific state.

    Explanation

    A Q-table stores Q-values, which estimate the expected discounted return for taking action a in state s and then following the optimal policy.

  7. 7

    What is the Bellman optimality equation used for in Q-learning?

    1. A

      To express the relationship between the Q-value of a state-action pair and the reward plus the best Q-value of the next state.

    2. B

      To compute the gradient of the policy parameters.

    3. C

      To define the loss function for training the Q-network.

    4. D

      To determine when an episode should terminate.

    Correct answer
    A

    To express the relationship between the Q-value of a state-action pair and the reward plus the best Q-value of the next state.

    Explanation

    The Bellman equation states Q*(s,a) = r + γ * max_{a'} Q*(s',a'), describing the optimal Q-values recursively.

  8. 8

    How is the policy derived from the optimal Q-function?

    1. A

      By averaging the Q-values over all possible actions.

    2. B

      By sampling actions proportionally to their Q-values.

    3. C

      By choosing the action that leads to the most visited state.

    4. D

      By taking the action with the maximum Q-value in the current state.

    Correct answer
    D

    By taking the action with the maximum Q-value in the current state.

    Explanation

    The optimal policy π*(s) = argmax_a Q*(s,a), selecting the action with the highest estimated return.

  9. 9

    In the three-state scenario with rewards 0, 1, and 1000, why might the agent never learn to reach the 1000 reward?

    1. A

      The reward model cannot distinguish between values larger than 1.

    2. B

      The environment resets after each reward, preventing accumulation.

    3. C

      The agent's initial random Q-values lead it to exploit suboptimal actions and never explore the best action.

    4. D

      The 1000 reward is discounted too heavily to be attractive.

    Correct answer
    C

    The agent's initial random Q-values lead it to exploit suboptimal actions and never explore the best action.

    Explanation

    If initial Q-values favor action 1 (reward 0) or action 2 (reward 1), the agent exploits them, updates Q-values to those rewards, and never tries action 3 (reward 1000) because it appears inferior initially.

  10. 10

    What is the main advantage of using a neural network in deep Q-learning instead of a Q-table?

    1. A

      Neural networks can generalize to unseen states, handling large or continuous state spaces.

    2. B

      Neural networks guarantee convergence to the optimal Q-function.

    3. C

      Neural networks automatically handle terminal states.

    4. D

      Neural networks require less training data than a Q-table.

    Correct answer
    A

    Neural networks can generalize to unseen states, handling large or continuous state spaces.

    Explanation

    Neural networks act as function approximators, allowing DQN to scale to high-dimensional state spaces like images where a Q-table would be infeasible.

  11. 11

    In DQN, how is the target for the Q-network computed during training?

    1. A

      As the immediate reward plus the maximum Q-value from the next state using a separate target network.

    2. B

      As the sum of all future rewards without discounting.

    3. C

      As the average reward over the last 100 episodes.

    4. D

      As the difference between the current Q-value and the reward.

    Correct answer
    A

    As the immediate reward plus the maximum Q-value from the next state using a separate target network.

    Explanation

    The target is y = r + γ * max_{a'} Q(s', a'; θ⁻) where θ⁻ are parameters of a target network (often a copy of the online network) to stabilize training.

  12. 12

    Why is experience replay used in DQN?

    1. A

      To improve exploration by selecting actions from memory.

    2. B

      To increase the variety and reduce correlation between consecutive training samples.

    3. C

      To compute the gradient more efficiently using parallel processing.

    4. D

      To store the best trajectories for later supervised learning.

    Correct answer
    B

    To increase the variety and reduce correlation between consecutive training samples.

    Explanation

    Experience replay stores transitions and samples random minibatches, breaking the correlation between successive experiences and stabilizing training.

  13. 13

    What is the purpose of the epsilon-greedy strategy in DQN?

    1. A

      To control the learning rate of the optimizer.

    2. B

      To balance exploration of new actions and exploitation of known good actions.

    3. C

      To prioritize experiences with large temporal-difference errors.

    4. D

      To reduce the variance of the Q-value estimates.

    Correct answer
    B

    To balance exploration of new actions and exploitation of known good actions.

    Explanation

    Epsilon-greedy selects a random action with probability ε and the greedy action otherwise, encouraging exploration to discover better states.

  14. 14

    Which pre-processing step is crucial for DQN when applied to Atari games?

    1. A

      Using principal component analysis to reduce the number of input channels.

    2. B

      Converting the screen to grayscale and cropping to reduce dimensionality.

    3. C

      Applying data augmentation like random rotations to increase dataset size.

    4. D

      Normalizing pixel values to have zero mean and unit variance.

    Correct answer
    B

    Converting the screen to grayscale and cropping to reduce dimensionality.

    Explanation

    DQN typically converts RGB frames to grayscale, crops the score, and stacks multiple frames to capture motion, reducing input complexity.

  15. 15

    How does a policy gradient method like PPO differ from value-based methods like DQN?

    1. A

      PPO is only suitable for discrete actions while DQN works for continuous actions.

    2. B

      PPO requires a separate target network while DQN does not.

    3. C

      PPO uses experience replay while DQN does not.

    4. D

      PPO directly learns the policy function while DQN learns a value function and derives the policy.

    Correct answer
    D

    PPO directly learns the policy function while DQN learns a value function and derives the policy.

    Explanation

    Policy gradient methods optimize the policy directly, often with a neural network outputting action probabilities, whereas value-based methods learn Q-values and act greedily.

  16. 16

    Why is Montezuma's Revenge especially challenging for reinforcement learning algorithms?

    1. A

      The agent must learn to collaborate with other characters.

    2. B

      Rewards are highly delayed, requiring long sequences of correct actions before any reward.

    3. C

      The game uses continuous control inputs for movement.

    4. D

      The game has a very large state space with 3D graphics.

    Correct answer
    B

    Rewards are highly delayed, requiring long sequences of correct actions before any reward.

    Explanation

    The agent may need dozens of precise steps like climbing ladders and avoiding enemies before reaching a key, making exploration extremely difficult due to sparse rewards.

  17. 17

    In AlphaGo, why did the agent sometimes make moves that seemed counterintuitive to human experts?

    1. A

      The agent had a flawed reward function that favored losing.

    2. B

      The agent was programmed to imitate human mistakes to appear more natural.

    3. C

      The agent was optimizing for winning by the smallest margin, not by maximizing captured stones.

    4. D

      The agent's neural network was overfitted to training data and made random errors.

    Correct answer
    C

    The agent was optimizing for winning by the smallest margin, not by maximizing captured stones.

    Explanation

    AlphaGo was trained only to maximize the probability of winning, not the score difference, leading to moves that secure a narrow win over flashy but risky plays.

  18. 18

    What is the primary limitation of supervised fine-tuning (SFT) for aligning language models?

    1. A

      It cannot handle prompts longer than a few tokens.

    2. B

      It only works for generating single-word responses.

    3. C

      It introduces harmful biases in the model.

    4. D

      It requires human-written demonstrations, which are costly and may not generalize to unseen prompts.

    Correct answer
    D

    It requires human-written demonstrations, which are costly and may not generalize to unseen prompts.

    Explanation

    SFT trains on fixed prompt-response pairs, making it an imitation learning method that is expensive and may fail to capture diverse user needs.

  19. 19

    How is the reward model (RM) in RLHF trained?

    1. A

      On a dataset of correct answers with scalar scores assigned by experts.

    2. B

      On the final outcome of a game like chess win/loss.

    3. C

      By using the language model's own likelihood as a reward signal.

    4. D

      On pairwise comparisons of responses to the same prompt, where human labelers indicate preference.

    Correct answer
    D

    On pairwise comparisons of responses to the same prompt, where human labelers indicate preference.

    Explanation

    The reward model is trained on human preference data: given a prompt and two responses, it learns to assign higher scores to the preferred response.

  20. 20

    In RLHF, why is the reward only given at the end of a generated sequence rather than per token?

    1. A

      The environment only provides a reward when the generation is complete.

    2. B

      Intermediate rewards would encourage the model to generate short responses.

    3. C

      Per-token rewards would make the training unstable due to high variance.

    4. D

      The reward model was trained on full prompt-response pairs, so it requires the complete output to evaluate.

    Correct answer
    D

    The reward model was trained on full prompt-response pairs, so it requires the complete output to evaluate.

    Explanation

    The reward model estimates human preference for the entire response, so the RL agent receives a single reward after the full sequence is generated, leading to a sparse reward setting.

  21. 21

    What is the role of the pretrained language model in the RLHF pipeline?

    1. A

      It generates the preference data used to train the reward model.

    2. B

      It acts as a fixed baseline to compare the fine-tuned model against.

    3. C

      It serves as the agent that is fine-tuned via reinforcement learning to maximize rewards from the reward model.

    4. D

      It provides the reward signal to guide the training of the reward model.

    Correct answer
    C

    It serves as the agent that is fine-tuned via reinforcement learning to maximize rewards from the reward model.

    Explanation

    The pretrained LM is the policy in the RL framework; its parameters are updated to produce responses that receive high scores from the reward model.

Question 1 of 21
Question 1 of 21

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent