Reinforcement Learning: i. Foundations and learning methods · ii. Partial observability, offline data, and DTRs.
Reinforcement learning studies how actions affect both immediate rewards and future decisions. We begin with a fully observed Markov decision process, derive the Bellman equations for expected return, and prove why exact value iteration converges. We then distinguish methods by the model, optimization target, and data they use. The setup follows Sutton–Barto, Chapter 3; the contraction argument follows Reinforcement Learning: Theory and Algorithms, Section 1.3.1.
1. A Markov decision process and its assumptions
Let and be nonempty finite state and action sets. At time , the agent observes , selects , and receives together with the next state . Fix an ordering of actions to resolve ties.
Write the full available history as
The controlled Markov assumption is an equality of conditional distributions:
Thus the current state and action determine the conditional distribution of the next state and reward; earlier history adds no further information. Writing without a time index also assumes time-homogeneous dynamics: the transition law does not change with time. Calling an observed variable a state does not establish either assumption.
We use the MDP specification
and assume almost surely under every state–action transition. Here is a probability kernel on next states and rewards. Its state marginal and conditional reward mean are
For transitions with , the value assigned to does not affect this sum. The joint kernel defines the reward distribution; is sufficient for the expected-return Bellman equations.
The model need not be known. The MDP describes the environment; a learning algorithm may have to estimate its consequences from sampled transitions. Temporal dependence within a trajectory is allowed. Independent one-step observations are not an MDP assumption.
2. Policies, returns, and the optimization target
A stationary Markov policy is a map , where denotes the probability simplex:
The agent samples using fresh randomization. A deterministic policy is the special case . More generally, a policy can depend on time and the full history through , but not on future information. Such policies are called nonanticipating; we include them in the optimality proof.
Write for the trajectory distribution generated by
Expectations average over all these draws, with the policy and environment fixed. The shorter uses this distribution, with any stated conditioning. A policy subscript therefore includes environment randomness, not just sampled actions. For a history-dependent policy , replace the action distribution by . A one-transition expectation at fixed instead integrates only .
Define the discounted return
Bounded rewards and imply
The return therefore exists absolutely. This bound also justifies the expectation and limit operations below by dominated convergence.
For a stationary Markov policy, define
Here uses the trajectory distribution above with fixed, rather than drawn from . The expectation also fixes , then follows for later actions. This defines even if . On events of positive probability, these definitions agree with the usual conditional expectations.
In , the value function is fixed. The outer expectation averages only over the initial state .
These are population value functions, not their fitted estimates. Policy evaluation determines or for a fixed policy; control seeks a policy maximizing expected return.
3. Deriving the Bellman expectation equations
First, condition on the initial action. The law of total expectation gives
Next, substitute the return recursion into the action value:
The second equality is the tower property. The third uses both the controlled Markov dynamics and the stationary Markov policy: conditional on , the continuation has the same law as a process newly started there. No independence between the immediate reward and next state is needed.
Combining the two identities gives
Alternatively, substituting the action average for gives
A matrix form for policy evaluation
Let . Regard as vectors and as a transition matrix, with
Then
To justify the inverse, use for the induced matrix norm. The convergent Neumann series gives
The th term is the expected reward transitions into the future, discounted by .
The advantage function is
The advantage therefore measures how an action's expected return differs from the policy's average at that same state.
4. Optimality and the contraction argument
For , define the Bellman operators
Theorem 1. Under the finite-space, bounded-reward, time-homogeneous assumptions in Section 1, has a unique fixed point . It equals the optimal value over all nonanticipating policies. A deterministic policy greedy with respect to is optimal from every starting state.
First, establish the elementary maximum inequality. For real vectors , choose . Then
Interchanging and yields the absolute-value version. Apply it inside :
Because transition probabilities are nonnegative and sum to one, their weighted average cannot exceed the largest value difference. Taking the maximum over states proves
Because is complete and , the Banach fixed-point theorem supplies a unique fixed point . The same averaging argument makes a contraction, whose fixed point is .
Next, select the first maximizing action in the fixed ordering:
By construction . Uniqueness of the policy-evaluation fixed point implies . In particular is an attained policy value and .
Finally, compare it with any history-dependent randomized policy . Since a maximum dominates every action mixture, the Markov assumption gives
Repeated substitution and the tower property yield, for every integer ,
The terminal term tends to zero because is bounded. Dominated convergence therefore gives . Together with , this proves and optimality of even against nonstationary, history-dependent competitors.
Consequently,
The optimal action is ; a policy and an action are different mathematical objects.
5. Value iteration and a worked example
Starting from any finite vector , iterate . Contraction gives
There is also a computable residual bound. Adding and subtracting , then applying contraction, gives
Input: Finite ; known ; ; initial ; iteration count ; fixed action ordering.
Output: Value approximation and a policy greedy with respect to .
- for do
- for each do
- Set .
- end for
- Set simultaneously for all states.
- end for
- Set .
- return .
This algorithm plans with a known model. Estimating or approximating its Bellman updates introduces additional errors, so those procedures need more than the exact-iteration theorem.
Immediate reward can favor the wrong action
Take , actions , and . The transitions and rewards are deterministic:
| State | Action | Immediate reward | Next state |
|---|---|---|---|
| 0 | wait | 1 | 0 |
| 0 | move | 0 | 1 |
| 1 | either | 2 | 1 |
State 1 gives . At state 0, the candidate satisfies
Thus the fixed point is and moving is optimal at state 0. Waiting forever instead gives there. Starting value iteration from zero produces
As the updates propagate future rewards back to state 0, moving becomes preferable to the immediately rewarding loop. The example illustrates the convergence established by the fixed-point proof.
6. Classifying learning methods without mixing categories
The original Spinning Up taxonomy places familiar algorithms in a broader map. The table below then separates design choices that can overlap; they are not mutually exclusive branches of one tree. These distinctions also follow the learning/planning discussion in Sutton–Barto and Levine et al., Section 2.1.
| Question | Main distinctions | Examples or interpretation |
|---|---|---|
| Is an environment model used for planning? | Model-based, model-free, hybrid | A learned transition model; Q-learning without one; Dyna combining real and simulated transitions |
| What is learned or optimized? | Value-based, direct policy search, actor–critic | A greedy rule from ; optimize ; combine a parameterized policy with a critic |
| How is a value target formed? | Monte Carlo, temporal-difference, multistep | Realized returns; bootstrapped continuation values; combinations over several transitions |
| Which policy generated the data? | On-policy, off-policy | Evaluate or improve the sampling policy; learn about a different target policy |
| How are functions represented? | Tabular, function approximation | One entry per state/action; linear models or neural networks |
For example, actor–critic methods can be on-policy or off-policy. Policy optimization can use a learned dynamics model. A neural network is a representation choice, not a new definition of the decision problem.
Sampled value updates
Monte Carlo evaluation uses a realized return as a target. In finite episodes this is the return through termination; an infinite-horizon implementation must truncate or otherwise estimate the tail. One-step temporal-difference evaluation instead uses
For action values, two familiar targets are
A tabular update at the visited pair takes the form
Other entries are unchanged. SARSA uses the next action sampled under its policy. Q-learning instead uses the best estimated continuation action, even when the behavior policy explores. It is therefore an off-policy control method.
Convergence of these sampled updates requires conditions on how often state–action pairs are visited, the learning rates, and any function approximation. The contraction proof for exact Bellman updates does not establish convergence for every sampled implementation.
Direct policy search and actor–critic
For a differentiable stochastic policy , direct policy optimization targets . To state the discounted policy-gradient identity, define the normalized state occupancy
Under positive differentiable action probabilities and conditions permitting differentiation under the expectation, the identity is
This is the policy-gradient theorem in Agarwal et al., Theorem 9.4, stated here rather than proved. A Monte Carlo method estimates the return from trajectories; an actor–critic method uses a fitted value function to estimate the policy update. The latter separates an actor from a critic such as or . The policy-gradient note derives the identity and compares these methods in detail.
7. Which assumptions will change next?
The discounted stationary MDP is one baseline, not the definition of every RL problem. A finite horizon allows with bounded rewards and generally requires stage-specific . A partially observed problem distinguishes the hidden state from the information available to the policy. Offline learning changes access to data, not necessarily the Markov dynamics.
Part ii redefines these settings explicitly and ends with their connection to the history-based DTR formulation.
References
- Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction, second edition. Publisher; accessible earlier author draft. The linked draft is an in-progress edition, not the final published text.
- Alekh Agarwal, Kianté Brantley, Nan Jiang, Sham M. Kakade, and Wen Sun. Reinforcement Learning: Theory and Algorithms. Section 1.3.1 gives contraction and value iteration; Theorem 9.4 gives the policy-gradient identity in the linked version.
- Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu (2020). Offline Reinforcement Learning: Tutorial, Review, and Perspectives on Open Problems. Section 2.1 reviews the RL formulation and algorithm families.

