arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.14992cs.CL
收藏

高效预训练长度扩展

Efficient Pretraining Length Scaling

ByteDance Seed(字节跳动种子);Peking University(北京大学);Hong Kong University(香港大学)

Bohong Wu, Shen Yan, Sijun Zhang, Jianqiao Lu, Yutao Zeng, Ya Wang, Xun Zhou

AI总结:

提出PHD-Transformer框架,通过区分原始与隐藏解码令牌的KV缓存管理,在预训练中实现高效长度扩展,并推出PHD-SWA和PHD-CSWA变体,在多个基准上取得一致改进。

摘要:

近期大型语言模型的进展已证明在后训练阶段进行长度扩展的有效性,但其在预训练中的潜力仍未得到充分探索。我们提出了并行隐藏解码Transformer(PHD-Transformer),一种新颖的框架,能够在预训练期间实现高效的长度扩展,同时保持推理效率。PHD-Transformer通过一种创新的KV缓存管理策略实现这一目标,该策略区分原始令牌和隐藏解码令牌。通过仅保留原始令牌的KV缓存以用于长距离依赖,同时在使用后立即丢弃隐藏解码令牌,我们的方法保持了与普通Transformer相同的KV缓存大小,同时实现了有效的长度扩展。为进一步提升性能,我们引入了两种优化变体:PHD-SWA采用滑动窗口注意力以保留局部依赖,而PHD-CSWA实现分块滑动窗口注意力以消除预填充时间的线性增长。大量实验表明,在多个基准上均取得了一致的改进。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑