ToM: Leveraging Tree-oriented MapReduce for Long-Context Reasoning in Large Language Models

Jiani Guo, Zuchao Li, Jie Wu, Qianren Wang, Yun Li, Lefei Zhang, Hai Zhao, Yujiu Yang · DOI

Introduction

Large Language Models (LLMs) have seen a dramatic expansion in context window sizes, yet their ability to reason over ultra-long documents remains inconsistent. Performance often degrades as context length increases, a phenomenon known as the "lost-in-the-middle" problem.

Existing approaches like Retrieval-Augmented Generation (RAG) and Divide-and-Conquer Frameworks (DCF) attempt to mitigate this but face significant limitations. RAG often loses the logical flow by treating documents as isolated chunks, while DCF can lead to contradictions because chunks are processed without global awareness. ToM (Tree-oriented MapReduce) addresses these issues by mimicking human hierarchical reasoning.

Comparison of RAG, Divide-and-Conquer, and the ToM Framework.

The ToM Framework

ToM introduces a two-stage process: DocTree Construction and Recursive MapReduce Reasoning. This approach ensures that the model maintains a structured mental map of the document rather than treating it as a flat string of text.

1. DocTree Construction

Instead of flat chunking, ToM builds a structured hierarchy. It utilizes Hierarchical Semantic Parsing (HSP), employing a distilled 3B-parameter model to parse text into subtrees with summaries and keywords. These subtrees are then aggregated bottom-up, creating a "DocTree" where leaf nodes contain raw text and internal nodes represent increasingly abstract summaries of the sections below them.

2. Recursive MapReduce Reasoning

Once the tree is built, the model reasons from the bottom up:

  • Map Step: The LLM generates local "rationales" (logical steps) for each leaf node based on local information.
  • Reduce Step: At each parent node, the LLM takes the rationales from its children, resolves any conflicts (e.g., differing dates or facts), and synthesizes a consensus rationale.
  • Recursion: This process repeats up the tree until a final, globally consistent answer is produced at the root.
The ToM process: treating long context as a DocTree and performing recursive MapReduce.

Experimental Evaluation

ToM was evaluated on rigorous benchmarks including LongBench and InfiniteBench, the latter featuring contexts averaging 192,000 tokens. The researchers tested the framework across several 70B+ parameter models, including Qwen2.5, DeepSeek-V3, and GPT-4o.

Key Results

  • Superior Performance: On InfiniteBench (Inf.QA), GPT-4o paired with ToM achieved an F1 score of 41.17%, significantly outperforming RAG (26.03%) and standard DCF methods like LongAgent (38.00%).
  • High Accuracy: In multi-choice tasks (Inf.MC), ToM reached 85.0% accuracy, a substantial jump over the 65.0% achieved by RAG.
  • Model Versatility: The framework is model-agnostic; even reasoning-heavy models like DeepSeek-R1 saw gains, hitting a 63.33% F1 on 2WikiMQA when paired with ToM.

Discussion and Future Work

ToM demonstrates that the structural organization of information is as critical as the content itself for long-context reasoning. By forcing the LLM to acknowledge document hierarchy, ToM prevents the model from getting confused by non-adjacent but related segments.

While highly effective, the framework does introduce computational overhead during tree construction. Future work will focus on optimizing this latency and extending ToM to multimodal documents, such as PDFs containing complex charts and tables where hierarchical structure is even more vital.

Summary updated

BibTeX
@misc{guo2025tom,
  author = {Jiani Guo and Zuchao Li and Jie Wu and Qianren Wang and Yun Li and Lefei Zhang and Hai Zhao and Yujiu Yang},
  title = {{ToM: Leveraging Tree-oriented MapReduce for Long-Context Reasoning in Large Language Models}},
  year = {2025},
  eprint = {2511.00489},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2511.00489},
}
Figure