Revision

Hyperparameters & step sizes

What each hyperparameter in Chapters 2–9 controls, what happens when it is too small or too large, and the book's guidance — with a special focus on constant vs varying step sizes.

1. The step size α — constant vs varying

Nearly every method uses the rule $\textit{New}\leftarrow\textit{Old}+\alpha[\textit{Target}-\textit{Old}]$ (2.4). The step size decides how much each new target moves the estimate, and therefore how the estimate weights old vs new data.

ScheduleFormulaSatisfies (2.7)?BehaviourWhere in the book
Sample average$\alpha_n=1/n$yesEqual weight to all targets; converges to the mean; initial bias vanishes after one update; adapts ever more slowlyCh 2 (2.3), Ch 5 MC averages
Constant$\alpha_n=\alpha$no ($\sum\alpha^2=\infty$)Exponential recency weighting $\alpha(1-\alpha)^{n-i}$; never fully converges; tracks nonstationary targets; permanent (decaying) initial biasCh 2 (2.5), constant-α MC (6.1), TD, Sarsa, Q-learning, Ch 9
Polynomial decay$\alpha_n=1/n^p,\ \tfrac12\lt p\le1$yesBetween the two; still convergesStochastic approximation theory
Too-fast decay$\alpha_n=1/n^2$no ($\sum\alpha_n\lt\infty$)Steps die out before overcoming the initial value — may stall short of the targetPitfall
Unbiased constant trick$\beta_n=\alpha/\bar o_n,\ \bar o_n=\bar o_{n-1}+\alpha(1-\bar o_{n-1})$no (→ α)$\beta_1=1$ removes initial bias; then behaves like constant αEx 2.7
Weighted IS step$W_n/C_n$data-dependentWeighted average of returns; bounded varianceCh 5 (5.8)
Tile-coding step$\alpha=1/(\tau n)$ for $n$ tilingsconstant$\tau=1$ ⇒ one-trial learning; $\tau=10$ ⇒ ~10 presentationsCh 9 §9.5.4
General linear rule$\alpha=(\tau\E[\mathbf x^\top\mathbf x])^{-1}$constantLearn in ≈ τ experiences with similar featuresCh 9 (9.19)
Fourier per-feature$\alpha_i=\alpha/\|\mathbf c^i\|$constantSmaller steps for high-frequency featuresCh 9 §9.5.2
No step sizeLSTD: $\mathbf w=\hat{\mathbf A}^{-1}\hat{\mathbf b}$—Needs ε; never forgets (bad when π changes)Ch 9 §9.8
$$\begin{aligned}\sum_{n=1}^\infty\alpha_n&=\infty&&\text{steps large enough to overcome initial conditions and noise}\\ \sum_{n=1}^\infty\alpha_n^2&\lt\infty&&\text{steps eventually small enough to converge}\end{aligned}$$
Robbins–Monro conditions — convergence with probability 1(2.7)
The core trade-off in one sentence

Decreasing step sizes (meeting 2.7) converge on stationary problems; constant step sizes keep tracking on nonstationary ones — and since RL targets are effectively nonstationary (the policy changes in GPI; bootstrapped targets change even for a fixed policy), the book mostly uses constant α. Decreasing sequences "often converge very slowly or need considerable tuning" and "are seldom used in applications".

Try it: step-size schedules on a noisy target

Targets are drawn from $\mathcal N(\mu_t, \sigma^2)$. With "jump", the true mean changes from 1 to 3 halfway (a nonstationary problem). Every estimator starts at $Q_1=0$.

Estimates

Step size used at each step

Step size by chapter — quick reference

ChapterTypical choice in the bookNotes
2 Bandits1/n (stationary) or α = 0.1Gradient bandit α ≈ 0.1–0.4; Fig 2.6 sweeps 1/32 … 4
4 DPnone (expected updates assign the target exactly)Accuracy via θ
5 MCsample averages; weighted IS $W/C$Constant-α MC (6.1) for nonstationary
6 TDrandom walk TD α = 0.05–0.15 vs MC 0.01–0.04; windy α = 0.5; cliff α = 0.5 (Expected Sarsa fine at 1)Batch TD answer independent of α
7 n-stepbest α shrinks as n grows (Fig 7.2)n and α must be tuned together
9 Approx.2×10⁻⁵ (gradient MC, 100k episodes), 10⁻⁴ / 5×10⁻⁵ (poly / Fourier), $1/(10n)$ tile coding(9.19) rule of thumb

2. Exploration parameters

ParameterControlsToo smallToo largeNotes
ε (ε-greedy)Fraction of random actionsStuck on sub-optimal actions; slow discoveryWasted steps; caps $P(\text{greedy})=1-\varepsilon+\varepsilon/k$; in cliff walking Q-learning falls off moreDecay (e.g. ε = 1/t) for GLIE convergence. On-policy MC/Sarsa converge to the best ε-soft policy for fixed ε
$Q_1$ (initial values)Optimism ⇒ early explorationNo exploration bonusLong initial explorationTemporary; useless for nonstationary tasks; with −1 rewards, Q = 0 is already optimistic (windy gridworld)
$c$ (UCB)Weight of the uncertainty bonus≈ greedyOver-explores; spike/dip at step k+1Best ≈ 1–2 on the testbed
Baseline $\bar R_t$Variance of gradient-bandit updatesNo effect on expected update; missing baseline with large rewards ⇒ slowRunning average of rewards
Behaviour policy $b$Off-policy explorationThe more it differs from π, the larger IS ratios (variance) or shorter tree-backup spansMust satisfy coverage

3. Discount rate γ

4. Bootstrapping depth n (and σ)

nMethodBiasVarianceDelay / memory
1TD(0)High (relies on V)LowNone
intermediaten-step TDMediumMediumn steps, n transitions stored
∞MCNoneHighWhole episode

Intermediate n is usually best (Figs 7.2, 9.2), and the best α decreases as n increases. In Q(σ), σ = 1 samples (Sarsa-like, needs IS off-policy) and σ = 0 takes expectations (tree backup, no IS).

5. DP parameters

6. Function-approximation design choices

ChoiceEffect
Number of features $d$ / order $n$Resolution (acuity); polynomial and Fourier grow as $(n+1)^k$
Receptive-field width (coarse coding)Breadth of early generalisation; little effect on final accuracy
Tile width $w$, number of tilings $n$Resolution unit $w/n$; active features = $n$ ⇒ set $\alpha=1/(\tau n)$
Tile offsetsAsymmetric (1, 3, 5, …) avoids diagonal artifacts; $n=2^m\ge4k$
Tile shapeStripes generalise along a dimension; conjunctive tiles learn interactions
RBF width σSmoothness / breadth
ε in LSTDToo small ⇒ unstable inverses; too large ⇒ slow
Interest $I_t$Which states the objective cares about (emphasis $M_t$)

7. How to read a parameter study