What are the Essential Factors in Crafting Effective Long Context Multi-Hop Instruction Datasets? Insights and Best Practices
Zhi Chen, Qiguang Chen, Libo Qin, Qipeng Guo, Haijun Lv, Yicheng Zou, Wanxiang Che, Hang Yan, Kai Chen, Dahua Lin
TL;DR
The paper tackles the quality bottleneck in long-context multi-hop instruction data for LLMs. It introduces the Multi-agent Interactive Multi-hop Generation (MIMG) framework, comprising a Quality Verification Agent, a Single-hop Question Generation Agent, a Multiple Question Sampling module, and a Multi-hop Question Merging Agent to produce high-quality, diverse long-context data. Extensive experiments across domains and models show LongMIT synthetic data substantially improves instruction-tuning performance, even matching or surpassing some larger human-annotated datasets, with ablations confirming the contribution of each module. The work highlights practical strategies for data synthesis, including scoring-based verification, rationale-enabled generation, embedding-driven sampling, and token-efficient merging, offering a scalable path to better long-context reasoning in LLMs.
Abstract
Recent advancements in large language models (LLMs) with extended context windows have significantly improved tasks such as information extraction, question answering, and complex planning scenarios. In order to achieve success in long context tasks, a large amount of work has been done to enhance the long context capabilities of the model through synthetic data. Existing methods typically utilize the Self-Instruct framework to generate instruction tuning data for better long context capability improvement. However, our preliminary experiments indicate that less than 35% of generated samples are multi-hop, and more than 40% exhibit poor quality, limiting comprehensive understanding and further research. To improve the quality of synthetic data, we propose the Multi-agent Interactive Multi-hop Generation (MIMG) framework, incorporating a Quality Verification Agent, a Single-hop Question Generation Agent, a Multiple Question Sampling Strategy, and a Multi-hop Question Merger Agent. This framework improves the data quality, with the proportion of high-quality, multi-hop, and diverse data exceeding 85%. Furthermore, we systematically investigate strategies for document selection, question merging, and validation techniques through extensive experiments across various models. Our findings show that our synthetic high-quality long-context instruction data significantly enhances model performance, even surpassing models trained on larger amounts of human-annotated data. Our code is available at: https://github.com/WowCZ/LongMIT.
