Deep Reinforcement Learning Intro
Deep Reinforcement Learning: Foundations and Problem Formulation
1. What Is Reinforcement Learning?
Reinforcement learning (RL) studies decision-making problems in which an agent must make a sequence of decisions while receiving information from its environment.
At each time step, the agent:
Observes the current situation.
Selects an action based on that information.
Causes or experiences a change in the environment.
Receives a new observation or state.
Repeats the process.
The central goal is to learn behavior that produces high long-term reward.
Examples include:
Controlling a robot or autonomous vehicle.
Playing games.
Generating responses in a chatbot.
Recommending songs, videos, or products.
Interacting with web pages.
Controlling traffic.
Designing computer chips.
Training generative models to follow prompts.
Learning advanced reasoning behaviors in language models.
Deep reinforcement learning emphasizes RL methods that can be represented and optimized using deep neural networks. These networks allow policies and other components to process high-dimensional inputs such as images, language, sensor readings, and long histories of interaction.
Major areas within reinforcement learning
Important families of RL problems and methods include:
Imitation learning: Learning to reproduce behavior demonstrated by an expert.
Model-free reinforcement learning: Learning behavior without explicitly modeling how the environment changes.
Model-based reinforcement learning: Learning or using a model of the environment’s dynamics.
Online reinforcement learning: Collecting new data while interacting with the environment.
Offline reinforcement learning: Learning from a previously collected, fixed data set.
Multi-task reinforcement learning: Learning behavior across multiple tasks.
Meta-reinforcement learning: Learning how to adapt quickly to new tasks or environments.
Reinforcement learning for robots: Learning physical control and manipulation.
Reinforcement learning for language models: Optimizing language-model behavior after initial pretraining.
The core objective is to understand and implement methods that allow neural networks to learn effective behavior from experience.
2. Deep Reinforcement Learning Compared with Supervised Learning
Supervised learning
In supervised learning, a model receives input-output pairs such as (x,y).
The objective is to learn a function that maps an input to its correct output:
The training data usually consists of labeled examples, and the model is directly told the desired answer for each input. Standard supervised-learning data is often assumed to be independent and identically distributed (i.i.d.), meaning that examples are sampled independently from the same underlying distribution.
For example:
Input: an image of an animal.
Label: “dog.”
Learning objective: predict the correct label.
The feedback is direct: the model can compare its prediction with the provided answer.
Reinforcement learning
In reinforcement learning, the goal is usually to learn a policy that maps states or observations to actions:
or, when only observations are available,
The agent is not directly told the correct action. Instead, it learns from indirect feedback, usually in the form of rewards accumulated over time.
Two important differences distinguish RL from ordinary supervised learning:
1. The desired output is not directly provided
In supervised learning, the correct output is included in the data. In RL, the agent must discover which actions are useful by interacting with the environment and observing their consequences.
A reward may indicate that an outcome was good or bad, but it may not specify exactly which action caused that outcome or what the correct action should have been.
2. The data distribution depends on the agent’s behavior
In supervised learning, the data distribution is often fixed. In RL, the agent’s policy influences which states it visits and which actions it takes. Therefore, the data distribution changes as the policy changes.
This creates a feedback loop:
The current policy determines the agent’s actions.
Those actions influence the states the agent encounters.
The resulting experience is used to improve the policy.
The improved policy generates different future experience.
Consequently, RL data is generally not i.i.d. in the same simple sense as supervised-learning data.
Key distinction: Supervised learning learns from labeled examples of correct outputs, whereas reinforcement learning learns behavior from experience and indirect feedback.
3. Why Study Deep Reinforcement Learning?
3.1 Going Beyond Supervised Examples
Many AI systems must make decisions whose consequences extend into the future. These problems cannot always be represented as isolated input-output predictions.
For example, a music recommendation system does more than choose a single song. A recommendation affects:
What the user listens to next.
Which genre or style the user encounters.
Whether the user remains engaged.
What recommendations are appropriate later.
Whether the system should avoid repeating recently played songs.
A reinforcement-learning formulation can account for these longer-term effects rather than optimizing each recommendation independently.
The same principle applies to:
Chatbots whose responses affect later conversation.
Recommenders whose choices influence future user preferences.
Autonomous vehicles whose actions affect future traffic situations.
Robots whose early movements affect what actions remain possible later.
These are feedback-loop problems: actions change future observations, states, and opportunities.
3.2 Learning When Direct Supervision Is Unavailable
Direct labels are often difficult, expensive, or impossible to obtain.
For instance, a coding assistant may receive feedback such as:
“This response was useful.”
“The code worked.”
“This answer was misleading.”
“The response was incomplete.”
This feedback does not directly specify the exact ideal output token by token. It gives a more indirect signal about the quality of the assistant’s behavior.
RL can optimize objectives that are:
Indirect rather than explicit labels.
Difficult to differentiate.
Based on human preferences.
Based on task completion.
Based on multiple outcomes over time.
Not reducible to prediction accuracy.
This makes reinforcement learning more flexible than ordinary supervised learning.
3.3 Learning from Experience
Learning from experience is closely related to the ability to improve through practice.
An RL agent can:
Attempt a task.
Observe the result.
Update its behavior.
Attempt the task again.
Gradually improve performance.
This differs from merely imitating patterns in a fixed data set. An agent that learns through interaction can potentially discover strategies that were not present in its initial training data.
Learning from experience is therefore important for:
Adaptation.
Experimentation.
Discovery.
Autonomous improvement.
Solving problems where the correct strategy is initially unknown.
3.4 Discovering New Strategies
RL can discover solutions that humans did not explicitly provide.
A notable example occurred when a deep-RL system trained to play Go produced a surprising strategy known as Move 37. The move was unexpected to human experts and demonstrated that an RL system could discover a novel approach rather than simply reproduce known human strategies.
This type of discovery may extend beyond games to problems requiring experimentation, such as:
Scientific discovery.
Drug or disease research.
Engineering design.
Mathematical reasoning.
Optimization of complex systems.
3.5 Real-World and High-Performance Applications
Deep RL has been applied to many challenging systems.
Robotics
RL has been used to train:
Legged robots to walk, dance, and perform dynamic movements.
Humanoid robots.
Robotic arms to manipulate objects.
Robots to unload and fold laundry.
Robots to perform simple origami.
Robots to insert objects into shape-sorting devices.
Robots to interact with tools and environments.
A common approach is to train a robot in simulation and then transfer the learned policy to the physical robot. This is called sim-to-real transfer.
Games
Deep RL has achieved strong performance in complex games, including Go. Game environments are useful because they provide:
Clearly defined actions.
Measurable outcomes.
Repeatable interaction.
Opportunities for long-horizon planning.
A setting in which novel strategies can be discovered.
Language models
Modern language models often use some form of RL during post-training. RL can help optimize:
Human preference alignment.
Instruction following.
Safety-related behavior.
Long-form responses.
Advanced reasoning.
Task completion.
Traffic control
RL can optimize traffic systems by learning how to coordinate vehicles and traffic signals. It can also help determine how to insert autonomous vehicles among human-driven cars to increase traffic throughput.
Generative models
RL can improve the degree to which a generated output satisfies a desired objective.
For example, a generative image model may initially produce a poor image for the prompt “a dolphin riding a bicycle.” RL can be used to optimize the model so that its generations better follow the prompt.
Chip design
RL has also been applied to computer-chip layout and design. A learned system can search through possible designs and optimize objectives such as performance, efficiency, and physical layout quality.
4. Reinforcement Learning as Improvement Through Practice
A particularly important feature of RL is that improvement can be observed directly over repeated attempts.
A robot may initially have no effective strategy for assembling or manipulating an object. During training:
It attempts different movements.
Some actions move it closer to success.
Other actions fail.
The reward signal distinguishes better from worse outcomes.
The policy is updated based on experience.
Performance improves over repeated trials.
This process demonstrates the idea of learning by practice.
Simple robot-learning demonstrations are useful because they show the learning process itself. Even when the task is not sophisticated, repeated practice makes the central RL idea clear: the agent can become better through its own interaction with the world.
Challenges in physical-world learning
Real-world RL is difficult because collecting experience can be expensive and inefficient.
In some experiments, a human must manually reset the robot after each failed attempt. For example, if a robot tries to hit a hockey puck toward a goal but cannot undo its previous actions, a person may need to reposition the robot and puck before every new attempt.
This creates several problems:
Human labor is required for resets.
Data collection becomes slow.
The number of training trials is limited.
The robot is not fully autonomous.
Failures may be difficult to recover from.
These limitations motivate research into reset-free reinforcement learning, in which an agent learns continuously without requiring a human to restore the environment after every attempt.
Open research questions
Important unresolved questions include:
How should an agent represent what is good for a task?
How can rewards be learned rather than manually designed?
How can an agent generalize across many situations?
How can RL scale to large and diverse data sets?
How can knowledge transfer from one task or goal to another?
How can agents learn long-horizon tasks such as cooking an entire meal?
How can RL help solve difficult mathematical problems?
How can robots practice completely autonomously?
How can agents operate reliably when rewards are sparse or delayed?
These questions motivate topics such as reward learning, offline RL, multitask RL, meta-RL, hierarchical RL, reasoning, and reset-free RL.
5. Modeling Behavior as Data
To learn from experience, an RL system needs a formal representation of what happened during interaction.
The system must represent:
What the environment was like.
What information the agent received.
What action the agent took.
How the environment changed.
How much reward the agent received.
The resulting data is usually represented as a sequence called a trajectory.
5.1 States
A state represents the current condition of the world.
The state is commonly denoted by s or S.
For a robot, the state might contain:
The position of the robot’s arm.
The positions of objects.
The location of a towel.
The location of a hook.
The positions of all robot joints.
The velocities of all robot joints.
Images from cameras.
A state should ideally contain all information needed to predict the future and choose an appropriate action.
For example, in a driving task, the state might include:
The vehicle’s position.
Its velocity.
Nearby vehicles.
Road geometry.
Traffic signals.
The velocity and direction of surrounding vehicles.
However, the complete state is not always directly available to the agent.
5.2 Observations
An observation is the information that the agent actually receives from the environment. It is commonly denoted by o or O.
An observation may contain only part of the true state.
For example:
A robot may receive an image from a camera rather than exact object positions.
A tactile sensor may only indicate contact at a particular location.
A chatbot may receive only the user’s latest message.
A self-driving car may receive sensor measurements that do not directly reveal the velocity of every nearby vehicle.
The distinction is:
State: The underlying condition of the environment.
Observation: The information available to the agent about that condition.
If the observation does not contain all relevant information, the agent may need to use a history of observations.
Chatbot example
Suppose the current observation is only the user’s latest message. That message may not contain enough information to determine the correct response.
The chatbot may need the conversation history:
The user’s original request.
The assistant’s previous response.
The user’s feedback or clarification.
The most recent message.
The history helps reconstruct the relevant state of the conversation.
Sensor-history example
A vehicle’s current LiDAR image may show where nearby cars are, but not how fast they are moving. A history of recent LiDAR observations can reveal their motion.
Thus, a state representation may be approximated using a fixed history, such as the most recent three seconds of sensor data.
Domain dependence
The amount of history needed depends strongly on the domain and sensors:
A camera image may contain substantial information about the environment.
A tactile sensor may provide highly incomplete information when there is no contact.
Combining tactile readings with vision can provide a more complete representation.
Some systems can use only the current sensor reading.
Other systems require long histories or learned memory.
Using history improves information but increases computational and memory costs. In some settings, history may be compressed using differences, summaries, or learned representations.
5.3 Actions
An action is a decision made by the agent. It is commonly denoted by a or A.
Examples include:
Moving a robot joint to a target position.
Applying torque to a motor.
Choosing the next chatbot message.
Recommending a song.
Steering a car.
Selecting a move in a game.
Clicking a button on a web page.
Choosing a token or sequence of tokens in a language model.
Actions may be:
Discrete: Choosing one item from a finite set, such as selecting a game move.
Continuous: Choosing a numerical value, such as a motor torque or target joint angle.
High-dimensional: Containing many simultaneous decisions, such as controlling all joints of a humanoid robot.
Structured or textual: Consisting of a sentence, paragraph, or other generated sequence.
5.4 Trajectories
A trajectory is a sequence of states and actions, or a sequence of observations and actions, generated during interaction with the environment.
A trajectory can be represented as:
or, when observations are used,
Here:
t denotes a particular time step.
T denotes the trajectory length or final time step.
The trajectory records one complete attempt or episode.
A trajectory may be augmented with rewards:
where rt is the reward associated with the state and action at time t.
Robot trajectory
A robot trajectory may contain:
A sequence of camera images.
A sequence of joint positions.
A sequence of joint velocities.
A sequence of commanded joint positions.
A sequence of rewards.
Time is often discretized at a fixed frequency. For example, at 20 Hertz:
Images are recorded at 20 frames per second.
Joint states are recorded 20 times per second.
Actions are issued 20 times per second.
Although humans do not consciously make twenty separate decisions per second, this representation is practical for physical control systems.
Chatbot trajectory
A chatbot trajectory may be a conversation trace:
User message.
Chatbot response.
User follow-up.
Chatbot response.
Additional feedback.
Unlike a robot trajectory, a conversation does not necessarily occur at a fixed frequency. The next step may happen when the user sends another message.
Thus, time may be represented differently:
For robots: fixed physical intervals such as 201 of a second.
For chatbots: event-based intervals such as the arrival of the next user message.
5.5 Reward Functions
A reward function measures how desirable a state, action, or outcome is.
A reward may be written as:
or, when it depends only on the state,
Examples include:
Reward 1 if a towel is placed on a hook and 0 otherwise.
Reward based on how close an object is to its goal.
Positive reward when a user upvotes a chatbot response.
Negative reward when a user downvotes a response.
A penalty for using excessive motor torque.
Reward for making forward progress while walking.
Reward for completing a web-based task.
Reward for generating an image that follows a prompt.
State-dependent rewards
Many rewards depend only on the state because the outcome itself indicates success.
Examples:
Whether an object is in the correct location.
Whether the towel is on the hook.
Whether the user appears satisfied.
How close the robot is to a target.
Action-dependent rewards
Rewards may also depend on actions when the behavior itself has a cost.
For example, a walking robot may receive reward for forward movement but be penalized for applying excessive torque:
Action-dependent penalties can encourage:
Energy efficiency.
Smooth movement.
Reduced wear on hardware.
Safer behavior.
Less aggressive control.
Sparse rewards and exploration
A reward of 1 for success and 0 otherwise is a sparse reward. It provides little information when the agent rarely reaches the goal.
If a robot never succeeds, it receives only zeros and has little evidence about how to improve. Demonstrations or initial examples can help the agent discover successful behavior and begin exploration.
This is why imitation learning, demonstrations, shaped rewards, or other forms of initialization can be useful in sparse-reward problems.
Reward learning
Manually defining a reward is often easy only for simple tasks. In realistic settings, it may be difficult to specify precisely what counts as good behavior.
For example, it is difficult to manually encode all the qualities of:
A helpful chatbot response.
A safe driving maneuver.
A natural robot movement.
A well-designed image.
A useful scientific experiment.
Reward learning attempts to infer a reward function from demonstrations, preferences, human feedback, or other signals.
6. Dynamics and the Markov Property
6.1 Environment Dynamics
The dynamics describe how the environment changes after an action.
They can be represented by a probability distribution such as:
This expression means: the probability of reaching next state st+1 given the current state st and current action at.
The dynamics account for effects such as:
Whether a robot arm moves as commanded.
How an object responds to contact.
How a towel moves when pushed.
How surrounding cars move.
How a game changes after a move.
How a user responds to a chatbot message.
The dynamics are often stochastic rather than deterministic. The same state-action pair may lead to different next states because of:
Physical uncertainty.
Sensor or actuator noise.
Unpredictable behavior by other agents.
Randomness in the environment.
Random initial conditions.
6.2 The Markov Property
A process satisfies the Markov property if the next state depends only on the current state and action, not on the entire past.
Formally:
For example, if the current state fully describes the robot, then the next state does not additionally depend on how the robot arrived at its current state.
The Markov property is useful because it allows a sequential decision problem to be decomposed into local transitions. The agent does not need to explicitly track every earlier state if the current state contains all relevant information.
Markov property: Once the current state and action are known, the past provides no additional information needed to predict the next state.
6.3 Why Observations May Not Be Markov
If the agent receives observations rather than complete states, the current observation may not contain enough information to determine the future.
The next observation may depend on earlier observations because those earlier observations provide clues about the hidden state.
For example:
A tactile sensor detects contact.
Contact stops.
Contact occurs again.
The most recent tactile observation alone may not reveal the object’s current position or whether the robot has moved relative to it. Earlier observations can provide essential context.
Therefore:
may not fully describe the process. A better prediction may require a history:
The underlying state may still follow Markov dynamics, even though the observed process does not appear Markov when viewed through incomplete observations.
7. Example Reinforcement Learning Formulations
7.1 Robotic Towel-Hanging Task
A robotic towel-hanging problem can be formulated as follows.
State or observation
The state may include:
RGB camera images.
Robot joint positions.
Robot joint velocities.
The towel’s position.
The hook’s position.
If the robot cannot directly measure the towel’s position, it may use camera images instead.
Action
The action may be the commanded next joint position. For example, if a joint is currently at 90∘, the action might command it to move to 92∘.
Trajectory
The trajectory contains a sequence of:
Camera images.
Joint positions.
Joint velocities.
Commanded joint positions.
Rewards.
Reward
Possible reward definitions include:
1 if the towel is on the hook.
0 otherwise.
A continuous reward based on the distance between the towel and the hook.
A penalty for excessive motor torque.
A shaped distance reward may provide more useful learning information than a purely binary success reward.
7.2 Chatbot Interaction
A chatbot can also be described as an RL system.
Observation
The current observation may be the user’s most recent message. In practice, the chatbot may also use the entire conversation history.
Action
The action is the chatbot’s next message, which may be a sentence, paragraph, or longer response.
Trajectory
The trajectory is the conversation trace:
User message.
Chatbot response.
User feedback or follow-up.
Further chatbot responses.
Reward
Example rewards include:
1 if the user upvotes the response.
−10 if the user downvotes it.
0 if the user gives no explicit feedback.
A reward function could also incorporate task completion, factuality, safety, helpfulness, or other objectives.
7.3 Autonomous Driving
For an autonomous vehicle, the state or observation might include:
Camera images.
LiDAR readings.
Vehicle position and velocity.
Road structure.
Nearby vehicles.
Traffic signals.
A single sensor reading may not reveal the velocities of surrounding cars. A history of observations can help infer whether another car is stopped, accelerating, or traveling quickly.
Action
Possible actions include:
Steering commands.
Acceleration or braking.
Lane changes.
Route decisions.
Reward
Possible rewards include:
Reaching a destination.
Making forward progress.
Avoiding collisions.
Maintaining comfort.
Following traffic laws.
Minimizing energy use.
7.4 Web Interaction
An agent interacting with a web page might use:
The page’s HTML.
The current URL.
Information about the visible page.
The interaction history.
Actions might include:
Clicking links.
Typing text.
Selecting options.
Navigating to another page.
The reward could indicate whether the assigned task was completed successfully.
8. Policies and Representation of Behavior
A policy is a rule for selecting actions based on states or observations.
It is commonly denoted by π.
A policy may be represented as:
where:
θ represents the policy parameters.
st is the current state.
at is the selected action.
The notation indicates that the action is sampled from the policy’s distribution.
If the policy uses observations, it may instead be written as:
or, with history,
where o1:t denotes all observations from time 1 through time t.
8.1 Neural-network policies
A policy can be implemented using many types of models:
Convolutional neural networks for images.
Fully connected networks for low-dimensional states.
Transformers for sequences and language.
Linear functions for simple control tasks.
Generative models for complex or structured actions.
The parameters θ are learned so that the resulting behavior maximizes expected reward.
8.2 Policy interaction loop
Using a policy involves repeatedly:
Observing the current state or observation.
Running the policy’s forward pass.
Sampling or selecting an action.
Executing the action.
Observing the next state or observation.
Repeating the process.
The resulting sequence is a trajectory.
A trajectory generated by executing a policy is often called:
A rollout.
An episode.
An attempt at completing the task.
The term rollout emphasizes that the policy and environment are applied sequentially to produce future states and actions.
8.3 Policies with memory
If the complete state is available, the policy can usually use only the current state:
If only partial observations are available, the policy may need memory:
Memory can be implemented using:
Recurrent neural networks.
Transformers.
Explicit observation histories.
Learned state estimators.
Compressed summaries of past observations.
Providing history increases memory and computation requirements, especially on a GPU, but it may be necessary when the current observation is insufficient.
A system may also use a two-stage architecture:
Infer or estimate the hidden state from observation history.
Predict an action from the estimated state.
This can be useful when the underlying state has a meaningful representation that can be modeled explicitly.
9. The Reinforcement Learning Objective
The goal of RL is to maximize reward over an entire trajectory rather than optimize an isolated action.
For a trajectory of length T, the undiscounted return is:
The policy objective is to maximize expected return:
Here:
τ is a trajectory.
pπ(τ) is the probability distribution over trajectories induced by policy π.
r(st,at) is the reward at time t.
The expectation averages over possible trajectories.
The policy does not usually appear directly inside the reward term. Instead, it affects the objective by changing the distribution of trajectories.
A policy that chooses different actions will:
Visit different states.
Encounter different outcomes.
Receive different rewards.
Produce a different trajectory distribution.
Thus, optimizing RL means finding the policy whose induced behavior leads to the highest expected reward.
9.1 Why return is stochastic
The return is generally not deterministic, even when the policy parameters remain fixed.
Two major sources of variability are:
Stochastic environment dynamics
The next state may be random:
For example:
Other cars may behave unpredictably.
A robot’s movement may be affected by noise.
A game may begin with randomly dealt cards.
Physical contact may produce variable outcomes.
Stochastic policies
The policy may sample different actions in the same state:
This randomness can be intentional, especially when exploration is important.
Initial-state randomness
Different episodes may begin in different initial states. The starting conditions of a game, robot, or environment may vary.
Consequently, the same policy can produce different trajectories and different total returns on separate runs.
9.2 Trajectory probability
The probability of a trajectory is determined by:
The probability of the initial state.
The probability of each action selected by the policy.
The probability of each transition under the environment dynamics.
For a trajectory
its probability can be written as:
with the final transition factor omitted or adjusted depending on the exact trajectory convention.
The objective can therefore be viewed as optimizing the expected reward under this policy-dependent trajectory distribution.
9.3 Variable-length trajectories
The horizon T does not have to be fixed.
A trajectory may end when:
The task is completed.
The agent fails.
A terminal state is reached.
A user ends a conversation.
A time limit is reached.
Fixed T is convenient for notation, but variable-length episodes are common in practice.
9.4 Discounted rewards
The undiscounted objective values rewards at all time steps equally. Sometimes immediate rewards should matter more than distant future rewards.
A discounted return can be written as:
where γ is the discount factor, usually satisfying:
Interpretation:
If γ=1, there is no discounting.
If γ is close to 1, distant rewards remain important.
If γ is smaller, near-term rewards receive more weight.
Smaller γ produces more short-sighted or “greedy” behavior.
Discounting can be useful when:
The task has a very long time horizon.
Immediate outcomes matter more than distant outcomes.
The system should prioritize near-term performance.
Future rewards become increasingly uncertain.
10. Why Use Stochastic Policies?
A stochastic policy represents a distribution over possible actions rather than selecting exactly one action every time.
Instead of a deterministic mapping
a stochastic policy specifies probabilities:
10.1 Exploration
An agent cannot improve effectively if it always repeats exactly the same behavior. It must try different actions and strategies to discover which ones work.
For example, a tennis-learning agent may need to experiment with:
Different swing angles.
Different speeds.
Different positions.
Different timing strategies.
Stochastic action selection provides a natural mechanism for exploration.
10.2 Modeling variable behavior
People and other agents may use different strategies in the same situation. If an RL system is trained on human demonstrations, a deterministic policy may fail to represent legitimate variation.
A stochastic policy can model:
Multiple acceptable actions.
Different human strategies.
Uncertainty about the best action.
Variation in language responses.
Diverse styles of behavior.
Generative-model techniques can be used to represent complex distributions over actions conditioned on states or observations.
11. Value Functions
Knowing how good a policy is requires estimating the future reward that it will produce.
A value function measures the expected future return from a particular state when the agent follows a policy afterward.
The value function for policy π is commonly written as:
In words, Vπ(s) is the expected future reward when:
The agent starts in state s.
It follows policy π from that point onward.
Rewards are accumulated over the future trajectory.
A high value means that following the policy from that state is expected to lead to good outcomes.
11.1 Q-functions
The Q-function evaluates a state-action pair rather than only a state.
It is commonly written as:
The distinction is:
Vπ(s): Expected return starting from state s and following policy π.
Qπ(s,a): Expected return starting from state s, taking action a first, and then following policy π.
The first action in Qπ(s,a) may differ from the action that policy π would normally select.
Value functions are important because they help determine:
Which states are promising.
Which actions are useful.
How well a policy is performing.
How to improve a policy.
How to compare alternative decisions.
12. Major Families of Reinforcement Learning Algorithms
12.1 Imitation Learning
Imitation learning trains an agent to reproduce the behavior of an expert or demonstrated policy.
The expert may be:
A human.
A previously trained controller.
A stronger AI system.
A scripted policy.
Imitation learning is especially useful when:
Rewards are sparse.
Random exploration is ineffective.
Demonstrations are available.
The agent needs a good starting policy.
The learned policy may later be improved through RL.
12.2 Policy-Gradient Methods
Policy-gradient methods directly optimize the policy parameters by estimating how changes in the policy affect expected reward.
Conceptually, they attempt to differentiate the RL objective with respect to θ:
where J(θ) is the expected return of the policy.
These methods learn from actual practice and experience and are applicable to stochastic policies and continuous actions.
12.3 Actor-Critic Methods
Actor-critic algorithms combine two components:
Actor: The policy that selects actions.
Critic: A value estimator that evaluates the actor’s behavior.
The critic estimates quantities such as Vπ(s) or Qπ(s,a), and the actor uses this information to improve its actions.
This division can make policy optimization more data-efficient or stable than relying only on complete trajectory returns.
12.4 Value-Based Methods
Value-based methods estimate the value of actions or states under an optimal policy.
The learned value function can then be used to select actions, often by choosing the action with the highest estimated value:
These methods are especially natural for discrete action spaces, such as game moves.
12.5 Model-Based Methods
Model-based RL learns or uses a model of the environment dynamics:
The model predicts how the world will evolve after an action.
The agent can then use the model for:
Planning.
Simulating future outcomes.
Comparing candidate action sequences.
Improving the policy.
Reducing the amount of real-world data needed.
13. Why Reinforcement Learning Has Many Algorithms
Supervised learning often relies on a relatively standard optimization approach such as gradient descent. RL is more varied because different environments and data sources create different practical trade-offs.
Important considerations include:
Cost of collecting data
Simulation may provide large amounts of inexpensive data.
Physical robots may require expensive hardware time.
Human feedback may be slow and costly.
Interacting with real users may be difficult to scale.
Available supervision
An environment may provide:
Expert demonstrations.
Detailed rewards.
Sparse success signals.
Human preferences.
Task-completion labels.
Noisy or incomplete feedback.
Stability and ease of use
Some methods are easier to tune and more stable, while others may be more data-efficient but sensitive to:
Hyperparameters.
Distribution shifts.
Approximation errors.
Reward design.
Policy initialization.
Data efficiency
If data is expensive, the algorithm should extract as much learning as possible from every interaction. If data is cheap, computationally simpler or more exploratory methods may be acceptable.
Action-space structure
The type of action affects algorithm choice:
Discrete actions may favor value-based methods.
Continuous actions may favor policy-gradient or actor-critic methods.
High-dimensional actions may require specialized representations.
Textual actions may require sequence-generation models.
Learnability of dynamics
Model-based methods are more attractive when the environment dynamics can be modeled accurately. If the environment is highly complex or unpredictable, model-free methods may be easier to apply.
No single RL algorithm is best for every problem. Different methods make different assumptions and perform well under different environmental, computational, and data-collection conditions.
14. Markov Decision Processes and Partial Observability
The basic mathematical formulation of a reinforcement-learning problem consists of:
States or observations.
Actions.
Rewards.
Initial-state distribution.
Environment dynamics.
A policy.
Trajectories.
An objective based on expected return.
When the system has fully observable states and Markov dynamics, it is called a Markov decision process (MDP).
An MDP can be described by:
where:
S is the state space.
A is the action space.
P is the transition or dynamics distribution.
r is the reward function.
p0 is the initial-state distribution.
When the agent receives only partial observations rather than the true state, the problem is called a partially observable Markov decision process (POMDP).
A POMDP additionally requires an observation model, often written as:
The observation model describes how the underlying state produces the information available to the agent.
MDP
In an MDP:
The current state contains all relevant information.
The next state depends only on the current state and action.
A memoryless policy may be sufficient.
POMDP
In a POMDP:
The true state is partly hidden.
The current observation may be insufficient.
Past observations can help infer the hidden state.
Policies may require memory or belief-state estimation.
MDP: Decision-making with complete Markov state information.
POMDP: Decision-making when the agent receives incomplete observations of the underlying state.
15. Core Concepts and Notation
The foundational concepts are:
State st: The underlying condition of the environment at time t.
Observation ot: The information the agent receives at time t.
Action at: The decision made by the agent.
Reward r(st,at): A numerical evaluation of the state-action outcome.
Dynamics P(st+1∣st,at): The probability distribution describing how the environment changes.
Initial-state distribution p0(s1): The distribution from which episodes begin.
Trajectory τ: A sequence of states or observations, actions, and possibly rewards.
Policy πθ: A parameterized rule or distribution for selecting actions.
Return G(τ): The cumulative reward obtained over a trajectory.
Value function Vπ(s): The expected future return from a state under policy π.
Q-function Qπ(s,a): The expected future return from taking action a in state s and then following policy π.
MDP: A fully observable Markov decision process.
POMDP: A partially observable Markov decision process.
The central reinforcement-learning objective is to find a policy that maximizes expected cumulative reward:
The essential challenge is that the policy determines the distribution of future experience, so learning behavior requires optimizing both action selection and the consequences that those actions create.

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