GO TO A SECTION

↑ ↓ to navigate · Enter to openExplore all sections →
FDEInterviews logo
ICLR 2024

RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval

Cluster a document's chunks, summarize each cluster, repeat to a root, and search every level at once: broad questions get summaries, narrow ones get chunks. Gains are modest.

Breakdown by FDE Interviews · 11 min read · Updated

About the original · 2024
AUTHORS
Sarthi, Abdullah, Tuli, Khanna, Goldie, Manning
FROM
Stanford University
PUBLISHED
Jan 2024 · ICLR 2024
CITED BY
800Semantic Scholar · Oct 2026
IN THIS BREAKDOWN · 10 SECTIONS

You can read 21% of this breakdown.

01

The paper in one minute

Retrieval-augmented generation usually splits documents into short chunks and retrieves the few most similar to the question. That works for "what year did X happen". It fails for "how did Cinderella reach her happy ending", where the answer is spread across the whole story and no chunk contains it. Parth Sarthi, Christopher Manning and colleagues at Stanford built RAPTOR (Recursive Abstractive Processing for Tree-Organized Retrieval) to retrieve at several levels of abstraction.

Building the tree. The document is cut into chunks of about 100 tokens (never splitting a sentence) and embedded with SBERT. The chunk embeddings are reduced with UMAP and clustered with a Gaussian mixture model; the number of clusters is chosen by the Bayesian information criterion, and a chunk may belong to more than one cluster. An LLM (gpt-3.5-turbo) summarizes each cluster. The summaries are embedded and clustered again, and the process repeats until clustering is no longer possible. The result is a tree: original chunks at the leaves, summaries of summaries toward the root.

Querying it. The paper tested two methods. Tree traversal starts at the root and descends, keeping the top-k nodes at each level. The collapsed tree puts every node from every layer into one pool, ranks them all by cosine similarity to the question, and adds nodes until a token budget (2,000 tokens, about 20 nodes) is filled. The collapsed tree did better and is used throughout. A broad question tends to match summaries; a detail question tends to match leaves.

On NarrativeQA (books and movie scripts), QASPER (NLP papers) and QuALITY (multiple choice over passages of about 5,000 tokens), RAPTOR beat retrieval without the tree with each of three retrievers, and with GPT-4 set new best results on QASPER and QuALITY.

THE IDEA, VISUALLY
BUILD THE TREE, BOTTOM UP c1 c2 c3 c4 c5 c6 c7 c8 summary c1 c2 c5 summary c3 c4 summary c5 c6 c7 summary c8 root summary of layer-1 summaries 100-token chunks, SBERT embeddings Each round: UMAP, then a Gaussian mixture (cluster count by BIC; a chunk can join several clusters), then gpt-3.5-turbo summarizes each cluster "with as many key details as possible". Average: 6.7 children, 131-token summaries. QUERY: COLLAPSED TREE Rank every node of every layer by cosine similarity to the question; add nodes until 2,000 tokens (about 20 nodes). Chosen over layer-by-layer traversal on 20 QASPER papers. Broad questions pull summaries; detail questions pull leaves. SAME RETRIEVER (SBERT), SAME READER (UNIFIEDQA) QuALITY acc flat 54.9 tree 56.6 NarrativeQA ROUGE-L flat 29.26 tree 30.87 QASPER F1 flat 36.23 tree 36.7 contiguous-chunk tree on QuALITY: 55.8 (Table 9) QASPER F1, GPT-4 READER (TABLE 3) BM25 50.2 DPR 53.0 RAPTOR 55.7 THE QUALITY HEADLINE, UNPACKED CoLISA, DeBERTaV3-large, test 62.3 RAPTOR + GPT-4, test 82.6 DPR + GPT-3, dev 60.4 RAPTOR + GPT-3, dev 62.4 The +20 points changes the reader, the retriever and the split at once. With the reader held at GPT-3, the tree added 2.0 over DPR.
RAPTOR clusters chunks, summarizes the clusters and repeats, then searches all levels together. With the retriever and reader held fixed, the tree added 0.5 to 1.7 points; the headline 20-point QuALITY jump compares GPT-4 with a much smaller model.
Research notes: the problem, approach and results
+0.5 to +1.7

gain from adding the tree to SBERT retrieval with the same UnifiedQA reader, across QuALITY, NarrativeQA and QASPER

82.6%

QuALITY test accuracy with GPT-4, against 62.3% for the previous best (CoLISA, DeBERTaV3-large)

≈1.23 M

summarizer input tokens per million document tokens to build the tree, computed from the paper's Appendix C averages

THE PROBLEM

Standard retrieval returns a few short contiguous chunks. Questions about a whole book or paper (what is the theme, how did the plot resolve) need information spread across the document, which no single chunk contains.

THE IDEA

Embed 100-token chunks, cluster them with Gaussian mixtures (soft membership, cluster count by BIC), summarize each cluster with an LLM, and repeat on the summaries until one layer remains. At query time, rank every node of every layer together and fill the context up to a token budget.

THE RESULT

With the same retriever and a UnifiedQA reader, the tree beat flat retrieval on all three datasets, by 0.5 to 4.4 points. With GPT-4, RAPTOR reached 55.7 F1 on QASPER (DPR 53.0) and 82.6% on QuALITY, against 62.3% for the previous best, a DeBERTa-based system.

02

Why it matters to an FDE

Customers ask summary questions of long documents: what are the main risks in this contract, what changed across these meeting notes, what is this report's conclusion. Flat chunk retrieval answers these badly, and RAPTOR's pattern is now common in RAG frameworks.

Match the question's altitude. Indexing summaries alongside chunks lets one search return a section-level summary for a broad question and a precise passage for a narrow one, without routing logic.

The gain depends on the question mix. With the same retriever and reader, the tree added 0.5 to 1.7 points on the paper's datasets. If the customer's questions are mostly factual lookups, expect little; if they are mostly thematic, test it.

Building costs LLM calls, once per document. About one summarization call per seven nodes, and summarizer input roughly 1.2 times the document's length. Updates to a document mean rebuilding its tree.

Summaries can hallucinate. The paper found minor hallucinations in 4% of sampled summaries. In regulated domains, keep citations pointing at leaves, not summaries.

THE FULL BREAKDOWN

Understand the mechanism. Try it on a real problem.

Unlock this breakdown and 99 more papers.

Premium opens every paper in full, plus every answer, concept, course and guide on the site. One payment for six months of access.

6 months · One payment · No auto-renewal

Get Premium · ₹2,000 / $25
  • ◇1 architecture diagram
  • </>1 runnable code experiment
  • ▦1 results table
  • ?5 interview questions with answers
  1. 03Key takeaways

    Construction details, retrieval choice, the controlled results and misreadings to avoid

    Free account
  2. 04How it works

    The clustering procedure, summarization, the two query methods and the evaluation setup

    Premium
  3. 05The numbers that matter

    Controlled gains, larger readers, best-system comparisons, the layer study and build cost

    Premium
  4. 06Try it yourself

    Tabulate the controlled gains, test the layer study, and estimate what building a tree costs

    Premium
  5. 07Where it breaks

    Small controlled gains, confounded headlines, tiny ablations, cost and staleness

    Premium
  6. 08Using it on a deployment

    Adding hierarchical summaries to a customer's retrieval index

    Premium
  7. 09Interview angles

    Five questions this paper prepares you for, with answer hints

    Premium
Back to the paper library →