LLM⨉MapReduce: Simplified Long-Sequence Processing using Large Language Models

Zihan Zhou, Chong Li, Xinyi Chen, Shuo Wang, Yu Chao, Zhili Li, Haoyu Wang, Rongqiao An, Qi Shi, Zhixing Tan, Xu Han, Xiaodong Shi, Zhiyuan Liu, Maosong Sun · DOI

TL;DR

This paper introduces LLM×MapReduce, a training-free framework that tackles the challenge of processing extremely long documents with LLMs by employing a divide-and-conquer strategy. It achieves state-of-the-art performance by introducing a structured information protocol to maintain inter-chunk dependencies and a confidence calibration mechanism to resolve inter-chunk conflicts, outperforming existing methods and even commercial LLMs on long-context benchmarks.

What Problem Does This Paper Address?

Large Language Models (LLMs) have revolutionized many NLP tasks, but their effectiveness is often limited by a "context window" – the maximum amount of text they can process at once. This limitation is particularly problematic for applications involving lengthy documents, such as summarizing books, analyzing legal texts, or answering questions about extensive research papers. While researchers are exploring ways to extend LLM context windows, this often requires extensive training and computational resources. Existing "divide-and-conquer" approaches, which split long texts into smaller chunks, struggle with two key issues: inter-chunk dependency (where information relevant to a question is spread across multiple chunks) and inter-chunk conflict (where different chunks provide contradictory information). These issues can lead to incomplete or incorrect final answers.

Methods

LLM×MapReduce proposes a training-free framework that leverages existing LLMs without any parameter tuning. It operates in three stages:

  • Map Stage: The long document is split into smaller chunks, each processed by an LLM to extract relevant information, a rationale for its extraction, an intermediate answer, and a confidence score. This structured output is key.
  • Collapse Stage: If the combined mapped results still exceed the LLM's context window, this stage compresses them into fewer, more manageable chunks. This is done iteratively until the content fits within the context window.
  • Reduce Stage: A final LLM aggregates the collapsed results to produce the ultimate answer.

The core innovations lie in how LLM×MapReduce addresses the challenges of long-text processing:

  • Structured Information Protocol: This protocol defines precisely what information (extracted facts, rationale, answer, confidence score) is passed between stages. This ensures that crucial details needed for understanding inter-chunk dependencies are preserved, preventing information loss that plagues simpler methods.
  • In-Context Confidence Calibration: To resolve inter-chunk conflicts, the framework uses a prompt-based mechanism to calibrate the confidence scores assigned by the LLM to each chunk's output. This ensures that confidence scores are comparable across different chunks, allowing the model to more reliably weigh evidence and identify contradictions.

Datasets

The primary evaluation dataset used is InfiniteBench (Zhang et al., 2024a), a benchmark designed to assess long-context capabilities across various tasks like retrieval, comprehension, and problem-solving. The authors specifically excluded certain subsets (Code.Run and Math.Calc) due to low model performance, making differentiation difficult. They also conducted an evaluation on an extended Needle-in-a-Haystack (NIAH) test, pushing the limits to 1280K tokens, to demonstrate the framework's ability to handle extremely long sequences.

Key Insights and Ideas

  • Structured Output is Crucial: Simply splitting text isn't enough. The way information is structured and passed between stages is critical for maintaining context and resolving ambiguities.
  • Confidence Matters for Conflict Resolution: Assigning a reliable confidence score to intermediate answers is vital for the LLM to effectively weigh conflicting information from different parts of the document.
  • Training-Free is Viable and Effective: The framework demonstrates that significant improvements in long-context processing can be achieved without the need for costly fine-tuning or retraining of LLMs.
  • Generalization Across Models: The framework's compatibility with different LLMs (Llama3-70B-Instruct and Qwen2-72B-Instruct) highlights its robustness and applicability.

Key Results

LLM×MapReduce achieved state-of-the-art performance on the InfiniteBench benchmark, with Llama3-70B-Instruct augmented by the framework reaching an average score of 68.66, outperforming both closed-source models (like GPT-4 at 57.34) and other divide-and-conquer baselines. The framework also demonstrated impressive efficiency, outperforming standard decoding in terms of inference latency for long sequences, requiring fewer GPUs for processing. On the extended NIAH test, LLM×MapReduce enabled Llama3-70B-Instruct (with an 8K trained context) to effectively process sequences up to 1280K tokens.

Limitations and Future Work

The authors acknowledge that while their framework significantly improves performance, the inherent nature of divide-and-conquer methods can still lead to some performance drops compared to models with truly massive native context windows, particularly in tasks requiring very fine-grained, long-range reasoning. Future work could explore more sophisticated methods for inter-chunk information fusion and potentially investigate adaptive chunking strategies based on content complexity. The paper also suggests that the confidence calibration prompts can be customized for various tasks, hinting at further potential for task-specific optimization.

Summary updated

BibTeX
@inproceedings{zhou2025llmmapreduce,
  author = {Zihan Zhou and Chong Li and Xinyi Chen and Shuo Wang and Yu Chao and Zhili Li and Haoyu Wang and Rongqiao An and Qi Shi and Zhixing Tan and Xu Han and Xiaodong Shi and Zhiyuan Liu and Maosong Sun},
  title = {{LLM⨉MapReduce: Simplified Long-Sequence Processing using Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
}
Figure