Quest: Query-centric Data Synthesis Approach for Long-context Scaling of Large Language Model
Chaochen Gao, Xing Wu, Qi Fu, Songlin Hu
TL;DR
Quest tackles the challenge of long-context learning by introducing a query-centric data synthesis framework that balances semantic relevance and context diversity. It predicts multiple potential queries per document, groups documents by shared queries and keywords, and concatenates diverse yet relevant documents to form long-context training data. Across 32k–128k contexts and up to 1M tokens, Quest consistently outperforms standard and similarity-based synthesis methods, and scales effectively to state-of-the-art models like LLaMA3-8B-128k, achieving top open-source performance and approaching GPT-4 Turbo levels on ultra-long tasks. The work also establishes a measurable scaling law for synthesized long-context data and demonstrates improved domain coverage, robust short-context performance, and broad applicability to various model sizes.
Abstract
Recent advancements in large language models (LLMs) have highlighted the importance of extending context lengths for handling complex tasks. While traditional methods for training on long contexts often use filtered long documents, these approaches lead to domain imbalances, limiting model performance. To address this, techniques like random document concatenation (Standard) and similarity-based methods (KNN, ICLM) have been developed. However, they either sacrifice semantic coherence or diversity. To balance both aspects, we introduce Quest, a query-centric data synthesis method aggregating semantically relevant yet diverse documents. Quest uses a generative model to predict potential queries for each document, grouping documents with similar queries and keywords. Extensive experiments demonstrate Quest's superior performance on long-context tasks, achieving remarkable results with context lengths of up to 1M tokens and confirming its scalability across various model sizes.
