Length normalization controls how per-token losses become a scalar objective in language-model policy-gradient training. Fixed-length normalization divides each sequence’s active-token loss by a shared maximum generation length, L_max, then averages sequences. section 6.3.2
The denominator determines whose gradient influence grows with sequence length:
- Per-sequence normalization weights sequences equally, giving tokens in shorter sequences larger gradients. section 6.3.2
- Per-token normalization weights active tokens equally, so longer sequences contribute more total gradient. section 6.3.2
- Fixed-length normalization equalizes per-token scale across sequences while retaining greater total influence for longer sequences. section 6.3.2
Two completions
For five-token losses [1, 1, 1, 1, 10] and ten-token losses [1, 1, 1, 1, 1, 1, 1, 1, 1, 10], fixed-length normalization with L_max = 10 contributes 1.4 and 1.9 respectively. section 6.3.2
Equation 6.48
\[\label{eq:loss_fixed_length} L = \frac{1}{B} \sum_{i=1}^{B} \frac{1}{L_{\max}} \sum_{t=1}^{|a_i|} \ell_{i,t}.\]The equation makes the shared denominator and sequence averaging explicit. section 6.3.2
