Reinforcement Learning: Short Notes (b)
Reinforcement Learning (RL) is a machine learning paradigm where an agent learns to make sequential decisions by interacting with an environment. At each time step, the agent chooses an action and receives a reward (possibly delayed). The goal is to learn a behavior that maximizes the expected long-term cumulative reward.
Key elements of the RL loop are modeled using a Markov decision process (MDP): states, actions, transition dynamics, and rewards. RL often uses policy to decide actions, and value function to evaluate how good outcomes are. A central set of relationships are the Bellman equations that express value as immediate reward plus discounted future value.
Objective (return and discounting)
The agent typically maximizes the discounted sum of rewards (the return):
where is the discount factor.
Reinforcement Learning (Overview) - Intro Concepts
Core learning ingredients (what an RL “system” needs)
1) Agent–environment interaction
RL is fundamentally about repeated interaction:
- Observe current state
- Choose an action
- Receive reward
- Move to the next state, then repeat
2) Policy and value
- A policy defines behavior.
- A value function estimates long-term usefulness of states or state-action pairs.
Common value targets:
- : expected return starting in state and following policy .
- : expected return starting in state , taking action , then following policy .
3) Exploration vs exploitation
RL must balance:
- Exploitation: choose actions known to yield high reward
- Exploration: try uncertain actions to improve future decisions
This is formalized with exploration strategies such as epsilon-greedy or stochastic policies (e.g., softmax), and sometimes upper confidence bound (UCB)-style methods.
Pro Tip
Start with small toy environments (gridworld/cartpole-like) to validate that your learning signal improves before scaling to larger problems.
How RL learns (high-level training loop)
- 1Step 1
Set up the agent (policy/value parameters). Initialize Q/V estimates or neural network weights.
- 2Step 2
At time , get the current observation/state from the environment.
- 3Step 3
Use the policy to pick (often with exploration, e.g., epsilon-greedy).
- 4Step 4
Execute , then receive reward and next state .
- 5Step 5
Update value estimates and/or policy parameters using the transition .
- 6Step 6
Continue for many steps/episodes until performance converges or meets a criterion.
Major families of reinforcement learning methods
A) Value-based methods
Value-based RL learns value functions (especially action-value function ) and chooses actions that maximize value.
- [Q-learning]{def="Off-policy control method using Bellman optimality updates for Q values"} updates toward an optimal action-value using a greedy target.
- [SARSA]{def="On-policy control method updating Q using the action actually taken next"} updates using the next action from the current policy.
Value-based methods are typically represented as:
- TD learning:
and use it to reduce prediction error.
B) Policy-based methods
Policy-based RL directly learns the policy parameters by gradient ascent on expected return. A classic approach is:
- REINFORCE (Monte Carlo policy gradients)
Policy-gradient intuition:
- Increase probability of actions that led to higher-than-expected return
- Decrease probability of actions that led to worse outcomes
Key concepts:
- advantage function helps reduce variance.
- baseline (e.g., ) is commonly used.
C) Actor–critic methods
Actor–critic combines both:
- Actor: policy (chooses actions)
- Critic: value function (evaluates actions)
The critic provides a learning signal (often via TD error or advantage), and the actor updates accordingly.
Warning
With deep RL, training can be unstable; common mitigations include target networks, experience replay, and reward normalization (depending on the algorithm).
Common progression in RL algorithm design
Define the problem
MDP modelingSpecify states, actions, rewards, transitions, and discount factor."
Learn Q/V (TD learning)
Value learningUse bootstrapping to improve estimates from sampled experience."
Improve behavior
Policy improvementDerive actions from values (value-based) or update policy parameters (policy-based)."
Scale with deep RL
StabilizationUse neural networks, experience replay, and target networks where appropriate."
RL Method Families (Conceptual Comparison)
Quick mental model of what each family primarily learns.
Short notes / FAQs for reinforcement learning
Knowledge Check
In reinforcement learning, the agent’s objective is to maximize what?
Explore Related Topics
Short Notes: Project Management, Test Case Design, and Software Reliability
Short Notes on Cook's Theorem, Randomized Algorithms, and Bin Packing
The notes cover Cook’s theorem establishing SAT as NP‑complete, the design and analysis of randomized (Las Vegas and Monte Carlo) algorithms, and the NP‑hard bin‑packing problem with its common heuristics and approximation guarantees.
- Cook’s theorem shows every language reduces to SAT via a polynomial‑time function such that , making SAT the first NP‑complete problem.
- Randomized algorithms: Las Vegas algorithms are always correct with expected runtime (e.g., for randomized quicksort); Monte Carlo algorithms run in fixed time with error ≤½, which can be reduced by amplification to after repetitions.
- Bin packing: the decision version is NP‑complete and the optimization version NP‑hard; heuristics like First Fit Decreasing guarantee .
- Together they illustrate three core CS themes: proving hardness via reductions, leveraging randomness for efficient algorithm design, and using heuristics/approximation to tackle intractable optimization problems.
Short Notes: YACC