paper-with-me

홈 › Papers

PoSE: Efficient Context Window Extension of LLMs via Positional Skip-wise Training

2023-09-19 · Dawei Zhu, Nan Yang, Liang Wang, YiFan Song, Wenhao Wu, Furu Wei, Sujian Li

Large Language Models (LLMs) are trained with a pre-defined context length, restricting their use in scenarios requiring long inputs. Previous efforts for adapting LLMs to a longer length usually requires fine-tuning with this target length (Full-length fine-tuning), suffering intensive training cost. To decouple train length from target length for efficient context window extension, we propose Positional Skip-wisE (PoSE) training that smartly simulates long inputs using a fixed context window. This is achieved by first dividing the original context window into several chunks, then designing distinct skipping bias terms to manipulate the position indices of each chunk. These bias terms and the lengths of each chunk are altered for every training example, allowing the model to adapt to all positions within target length. Experimental results show that PoSE greatly reduces memory and time overhead compared with Full-length fine-tuning, with minimal impact on performance. Leveraging this advantage, we have successfully extended the LLaMA model to 128k tokens using a 2k training context window. Furthermore, we empirically confirm that PoSE is compatible with all RoPE-based LLMs and position interpolation strategies. Notably, our method can potentially support infinite length, limited only by memory usage in inference. With ongoing progress for efficient inference, we believe PoSE can further scale the context window beyond 128k.

📄 PDF Abstract BibTeX arXiv:2309.10400

Code (2)

dwzhu-pku/pose 공식 구현 pytorch
jzhang38/EasyContext pytorch

Tasks

2kPosition

Similar Papers 제목 키워드 기반

Exploring Context Window of Large Language Models via Decomposed Positional Vectors

2024-05-28 · Zican Dong, Junyi Li, Xin Men, Wayne Xin Zhao 외

Transformer-based large language models (LLMs) typically have a limited context window, resulting in significant performance degradation when processing text beyond the length of the context window. Extensive studies hav…

LongRoPE: Extending LLM Context Window Beyond 2 Million Tokens

2024-02-21 · Yiran Ding, Li Lyna Zhang, Chengruidong Zhang, Yuanyuan Xu 외

Large context window is a desirable feature in large language models (LLMs). However, due to high fine-tuning costs, scarcity of long texts, and catastrophic values introduced by new token positions, current extended con…

8k

UltraLLaDA: Scaling the Context Length to 128K for Diffusion Large Language Models

2025-10-12 · Guangxin He, Shen Nie, Fengqi Zhu, Yuankang Zhao 외 arxiv

Diffusion LLMs have attracted growing interest, with plenty of recent work emphasizing their great potential in various downstream tasks; yet the long-context behavior of diffusion LLMs remains largely uncharted. We pres…

Effective Length Extrapolation via Dimension-Wise Positional Embeddings Manipulation

2025-04-26 · Yi Lu, Wanxu Zhao, Xin Zhou, Chenxin An 외

Large Language Models (LLMs) often struggle to process and generate coherent context when the number of input tokens exceeds the pre-trained length. Recent advancements in long-context extension have significantly expand…

8kPosition

Retrieval meets Long Context Large Language Models

2023-10-04 · Peng Xu, Wei Ping, Xianchao Wu, Lawrence McAfee 외

Extending the context window of large language models (LLMs) is getting popular recently, while the solution of augmenting LLMs with retrieval has existed for years. The natural questions are: i) Retrieval-augmentation v…

16k4kFew-Shot LearningNatural Questions+2