Explore the research collection
1 entry · Follow this search
- Paper
Length Generalization Needs Proper Regularization
Argues transformers need no architectural changes for length generalization — proper dropout regularization suffices, making the problem architecture-agnostic rather than a positional-encoding or attention-mechanism question. Diagnoses training-procedure culprits for extrapolation failure: weight decay can hinder extrapolation, while dropout improves it only when its placement is reconsidered — standard dropout before layer normalization introduces a systematic distributional mismatch; applying dropout just before the linear projection resolves it. Proposes Variance-Preserving Affine Dropout (VPAD), which substantially reduces the resulting pre-activation variance mismatch and further improves extrapolation; VPAD is complementary to attention-scaling methods. Results: modified SmolLM3 with sliding-window attention, continually pre-trained with dropout, extrapolates perfectly to 64x on Needle-in-a-Haystack and far beyond pre-training context on RULER and HELMET; training SmolLM3 from scratch reaches RBA 100.0 at 32x training length; matches a 'perfect' baseline at 2-8x extrapolation and improves on ICL/NIAH/RULER at longer contexts. Mamba2 also benefits from dropout, supporting the architecture-agnostic claim. CC BY 4.0 license. Directly relevant to the user's long-context training work (3:1 SWA:full-attention hybrid stack) — the dropout-placement fix applies to their architecture too.