passdrill
AI & LLM Engineering · RAG & Embeddings · Card 027/032 medium

A RAG system built on flat, similarity-ranked chunk retrieval answers narrow factual questions well but struggles with a question like 'what is the overall argument this document makes across all of its sections,' because no single chunk or small handful of chunks contains that overall picture. RAPTOR (Sarthi et al., 2024) was designed to address exactly this class of question. What does RAPTOR do differently from flat chunk retrieval?

  1. It fine-tunes the underlying language model directly on the document collection so broad questions can be answered from the model's own updated parameters instead of from any retrieval step
  2. It extracts named entities and their relationships from the corpus into a knowledge graph, then partitions that graph into communities and pre-generates a summary for each community
  3. It recursively embeds, clusters, and summarizes chunks from the bottom up, building a tree with multiple levels of summarization above the raw chunks, so a query can be answered from higher, more abstractive levels of the tree in addition to the original raw chunks, rather than being limited to whatever a single flat chunk happens to contain
  4. It increases the number of raw chunks retrieved for every query to the maximum the embedding model can accept in one batch, without adding any new structure above the chunks themselves
Next card → Shuffle