Structured Packing in LLM Training Improves Long Context Utilization

Konrad Staniszewski, Szymon Tworkowski, Sebastian Jaszczur, Łukasz Kuciński, Piotr Miłoś · Submission to ICLR 2024 · Rejected

Abstract

Recent advances in long-context Large Language Models (LCLMs) have generated significant interest, especially in applications such as querying scientific research papers. However, their potential is often limited by inadequate context utilization. We identify the absence of long-range semantic dependencies in typical training data as a primary hindrance. To address this, we delve into the benefits of frequently incorporating related documents into training inputs. Using the inherent directory structure of code data as a source of training examples, we demonstrate improvements in perplexity, even for tasks unrelated to coding. Building on these findings, but with a broader focus, we introduce Structured Packing for Long Context (SPLiCe). SPLiCe is an innovative method for creating training examples by using BM25 to collate the most mutually relevant documents into a single training context. Our results indicate that SPLiCe enhances model performance across various tasks and can be used to train large models to utilize long contexts better. We validate our results by training a large 3B model, showing both perplexity improvements and better long-context performance on a benchmark key-value retrieval task.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
TREC3B FoT SPLiCeclassification accuracy79.3+5.4 vs baselinesplit: test · params=3B
Source quote
L121: 32K │ 73.9 │ 79.3 │ 5.4~[{4.7,6.2]}~~ │ 82.9 │ 85.9 │ 3.0~[{2.6,3.6]}
Qasper7B FoT SPLiCequestion-answering score23.12-shot · params=7B
Source quote
L147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]}
HotpotQA7B FoT SPLiCequestion-answering score27.310-shot · params=7B
Source quote
L147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]}
Reported baseline / comparator measurements (3)
BenchmarkMethodMetricScoreProtocol / Evidence
TREC3B FoT Baseline baselineclassification accuracy73.9split: test · params=3B
Source quote
L121: 32K │ 73.9 │ 79.3 │ 5.4~[{4.7,6.2]}~~ │ 82.9 │ 85.9 │ 3.0~[{2.6,3.6]}
Qasper7B FoT Baseline baselinequestion-answering score22.82-shot · params=7B
Source quote
L147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]}
HotpotQA7B FoT Baseline baselinequestion-answering score26.010-shot · params=7B
Source quote
L147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]}
BibTeX
@misc{staniszewski2023structured,
  author = {Konrad Staniszewski and Szymon Tworkowski and Sebastian Jaszczur and Łukasz Kuciński and Piotr Miłoś},
  title = {{Structured Packing in LLM Training Improves Long Context Utilization}},
  year = {2023},
  eprint = {2312.17296},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.17296},
}
Figure