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

Study methods

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

Deep Reinforcement Learning Intro

Speaker 1Speaker 2

Deep Reinforcement Learning Intro

16:50
0:00-16:50
  1. Anna

    Welcome to our introduction to deep reinforcement learning, or deep RL. The course aims to explain what deep reinforcement learning is, how to represent behavior so it can be optimized, and how to formulate a reinforcement learning problem. We will focus on core concepts and on implementing algorithms ourselves, with examples from robotics, control, language models, and other applications.

  2. Simon

    So what exactly is reinforcement learning? At the broadest level, it studies decision-making problems in which a system makes multiple decisions based on a stream of information. It observes the world, takes an action, observes again, takes another action, and continues that interaction over time.

  3. Anna

    And deep reinforcement learning emphasizes solutions that scale to deep neural networks. The course may include imitation learning, model-free and model-based reinforcement learning, offline and online RL, multitask and meta-RL, reinforcement learning for large language models, and reinforcement learning for robots. The goal is not to cover every possible method, but to understand the principles well enough to follow existing and emerging approaches.

  4. Simon

    That differs substantially from the usual supervised-learning setup. In supervised learning, we receive input-output pairs, usually written as x and y, and learn a function that maps x to y. The data points are typically assumed to be independently and identically sampled from one distribution, and the desired output is provided directly.

  5. Anna

    In reinforcement learning, the target is behavior. We usually write the behavior as a policy, pi, which maps a state or observation, s, to an action, a. But no one directly tells the system the correct action for every situation. Instead, the policy learns from indirect feedback, and the experience it receives often comes from the policy it is currently learning.

  6. Simon

    That creates two major differences from supervised learning. First, the feedback is indirect rather than a label saying, 'This is the correct output.' Second, the data distribution is not fixed independently of the learner: the policy affects which states and situations the system encounters.

  7. Anna

    The behavior could be controlling a robot, playing a game, driving a car, interacting with a person through a chatbot, recommending content, or operating on the web. In all of these cases, actions can affect what happens later, so we need a framework for learning behavior over time rather than predicting isolated outputs.

  8. Simon

    Why study deep RL? One reason is that many AI predictions have consequences. A Spotify recommendation, for example, affects what the user listens to and therefore what might make sense to recommend next. The system may avoid repeatedly recommending the same song or may try to remain within an appropriate genre, because current decisions influence future outcomes.

  9. Anna

    Another reason is that direct supervision may not be available. A coding assistant might receive feedback that a response was helpful or poor, rather than being given the exact correct output. More generally, objectives that are indirect or not simply differentiable accuracy measures can be formulated as reinforcement learning problems.

  10. Simon

    Reinforcement learning is also useful because it lets systems learn from experience. That ability to improve with practice seems fundamental to intelligence, and it can help an agent discover solutions rather than merely imitate patterns already present in data. Finally, deep RL has many open research problems, which makes it an active area for research.

  11. Anna

    There are already impressive applications. Legged robots have learned behaviors in simulation and transferred them to the real world, including walking and dancing. Robots can also manipulate objects, such as unloading and folding laundry or folding simple origami, sometimes using imitation learning within the broader scope of reinforcement-learning methods.

  12. Simon

    Games provide another example. DeepMind trained a deep reinforcement-learning system to play Go and defeat Lee Sedol. A particularly famous moment was Move 37, a strategy that surprised expert human players and illustrated how reinforcement learning can discover solutions people had not previously considered.

  13. Anna

    That discovery aspect could matter beyond games, including settings where systems need to experiment in order to discover diseases or other new possibilities. Deep RL also appears in modern language-model post-training, especially for more advanced reasoning, as well as in traffic control, generative-model training, and chip design.

  14. Simon

    For example, reinforcement learning can optimize a generative model so that an image better follows a prompt such as 'a dolphin riding a bike.' It has also been used in research on inserting cars into human-driven traffic to increase road throughput, and in designing chips used in Google's production TPU.

  15. Anna

    Robotics gives a very concrete picture of learning through practice. In one example, a robot initially knew nothing about inserting and assembling parts of a toy airplane, but improved through repeated real-world experience. A later system used cameras to learn how to insert a red block into a shape-sorting cube, eventually reaching roughly 95 to 100 percent success in the demonstrated task.

  16. Simon

    Those examples also reveal important challenges. How should a robot represent what is good for a task? How can an agent generalize from one situation to many? Can reinforcement learning scale to large, diverse datasets, transfer knowledge from other tasks and goals, handle long-horizon activities such as cooking a meal or solving a difficult math problem, and let robots practice autonomously?

  17. Anna

    Autonomous practice is especially difficult in the real world. In one hockey example, the robot repeatedly tried to hit a puck into a goal, but after each attempt it could not reset the task itself. A person had to do much of the resetting, which is inefficient and makes collecting large amounts of data impractical. This motivates topics such as reward learning, offline RL, multitask and meta-RL, hierarchy, reasoning, and reset-free RL.

  18. Simon

    Rewards themselves can be hard to specify. In a simple robotics example, the reward was the negative distance between an object and its goal. That was possible because the robot's arm position gave information about the object's position. In another example, a motion-capture marker measured where a hockey puck was, but these task-specific measurements are not always available, which is why general reward learning is important.

  19. Anna

    To model an RL problem, we first need to represent experience as data. The basic concepts are the state, the action, the trajectory, and the reward. We use S for the current state of the world and A, or lowercase a, for a decision taken by the agent.

  20. Simon

    A state might include everything needed to make a decision. For a robot, it could include the arm's position, the towel's position, and the hook's position. But sometimes the agent cannot directly access the full state, so we use an observation, written O, such as a camera image and the robot's joint positions.

  21. Anna

    The distinction is important. An observation may not contain all the information needed for a decision, while a state is intended to capture the relevant information. For a chatbot, the latest user message is an observation, but it does not tell the system the entire conversation or what has already happened. The chatbot may need a history of previous messages.

  22. Simon

    A trajectory is the sequence produced during an interaction: states and actions, or observations and actions. So reinforcement learning works with datasets of trajectories rather than ordinary independent x-y pairs. The trajectory can also be augmented with rewards, recording how good the interaction was at each step.

  23. Anna

    A reward function tells us how good a state and action are. In many cases it depends only on the state, such as whether a towel is on a hook or how close it is to being hung. For a chatbot, reward might reflect user feedback, such as a thumbs-up or thumbs-down.

  24. Simon

    There are cases where the action belongs in the reward too. Imagine a humanoid robot learning to walk. Forward progress depends on the state, but we might also penalize excessive motor torque to discourage using too much energy. So rewards can depend on state, action, or both.

  25. Anna

    The state-and-action sequence has a useful Markov structure. The current state and action determine a distribution over the next state, written P of S sub t plus 1 given S sub t and A sub t. The next state does not need the entire earlier history once the current state is known.

  26. Simon

    That conditional independence is the Markov property. It lets us break a sequential problem into local transitions rather than tracking every dependency from the beginning. The dynamics function describes how the world changes: for example, how the robot arm and the towel move as a function of their previous state and the robot's action.

  27. Anna

    With observations, the situation can be partially observable. An observation is generated from the underlying state, but it may omit information. Then a future observation may depend on earlier observations as well as the latest one, because earlier information can help infer the hidden state.

  28. Simon

    The number of past observations needed is domain-dependent. In some robotics settings, the current sensor reading is enough, but tactile sensors may reveal much less than vision, especially when the robot is not making contact. A history of observations can help, although it may be costly to store; sometimes histories can be compressed, for example using changes or deltas.

  29. Anna

    A robotics formulation might use RGB camera images, all joint positions, and joint velocities as the state. The action could be a commanded next joint position, such as moving a joint from 90 degrees to 92 degrees. A trajectory would contain those images, joint observations, and commanded positions over time.

  30. Simon

    Physical systems often discretize time. A robot might record images, joint observations, and actions at 20 hertz, or 20 times per second. That does not mean the robot consciously makes decisions the way a person does; it is simply a practical representation of behavior.

  31. Anna

    For that robot, a reward could be one when the towel is on the hook and zero otherwise, possibly combined with a penalty for large torques. Such a reward is sparse: if the robot never succeeds, it sees only zeros. In practice, demonstrations or a few examples of how to perform the task can help with exploration and jump-start learning.

  32. Simon

    A chatbot gives a different formulation. The observation might be the user's most recent message, and the action is the chatbot's next sentence or paragraph. The trajectory is the conversation trace, and time is represented by the arrival of the next user response rather than by a fixed frequency.

  33. Anna

    A simple chatbot reward could be one for an upvote, negative ten for a downvote, and zero when there is no user feedback. The same modeling pattern can apply to a web agent: its observation might include page information and a URL, its action might be an interaction with the page, and its reward might indicate whether the task was completed.

  34. Simon

    Behavior is represented with a policy, written pi. A policy maps states or observations, or a sequence of observations, to actions. It could be a convolutional neural network, a transformer, a fully connected network, or even a linear function, with theta denoting its learnable parameters.

  35. Anna

    Using a policy means observing the current state, running a forward pass, sampling or selecting an action, executing it, and observing the next state. Repeating this process produces a trajectory. When a policy generates the trajectory, we call it a rollout or an episode—one attempt that can be repeated.

  36. Simon

    If the full state is available, the policy can use just the current state. If only partial observations are available, the policy needs memory or a sequence of observations. Sequence models are a natural choice, especially for language, although storing a large amount of history can consume substantial computer or GPU memory.

  37. Anna

    The overall goal is to maximize reward across the trajectory, not merely at one time step. The basic objective is the expected sum of rewards from the states and actions in trajectories generated by the policy. We seek the policy pi that produces the highest expected total reward.

  38. Simon

    That total reward is usually not deterministic. The environment can be stochastic, meaning the same state and action can lead to different next states. The policy can also be stochastic, meaning it may choose different actions from the same state. In driving, for example, other cars may behave differently, and the agent itself may sample different decisions.

  39. Anna

    To express this formally, we consider a probability distribution over trajectories. A trajectory begins with an initial-state probability, then the policy supplies an action probability, the dynamics supply the probability of the next state, and this alternates through the episode. The trajectory probability is therefore the initial-state probability multiplied by the sequence of policy and dynamics probabilities.

  40. Simon

    The policy appears in the reinforcement-learning objective through that trajectory distribution. Even if the reward expression itself does not visibly contain pi, changing pi changes which actions are taken, which states are visited, and therefore which rewards are obtained. Optimizing RL means finding the policy whose induced distribution over trajectories gives the greatest expected return.

  41. Anna

    The trajectory length, written capital T, does not have to be fixed. Fixed length is just convenient notation; an episode can have a variable endpoint. We can also introduce a discount factor, usually between zero and one, to weight future rewards less than immediate rewards.

  42. Simon

    When the discount factor is one, the objective is the ordinary sum of rewards. As it becomes smaller, the policy becomes more focused on near-term rewards and less concerned with rewards far in the future. That matters when the horizon is extremely long and rewards many steps or years away should count less.

  43. Anna

    A stochastic policy is useful for exploration. An agent learning tennis, for example, should not repeat exactly the same technique forever; it needs to try alternatives. Stochastic policies are also useful when modeling people or systems that naturally use different strategies, and generative-model tools can represent a distribution over actions given states or observations.

  44. Simon

    To judge whether a policy is good, we use a value function. The value of a state under policy pi, written V pi of S, is the expected future reward obtained by starting at S and following that policy from then onward.

  45. Anna

    A related quantity is the Q-value function. It considers starting in a state, taking a particular action—which may differ from the action policy pi would normally choose—and then following pi afterward. These functions become important tools for evaluating and improving behavior.

  46. Simon

    The course will cover several algorithm families. Imitation learning tries to mimic a policy that achieves high reward. Policy-gradient methods directly differentiate the reinforcement-learning objective and learn from practice and experience.

  47. Anna

    Actor-critic methods estimate the value of the current policy and use that estimate to improve the policy. Value-based methods estimate the value of an optimal policy and then use those values to derive a good policy. Model-based methods learn the world's dynamics, predict possible futures, and use those predictions for planning or policy improvement.

  48. Simon

    Why are there so many approaches instead of one universal method like ordinary gradient descent in supervised learning? Reinforcement-learning algorithms make different trade-offs and work under different assumptions. The choice depends on how expensive data collection is, whether the system is in a cheap simulator or interacting with people, what demonstrations or rewards are available, and how much stability or data efficiency matters.

  49. Anna

    The action space also matters. Actions may be discrete or continuous and may have high dimensionality. It matters too whether the environment dynamics are easy to learn. These differences help explain why different RL algorithms are useful in different settings.

  50. Simon

    Let's finish by organizing the terminology. States or observations describe what the agent knows, actions describe what it does, rewards describe how good outcomes are, the initial-state distribution describes where an episode begins, and the dynamics describe how the world changes. Together, the state-based formulation is called a Markov decision process, or MDP.

  51. Anna

    When the agent receives only partial observations rather than the full state, the formulation is a partially observable Markov decision process, or POMDP. We also introduced trajectories, policies, the expected-reward objective, value functions, and Q-functions. Those are the building blocks for understanding and implementing deep reinforcement-learning methods.

  52. Simon

    So the central picture is this: an agent uses a policy to map information to actions, interacts with an environment whose dynamics produce new states or observations, receives rewards, and learns to improve the expected return over complete trajectories. That framework applies from robots and games to chatbots, recommenders, traffic systems, generative models, and chip design.

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent