Introduction
Processing massive documents with Large Language Models (LLMs) remains a significant challenge due to context window limitations and the quadratic computational costs of self-attention. While many models claim "infinite context," performance often degrades as sequence length increases. LLM×MapReduce introduces a training-free framework that applies a structured divide-and-conquer strategy to enable short-context LLMs to handle extremely long texts efficiently.
The Challenge of Long-Context Processing
Standard "divide-and-conquer" approaches, such as basic MapReduce, often fail in complex document processing for two primary reasons:
- Inter-chunk Dependency: When critical information is split across multiple chunks, the model may fail to synthesize a complete understanding.
- Inter-chunk Conflict: Different document segments may contain contradictory information. Without a mechanism to weigh the reliability of individual parts, the final aggregation often produces incorrect or hallucinated results.
The LLM×MapReduce Framework
The proposed framework refines the traditional MapReduce pipeline into three distinct stages: Map, Collapse, and Reduce. This structured approach ensures that information is preserved and conflicts are resolved systematically.
Structured Information Protocol
To address inter-chunk dependencies, the "Map" stage requires the LLM to output a structured four-part response for each chunk:
- Extracted Information: Relevant data points from the chunk.
- Rationale: The logical reasoning behind the extraction.
- Intermediate Answer: A preliminary answer based solely on the current chunk.
- Confidence Score: A self-assessment of the answer's reliability.
This protocol ensures that the subsequent stages have the necessary context and logic to resolve dependencies and conflicts effectively.
In-Context Confidence Calibration
To resolve inter-chunk conflicts, the authors implement in-context learning to calibrate the model's self-reported confidence. By providing specific scoring rubrics (e.g., assigning higher points to fully supported claims versus inferred ones), the framework ensures that confidence scores are comparable across different chunks, allowing the "Reduce" stage to prioritize the most reliable information.
Experimental Evaluation
The framework was evaluated on several rigorous benchmarks, including InfiniteBench (average inputs >100k tokens) and Needle-in-a-Haystack (NIAH) (up to 1.28 million tokens). Additionally, the authors introduced Pyramid-Align, a data synthesis engine that builds a hierarchical "pyramid" of document abstractions to generate high-quality long-range QA pairs.
Key Results
- Superior Performance: Using Llama3-70B as a backbone, LLM×MapReduce achieved an average score of 68.66 on InfiniteBench, significantly outperforming commercial models like GPT-4 (57.34) and Claude 2 (51.62).
- Extreme Scaling: The framework maintained near-perfect retrieval accuracy on the NIAH test up to 1.28 million tokens, even though the underlying model was only trained on an 8k token window.
- Hardware Efficiency: LLM×MapReduce is significantly more memory-efficient than standard long-context decoding. It can process 128k tokens on just 2 GPUs, whereas standard decoding typically requires at least 4.
Conclusion
LLM×MapReduce demonstrates that structured protocols and calibrated confidence can significantly extend the capabilities of short-context LLMs. By avoiding the quadratic memory explosion of long-sequence attention, it provides a scalable and efficient path for processing massive documents. Future work will focus on adaptive chunking and extending the framework to handle multi-modal information.
Summary updated