Critical Sequence Length: A Note on How Document Structure Bounds Gradient-Noise Reduction
Sunny Guha
Oracle
Published December 2, 2026 · on the feed December 3, 2026 · ▲ 3 · arXiv 2612.03183
The abstract
LLM pre-training commonly treats every token in a training sequence as an independent sample of the gradient. Under this assumption, gradient noise scales as 1/(BS) for batch size B and sequence length S, so B is halved whenever S is doubled. We show that this rule breaks down beyond a certain length, and that the point where it breaks down can be measured. Guided by a simple model of how gradient noise arises in next-token training, we split the noise into two parts: a per-token term that averages away as 1/S, and a floor, caused by correlations between tokens of the same document, that does not. The two meet at a critical sequence length S*. Below it, longer sequences reduce gradient noise; above it, they add context but barely reduce the noise. We test this picture on GPT models from 125M to 1B parameters, trained on short web documents (FineWeb-Edu) and on whole books (Project Gutenberg), and find that it fits well, with informative exceptions on books and on artificially chopped data. Three findings stand out. First, S* is set by the data: it depends on the documents and on how they are packed into sequences, and chopping documents into short pieces halves the floor. Second, the critical length measured on the updates that AdamW actually applies is largely stable across model sizes and training time (and, at 1B, across corpora) and grows only with the training length, whereas the raw-gradient version varies widely. Third, validation loss is lowest when training near this length and changes little beyond it, but downstream performance is more fragile: it drops modestly as more documents are packed into each sequence and collapses when documents are chopped into short pieces. Intra-document attention masking keeps the critical length stable under heavy packing and lowers the loss. These results lead to a simple, regime-aware rule for trading batch size against sequence length.
The Brief
2:43A short podcast summary of the paper. Written and voiced by AI.
Transcript
Critical Sequence Length. A Note on How Document Structure Bounds Gradient-Noise Reduction. By Sunny Guha, from Oracle. Published on the second of December.
Pre-training a language model commonly treats every token in a training sequence as an independent sample of the gradient. If that were true, gradient noise would fall as one over the batch size times the sequence length, and doubling the length would let you halve the batch. This note shows that the rule breaks down past a certain length, and that the breaking point can be measured. Guided by a simple model of how noise arises in next-token training, the noise splits into two parts. One is a per-token term that averages away as one over the sequence length. The other is a floor that does not average away, caused by correlations between tokens from the same document. Where the two meet is a critical sequence length. Below it, longer sequences reduce gradient noise. Above it, they add context but barely reduce the noise at all.
The picture is tested on GPT models from one hundred and twenty-five million to one billion parameters, trained on short web documents from FineWeb-Edu and on whole books from Project Gutenberg. It fits well, with exceptions on books and on artificially chopped data that the author calls informative. Three findings stand out. The first is that the critical length is set by the data. It depends on the documents and on how they are packed into sequences, and chopping documents into short pieces halves the floor.
The second concerns what is measured. Taken on the updates that AdamW actually applies, the critical length is largely stable across model sizes and across training time, and at one billion parameters across corpora too. It grows only with training length. Measured on raw gradients instead, it varies widely. The third finding is about outcomes. Validation loss is lowest when training near the critical length and changes little beyond it. Downstream performance is more fragile: it drops modestly as more documents are packed into each sequence, and collapses when documents are chopped short. Intra-document attention masking keeps the critical length stable under heavy packing, and also lowers the loss.
The models tested stop at one billion parameters, and the corpora are two: short web text and whole books. The cross-corpus stability of the critical length is stated only for the one billion model. The fit itself has exceptions, on books and on chopped data, so the simple two-part model is a good description rather than an exact one. And the downstream results pull in a different direction from the loss, which means a sequence length that looks fine on validation loss can still hurt downstream performance when documents are packed or chopped.
The practical result is a rule for trading batch size against sequence length that depends on which regime you are in. Below the critical length, the old exchange of halving the batch for doubling the length still holds. Above it, the extra length mostly buys context rather than quieter gradients, and the batch should not be cut as if it did. Since documents set where that line falls, the line moves with the data.
More with an account
Listen to every day’s papers
Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.
Join free