TL;DR
While modern large language models (LLMs) boast massive context windows, training them to effectively synthesize information across long texts remains a major challenge due to the poor quality of standard synthetic datasets. To solve this, researchers introduced the Multi-agent Interactive Multi-hop Generation (MIMG) framework, a pipeline that boosts the proportion of high-quality, multi-hop synthetic data from under 35% to over 85%. The resulting dataset, LongMIT, improves long-context performance across various LLMs by an average of 7.54%, even outperforming models trained on larger human-annotated datasets.
What Problem Does This Paper Address?
Extending an LLM's context window (e.g., to 128k tokens or more) is only half the battle; the model must also be instruction-tuned to find, connect, and reason over disparate pieces of information scattered throughout that text—a capability known as multi-hop reasoning.
Gathering human annotations for long-context data is prohibitively expensive and mentally taxing. While researchers frequently turn to the "Self-Instruct" method (using LLMs to generate their own training data), the authors discover that standard Self-Instruct approaches perform poorly for long contexts. Specifically, fewer than 35% of the samples generated by standard methods are truly multi-hop, and over 40% exhibit poor quality or semantic duplication. This paper investigates the essential factors required to craft genuinely effective, diverse, and high-quality long-context multi-hop datasets.
Methods
The authors propose the Multi-agent Interactive Multi-hop Generation (MIMG) framework, which breaks down data synthesis into a structured, multi-agent pipeline rather than relying on a single prompt generation step.
The framework consists of four core components:
- Single-hop Question Generation Agent (SQGA): Extracts simple, direct question-answer pairs from individual document chunks. The authors found that a two-stage process (generating the question first, then the answer) yields much higher quality than generating both simultaneously.
- Multiple Question Sampling (MQS): Uses embedding similarity (specifically BGE embeddings) to build a question-semantic relevance matrix. It samples related questions either within the same document (intra-document) or across different documents (inter-document) to ensure diversity.
- Multi-hop Question Merger Agent (MQMA): Takes the sampled single-hop questions and blends them into a complex, multi-hop question. Crucially, the agent only needs the single-hop QA pairs to do this, meaning you don't need to feed massive raw documents back into the LLM, saving significant token costs.
- Quality Verification Agent (QVA): Globally supervises the pipeline. Instead of asking the LLM to perform binary classification (High/Poor quality), it prompts the LLM to score the data across multiple criteria (clarity, factual accuracy, logical coherence), which significantly reduces long-context evaluation bias.
Datasets
The authors introduced a new dataset called LongMIT (Long Multi-hop Instruction Tuning):
- Size: 64.40k samples, totaling 5.07B tokens.
- Composition: Spans 2 languages (English and Chinese) and 9 distinct domains, including Academic Papers (arXiv/CNKI), Books, Finance, Law, Medicine, Technology (StackExchange), and Web Resources.
For evaluation, the models were tested on standard long-context benchmarks:
- LongBench: (Includes NarrativeQA, 2WikiMQA, HotpotQA, MuSiQue, etc.)
- Ruler: A benchmark designed to evaluate effective context behaviors.
- IFEval & ArenaHard: Used to ensure short-context instruction-following capabilities were not degraded.
Key Insights and Ideas
- LLMs are Great Selectors, Poor Annotators: In long-context regimes, LLMs show very low agreement with human annotators (low Kappa scores) when asked to label data directly. However, they maintain near-perfect precision when filtering and scoring data, making them excellent quality control filters rather than raw data creators.
- Scoring Beats Classification: Binary classification suffers heavily from long-context bias; LLMs tend to label almost everything as "high quality" once text length increases. Continuous scoring against multiple criteria mitigates this bias.
- Rationales Hurt Multi-Hop Merging: While Chain-of-Thought (CoT) rationales help generate better single-hop questions, incorporating rationales during the multi-hop merging phase actually causes LLMs to misinterpret queries and fail logically. Multi-hop synthesis should avoid rationales during the merge step.
- Documents are Overkill for Merging: You do not need to provide the entire long document to the model when merging single-hop questions into a multi-hop query. Merging based purely on the question-answer pairs is token-efficient and equally effective.
Key Results
The MIMG framework successfully raised the proportion of high-quality, multi-hop, and non-duplicative samples to over 85% (compared to <35% from standard Self-Instruct).
When fine-tuning models (such as LLaMA3-8B and InternLM2-7B) on the LongMIT dataset, the authors observed:
- Performance Boost: An average accuracy improvement of at least 7.54% across long-context tasks.
- Surpassing Human Data: Models trained on LongMIT outperformed those trained on larger human-annotated or alternative synthetic datasets like
LongAlignandChatQA2. For example, on InternLM2-7B, LongMIT achieved an average score of 67.48 on LongBench, compared to LongAlign's 57.71.
Limitations and Future Work
The authors acknowledge that due to the high API costs of proprietary models like GPT-4, their deep manual evaluation and validation sets were restricted to a small scale of 200 sampled items, which introduces potential minor sampling biases. Furthermore, because LLMs are inherently stochastic, strictly controlling them to generate identical questions for exact quality comparisons remains difficult.
Future work will likely focus on scaling these multi-agent interaction strategies to even larger token windows and exploring how these frameworks can optimize long-context code generation and mathematical reasoning datasets.
Summary updated