Simple Algorithm
Reinforcement Learning · Fixed Point · 30 min

Provably Efficient RL with Features

Linear MDPs, LSVI-UCB and the lower bounds that limit function approximation.

Give an agent dd features of each state–action pair. How many episodes does it need to learn a near-optimal policy, with no dependence on the number of states? It depends sharply on what the features are assumed to capture. If the dynamics are linear in them, optimism plus least squares gives regret polynomial in dd and the horizon. If only the optimal values are linear, every algorithm can need exponentially many samples, even with a simulator. This lesson develops both sides, and the complexity measures that try to say exactly when RL with function approximation is tractable.

What you’ll learn

  • Define linear and linear-mixture MDPs, and prove that in a linear MDP every policy's Q-function is linear and the linear class is Bellman complete.
  • State LSVI-UCB and its regret bound, and sketch the proof: optimism from self-normalized concentration plus the elliptical potential lemma.
  • State the exponential lower bounds for approximately and exactly realizable value functions, online, with a generative model and offline, with their conditions.
  • Place Bellman rank, the Bellman–Eluder dimension and the decision–estimation coefficient on a map of tractable settings.

Linear MDPs

Throughout, the setting is episodic with horizon HH and possibly step-dependent dynamics PhP_h and rewards rh∈[0,1]r_h\in[0,1]; the agent plays KK episodes, T=KHT=KH steps in all, and its regret is ∑k=1K(V1⋆(s1k)−V1πk(s1k))\sum_{k=1}^K\big(V^\star_1(s_1^k)-V^{\pi_k}_1(s_1^k)\big). A feature map ϕ:S×A→Rd\boldsymbol\phi:\mathcal S\times\mathcal A\to\R^d is known.

DerivationEvery Q-function is linear, and the class is complete
  1. (PhV)(s,a)=∫V(s′) ⟨ϕ(s,a),dνh(s′)⟩=⟨ϕ(s,a), ∫V dνh⟩(P_hV)(s,a)=\int V(s')\,\big\langle\boldsymbol\phi(s,a),d\boldsymbol\nu_h(s')\big\rangle=\Big\langle\boldsymbol\phi(s,a),\ \int V\,d\boldsymbol\nu_h\Big\rangle

    For any function VV on states, the expected next value is linear in the features, with a weight vector that depends on VV:

  2. Qhπ(s,a)=⟨ϕ(s,a), θh+∫Vh+1π dνh⟩,(Thf)(s,a)=⟨ϕ(s,a), θh+∫max⁡a′f(⋅,a′) dνh⟩Q^\pi_h(s,a)=\Big\langle\boldsymbol\phi(s,a),\ \boldsymbol\theta_h+\int V^\pi_{h+1}\,d\boldsymbol\nu_h\Big\rangle,\qquad(\mathcal T_hf)(s,a)=\Big\langle\boldsymbol\phi(s,a),\ \boldsymbol\theta_h+\int\max_{a'}f(\cdot,a')\,d\boldsymbol\nu_h\Big\rangle

    Hence for every policy, Qhπ=rh+PhVh+1πQ^\pi_h=r_h+P_hV^\pi_{h+1} is linear, and so is Qh⋆Q^\star_h. More: the Bellman backup of any function lands in the linear class, which is Bellman completeness, the property that makes least-squares value iteration consistent.

A different structure, the linear mixture MDP (Ayoub et al., 2020), assumes P(s′∣s,a)=∑i=1dθiPi(s′∣s,a)P(s'\mid s,a)=\sum_{i=1}^d\theta_iP_i(s'\mid s,a) for known base models PiP_i and unknown weights θ\boldsymbol\theta. It is model-based, and estimates θ\boldsymbol\theta by value-targeted regression: regress the observed next value V(s′)V(s') on the features (∑s′Pi(s′∣s,a)V(s′))i\big(\sum_{s'}P_i(s'\mid s,a)V(s')\big)_i. Their UCRL-VTR has regret O~(dH3T)\tilde O(d\sqrt{H^3T}), and Zhou, Gu & Szepesvári (2021) reached O~(dHT)\tilde O(dH\sqrt T) with a matching Ω(dHT)\Omega(dH\sqrt T) lower bound. With a generative model and discounting, Yang & Wang (2019) learn an ε\varepsilon-optimal policy from O~(d/((1−γ)3ε2))\tilde O\big(d/((1-\gamma)^3\varepsilon^2)\big) samples under a related linear transition assumption (with "anchor" state–action pairs), matching their lower bound up to logarithmic factors.

LSVI-UCB: optimism with least squares

text
LSVI-UCB (Jin, Yang, Wang & Jordan, 2020), regularizer λ = 1, bonus scale β
for episode k = 1, ..., K:
    Q[H+1] ← 0
    for h = H down to 1:                                  # least-squares value iteration
        Λ ← λI + Σ_{τ<k} φ(s_h^τ, a_h^τ) φ(s_h^τ, a_h^τ)ᵀ
        w ← Λ⁻¹ Σ_{τ<k} φ(s_h^τ, a_h^τ) · ( r_h^τ + max_a Q[h+1](s_{h+1}^τ, a) )
        Q[h](s, a) ← min( wᵀφ(s, a) + β · sqrt(φ(s, a)ᵀ Λ⁻¹ φ(s, a)),  H )
    for h = 1, ..., H:
        play a_h = argmax_a Q[h](s_h, a); observe r_h and s_{h+1}

The bonus β∥ϕ∥Λ−1\beta\norm{\boldsymbol\phi}_{\Lambda^{-1}} is large in directions of feature space the data have not covered, exactly as in LinUCB (Linear Bandits: LinUCB & OFUL). The values are computed only where needed, at visited next states, so the cost is polynomial in dd, ∣A∣|\mathcal A| and KK, independent of ∣S∣|\mathcal S|.

DerivationProof sketch
  1. ∣w⊤ϕ(s,a)−(rh+PhVh+1)(s,a)∣≤β ∥ϕ(s,a)∥Λ−1,β=O~(dH)\Big|\mathbf w^\top\boldsymbol\phi(s,a)-(r_h+P_hV_{h+1})(s,a)\Big|\le\beta\,\norm{\boldsymbol\phi(s,a)}_{\Lambda^{-1}},\qquad\beta=\tilde O(dH)

    Concentration. At step hh, w\mathbf w is a ridge regression of targets whose mean is (rh+PhVh+1)(s,a)(r_h+P_hV_{h+1})(s,a), linear in ϕ\boldsymbol\phi by completeness. A self-normalized martingale bound, combined with a union bound over a covering of the possible functions Vh+1V_{h+1} (which depend on the same data), gives for all (s,a)(s,a) with high probability

  2. V1⋆(s1k)−V1πk(s1k)≤∑h=1H2β ∥ϕ(shk,ahk)∥Λh,k−1+ξkV^\star_1(s_1^k)-V^{\pi_k}_1(s_1^k)\le\sum_{h=1}^H2\beta\,\norm{\boldsymbol\phi(s_h^k,a_h^k)}_{\Lambda_{h,k}^{-1}}+\xi_k

    Optimism. Backward induction from QH+1=QH+1⋆=0Q_{H+1}=Q^\star_{H+1}=0 then gives Qh≥Qh⋆Q_h\ge Q^\star_h at every step, so the greedy policy's planned value overestimates V⋆V^\star. Regret decomposition. The overestimate is paid for by the bonuses actually collected along the episode, plus a martingale term of order H2T\sqrt{H^2T}:

  3. ∑k=1K∥ϕk∥Λk−1≤K∑k=1K∥ϕk∥Λk−12≤2dKlog⁡(1+K/d)\sum_{k=1}^K\norm{\boldsymbol\phi_k}_{\Lambda_k^{-1}}\le\sqrt{K\sum_{k=1}^K\norm{\boldsymbol\phi_k}^2_{\Lambda_k^{-1}}}\le\sqrt{2dK\log(1+K/d)}

    Elliptical potential. Each new feature vector is added to Λ\Lambda, so the bonuses shrink in the directions explored. For ∥ϕ∥≤1\norm{\boldsymbol\phi}\le1 and λ=1\lambda=1, Cauchy–Schwarz and the determinant argument of linear bandits give

  4. Regret(K)≤O~(H⋅dH⋅dK)=O~(d3H4K)=O~(d3H3T)\mathrm{Regret}(K)\le\tilde O\big(H\cdot dH\cdot\sqrt{dK}\big)=\tilde O\big(\sqrt{d^3H^4K}\big)=\tilde O\big(\sqrt{d^3H^3T}\big)

    Multiply: HH steps, bonus scale dHdH, potential dK\sqrt{dK}. The extra d\sqrt d in β\beta (a linear bandit needs only d\sqrt d) is the price of the union bound over value functions, whose class has dimension about d2d^2 through the matrix Λ\Lambda.

Predict before you look

By what factor does LSVI-UCB's regret bound O~(d3H3T)\tilde O(\sqrt{d^3H^3T}) grow when the feature dimension dd doubles and everything else stays fixed?

Show the answer

2.83

(2d)3/d3=23/2≈2.83\sqrt{(2d)^3}/\sqrt{d^3}=2^{3/2}\approx2.83. The nearly minimax O~(dH3K)\tilde O(d\sqrt{H^3K}) bound would grow by only 2. Doubling the number of states changes neither bound, which is the point of the linear structure.

Completeness can be relaxed. Zanette, Lazaric, Kochenderfer & Brunskill (2020) assume only a small inherent Bellman error (the linear class is closed under backups up to an error IBE) and obtain regret O~(∑hdhK+∑hdh IBE K)\tilde O\big(\sum_hd_h\sqrt K+\sum_h\sqrt{d_h}\,\mathrm{IBE}\,K\big) with step-dependent dimensions dhd_h, a sharper dependence on the dimension than LSVI-UCB's that matches their lower bound; their algorithm is not known to be computationally efficient.

When good features are not enough: lower bounds

Linear MDPs assume a lot: the dynamics themselves are linear. The weakest natural assumption is realizability, that Q⋆Q^\star (or every QπQ^\pi) is linear, perhaps up to an error δ\delta. A run of lower bounds shows that realizability alone does not buy sample efficiency.

ResultAssumption and accessLower bound
Du, Kakade, Wang & Yang (2020)∣Qhπ−θh,π⊤ϕ∣≤δ\abs{Q^\pi_h-\boldsymbol\theta_{h,\pi}^\top\boldsymbol\phi}\le\delta for every policy; 2 actions; even known transitionsΩ(min⁡{∣S∣,2H,edδ2/16})\Omega\big(\min\{|\mathcal S|,2^H,e^{d\delta^2/16}\}\big) trajectories for a 12\tfrac12-optimal policy: exponential once δ≳H/d\delta\gtrsim\sqrt{H/d}
Weisz, Amortila & Szepesvári (2021)Q⋆Q^\star exactly linear; generative model (local planning); an action set exponentially large in ddmin⁡(eΩ(d),Ω(2H))\min\big(e^{\Omega(d)},\Omega(2^H)\big) queries; eΩ(d)e^{\Omega(d)} in the discounted setting
Wang, Wang & Kakade (2021)Q⋆Q^\star exactly linear plus a constant suboptimality gap; online2Ω(min⁡{d,H})2^{\Omega(\min\{d,H\})}: exponential in min⁡(d,H)\min(d,H)
Wang, Foster & Kakade (2021)Offline evaluation; every QπQ^\pi exactly linear; data with well-conditioned feature covarianceExponential in HH
Foster, Krishnamurthy, Simchi-Levi & Xu (2022)Offline; realizability plus concentrabilityPolynomial in ∣S∣|\mathcal S|: no bound in terms of log⁡∣F∣\log|\mathcal F| alone
The positive side of the first row: with a generative model and every QπQ^\pi ε\varepsilon-close to linear, approximate policy iteration finds a policy optimal up to O(εd/(1−γ)2)\order{\varepsilon\sqrt d/(1-\gamma)^2} from about d/(ε2(1−γ)4)d/(\varepsilon^2(1-\gamma)^4) samples (Lattimore, Szepesvári & Weisz, 2020; see also Van Roy & Dong, 2019). The misspecification is amplified by d\sqrt d, which is why errors of order H/d\sqrt{H/d} already make learning hard. The Weisz et al. construction needs exponentially many actions; Weisz, Szepesvári & György (2022) keep the bound exponential with only Ω(min⁡(d1/4,H1/2))\Omega(\min(d^{1/4},H^{1/2})) actions.

What separates the upper bounds from these lower bounds is not dimension but closure. In a linear MDP, the backup of any estimate stays in the class, so regression targets are always realizable; under realizability of Q⋆Q^\star alone, the intermediate targets r+max⁡a′Qh+1r+\max_{a'}Q_{h+1} of value iteration can fall outside the class, and errors compound without control. The same distinction between realizability and completeness reappears in batch RL (Fitted Q-Iteration & Its Guarantees).

Check your understanding

LSVI-UCB enjoys polynomial regret in linear MDPs, while Weisz, Amortila & Szepesvári prove an exponential lower bound when Q⋆Q^\star is exactly linear, even with a simulator. What does the linear MDP assume that exact realizability of Q⋆Q^\star does not?

  1. A smaller feature dimension
  2. Deterministic transitions
  3. That the Bellman backup of every function is linear in the features (completeness), because the transitions themselves are linear
  4. A positive suboptimality gap
Show the answer

C. That the Bellman backup of every function is linear in the features (completeness), because the transitions themselves are linear

With linear transitions, PhVP_hV is linear for every VV, so every regression target in least-squares value iteration is realizable. Realizability of Q⋆Q^\star says nothing about the targets built from the algorithm's current, imperfect estimates, and the lower-bound constructions exploit exactly that gap.

Structural conditions: when is RL with function approximation tractable?

The search for the right general condition produced a sequence of complexity measures, each containing the previous tractable cases.

  • Bellman rank (Jiang, Krishnamurthy, Agarwal, Langford & Schapire, 2017). For candidate value functions f,f′f,f', form the average Bellman error of f′f' on the state distribution of ff's greedy policy at step hh. If this matrix, indexed by (f,f′)(f,f'), has rank MM, the OLIVE algorithm learns a near-optimal policy with a number of samples polynomial in MM, ∣A∣|\mathcal A|, HH, 1/ε1/\varepsilon and log⁡∣F∣\log|\mathcal F|, independent of the number of observations. OLIVE eliminates hypotheses and is not computationally efficient in general.
  • Eluder dimension (Russo & Van Roy, 2013): how long a sequence of inputs can keep surprising a function class, the quantity behind optimistic exploration with general classes.
  • Bellman–Eluder dimension (Jin, Liu & Miryoosefi, 2021): an eluder dimension of the Bellman errors, which subsumes tabular and linear MDPs, reactive POMDPs, low Bellman rank and low eluder dimension. Under realizability and completeness, their GOLF algorithm has regret O(HdBEKβ)\order{H\sqrt{d_{\mathrm{BE}}K\beta}} with β\beta logarithmic in the covering number of the function classes.
  • Bilinear classes (Du et al., 2021) organize many of these examples by one algebraic condition on Bellman errors.
  • The decision–estimation coefficient (Foster, Kakade, Qian & Rakhlin, 2021) measures, for a class of models, the best trade-off between the regret of a decision and the information it reveals; they prove a lower bound on regret in terms of it for any algorithm, and an upper bound for their Estimation-to-Decisions method that matches it up to the cost of estimation.

These theories assume the features, or the function class, are given. In a low-rank MDP only the existence of a dd-dimensional factorization P(s′∣s,a)=ϕ⋆(s,a)⊤ν⋆(s′)P(s'\mid s,a)=\boldsymbol\phi^\star(s,a)^\top\boldsymbol\nu^\star(s') is assumed, with ϕ⋆\boldsymbol\phi^\star and ν⋆\boldsymbol\nu^\star in known classes Φ\Phi and Υ\Upsilon. FLAMBE (Agarwal, Kakade, Krishnamurthy & Sun, 2020) learns such features while exploring, with sample complexity polynomial in dd, HH, ∣A∣|\mathcal A| and 1/ε1/\varepsilon and logarithmic in ∣Φ∣∣Υ∣|\Phi||\Upsilon|, given a maximum-likelihood oracle over both classes: representation learning with a guarantee (Representation Learning for RL).

Key takeaways

  • In a linear MDP, PhVP_hV is linear for every VV, so every QπQ^\pi is linear and the linear class is Bellman complete.
  • LSVI-UCB adds the bonus β∥ϕ∥Λ−1\beta\norm{\boldsymbol\phi}_{\Lambda^{-1}} to least-squares value iteration and has regret O~(d3H3T)\tilde O(\sqrt{d^3H^3T}), independent of ∣S∣|\mathcal S|; O~(dH3K)\tilde O(d\sqrt{H^3K}) is nearly minimax.
  • Realizability alone is not enough: approximately linear QπQ^\pi with δ≳H/d\delta\gtrsim\sqrt{H/d}, exactly linear Q⋆Q^\star with a simulator (and many actions), and offline evaluation with every QπQ^\pi linear all have exponential lower bounds.
  • The divide is closure under the Bellman operator (completeness); Bellman rank, the Bellman–Eluder dimension and the DEC generalize the tractable cases, mostly without efficient algorithms.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Why is QhπQ^\pi_h linear in ϕ\boldsymbol\phi for every policy in a linear MDP?

  1. Because the optimal policy is linear
  2. Because (PhV)(s,a)=⟨ϕ(s,a),∫V dνh⟩(P_hV)(s,a)=\big\langle\boldsymbol\phi(s,a),\int V\,d\boldsymbol\nu_h\big\rangle is linear for any function VV, so rh+PhVh+1πr_h+P_hV^\pi_{h+1} is linear
  3. Because the rewards are bounded
  4. Because the features are one-hot
Show the answer

B. Because (PhV)(s,a)=⟨ϕ(s,a),∫V dνh⟩(P_hV)(s,a)=\big\langle\boldsymbol\phi(s,a),\int V\,d\boldsymbol\nu_h\big\rangle is linear for any function VV, so rh+PhVh+1πr_h+P_hV^\pi_{h+1} is linear

Linearity of the transitions passes to the expectation of any next-state function. That gives realizability of every QπQ^\pi and of Q⋆Q^\star and, more importantly for algorithms, closure of the linear class under Bellman backups.

Question 2

Write LSVI-UCB's regret O~(d3H3T)\tilde O(\sqrt{d^3H^3T}) in terms of the number of episodes KK, with T=KHT=KH.

  1. O~(d3H3K)\tilde O(\sqrt{d^3H^3K})
  2. O~(d3H2K)\tilde O(\sqrt{d^3H^2K})
  3. O~(d3H4K)\tilde O(\sqrt{d^3H^4K})
  4. O~(d3H3K)\tilde O(d^3H^3\sqrt K)
Show the answer

C. O~(d3H4K)\tilde O(\sqrt{d^3H^4K})

d3H3⋅KH=d3H4K\sqrt{d^3H^3\cdot KH}=\sqrt{d^3H^4K}. Papers state bounds in either TT or KK, and the horizon exponent shifts by one inside the square root when converting; the later O~(dH3K)\tilde O(d\sqrt{H^3K}) bound equals O~(dHT)\tilde O(dH\sqrt T).

Question 3

Which statement matches the lower bound of Weisz, Amortila & Szepesvári (2021)?

  1. Even if Q⋆Q^\star is exactly linear in dd known features and the planner has a generative model, it can need min⁡(eΩ(d),Ω(2H))\min(e^{\Omega(d)},\Omega(2^H)) queries
  2. If Q⋆Q^\star is only approximately linear, planning needs exponentially many queries, but exact linearity makes it easy
  3. Linear MDPs require exponentially many samples
  4. The lower bound disappears with a constant suboptimality gap
Show the answer

A. Even if Q⋆Q^\star is exactly linear in dd known features and the planner has a generative model, it can need min⁡(eΩ(d),Ω(2H))\min(e^{\Omega(d)},\Omega(2^H)) queries

Their construction has exact realizability of Q⋆Q^\star and simulator access, the most favorable setting short of linear dynamics, and still forces exponentially many queries. Du et al.'s earlier bound needed approximation error δ≳H/d\delta\gtrsim\sqrt{H/d}; this one needs none.

Further reading

  • C. Jin, Z. Yang, Z. Wang & M. I. Jordan, "Provably efficient reinforcement learning with linear function approximation", COLT (2020).
  • S. S. Du, S. M. Kakade, R. Wang & L. F. Yang, "Is a good representation sufficient for sample efficient reinforcement learning?", ICLR (2020).
  • G. Weisz, P. Amortila & C. Szepesvári, "Exponential lower bounds for planning in MDPs with linearly-realizable optimal action-value functions", ALT (2021).
  • C. Jin, Q. Liu & S. Miryoosefi, "Bellman eluder dimension: New rich classes of RL problems, and sample-efficient algorithms", NeurIPS (2021).
  • A. Agarwal, N. Jiang, S. M. Kakade & W. Sun, Reinforcement Learning: Theory and Algorithms (monograph draft, 2019–2022).