Efficient Pretraining Length Scaling

Bohong Wu, Shen Yan, Sijun Zhang, Jianqiao Lu, Yutao Zeng +2 more
4/21/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Recent advances in large language models have demonstrated the effectiveness of length scaling during post-training, yet its potential in pre-training remains underexplored. We present the Parallel Hidden Decoding Transformer (\textit{PHD}-Transformer), a novel framework that enables efficient length scaling during pre-training while maintaining inference efficiency. \textit{PHD}-Transformer achieves this through an innovative KV cache management strategy that distinguishes between original tokens and hidden decoding tokens. By retaining only the KV cache of original tokens for long-range dependencies while immediately discarding hidden decoding tokens after use, our approach maintains the same KV cache size as the vanilla transformer while enabling effective length scaling. To further enhance performance, we introduce two optimized variants: \textit{PHD-SWA} employs sliding window attention to preserve local dependencies, while \textit{PHD-CSWA} implements chunk-wise sliding window attention to eliminate linear growth in pre-filling time. Extensive experiments demonstrate consistent improvements across multiple benchmarks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wu2025efficient,
  title  = {Efficient Pretraining Length Scaling},
  author = {Bohong Wu and Shen Yan and Sijun Zhang and Jianqiao Lu and Yutao Zeng and Ya Wang and Xun Zhou},
  year   = {2025},
  eprint = {2504.14992},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.14992v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.14992.svg)](https://codeofpaper.com/paper/2504.14992)

Discussion