An Efficient Recipe for Long Context Extension via Middle-Focused Positional Encoding
Tong Wu, Yanpeng Zhao, Zilong Zheng

TL;DR
CREAM is a simple, training-efficient method that extends large language models' context length to 256K by interpolating positional encodings and focusing on the middle context during fine-tuning.
Contribution
It introduces CREAM, a novel positional encoding interpolation technique that enables long context extension with minimal fine-tuning and addresses the middle-context information loss.
Findings
Successfully extends Llama 2-7B to 256K context length
Improves middle-context information utilization
Requires only fine-tuning at original context window
Abstract
Recently, many methods have been developed to extend the context length of pre-trained large language models (LLMs), but they often require fine-tuning at the target length () and struggle to effectively utilize information from the middle part of the context. To address these issues, we propose ontinuity-elativity indxing with gussian iddle (), which interpolates positional encodings by manipulating position indices. Apart from being simple, is training-efficient: it only requires fine-tuning at the pre-trained context window (e.g., Llama 2-4K) and can extend LLMs to a much longer target context length (e.g., 256K). To ensure that the model focuses more on the information in the middle, we introduce a truncated Gaussian to encourage sampling from the middle part of the context during…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
Taxonomy
TopicsTopic Modeling · Speech Recognition and Synthesis · Natural Language Processing Techniques
MethodsBalanced Selection · LLaMA
