Structured Packing in LLM Training Improves Long Context Utilization

Konrad Staniszewski, Szymon Tworkowski, Sebastian Jaszczur, Yu Zhao, Henryk Michalewski, Łukasz Kuciński, Piotr Miłoś

Abstract

Recent advancements in long-context large language models have attracted significant attention, yet their practical applications often suffer from suboptimal context utilization. This study investigates structuring training data to enhance semantic interdependence, demonstrating that this approach effectively improves context utilization. To this end, we introduce the Structured Packing for Long Context (SPLiCe) method, which utilizes retrieval to collate mutually relevant documents into long and coherent training examples. We validate SPLiCe empirically across models of varying sizes -- 3B, 7B, and 13B -- achieving improved performance in long-context tasks, such as Qasper and HotpotQA. Remarkably, even brief fine-tuning with SPLiCe is sufficient to realize these benefits. Additionally, SPLiCe effectively mitigates the lost-in-middle phenomenon often observed in large models. Our comprehensive analysis of SPLiCe explores its design choices and reveals intriguing transfer effects; for instance, training on programming code enhances performance on natural language tasks.

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 Yu Zhao and Henryk Michalewski 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},
}

Loading related content...

Figure