atlas

Research map / Large language models / Instruction and fine-tuning

An Efficient Recipe for Long Context Extension via Middle-Focused Positional Encoding

NeurIPS 2024 · Large language models › Instruction and fine-tuning · approach: Efficient LLM fine-tuning systems · 1 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Proposes CREAM, a positional-index manipulation recipe that fine-tunes Llama-2 at its 4K pre-trained window with continuity/relativity segmentation and truncated-Gaussian middle sampling to extend context to 256K, mitigating lost-in-the-middle.

Problem

Extending the context window of pre-trained LLMs usually requires fine-tuning at the target length, and existing position-index methods perform poorly on information located in the middle of long contexts.

Approach

Remap position indices so that long target sequences map into the pre-trained window, splitting the window into head/middle/tail segments that mix continuity (small fixed head/tail) and relativity (N/3 head/tail), and sample the middle segment's location from a truncated Gaussian to focus training on middle positions.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use CREAM instead of PoSE with linear interpolationLlama 2-7B · Lost-in-the-Middle, 5K, AVGaccuracy: 50.9 -> 65.2Helped
Use CREAM instead of PoSE with linear interpolationLlama 2-7B · Lost-in-the-Middle, 10K, AVGaccuracy: 28.7 -> 39.4Helped
Use CREAM instead of PoSE with YaRN interpolationLlama 2-7B · Lost-in-the-Middle, 5K, AVGaccuracy: 50.0 -> 73.4Helped
Use CREAM instead of PoSE with YaRN interpolationLlama 2-7B · Lost-in-the-Middle, 10K, AVGaccuracy: 24.4 -> 45.2Helped
Use CREAM-7B-32k instead of LongChat-v1.5-7B-32kLlama2-7B-Chat context extension · LongBenchAVG: 34.3 -> 35.9Helped
Use CREAM with LoRA fine-tuning instead of full-parameter fine-tuningLlama2-7B-Chat · LongBenchMacro: 35.9 -> 35.5No clear effect
Use CREAM with QLoRA fine-tuning instead of full-parameter fine-tuningLlama2-7B-Chat · LongBenchMacro: 35.9 -> 35.0No clear effect
Replace truncated Gaussian sampling with uniform sampling (ablation)CREAM · LongChat-Lines retrievalretrieval performanceHurt
Remove both fixed head and tail segments (ablation)CREAM · LongChat-Lines retrieval at 32Kscore: zero scoreHurt
Keep only the fixed head segment (ablation)CREAM · LongChat-Lines retrievalretrieval performanceHurt
Keep only the fixed tail segment (ablation)CREAM · LongChat-Lines retrievalretrieval performanceHurt
Balance continuity and relativity rather than enforce only one (ablation)CREAM · LongChat-Lines retrievalretrieval performanceHelped

Surprising findings

Limitations

Experimental setup

Datasets: The Pile ShareGPT GovReport Proof-pile PG-19 Book3 LongChat-Lines Lost-in-the-Middle key-value retrieval LongBench Needle-in-a-Haystack WinoGrande TruthfulQA

Benchmarks: LongChat-Lines Lost-in-the-Middle LongBench Needle-in-a-Haystack GovReport perplexity Proof-pile perplexity PG-19 perplexity Book3 perplexity WinoGrande TruthfulQA PIQA BoolQ

Metrics: accuracy perplexity GPT score

Baselines: PoSE RandPos SkipAlign LongChat-v1.5-7B-32k Llama 2-7B LoRA QLoRA

Builds on: PoSE RandPos Positional Interpolation YaRN NTK-aware interpolation

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy