Structured Packing in LLM Training Improves Long Context Utilization
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 →
| Benchmark | Method | Metric | Score | Protocol / Evidence |
|---|---|---|---|---|
| TREC | 3B FoT SPLiCe | classification accuracy | 79.3+5.4 vs baseline | split: test · params=3BSource quoteL121: 32K │ 73.9 │ 79.3 │ 5.4~[{4.7,6.2]}~~ │ 82.9 │ 85.9 │ 3.0~[{2.6,3.6]} |
| Qasper | 7B FoT SPLiCe | question-answering score | 23.1 | 2-shot · params=7BSource quoteL147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]} |
| HotpotQA | 7B FoT SPLiCe | question-answering score | 27.3 | 10-shot · params=7BSource quoteL147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]} |
Reported baseline / comparator measurements (3)
| Benchmark | Method | Metric | Score | Protocol / Evidence |
|---|---|---|---|---|
| TREC | 3B FoT Baseline baseline | classification accuracy | 73.9 | split: test · params=3BSource quoteL121: 32K │ 73.9 │ 79.3 │ 5.4~[{4.7,6.2]}~~ │ 82.9 │ 85.9 │ 3.0~[{2.6,3.6]} |
| Qasper | 7B FoT Baseline baseline | question-answering score | 22.8 | 2-shot · params=7BSource quoteL147: 7B_{\text{FoT}} │ 22.8 │ 23.1 │ 26.0 │ 27.3 │ 1.3~[{1.2,1.5]} |
| HotpotQA | 7B FoT Baseline baseline | question-answering score | 26.0 | 10-shot · params=7BSource quoteL147: 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},
}Ask Althea to put this paper to the test.