We present a series of long-context LLMs that support effective context windows of up to 32,768 tokens. Our model series are built through continual pretraining from Llama 2 with longer training sequences and on a dataset where long texts are upsampled. We perform extensive evaluation on language modeling, synthetic context probing tasks, and a wide range of research benchmarks. On research benchmarks, our models achieve consistent improvements on most regular tasks and significant improvements on long-context tasks over Llama 2. Notably, with a cost-effective instruction tuning procedure that does not require human-annotated long instruction data, the 70B variant can already surpass gpt-3.5-turbo-16k's overall performance on a suite of long-context tasks. Alongside these results, we provide an in-depth analysis on the individual components of our method. We delve into Llama's position encodings and discuss its limitation in modeling long dependencies. We also examine the impact of various design choices in the pretraining process, including the data mix and the training curriculum of sequence lengths -- our ablation experiments suggest that having abundant long texts in the pretrain dataset is not the key to achieving strong performance, and we empirically verify that long context continual pretraining is more efficient and similarly effective compared to pretraining from scratch with long sequences.
翻译:我们提出了一系列支持有效上下文窗口高达32,768个token的长上下文大语言模型。该模型系列基于Llama 2进行持续预训练,采用更长的训练序列,并在长文本上采样的数据集上训练。我们在语言建模、合成上下文探测任务以及广泛的研究基准上进行了全面评估。在研究基准上,与Llama 2相比,我们的模型在大多数常规任务上取得一致改进,并在长上下文任务上获得显著提升。值得注意的是,通过一种无需人工标注长指令数据的低成本指令微调流程,70B变体在长上下文任务套件上的整体性能已超越gpt-3.5-turbo-16k。除实验结果外,我们还对方法的各个组成部分进行了深入分析。我们深入研究了Llama的位置编码,并讨论了其在建模长距离依赖关系时的局限性。同时,我们考察了预训练过程中多种设计选择的影响,包括数据混合和序列长度的训练课程——我们的消融实验表明,预训练数据集中包含大量长文本并非实现强性能的关键,并通过实验验证了长上下文持续预训练相比从头开始使用长序列预训练更高效且效果相当。