Skip to main content
QUICK REVIEW

[论文解读] Effective Long-Context Scaling of Foundation Models

Wenhan Xiong, Jingyu Liu|arXiv (Cornell University)|Sep 27, 2023
Topic ModelingComputer Science被引用 9
一句话总结

该论文通过从 Llama 2 进行持续预训练并进行轻量级指令微调,提出一系列长上下文 LLM(最高可达 32,768 标记),在分析位置编码和训练课程的同时实现强劲的长上下文表现和具竞争力的短上下文表现。

ABSTRACT

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.

研究动机与目标

  • 展示开放且强劲的长上下文能力,超越现有开源模型。
  • 研究如何修改架构与训练以在不过高成本下支持极长上下文。
  • 评估数据混合、课程设置和指令微调对长上下文性能的影响。
  • 分析位置编码及其他影响长程建模的设计选择。
  • 评估安全性并在长上下文基准上与专有模型进行比较。

提出的方法

  • 从 Llama 2 进行持续预训练,使用更长的序列(高达 32,768 个标记)并对长文本进行数据上采样。
  • 修改 RoPE 位置编码(基频)以实现对更长上下文的注意力。
  • 实验数据混合,评估长文本存在与数据质量对长上下文能力的影响。
  • 通过利用短提示的 RLHF 数据结合自指令长文本数据,在没有人工长上下文注释的情况下实现成本高效的指令微调。
  • 训练 7B/13B 使用 32k,34B/70B 使用 16k–32k 序列;用语言建模、合成探针和多样化基准进行评估。
  • 检查训练课程,比较持续预训练与从头开始的长序列预训练。
Figure 1 : We show that our model’s validation loss can be fit as a function of the context length: $L(c)=(\frac{\alpha}{c})^{\beta}+\gamma$ with a different set of $\alpha,\beta,\gamma$ for each model size. This power-law relationship also suggests that context length is another important axis of s
Figure 1 : We show that our model’s validation loss can be fit as a function of the context length: $L(c)=(\frac{\alpha}{c})^{\beta}+\gamma$ with a different set of $\alpha,\beta,\gamma$ for each model size. This power-law relationship also suggests that context length is another important axis of s

实验结果

研究问题

  • RQ1开放源代码的长上下文 LLM 是否能够在长上下文基准上匹配或超过专有的长上下文模型?
  • RQ2哪些架构和训练选择最能在不过高计算成本的前提下实现长上下文建模?
  • RQ3数据混合、课程设置和指令微调如何影响长上下文与短上下文性能?
  • RQ4位置编码在多大程度上限制长距离注意力,是否有简单修正能有效扩展上下文长度?
  • RQ5与现有基线相比,长上下文指令微调模型的安全性如何?

主要发现

  • 模型实现了高达 32,768 标记的有效上下文窗口,验证损失随上下文长度呈幂律缩放。
  • 在研究基准上,长上下文模型较 Llama 2 有所提升,在长上下文任务上有显著增益,某些短上下文任务上也有适度增益。
  • 一个 70B 的指令微调模型在一组长上下文基准上可超越 gpt-3.5-turbo-16k,且无需人工注释的长上下文数据。
  • RoPE ABF(调整后的基频)在长上下文建模上优于其他位置编码变体,能够在 32k 标记下维持性能。
  • 数据质量比单纯的大量长文本更为关键;即使长期文本数据有限,长上下文收益仍然存在;混合包含长数据的组合对短上下文知识任务有帮助。
  • 持续预训练并使用更长序列在 FLOPs 明显更少的情况下实现了类似或更好的结果,相较于从头训练长序列。
Figure 2 : Performance on long-context tasks as the maximum context lengths of prompts increase.
Figure 2 : Performance on long-context tasks as the maximum context lengths of prompts increase.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。