Module Bank For Module-1 - RL
Module Bank For Module-1 - RL
VFSTR - VADLAMUDI
Year Semester Branch Section
1.
Consider the grid-world shown in the figure, where each cell represents a state and the arrows
indicate immediate rewards r(s,a) for taking an action in that state. The terminal state G gives
a reward of +100 and ends the episode. Assume: Learning rate α=0.5 Discount factor γ=0.9
Initial Q-values Q(s,a)=0 for all state action pairs The agent follows the action sequence shown
below during learning
a). Illustrate how value function updates occur after each move in a Tic-Tac-Toe game using
TD learning. Can an RL agent fail even with infinite training? Why?
b). In a game, an agent chooses actions based on rewards and updates its strategy. Explain how
RL works in this scenario. How does reward shaping influence agent behavior?
c). A robot receives feedback immediately after avoiding an obstacle. Identify the type of
reinforcement learning used and justify your answer. What is the role of the discount factor in
RL?
3.
a). Explain PAC optimality for Multi-Armed Bandit algorithms. How does PAC analysis differ
from regret-based analysis? Can an RL agent fail even with infinite training? Why?
b). A robot learns to reach a goal by receiving rewards and penalties. Identify the RL
components involved. Why is reinforcement learning preferred over supervised learning in
sequential decision problems?
c). In a video game, the player gains points instantly after each correct move. Explain how this
relates to immediate reinforcement learning. What happens if the reward function is poorly
designed?
4.
b). Traffic signal lights adjust instantly based on vehicle density. Is this immediate
reinforcement learning? Explain. How does reward shaping influence agent behavior?
c). Define asymptotic correctness, regret, and PAC optimality in the context of Multi-Armed
Bandits. Show why an algorithm can be PAC-optimal but not regret-optimal, using suitable
examples.
5.
a). Consider a Tic-Tac-Toe agent using TD (0) with learning rate α = 0.5 and discount factor
γ = 1. Current state value: V(st)=0.4 For each case below, compute the updated value V(st)
i). Next state is a winning terminal state with reward +1
ii). Next state is a losing terminal state with reward −1
iii). Next state is a draw state with reward 0 .
b). Explain why the learning rate (α) and discount factor (γ) are considered critical hyper
parameters in reinforcement learning. Discuss their impact on convergence, stability, and
policy performance with reference to Temporal-Difference learning.
6.
7.
a). Discuss how Bellman equations are used to solve real-world RL problems, providing an
example.
b). Compare and contrast Model-free vs. Model-based RL with application scenarios.
c). Why we need action values instead of state values in Model free Monte Carlo?
8.
Consider designing a reinforcement learning (RL) agent to navigate a magic street with blocks
numbered 1 to n. Walking from one block to the next takes 1 minute, but there's a magic tram
that can instantly transport the agent to any block that's a multiple of its current location (i.e.,
2s, 3s, etc.). Taking the tram takes 2 minutes. The goal is to minimize the total travel time for
the agent to reach any destination block from a starting block.
a). Formulate this scenario as MDP problem, specifying the state space, action space, reward
function, and discount factor.
b). Explain why a tabular Q-learning approach might not be ideal for this problem.
c). Suggest a more suitable RL algorithm for this scenario and justify your choice based on the
problem characteristics. Discuss how they differ from other machine learning paradigms.
9.
Consider training a robot arm to pick up objects in a 5x5 grid world. The robot arm can move
up, down, left, and right within the grid. There are different objects at specific locations, and
the robot receives a reward for picking up the desired object.
a). Explain the key differences between function approximation and tabular methods in
reinforcement learning (RL).
b). Would a tabular method or function approximation be a better choice for this scenario?
c). Discuss the advantages and disadvantages of each approach, and provide examples of
scenarios where each would be the preferred choice.
10.
a). Explain the core idea behind Bellman equations in the context of RL.
b). Derive the Bellman equation for the state-value function (V(s)) in an environment. Briefly
explain the meaning of each term in the equation.
c). Describe two ways Bellman equations inspire the development of practical RL algorithms
(leveraging the ideas from Bellman equations).
11.
Consider training an RL agent to play a simple racing game. The agent observes the current
state of the race, which includes its own position, speed, and the positions of other racers. The
agent can take actions like accelerating, braking, or steering. The reward function is designed
to encourage the agent to finish the race in first place.
a). Discuss two specific strategies you could use to balance exploration and exploitation during
the agent's training.
b). How could incorporate additional information about the race track (e.g., sharp turns, long
straights) be beneficial for the agent's learning process?
Bellman equations are fundamental in solving real-world RL problems as they provide a recursive decomposition of the value functions based on the principle of optimality. They allow the calculation of the optimal state-value or action-value functions, which in turn define the optimal policies for decision-making processes . For example, in robotics navigation, Bellman equations can optimize the value function for each state, helping the robot decide the best path to a goal by evaluating the expected future rewards of different actions relative to the current state .
Reinforcement learning is preferred over supervised learning in sequential decision-making problems because it models situations where decisions affect future states and rewards, effectively handling long-term dependencies. Unlike supervised learning, which requires labeled input-output pairs, reinforcement learning allows agents to learn from the consequences of their actions through trial and error . This is particularly advantageous for robotics tasks, where dynamic and adaptive decision-making is crucial, and environments can be unpredictable or partially observable .
Reward shaping involves modifying the reward function to guide an RL agent's learning more effectively. It influences agent behavior by providing additional rewards or penalties that emphasize desirable behaviors, thereby accelerating learning and improving convergence . However, poorly designed reward functions can lead to unintended behaviors or suboptimal policies, as the agent may focus on maximizing immediate rewards instead of long-term goals. This could impede the learning process and result in an agent that exploits loopholes rather than achieving the intended outcomes .
The learning rate (α) and discount factor (γ) are critical hyperparameters in reinforcement learning because they significantly affect the convergence, stability, and overall performance of the learning process. The learning rate determines how much updates are influenced by new data, impacting convergence speed and stability—too high a rate can cause oscillations, while too low may slow convergence . The discount factor adjusts the importance of future rewards, influencing the agent's focus on short-term versus long-term gains. Proper tuning of these parameters is pivotal for efficient and effective learning, particularly in temporal-difference learning, where stability is crucial .
The exploration-exploitation trade-off is a fundamental challenge in reinforcement learning because it involves choosing between exploring new actions to discover potentially better rewards and exploiting known actions to maximize the immediate gain . Excessive exploration can lead to inefficiencies and slow learning, whereas excessive exploitation can prevent the discovery of optimal strategies. Balancing these two approaches is crucial for developing effective RL agents, as it affects the agent's ability to learn optimal policies over time .
The type of reinforcement learning used when a robot receives immediate feedback after avoiding an obstacle is an example of immediate reinforcement learning, where the agent learns from each action's reward without delay . The discount factor in this context determines the weight given to future rewards compared to immediate rewards. A higher discount factor values future rewards more, while a lower one prioritizes immediate gains, balancing short-term and long-term rewards .
A tabular Q-learning approach may not be ideal for navigating a magic street because it requires maintaining a table of Q-values for all state-action pairs, which can become computationally expensive and inefficient, especially if the number of states is large. Instead, a function approximation method, such as Deep Q-Networks (DQNs), would be more suitable because they can generalize across similar states, reducing the need to store explicit Q-values for each pair and handling larger state spaces more effectively .
In a video game scenario, immediate reinforcement learning works by providing real-time feedback to the player, with rewards given instantly after each correct move. This allows the agent to quickly adapt and improve its strategy based on direct feedback from actions . However, if the reward function is not well-defined, it can lead to inconsistent learning, as the agent may not align its actions with the intended game objectives. A poorly constructed reward function can cause the agent to exploit unimportant aspects of the game environment, leading to suboptimal performance .
Function approximation approaches approximate the value function using parameters, enabling them to generalize across similar states and perform well in large or continuous state spaces . Tabular methods, on the other hand, store values for each state-action pair explicitly, which can become impractical for large state spaces. For training a robot arm in a 5x5 grid world, where the state space is relatively small, a tabular method may suffice and be more straightforward to implement. However, if the complexity or dimensionality increases, function approximation becomes preferable due to its scalability and generalization capabilities .
In Tic-Tac-Toe, policy convergence using Temporal-Difference (TD) learning is achieved by iteratively updating the value function based on the difference between predicted and actual rewards received from each move. This adjustment gradually aligns the value function with the expected long-term rewards, leading the strategy toward optimal play . The exploration vs. exploitation dilemma in this context involves deciding whether to explore new moves to discover alternative strategies or exploit known strategies that have previously yielded success. Balancing these elements is essential to arriving at a strategy that maximizes game wins while ensuring robustness against various opponents .