Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Infinite-Horizon Markov Decision Processes

Finite-horizon stochastic dynamic programming obtains its boundary condition from the terminal reward. What value equation remains when the process has no terminal date? Discounting makes the infinite reward stream bounded and turns the Bellman equations into fixed-point problems.

The undiscounted expected total reward of policy πΠHR\boldsymbol{\pi} \in \Pi^{\mathrm{HR}} is

vπ(s)=E[t=1r(St,At)]v^{\boldsymbol{\pi}}(s) = \mathbb{E}\left[\sum_{t=1}^{\infty} r(S_t, A_t)\right]

One drawback of this model is that we could easily encounter values that are ++\infty or -\infty, even in a setting as simple as a single-state MDP which loops back into itself and where the accrued reward is nonzero.

Therefore, it is often more convenient to work with an alternative formulation which guarantees the existence of a limit: the expected total discounted reward of policy πΠHR\boldsymbol{\pi} \in \Pi^{\mathrm{HR}} is defined to be:

vγπ(s)limNE[t=1Nγt1r(St,At)]v_\gamma^{\boldsymbol{\pi}}(s) \equiv \lim_{N \rightarrow \infty} \mathbb{E}\left[\sum_{t=1}^N \gamma^{t-1} r(S_t, A_t)\right]

for 0γ<10 \leq \gamma < 1 and when maxsSmaxaAsr(s,a)=Rmax<\max_{s \in \mathcal{S}} \max_{a \in \mathcal{A}_s}|r(s, a)| = R_{\max} < \infty, in which case, vγπ(s)(1γ)1Rmax|v_\gamma^{\boldsymbol{\pi}}(s)| \leq (1-\gamma)^{-1} R_{\max}.

Finally, another possibility for the infinite-horizon setting is the so-called average reward or gain of policy πΠHR\boldsymbol{\pi} \in \Pi^{\mathrm{HR}} defined as:

gπ(s)limN1NE[t=1Nr(St,At)]g^{\boldsymbol{\pi}}(s) \equiv \lim_{N \rightarrow \infty} \frac{1}{N} \mathbb{E}\left[\sum_{t=1}^N r(S_t, A_t)\right]

We won’t be working with this formulation in this course due to its inherent practical and theoretical complexities.

Extending the previous notion of optimality from finite-horizon models, a policy π\boldsymbol{\pi}^* is said to be discount optimal for a given γ\gamma if:

vγπ(s)vγπ(s) for each sS and all πΠHRv_\gamma^{\boldsymbol{\pi}^*}(s) \geq v_\gamma^{\boldsymbol{\pi}}(s) \quad \text { for each } s \in S \text { and all } \boldsymbol{\pi} \in \Pi^{\mathrm{HR}}

Furthermore, the value of a discounted MDP vγ(s)v_\gamma^*(s), is defined by:

vγ(s)maxπΠHRvγπ(s)v_\gamma^*(s) \equiv \max _{\boldsymbol{\pi} \in \Pi^{\mathrm{HR}}} v_\gamma^{\boldsymbol{\pi}}(s)

More often, we refer to vγv_\gamma by simply calling it the optimal value function.

As for the finite-horizon setting, the infinite horizon discounted model does not require history-dependent policies, since for any πΠHR\boldsymbol{\pi} \in \Pi^{HR} there exists a πΠMR\boldsymbol{\pi}^{\prime} \in \Pi^{MR} with identical total discounted reward:

vγ(s)maxπΠHRvγπ(s)=maxπΠMRvγπ(s).v_\gamma^*(s) \equiv \max_{\boldsymbol{\pi} \in \Pi^{HR}} v_\gamma^{\boldsymbol{\pi}}(s)=\max_{\boldsymbol{\pi} \in \Pi^{MR}} v_\gamma^{\boldsymbol{\pi}}(s) .

Random Horizon Interpretation of Discounting

Can geometric termination give the discount factor a probabilistic meaning rather than treating it only as an algebraic device? The use of discounting can be motivated both from a modeling perspective and as a means to ensure that the total reward remains bounded. From the modeling perspective, we can view discounting as a way to weight more or less importance on the immediate rewards vs. the long-term consequences. There is also another interpretation which stems from that of a finite horizon model but with an uncertain end time. More precisely:

Let vνπ(s)v_\nu^{\boldsymbol{\pi}}(s) denote the expected total reward obtained by using policy π\boldsymbol{\pi} when the horizon length ν\nu is random. We define it by:

vνπ(s)Esπ[Eν{t=1νr(St,At)}]v_\nu^{\boldsymbol{\pi}}(s) \equiv \mathbb{E}_s^{\boldsymbol{\pi}}\left[\mathbb{E}_\nu\left\{\sum_{t=1}^\nu r(S_t, A_t)\right\}\right]

Vector Representation in Markov Decision Processes

How do transition kernels, rewards, and policies become matrices and vectors that expose the Bellman equations as operator equations?

Let V be the set of bounded real-valued functions on a discrete state space S. This means any function fV f \in V satisfies the condition:

f=maxsSf(s)<.\|f\| = \max_{s \in S} |f(s)| < \infty.

where notation f \|f\| represents the sup-norm (or \ell_\infty -norm) of the function f f .

When working with discrete state spaces, we can interpret elements of V as vectors and linear operators on V as matrices, allowing us to leverage tools from linear algebra. The sup-norm (\ell_\infty norm) of matrix H\mathbf{H} is defined as:

HmaxsSjSHs,j\|\mathbf{H}\| \equiv \max_{s \in S} \sum_{j \in S} |\mathbf{H}_{s,j}|

where Hs,j\mathbf{H}_{s,j} represents the (s,j)(s, j)-th component of the matrix H\mathbf{H}.

For a Markovian decision rule πΠMD\pi \in \Pi^{MD}, we define:

rπ(s)r(s,π(s)),rπRS,[Pπ]s,jp(js,π(s)),PπRS×S.\begin{align*} \mathbf{r}_\pi(s) &\equiv r(s, \pi(s)), \quad \mathbf{r}_\pi \in \mathbb{R}^{|S|}, \\ [\mathbf{P}_\pi]_{s,j} &\equiv p(j \mid s, \pi(s)), \quad \mathbf{P}_\pi \in \mathbb{R}^{|S| \times |S|}. \end{align*}

For a randomized decision rule πΠMR\pi \in \Pi^{MR}, these definitions extend to:

rπ(s)aAsπ(as)r(s,a),[Pπ]s,jaAsπ(as)p(js,a).\begin{align*} \mathbf{r}_\pi(s) &\equiv \sum_{a \in A_s} \pi(a \mid s) \, r(s, a), \\ [\mathbf{P}_\pi]_{s,j} &\equiv \sum_{a \in A_s} \pi(a \mid s) \, p(j \mid s, a). \end{align*}

In both cases, rπ\mathbf{r}_\pi denotes a reward vector in RS\mathbb{R}^{|S|}, with each component rπ(s)\mathbf{r}_\pi(s) representing the reward associated with state ss. Similarly, Pπ\mathbf{P}_\pi is a transition probability matrix in RS×S\mathbb{R}^{|S| \times |S|}, capturing the transition probabilities under decision rule π\pi.

For a nonstationary Markovian policy π=(π1,π2,)ΠMR\boldsymbol{\pi} = (\pi_1, \pi_2, \ldots) \in \Pi^{MR}, the expected total discounted reward is given by:

vγπ(s)=E[t=1γt1r(St,At)|S1=s].\mathbf{v}_\gamma^{\boldsymbol{\pi}}(s)=\mathbb{E}\left[\sum_{t=1}^{\infty} \gamma^{t-1} r\left(S_t, A_t\right) \,\middle|\, S_1 = s\right].

Using vector notation, this can be expressed as:

vγπ=t=1γt1Pπt1rπ1=rπ1+γPπ1rπ2+γ2Pπ1Pπ2rπ3+=rπ1+γPπ1(rπ2+γPπ2rπ3+γ2Pπ2Pπ3rπ4+).\begin{aligned} \mathbf{v}_\gamma^{\boldsymbol{\pi}} &= \sum_{t=1}^{\infty} \gamma^{t-1} \mathbf{P}_{\boldsymbol{\pi}}^{t-1} \mathbf{r}_{\pi_1} \\ &= \mathbf{r}_{\pi_1} + \gamma \mathbf{P}_{\pi_1} \mathbf{r}_{\pi_2} + \gamma^2 \mathbf{P}_{\pi_1} \mathbf{P}_{\pi_2} \mathbf{r}_{\pi_3} + \cdots \\ &= \mathbf{r}_{\pi_1} + \gamma \mathbf{P}_{\pi_1} \left( \mathbf{r}_{\pi_2} + \gamma \mathbf{P}_{\pi_2} \mathbf{r}_{\pi_3} + \gamma^2 \mathbf{P}_{\pi_2} \mathbf{P}_{\pi_3} \mathbf{r}_{\pi_4} + \cdots \right). \end{aligned}

This formulation leads to a recursive relationship:

vγπ=rπ1+γPπ1vγπ=t=1γt1Pπt1rπt\begin{align*} \mathbf{v}_\gamma^{\boldsymbol{\pi}} &= \mathbf{r}_{\pi_1} + \gamma \mathbf{P}_{\pi_1} \mathbf{v}_\gamma^{\boldsymbol{\pi}^{\prime}}\\ &=\sum_{t=1}^{\infty} \gamma^{t-1} \mathbf{P}_{\boldsymbol{\pi}}^{t-1} \mathbf{r}_{\pi_t} \end{align*}

where π=(π2,π3,)\boldsymbol{\pi}^{\prime} = (\pi_2, \pi_3, \ldots).

For a stationary policy π=const(π)\boldsymbol{\pi} = \mathrm{const}(\pi) with constant decision rule π\pi, the total expected reward simplifies to:

vγπ=rπ+γPπvγπ=t=1γt1Pπt1rπ\begin{align*} \mathbf{v}_\gamma^{\pi} &= \mathbf{r}_\pi+ \gamma \mathbf{P}_\pi \mathbf{v}_\gamma^{\pi} \\ &=\sum_{t=1}^{\infty} \gamma^{t-1} \mathbf{P}_\pi^{t-1} \mathbf{r}_{\pi} \end{align*}

This last expression is called a Neumann series expansion, and it’s guaranteed to exists under the assumptions of bounded reward and discount factor strictly less than one.

Note that for any induced matrix norm \|\cdot\| (i.e., a norm satisfying HvHv\|\mathbf{H}\mathbf{v}\| \leq \|\mathbf{H}\| \cdot \|\mathbf{v}\| for all vectors v\mathbf{v}) and any matrix H\mathbf{H}, the spectral radius is bounded by:

ρ(H)H.\rho(\mathbf{H}) \leq \|\mathbf{H}\|.

This inequality provides a practical way to verify the convergence condition ρ(H)<1\rho(\mathbf{H}) < 1 by checking the simpler condition H<1\|\mathbf{H}\| < 1 rather than trying to compute the eigenvalues directly.

We can now verify that (IγPπ)(\mathbf{I} - \gamma \mathbf{P}_\pi) is invertible and the Neumann series converges.

  1. Norm of the transition matrix: Since Pπ\mathbf{P}_\pi is a stochastic matrix (each row sums to 1 and all entries are non-negative), its \ell_\infty-norm is:

    Pπ=maxsSjS[Pπ]s,j=maxsS1=1.\|\mathbf{P}_\pi\| = \max_{s \in S} \sum_{j \in S} [\mathbf{P}_\pi]_{s,j} = \max_{s \in S} 1 = 1.
  2. Norm of the scaled matrix: Using the homogeneity property of norms, we have:

    γPπ=γPπ=γ1=γ.\|\gamma \mathbf{P}_\pi\| = |\gamma| \cdot \|\mathbf{P}_\pi\| = |\gamma| \cdot 1 = |\gamma|.
  3. Bounding the spectral radius: Since the spectral radius is bounded by the matrix norm:

    ρ(γPπ)γPπ=γ.\rho(\gamma \mathbf{P}_\pi) \leq \|\gamma \mathbf{P}_\pi\| = |\gamma|.
  4. Verifying convergence: Since 0γ<10 \leq \gamma < 1 by assumption, we have:

    ρ(γPπ)γ<1.\rho(\gamma \mathbf{P}_\pi) \leq |\gamma| < 1.

    This strict inequality guarantees that (IγPπ)(\mathbf{I} - \gamma \mathbf{P}_\pi) is invertible and the Neumann series converges.

Therefore, the Neumann series expansion converges and yields:

vγπ=(IγPπ)1rπ=t=0(γPπ)trπ=t=1γt1Pπt1rπ.\mathbf{v}_\gamma^{\pi} = (\mathbf{I} - \gamma \mathbf{P}_\pi)^{-1} \mathbf{r}_\pi = \sum_{t=0}^{\infty} (\gamma \mathbf{P}_\pi)^t \mathbf{r}_\pi = \sum_{t=1}^{\infty} \gamma^{t-1} \mathbf{P}_\pi^{t-1} \mathbf{r}_\pi.

Consequently, for a stationary policy, vγπ\mathbf{v}_\gamma^{\pi} can be determined as the solution to the linear equation:

v=rπ+γPπv,\mathbf{v} = \mathbf{r}_\pi+ \gamma \mathbf{P}_\pi\mathbf{v},

which can be rearranged to:

(IγPπ)v=rπ.(\mathbf{I} - \gamma \mathbf{P}_\pi) \mathbf{v} = \mathbf{r}_\pi.

We can also characterize vγπ\mathbf{v}_\gamma^{\pi} as the solution to an operator equation. More specifically, define the transformation Lπ\mathrm{L}_\pi by

Lπvrπ+γPπv\mathrm{L}_\pi \mathbf{v} \equiv \mathbf{r}_\pi+\gamma \mathbf{P}_\pi\mathbf{v}

for any vV\mathbf{v} \in V. Intuitively, Lπ\mathrm{L}_\pi takes a value function v\mathbf{v} as input and returns a new value function that combines immediate rewards (rπ\mathbf{r}_\pi) with discounted future values (γPπv\gamma \mathbf{P}_\pi\mathbf{v}).

Therefore, we view Lπ\mathrm{L}_\pi as an operator mapping elements of VV to VV: i.e., Lπ:VV\mathrm{L}_\pi: V \rightarrow V. The fact that the value function of a policy is the solution to a fixed-point equation can then be expressed with the statement:

vγπ=Lπvγπ.\mathbf{v}_\gamma^{\pi}=\mathrm{L}_\pi \mathbf{v}_\gamma^{\pi}.

This is a fixed-point equation: the value function vγπ\mathbf{v}_\gamma^{\pi} is a fixed point of the operator Lπ\mathrm{L}_\pi.

Solving Operator Equations

Which iterative and Newton-like methods solve a fixed point when direct matrix inversion is unavailable or inappropriate?

The operator equation we encountered in MDPs, vγπ=Lπvγπ\mathbf{v}_\gamma^{\pi} = \mathrm{L}_\pi \mathbf{v}_\gamma^{\pi}, is a specific instance of a more general class of problems known as operator equations. These equations appear in various fields of mathematics and applied sciences, ranging from differential equations to functional analysis.

Operator equations can take several forms, each with its own characteristics and solution methods:

  1. Fixed Point Form: x=T(x)x = \mathrm{T}(x), where T:XX\mathrm{T}: X \rightarrow X. Common in fixed-point problems, such as our MDP equation, we seek a fixed point xx^* such that x=T(x)x^* = \mathrm{T}(x^*).

  2. General Operator Equation: T(x)=y\mathrm{T}(x) = y, where T:XY\mathrm{T}: X \rightarrow Y. Here, XX and YY can be different spaces. We seek an xXx \in X that satisfies the equation for a given yYy \in Y.

  3. Nonlinear Equation: T(x)=0\mathrm{T}(x) = 0, where T:XY\mathrm{T}: X \rightarrow Y. A special case of the general operator equation where we seek roots or zeros of the operator.

  4. Variational Inequality: Find xKx^* \in K such that T(x),xx0\langle \mathrm{T}(x^*), x - x^* \rangle \geq 0 for all xKx \in K. Here, KK is a closed convex subset of XX, and T:KX\mathrm{T}: K \rightarrow X^* (the dual space of XX). These problems often arise in optimization, game theory, and partial differential equations.

Successive Approximation Method

For equations in fixed point form, a common numerical solution method is successive approximation, also known as fixed-point iteration:

The convergence of successive approximation depends on the properties of the operator T\mathrm{T}. In the simplest and most common setting, we assume T\mathrm{T} is a contraction mapping. The Banach Fixed-Point Theorem then guarantees that T\mathrm{T} has a unique fixed point, and the successive approximation method will converge to this fixed point from any starting point. Specifically, T\mathrm{T} is a contraction if there exists a constant q[0,1)q \in [0,1) such that for all x,yXx,y \in X:

d(T(x),T(y))qd(x,y)d(\mathrm{T}(x), \mathrm{T}(y)) \leq q \cdot d(x,y)

where dd is the metric on XX. In this case, the rate of convergence is linear, with error bound:

d(xn,x)qn1qd(x1,x0)d(x_n, x^*) \leq \frac{q^n}{1-q} d(x_1, x_0)

However, the contraction mapping condition is not the only one that can lead to convergence. For instance, if T\mathrm{T} is nonexpansive (i.e., Lipschitz continuous with Lipschitz constant 1) and XX is a Banach space with certain geometrical properties (e.g., uniformly convex), then under additional conditions (e.g., T\mathrm{T} has at least one fixed point), the successive approximation method can still converge, albeit potentially more slowly than in the contraction case.

In practice, when dealing with specific problems like MDPs or differential equations, the properties of the operator often naturally align with one of these convergence conditions. For example, in discounted MDPs, the Bellman operator is a contraction in the supremum norm, which guarantees the convergence of value iteration.

Newton-Kantorovich Method

The Newton-Kantorovich method is a generalization of Newton’s method from finite dimensional vector spaces to infinite dimensional function spaces: rather than iterating in the space of vectors, we are iterating in the space of functions.

Newton’s method is often written as the familiar update:

xk+1=xk[DF(xk)]1F(xk),x_{k+1} = x_k - [DF(x_k)]^{-1} F(x_k),

which makes it look as though the essence of the method is “take a derivative and invert it.” But the real workhorse behind Newton’s method (both in finite and infinite dimensions) is linearization.

At each step, the idea is to replace the nonlinear operator F:XYF:X \to Y by a local surrogate model of the form

F(x+h)F(x)+Lh,F(x+h) \approx F(x) + Lh,

where LL is a linear map capturing how small perturbations in the input propagate to changes in the output. This is a Taylor-like expansion in Banach spaces: the role of the derivative is precisely to provide the correct notion of such a linear operator.

To find a root of FF, we impose the condition that the surrogate vanishes at the next iterate:

0=F(x+h)F(x)+Lh.0 = F(x+h) \approx F(x) + Lh.

Solving this linear equation gives the increment hh. In finite dimensions, LL is the Jacobian matrix; in Banach spaces, it must be the Fréchet derivative.

But what exactly is a Fréchet derivative in infinite dimensions? To understand this, we need to generalize the concept of derivative from finite-dimensional calculus. In infinite-dimensional spaces, there are several notions of differentiability, each with different strengths and requirements:

1. Gâteaux (Directional) Derivative

We say that the Gâteaux derivative of FF at xx in a specific direction hh is:

F(x;h)=limt0F(x+th)F(x)tF'(x; h) = \lim_{t \to 0} \frac{F(x + th) - F(x)}{t}

This quantity measures how the function FF changes along the ray x+thx + th. While this limit may exist for each direction hh separately, it doesn’t guarantee that the derivative is linear in hh. This is a key limitation: the Gâteaux derivative can exist in all directions but still fail to provide a good linear approximation.

2. Hadamard Directional Derivative

Rather than considering a single direction of perturbation, we now consider a bundle of perturbations around hh. We ask how the function changes as we approach the target direction from nearby directions. We say that FF has a Hadamard directional derivative if:

F(x;h)=limt0hhF(x+th)F(x)tF'(x; h) = \lim_{\substack{t \downarrow 0 \\ h' \to h}} \frac{F(x + t h') - F(x)}{t}

This is a stronger condition than Gâteaux differentiability because it requires the limit to be uniform over nearby directions. However, it still doesn’t guarantee linearity in hh.

3. Fréchet Derivative

The strongest and most natural notion: FF is Fréchet differentiable at xx if there exists a bounded linear operator LL such that:

limh0F(x+h)F(x)Lhh=0\lim_{h \to 0} \frac{\|F(x + h) - F(x) - Lh\|}{\|h\|} = 0

This definition directly addresses the inadequacy of the previous notions. Unlike Gâteaux and Hadamard derivatives, the Fréchet derivative explicitly requires the existence of a linear operator LL that provides a good approximation. Key properties:

Relationship:

Freˊchet differentiableHadamard directionally diff.Gaˆteaux directionally diff.\text{Fréchet differentiable} \Rightarrow \text{Hadamard directionally diff.} \Rightarrow \text{Gâteaux directionally diff.}

In the context of the Newton-Kantorovich method, we work with an operator F:XYF: X \to Y where both XX and YY are Banach spaces. The Fréchet derivative F(x)F'(x) is the best linear approximation of FF near xx, and it’s exactly this linear operator LL that we use in our linearization F(x+h)F(x)+F(x)hF(x+h) \approx F(x) + F'(x)h.

Now apart from those mathematical technicalities, Newton-Kantorovich has in essence the same structure as that of the original Newton’s method. That is, it applies the following sequence of steps:

  1. Linearize the Operator: Given an approximation xn x_n , we consider the Fréchet derivative of F F , denoted by F(xn) F'(x_n) . This derivative is a linear operator that provides a local approximation of F F near xn x_n .

  2. Set Up the Newton Step: The method then solves the linearized equation for a correction hn h_n :

    F(xn)hn=F(xn).F'(x_n) h_n = -F(x_n).

    This equation represents a linear system where hn h_n is chosen so that the linearized operator F(xn)+F(xn)hn F(x_n) + F'(x_n)h_n equals zero.

  3. Update the Solution: The new approximation xn+1 x_{n+1} is then given by:

    xn+1=xn+hn.x_{n+1} = x_n + h_n.

    This correction step refines xn x_n , bringing it closer to the true solution.

  4. Repeat Until Convergence: We repeat the linearization and update steps until the solution xn x_n converges to the desired tolerance, which can be verified by checking that F(xn) \|F(x_n)\| is sufficiently small, or by monitoring the norm xn+1xn \|x_{n+1} - x_n\| .

The convergence of Newton-Kantorovich does not hinge on F F being a contraction over the entire domain (as it could be the case for successive approximation). The convergence properties of the Newton-Kantorovich method are as follows:

  1. Local Convergence: Under mild conditions (e.g., FF is Fréchet differentiable and F(x)F'(x) is invertible near the solution), the method converges locally. This means that if the initial guess is sufficiently close to the true solution, the method will converge.

  2. Global Convergence: Global convergence is not guaranteed in general. However, under stronger conditions (e.g., FF is analytic and satisfies certain bounds), the method can converge globally.

  3. Rate of Convergence: When the method converges, it typically exhibits quadratic convergence. This means that the error at each step is proportional to the square of the error at the previous step:

    xn+1xCxnx2\|x_{n+1} - x^*\| \leq C\|x_n - x^*\|^2

    where xx^* is the true solution and CC is some constant. This quadratic convergence is significantly faster than the linear convergence typically seen in methods like successive approximation.

Optimality Equations for Infinite-Horizon MDPs

How does actionwise maximization turn fixed-policy evaluation into the Bellman optimality equation?

Recall that in the finite-horizon setting, the optimality equations are:

vn(s)=maxaAs{r(s,a)+γjSp(js,a)vn+1(j)}v_n(s) = \max_{a \in A_s} \left\{r(s, a) + \gamma \sum_{j \in S} p(j | s, a) v_{n+1}(j)\right\}

where vn(s)v_n(s) is the value function at time step nn for state ss, AsA_s is the set of actions available in state ss, r(s,a)r(s, a) is the reward function, γ\gamma is the discount factor, and p(js,a)p(j | s, a) is the transition probability from state ss to state jj given action aa.

Intuitively, we would expect that by taking the limit of nn to infinity, we might get the nonlinear equations:

v(s)=maxaAs{r(s,a)+γjSp(js,a)v(j)}v(s) = \max_{a \in A_s} \left\{r(s, a) + \gamma \sum_{j \in S} p(j | s, a) v(j)\right\}

which are called the optimality equations or Bellman equations for infinite-horizon MDPs.

We can adopt an operator-theoretic perspective by defining operators on the space VV of bounded real-valued functions on the state space SS. For a deterministic Markov rule πΠMD\pi \in \Pi^{MD}, define the policy-evaluation operator:

(Lπv)(s)=r(s,π(s))+γjSp(js,π(s))v(j)(\BellmanPi v)(s) = r(s,\pi(s)) + \gamma \sum_{j \in \mathcal{S}} p(j|s,\pi(s)) v(j)

The Bellman optimality operator is then:

LvmaxπΠMD{rπ+γPπv}\Bellman \mathbf{v} \equiv \max_{\pi \in \Pi^{MD}} \left\{\mathbf{r}_\pi + \gamma \mathbf{P}_\pi \mathbf{v}\right\}

where ΠMD\Pi^{MD} is the set of Markov deterministic decision rules, rπ\mathbf{r}_\pi is the reward vector under decision rule π\pi, and Pπ\mathbf{P}_\pi is the transition probability matrix under decision rule π\pi.

Note that while we write maxπΠMD\max_{\pi \in \Pi^{MD}}, we do not implement the above operator by enumerating all decision rules. Rather, the fact that we compare policies based on their value functions in a componentwise fashion means that maximizing over the space of Markovian deterministic rules reduces to the following update in component form:

(Lv)(s)=maxaAs{r(s,a)+γjSp(js,a)v(j)}(\Bellman \mathbf{v})(s) = \max_{a \in \mathcal{A}_s} \left\{r(s,a) + \gamma \sum_{j \in \mathcal{S}} p(j|s,a) v(j)\right\}

For convenience, we define the greedy selector Greedy(v)ΠMD\mathrm{Greedy}(v) \in \Pi^{MD} that extracts an optimal decision rule from a value function:

Greedy(v)(s)argmaxaAs{r(s,a)+γjSp(js,a)v(j)}\mathrm{Greedy}(v)(s) \in \arg\max_{a \in \mathcal{A}_s} \left\{r(s,a) + \gamma \sum_{j \in \mathcal{S}} p(j|s,a) v(j)\right\}

In Puterman’s terminology, such a greedy selector is called vv-improving (or conserving when it achieves the maximum). This operator will be useful for expressing algorithms succinctly:

The equivalence between these two forms can be shown mathematically, as demonstrated in the following proposition and proof.

Algorithms for Solving the Optimality Equations

What computational trade-off separates value iteration, policy evaluation, and policy improvement?

The optimality equations are operator equations. Therefore, we can apply general numerical methods to solve them. Applying the successive approximation method to the Bellman optimality equation yields a method known as “value iteration” in dynamic programming. A direct application of the blueprint for successive approximation yields the following algorithm:

The termination criterion in this algorithm is based on a specific bound that provides guarantees on the quality of the solution. This is in contrast to supervised learning, where we often use arbitrary termination criteria based on computational budget or early stopping when the learning curve flattens. This is because establishing implementable generalization bounds in supervised learning is challenging.

However, in the dynamic programming context, we can derive various bounds that can be implemented in practice. These bounds help us terminate our procedure with a guarantee on the precision of our value function and, correspondingly, on the optimality of the resulting policy.

Bellman contraction laboratory

Use the controls below to change the discount factor, transition persistence, reward asymmetry, and starting value. Before moving γ\gamma, predict how it will change the slope of the error envelope. The middle panel compares the observed error and Bellman residual with the contraction bound; the text below reports the final greedy policy.

Static Bellman contraction laboratory preview

Figure 1:Static preview of value-iteration traces and a geometric contraction bound. The online book provides controls for γ\gamma, transitions, rewards, and the initial value.

Exact Scheduling MDP for Inference Serving

How can a large request-level system be reduced to a finite MDP, and which predictive distinctions disappear in that reduction?

The inference examples have so far treated the scheduling rule as fixed and the GPU clock as the action. A different decision interface fixes the clock and asks which phase should receive the next unit of service. Prefill admits new requests into decode and consumes cache; decode advances requests already producing output tokens. Serving either phase delays the other.

An exact request-level Markov state would contain every prompt length, generated token count, cache allocation, and waiting time. For computation, these quantities are aggregated into the finite state

s=(p,d,a){0,,6}2×{0,,4},s=(p,d,a)\in\{0,\ldots,6\}^2\times\{0,\ldots,4\},

where pp counts waiting prefill jobs, dd counts active decode jobs, and aa is the oldest prefill-age bin. The actions are

A={prefill,decode,idle}.\mathcal A=\{\text{prefill},\text{decode},\text{idle}\}.

An action is masked when its phase is empty. Prefill is also masked at d=6d=6, which represents the cache limit in this abstraction. A Bernoulli arrival probability for each 0.1-second decision period is calibrated from the load-normalized version of the same five-minute Azure trace used in the modeling chapter.

The phase rates and powers come from one measured NVIDIA L4 run of Qwen/Qwen2.5-7B-Instruct served by vLLM 0.28.0. The reduced MDP uses the 1,125 MHz requested clock level; its batch-balanced median realized graphics clock was 939.375 MHz. The measured prefill rate and the trace’s mean prompt length determine the Bernoulli probability that a prefill action completes one aggregate prompt. A successful completion moves that job into decode. The measured decode rate and mean output length similarly determine one aggregate expected completion budget per decode action. That budget is shared symmetrically across the active jobs, so adding jobs does not multiply the model’s expected completion capacity. Queue counts are capped at six, and arrivals beyond that cap are recorded as drops. These choices define a complete transition matrix PssuP_{ss'}^u on 245 states.

The one-step cost assigns separate penalties to congestion, old prompt work, decode stalls, dropped requests, and energy:

c(s,u)=p+d+41{a=4}+2d1{udecode}+10E[Ndrops,u]+0.1E(u)Emax.c(s,u)=p+d+4\mathbf 1\{a=4\} +2d\mathbf 1\{u\ne\text{decode}\} +10\mathbb E[N_{\mathrm{drop}}\mid s,u] +0.1\frac{E(u)}{E_{\max}}.

For prefill, decode, and idle, respectively, the measured profile gives E(u)=(6.427,6.274,2.339)E(u)=(6.427,6.274,2.339) joules per decision period. Each value is the measured phase-power summary at the requested 1,125 MHz level multiplied by 0.1 seconds, rather than a direct request-level energy measurement. Only the ratio E(u)/EmaxE(u)/E_{\max} enters the stage cost.

With γ=0.99\gamma=0.99, cost-minimizing value iteration applies

Qn(s,u)=c(s,u)+γsPssuVn(s),Vn+1(s)=minuA(s)Qn(s,u).\begin{aligned} Q_n(s,u)&=c(s,u)+\gamma\sum_{s'}P_{ss'}^uV_n(s'),\\ V_{n+1}(s)&=\min_{u\in\mathcal A(s)}Q_n(s,u). \end{aligned}

Iteration stops when Vn+1Vn<1010\lVert V_{n+1}-V_n\rVert_\infty<10^{-10}. The final Bellman residual is checked independently and must be below 10-8.

Policy slices compare the optimal phase decision across the two queue lengths and the age of the oldest prompt. A replay applies the resulting policy to fixed evaluation episodes and compares it with the decode-priority rule.

Figure 2:Exact value iteration on the measured-L4-calibrated inference-scheduling MDP. All five age slices yield the same rule: serve decode when a decode job is active, otherwise serve prefill, and idle only when the system is empty. The replay samples queue transitions from the reduced model at its fixed measured-profile clock; these trajectories are simulated, not direct vLLM observations.

Loading...
Static policy slices for prefill, decode, and idle actions in the reduced scheduling MDP.

Figure 3:Policy slices at oldest-age bins zero, two, and four. The interactive version adds an age selector and controls for playing, stepping through, and scrubbing a fixed episode sampled from the reduced transition model. The queue trajectory is simulated rather than observed directly from vLLM.

The reduced scheduling MDP has the following transition parameters and value-iteration certificate. The Bellman residual applies only to this finite model.

Loading...

Download the dynamic-programming certificate (CSV)

Value iteration required 2,454 sweeps on this high-discount problem. Its independently recomputed Bellman residual is 9.823×10119.823\times10^{-11}, below both the 10-8 acceptance threshold and the 10-10 stopping tolerance. The certificate concerns the supplied 245-state transition matrix. The optimal policy serves decode whenever d>0d>0, serves prefill when d=0d=0 and p>0p>0, and idles only in the empty state. The same rule appears in all five age slices. For this calibration, the decode-stall penalty and aggregate completion budget make the transparent decode-priority heuristic exactly optimal within the reduced model. A richer state or a different cost can produce a switching boundary instead.

The result is exact for the stated finite MDP, not for vLLM. Aggregating request ages and lengths removes distinctions that can affect head-of-line waiting and cache release. The calibrated transition kernel is stationary, the clock is fixed, temperature is absent from the state, and the action set excludes mixed prefill-decode batches. Measurements from one L4 deployment calibrate the phase rates and powers; they do not establish scheduling performance across L4 systems. The request-level replay from the earlier chapters remains a model-audit tool, not part of the optimality proof.

Inspect the scheduling MDP and value iteration
inference_control.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
def solve_scheduling_mdp(
    mdp: SchedulingMDP | None = None,
    *,
    tolerance: float = 1e-10,
    maximum_iterations: int = 100_000,
) -> DPSolution:
    """Solve the reduced discounted scheduling model by value iteration."""

    model = make_scheduling_mdp() if mdp is None else mdp
    model.validate()
    if tolerance <= 0.0 or maximum_iterations <= 0:
        raise ValueError("tolerance and maximum_iterations must be positive")
    value = np.zeros(model.states.shape[0], dtype=float)
    iterations = 0
    for iterations in range(1, maximum_iterations + 1):
        continuation = np.einsum("sak,k->sa", model.transitions, value)
        q_values = model.stage_cost + model.gamma * continuation
        q_values = np.where(model.valid_actions, q_values, np.inf)
        updated = np.min(q_values, axis=1)
        if np.max(np.abs(updated - value)) <= tolerance:
            value = updated
            break
        value = updated
    continuation = np.einsum("sak,k->sa", model.transitions, value)
    q_values = np.where(
        model.valid_actions,
        model.stage_cost + model.gamma * continuation,
        np.inf,
    )
    bellman_update = np.min(q_values, axis=1)
    residual = float(np.max(np.abs(bellman_update - value)))
    policy = np.argmin(q_values, axis=1).astype(int)
    labels = tuple(SCHEDULING_ACTIONS[int(action)] for action in policy)
    return DPSolution(
        value=value,
        policy=policy,
        policy_labels=labels,
        iterations=iterations,
        bellman_residual=residual,
        mdp=model,
    )

Download the complete inference-control implementation

Newton-Kantorovich Applied to Bellman Optimality

We now apply the Newton-Kantorovich framework to the Bellman optimality equation. Let

(Lv)(s)=maxaA(s){r(s,a)+γsp(ss,a)v(s)}.(\Bellman v)(s) = \max_{a \in A(s)} \left\{ r(s,a) + \gamma \sum_{s'} p(s' \mid s,a) v(s') \right\}.

The problem is to find vv such that Lv=v\Bellman v = v, or equivalently B(v):=Lvv=0\mathrm{B}(v) := \Bellman v - v = 0. The operator L\Bellman is piecewise affine, hence not globally differentiable, but it is directionally differentiable everywhere in the Hadamard sense and Fréchet differentiable at points where the maximizer is unique.

We consider three complementary perspectives for understanding and computing its derivative.

Perspective 1: Max of Affine Maps

In tabular form, for finite state and action spaces, the Bellman operator can be written as a pointwise maximum of affine maps:

(Lv)(s)=maxaA(s){r(s,a)+γ(Pav)(s)},(\Bellman v)(s) = \max_{a \in A(s)} \left\{ r(s,a) + \gamma (P_a v)(s) \right\},

where PaRS×SP_a \in \mathbb{R}^{|S| \times |S|} is the transition matrix associated with action aa. Each Qav:=ra+γPavQ_a v := r^a + \gamma P_a v is affine in vv. The operator L\Bellman therefore computes the upper envelope of a finite set of affine functions at each state.

At any vv, let the active set at state ss be

A(s;v):=argmaxaA(s)(Qav)(s).\mathcal{A}^*(s; v) := \arg\max_{a \in A(s)} (Q_a v)(s).

Then the Hadamard directional derivative exists and is given by

(L(v;h))(s)=maxaA(s;v)γ(Pah)(s).(\Bellman '(v; h))(s) = \max_{a \in \mathcal{A}^*(s; v)} \gamma (P_a h)(s).

If the active set is a singleton, this expression becomes linear in hh, and L\Bellman is Fréchet differentiable at vv, with

L(v)=γPπv,\Bellman'(v) = \gamma P_{\pi_v},

where πv(s):=a(s)\pi_v(s) := a^*(s) is the greedy policy at vv.

Perspective 2: Envelope Theorem

Consider now a value function approximated as a linear combination of basis functions:

vc(s)=jcjϕj(s).v_c(s) = \sum_j c_j \phi_j(s).

At a node sis_i, define the parametric maximization

vi(c):=(Lvc)(si)=maxaA(si){r(si,a)+γjcjEssi,a[ϕj(s)]}.v_i(c) := (\Bellman v_c)(s_i) = \max_{a \in A(s_i)} \left\{ r(s_i,a) + \gamma \sum_j c_j \mathbb{E}_{s' \mid s_i, a}[\phi_j(s')] \right\}.

Define

Fi(a,c):=r(si,a)+γjcjEssi,a[ϕj(s)],F_i(a, c) := r(s_i,a) + \gamma \sum_j c_j \mathbb{E}_{s' \mid s_i, a}[\phi_j(s')],

so that vi(c)=maxaFi(a,c)v_i(c) = \max_a F_i(a, c). Since FiF_i is linear in cc, we can apply the envelope theorem (Danskin’s theorem): if the optimizer ai(c)a_i^*(c) is unique or selected measurably, then

vicj(c)=γEssi,ai(c)[ϕj(s)].\frac{\partial v_i}{\partial c_j}(c) = \gamma \mathbb{E}_{s' \mid s_i, a_i^*(c)}[\phi_j(s')].

We do not need to differentiate the optimizer ai(c)a_i^*(c) itself. The result extends to the subdifferential case when ties occur, where the Jacobian becomes set-valued.

This result is useful when solving the collocation equation Φc=v(c)\Phi c = v(c). Newton’s method requires the Jacobian v(c)v'(c), and this expression allows us to compute it without involving any derivatives of the optimal action.

Perspective 3: The Implicit Function Theorem

The third perspective applies the implicit function theorem to understand when the Bellman operator is differentiable despite containing a max operator. The maximization problem defines an implicit relationship between the value function and the optimal action, and the implicit function theorem tells us when this relationship is smooth enough to differentiate through.

The Bellman operator is defined as

(Lv)(s)=maxa{r(s,a)+γjp(js,a)v(j)}.(\Bellman v)(s) = \max_{a} \left\{ r(s,a) + \gamma \sum_j p(j \mid s,a) v(j) \right\}.

The difficulty is that the max operator encodes a discrete selection: which action achieves the maximum. To apply the implicit function theorem, we reformulate this as follows. For each action aa, define the action-value function:

Qa(v,s):=r(s,a)+γjp(js,a)v(j).Q_a(v, s) := r(s,a) + \gamma \sum_j p(j \mid s,a) v(j).

The optimal action at vv satisfies the optimality condition:

Qa(s)(v,s)Qa(v,s)for all a.Q_{a^*(s)}(v, s) \geq Q_a(v, s) \quad \text{for all } a.

Now suppose that at a particular vv, action a(s)a^*(s) is a strict local maximizer in the sense that there exists δ>0\delta > 0 such that

Qa(s)(v,s)>Qa(v,s)+δfor all aa(s).Q_{a^*(s)}(v, s) > Q_a(v, s) + \delta \quad \text{for all } a \neq a^*(s).

This strict inequality is the regularity condition needed for the implicit function theorem. It ensures that the optimal action is unique at vv and remains so in a neighborhood of vv.

To see why, consider any perturbation v+hv + h with h\|h\| small. Since QaQ_a is linear in vv, we have:

Qa(v+h,s)=Qa(v,s)+γjp(js,a)h(j).Q_a(v+h, s) = Q_a(v, s) + \gamma \sum_j p(j \mid s,a) h(j).

The perturbation term is bounded: γjp(js,a)h(j)γh|\gamma \sum_j p(j \mid s,a) h(j)| \leq \gamma \|h\|. Therefore, for h<δ/γ\|h\| < \delta/\gamma, the strict gap ensures that

Qa(s)(v+h,s)>Qa(v+h,s)for all aa(s).Q_{a^*(s)}(v+h, s) > Q_a(v+h, s) \quad \text{for all } a \neq a^*(s).

Thus a(s)a^*(s) remains the unique maximizer throughout the neighborhood {v+h:h<δ/γ}\{v + h : \|h\| < \delta/\gamma\}.

The implicit function theorem now applies: in this neighborhood, the mapping va(s;v)v \mapsto a^*(s; v) is constant (and hence smooth), taking the value a(s)a^*(s). This allows us to write

(Lv)(s)=Qa(s)(v,s)=r(s,a(s))+γjp(js,a(s))v(j)(\Bellman v)(s) = Q_{a^*(s)}(v, s) = r(s,a^*(s)) + \gamma \sum_j p(j \mid s,a^*(s)) v(j)

as an explicit formula that holds throughout the neighborhood. Since Qa(s)(,s)Q_{a^*(s)}(\cdot, s) is an affine (hence smooth) function of vv, we can differentiate it:

ddv(Lv)(s)=γPa(s).\frac{d}{dv} (\Bellman v)(s) = \gamma P_{a^*(s)}.

More precisely, for any perturbation hh:

(L(v+h))(s)=(Lv)(s)+γjp(js,a(s))h(j)+o(h).(\Bellman (v+h))(s) = (\Bellman v)(s) + \gamma \sum_j p(j \mid s,a^*(s)) h(j) + o(\|h\|).

This is the Fréchet derivative:

L(v)=γPπv,\Bellman'(v) = \gamma P_{\pi_v},

where πv(s)=a(s)\pi_v(s) = a^*(s) is the greedy policy.

The role of the implicit function theorem: It guarantees that when the maximizer is unique with a strict gap (the regularity condition), the argmax function va(s;v)v \mapsto a^*(s; v) is locally constant, which removes the non-differentiability of the max operator. Without this regularity condition (specifically, at points where multiple actions tie for optimality), the implicit function theorem does not apply, and the operator is not Fréchet differentiable. The active set perspective (Perspective 1) and the envelope theorem (Perspective 2) provide the tools to handle these non-smooth points.

Connection to Policy Iteration

We return to the Newton-Kantorovich step:

(IL(vn))hn=vnLvn,vn+1=vnhn.(I - \Bellman'(v_n)) h_n = v_n - \Bellman v_n, \quad v_{n+1} = v_n - h_n.

Suppose L(vn)=γPπvn\Bellman'(v_n) = \gamma P_{\pi_{v_n}} for the greedy policy πvn\pi_{v_n}. Then

(IγPπvn)vn+1=rπvn,(I - \gamma P_{\pi_{v_n}}) v_{n+1} = r^{\pi_{v_n}},

which is exactly policy evaluation for πvn\pi_{v_n}. Recomputing the greedy policy from vn+1v_{n+1} yields the next iterate.

Thus, policy iteration is Newton-Kantorovich applied to the Bellman optimality equation. At points of nondifferentiability (when ties occur), the operator is still semismooth, and policy iteration corresponds to a semismooth Newton method. The envelope theorem is what justifies the simplification of the Jacobian to γPπv\gamma P_{\pi_v}, bypassing the need to differentiate through the optimizer. This completes the equivalence.

The Semismooth Newton Perspective

The three perspectives we developed above (the active set view, the envelope theorem, and the implicit function theorem) all point toward a deeper framework for understanding Newton-type methods on non-smooth operators. This framework, known as semismooth Newton methods, was developed precisely to handle operators like the Bellman operator that are piecewise smooth but not globally differentiable. The connection between policy iteration and semismooth Newton methods has been rigorously developed in recent work Gargiani et al. (2022).

The classical Newton-Kantorovich method assumes the operator is Fréchet differentiable everywhere. The derivative exists, is unique, and varies continuously with the base point. But the Bellman operator L\Bellman violates this assumption at any value function where multiple actions tie for optimality at some state. At such points, the implicit function theorem fails, and there is no unique Fréchet derivative.

Semismooth Newton methods address this by replacing the notion of a single Jacobian with a generalized derivative that captures the behavior of the operator near non-smooth points. The most commonly used generalized derivative is the Clarke subdifferential, which we can think of as the convex hull of all possible “candidate Jacobians” that arise from limits approaching the non-smooth point from different directions.

For the Bellman residual B(v)=Lvv\mathrm{B}(v) = \Bellman v - v, the Clarke subdifferential at a point vv can be characterized explicitly using our first perspective. Recall that at each state ss, we defined the active set A(s;v)=argmaxaQa(v,s)\mathcal{A}^*(s; v) = \arg\max_a Q_a(v, s). When this set contains multiple actions, the operator is not Fréchet differentiable. However, it remains directionally differentiable in all directions, and the Clarke subdifferential consists of all matrices of the form

B(v)={IγPπ:π(s)A(s;v) for all s}.\partial \mathrm{B}(v) = \left\{ I - \gamma P_\pi : \pi(s) \in \mathcal{A}^*(s; v) \text{ for all } s \right\}.

In words, the generalized Jacobian is the set of all matrices IγPπI - \gamma P_\pi where π\pi is any policy that selects an action from the active set at each state. When the maximizer is unique everywhere, this set reduces to a singleton, and we recover the classical Fréchet derivative. When ties occur, the set has multiple elements: precisely the convex combinations mentioned in Perspective 1.

The semismooth Newton method for solving B(v)=0\mathrm{B}(v) = 0 proceeds by selecting an element JkB(vk)J_k \in \partial \mathrm{B}(v_k) at each iteration and solving

Jkhk=B(vk),vk+1=vk+hk.J_k h_k = -\mathrm{B}(v_k), \quad v_{k+1} = v_k + h_k.

What this tells us is that any choice from the Clarke subdifferential yields a valid Newton-like update. In the context of the Bellman equation, choosing Jk=IγPπkJ_k = I - \gamma P_{\pi_k} where πk\pi_k is any greedy policy corresponds exactly to the policy evaluation step in policy iteration. The freedom in selecting which action to choose when ties occur translates to the freedom in selecting which element of the subdifferential to use.

Under appropriate regularity conditions (specifically, when the residual function is BD-regular or CD-regular), the semismooth Newton method converges locally at a quadratic rate Gargiani et al. (2022). This means that near the solution, the error decreases quadratically:

vk+1vCvkv2.\|v_{k+1} - v^*\| \leq C \|v_k - v^*\|^2.

This theoretical result explains an empirical observation that has long been noted in practice: policy iteration typically converges in very few iterations, often just a handful, even when the state and action spaces are enormous and the space of possible policies is exponentially large.

The semismooth Newton framework also suggests a spectrum of methods interpolating between value iteration and policy iteration. Value iteration can be interpreted as a Newton-like method where we choose Jk=IJ_k = I at every iteration, ignoring the dependence of L\Bellman on vv entirely. This choice guarantees global convergence through the contraction property but sacrifices the quadratic local convergence rate. Policy iteration, at the other extreme, uses the full generalized Jacobian Jk=IγPπkJ_k = I - \gamma P_{\pi_k}, achieving quadratic convergence but at the cost of solving a linear system at each iteration.

Between these extremes lie methods that use approximate Jacobians. One natural variant is to choose Jk=αIJ_k = \alpha I for some scalar α>1\alpha > 1. This leads to the update

vk+1=α1αvk+1αLvk.v_{k+1} = \frac{\alpha - 1}{\alpha} v_k + \frac{1}{\alpha} \Bellman v_k.

This is known as α\alpha-value iteration or successive over-relaxation when α>1\alpha > 1. For appropriate choices of α\alpha, this method retains global convergence while achieving better local rates than standard value iteration, and it requires only pointwise operations rather than solving a linear system. The Newton perspective thus unifies existing algorithms and generates new ones by systematically exploring different approximations to the generalized Jacobian.

The connection to semismooth Newton methods places policy iteration within a broader mathematical framework that extends far beyond dynamic programming. Semismooth Newton methods are used in optimization (for complementarity problems and variational inequalities), in PDE-constrained optimization (for problems with control constraints), and in economics (for equilibrium problems). The Bellman equation, viewed through this lens, is simply one instance of a piecewise smooth equation, and the tools developed for such equations apply directly.

Policy Iteration

While we derived policy iteration-like steps from the Newton-Kantorovich method, it’s worth examining policy iteration as a standalone algorithm, as it has been traditionally presented in the field of dynamic programming.

The policy iteration algorithm for discounted Markov decision problems is as follows:

As opposed to value iteration, this algorithm produces a sequence of both deterministic Markovian decision rules {πn}\{\pi_n\} and value functions {vn}\{\mathbf{v}^n\}. We recognize in this algorithm the linearization step of the Newton-Kantorovich procedure, which takes place here in the policy evaluation step 3 where we solve the linear system (IγPπn)v=rπn(\mathbf{I}-\gamma \mathbf{P}_{\pi_n}) \mathbf{v} = \mathbf{r}_{\pi_n}. In practice, this linear system could be solved either using direct methods (eg. Gaussian elimination), using simple iterative methods such as the successive approximation method for policy evaluation, or more sophisticated methods such as GMRES.

Summary and Outlook

Discounting converts an infinite stream of rewards into a bounded value and makes the Bellman maps contractions in the sup norm. Value iteration applies successive approximation; policy iteration alternates a fixed-policy linear solve with greedy improvement. The inference-scheduling example also shows the price of state reduction: a smaller MDP averages over distinctions that can still affect future completions.

The hard maximum in the Bellman operator selects one action and is nondifferentiable at ties. Can the decision rule remain stochastic while the operator becomes smooth? Smooth and regularized dynamic programming answers by placing a convex regularizer on the action distribution.

Self-checks

Solution to Exercise 1

At most γε\gamma\varepsilon. The discounted Bellman operator is a γ\gamma-contraction in the sup norm.

Solution to Exercise 2

vvTvv/(1γ)=0.02/0.1=0.2\|v-v^*\|_\infty\leq \|Tv-v\|_\infty/(1-\gamma)=0.02/0.1=0.2.

Solution to Exercise 3

Policy evaluation solves (IγPπ)v=rπ(I-\gamma P_\pi)v=r_\pi. Policy improvement computes action values from that vv and chooses a greedy action in each state.

Solution to Exercise 4

Two states can have the same numbers of waiting and decoding requests and the same oldest prefill-age bin while their active requests have different remaining output lengths. The reduced state discards those lengths, so its transition kernel averages over them.

References
  1. Puterman, M. L. (1994). Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons.
  2. Gargiani, M., Zanelli, A., Liao-McPherson, D., Summers, T. H., & Lygeros, J. (2022). Dynamic Programming Through the Lens of Semismooth Newton-Type Methods. IEEE Control Systems Letters, 6, 2996–3001. 10.1109/LCSYS.2022.3181213