betaFeedback

WorksComputer Science

Structure-Exploiting Hierarchical Retrieval for Long Narrative Documents: A Precision-Oriented Alternative to Learned Abstraction Trees

Abstract

Retrieval-augmented generation over book-length documents must locate a small, coherent set of passages inside tens of thousands of tokens. Flat dense retrieval ignores document structure; RAPTOR instead builds a hierarchy by recursively clustering and summarizing with a language model. We study a complementary design that exploits the native structure of a document: a two-level retriever that (i) selects chapters with a hybrid BM25+dense match over chapter recaps, (ii) runs a chapter-filtered dense search, and (iii) expands top passages into contiguous, section-aware spans under a token budget, plus content-hash-gated delta ingestion to keep the index cheap to update. We evaluate on five public-domain books (113 chapter-localization queries) and on QuALITY and NovelQA (200K+ token novels). In-house, we find a seed-stable precision/ranking tradeoff: with section expansion off, hierarchical retrieval returns a higher fraction of chunks from the correct chapter (+3.3pp, Wilcoxon p=0.014); with expansion on, ranking improves (MRR, p=0.040). Accuracy differences are not significant. On QuALITY, hierarchical retrieval beats flat top-k (81.0% vs 70.4%, p=0.0019) and matches the full article (p=0.74). On NovelQA, hierarchical and flat retrieval are statistically tied (55.7% vs 56.8%, p=0.24); hierarchy helps aggregation questions while flat wins on localized facts. Against a faithful RAPTOR baseline we find a complementary tradeoff, not superiority. Delta ingestion reuses 94 to 99.7% of embeddings on incremental edits. We make no claim of semantic chapter-boundary inference and scope claims to English narrative prose.

Introduction

Answering a question against a full-length book is a retrieval problem before it is a generation problem. A modern large language model can read a passage and answer well, but a novel or treatise spans tens or hundreds of thousands of tokens — far more than fits comfortably (or cheaply) in a context window, and long enough that “stuff everything in” both wastes tokens and degrades answer quality as relevant evidence is buried among distractors [4]. The standard remedy is retrieval-augmented generation (RAG) [3]: embed the document as chunks, retrieve the top-kk by vector similarity [1], and condition the model on those chunks. But flat top-kk retrieval treats a structured book as an unordered bag of passages, discarding exactly the signal — chapters, sections, narrative order — that a human uses to find an answer fast.

Two broad strategies add structure back. The first, exemplified by RAPTOR [8], learns a hierarchy: it clusters chunk embeddings, summarizes each cluster with an LLM into a parent node, and recurses, producing a tree of increasingly abstract summaries that helps thematic and multi-hop questions. This is powerful and corpus-agnostic, but the hierarchy is manufactured from content and must be rebuilt (re-clustered, re-summarized) when the document changes. The second strategy — ours — observes that many valuable long documents (books, manuals, legal texts, standards) already carry an authored hierarchy, and that exploiting it directly is both cheaper and better matched to precise localization.

We present a structure-exploiting hierarchical retriever with three properties that distinguish it from learned-abstraction approaches:

  1. Native two-level hierarchy. We use the document’s own chapters as the coarse layer (matched via a hybrid BM25+dense query over compact chapter recaps) and its chunks as the fine layer, retrieved with a chapter-filtered dense search. There is no recursive re-summarization.

  1. Section-aware expansion. Rather than returning scattered top-kk chunks, we expand the highest-ranked passages into contiguous spans under a token budget, trading a knob between ranking quality and passage precision.

  1. Delta ingestion. Content-hash gating at chapter and chunk granularity re-embeds only changed text, so keeping the index current after edits costs a fraction of a full re-index.

Our contribution is as much methodological honesty as it is architecture. Long-document retrieval papers are easy to oversell; we therefore report results only on reproducible, deterministic indices, subject each significant effect to a recap-seed-stability test (LLM summaries are the one non-deterministic input), and retire earlier figures that a clean re-ingestion could not reproduce. The resulting claims are modest but solid:

  • On 113 in-house chapter-localization queries over five books, hierarchical retrieval yields a seed-stable, statistically significant precision gain (+3.3pp, p=0.014p=0.014, significant in 3/3 recap seeds) with section expansion off, and a suggestive ranking gain (MRR, p=0.040p=0.040, 2/3 seeds) with it on; accuracy is statistically tied (§ 5.3).

  • On the QuALITY benchmark, hierarchical retrieval significantly beats flat top-kk (81.0% vs 70.4%, p=0.0019p=0.0019) and matches full-article context (p=0.74p=0.74), i.e. recovers the long-context ceiling from far less text (§ 5.1).

  • On the harder NovelQA benchmark (>200>200K-token novels), hierarchical and flat retrieval are statistically tied (55.7% vs 56.8%, p=0.24p=0.24); a per-aspect analysis localizes where each helps (hierarchy on counting/interpretation, flat on localized facts), bounding the hierarchical advantage rather than overselling it (§ 5.2).

  • Against a faithful RAPTOR baseline on the same corpus and embeddings, the honest verdict is a complementary tradeoff: RAPTOR favors broad coverage, ours favors precise localization; under a fair per-node metric RAPTOR shows no significant accuracy edge over flat retrieval (§ 5.5).

  • Delta ingestion reuses 94–99.7% of embeddings on realistic edits (§ 5.6).

We are explicit about what we do not show: we make no semantic chapter-boundary-inference claim (a measured negative result, § 5.8), and we scope every empirical claim to English narrative and classical prose.

Related Work

Flat dense retrieval and RAG. Dense passage retrieval [1] and RAG [3] are the standard backbone: chunk, embed, retrieve top-kk by approximate nearest neighbor [5], generate. Lexical matching (BM25) [7] remains a strong complement, especially for rare or technical vocabulary, motivating our hybrid coarse stage. Flat retrieval is our primary baseline throughout.

Learned hierarchical retrieval (RAPTOR). RAPTOR [8] builds a bottom-up tree by soft-clustering leaf embeddings (GMMs over UMAP-reduced vectors), LLM-summarizing each cluster into a parent, and recursing; retrieval either collapses all nodes into one pool (its stronger reported mode) or traverses the tree. The abstraction layers help multi-hop and thematic questions on unstructured corpora. Our design differs on every axis (Table 1): the hierarchy is native rather than learned, two-level rather than arbitrary-depth, matched by a hybrid lexical+dense coarse filter, and maintained by delta ingestion rather than re-clustering. We run a direct head-to-head in § 5.5.

DimensionRAPTORThis work
Source of hierarchyLearned clusters (GMM/UMAP) over embeddingsDocument’s native chapters + recaps
Abstraction layersArbitrary depth, recursive LLM summariesFixed 2-level: chapter recap → chunk
Coarse matchingDense only (summary embeddings)Hybrid BM25 + dense on recaps
Retrieval flowCollapse all nodes, top-kkCoarse-to-fine gating + section expansion
Output shapeMixed leaf/summary nodesCoherent contiguous passages
Index updateRe-cluster + re-summarizeContent-hash delta ingestion (94–99.7% reuse)
Structure neededNoneNative structure (chapters/sections)

Table 1. Concrete design differences vs. RAPTOR. The head-to-head is in § 5.5.

Long-document QA benchmarks. NarrativeQA [2], QuALITY [6], and NovelQA [9] target comprehension over long documents. QuALITY (multiple-choice over ∼5K-token articles) is our external benchmark here; NovelQA (89 novels, >200K tokens) is the construct-appropriate benchmark for book-scale hierarchy; we evaluate on its 60 redistributable public-domain novels in § 5.2 (the 28 copyright-restricted novels have no downloadable text). Long-context language models are an orthogonal alternative to retrieval; we include a full-article “stuff everything” condition on QuALITY as a long-context ceiling.

Method

Three-stage hierarchical retrieval

Given a query qq and a book with chapters {C1,…,Cn}\{C_1,\ldots,C_n\}, each pre-chunked into passages with cached embeddings:

Stage 1 — hybrid chapter selection. We embed a compact recap of each chapter and retrieve chapters by merging (a) dense kNN between the query and recap embeddings and (b) a BM25 match of the query against recap text, deduplicated with kNN-first ordering. The number of chapters scales with book size, top_chapters =min⁡(max⁡(3,⌊n/8⌋),7)=\min(\max(3,\lfloor n/8\rfloor),7), so short books are not over-selected and long books retain enough coarse recall. The hybrid stage exists because purely dense recap matching misses rare technical/philosophical terms that BM25 catches.

Stage 2 — chapter-filtered dense search. Within the selected chapters we run dense kNN over chunks, using OpenSearch’s native kNN filter parameter (Lucene engine) so the chapter restriction is applied during the approximate search. This is not a cosmetic detail: wrapping the filter in a bool.filter around the kNN clause causes the engine to run global ANN first and post-filter, which with small kk routinely returns zero in-chapter neighbors (Appendix § 11).

Stage 3 — section-aware expansion. We keep the Stage-2 top chunks for breadth, then expand the highest-ranked sections into contiguous passages up to a 1500-token budget, deduplicating overlaps. Expansion is the knob that trades passage precision (expansion off: only the retrieved chunks, tightly on-chapter) against ranking quality (expansion on: coherent neighboring context that lifts MRR). Our experiments treat this knob as a first-class variable rather than fixing it.

Flat baseline. Standard kNN over all chunks in the book, top-5, same embeddings and index engine, is_latest filter only. This is the primary baseline in every experiment.

Delta ingestion

Every chapter and chunk is keyed by a SHA-256 content hash. On re-ingestion, unchanged hashes reuse their stored embeddings; only new or changed text is re-embedded and marked is_latest, and all retrieval filters gate on is_latest so a live index serves the current revision while preserving history. This makes incremental maintenance proportional to the edit size rather than the document size (§ 5.6).

Experimental Setup

Corpus. Five English public-domain books from Project Gutenberg, chosen to span narrative fiction, classical philosophy, and treatise prose (Table 2). Public-domain status makes the corpus, query set, and labels releasable.

IDTitleChaptersQueries
132The Art of War1321
1342Pride and Prejudice6123
1497The Republic1023
84Frankenstein2423
98A Tale of Two Cities4523
Total113

Table 2. Canonical evaluation corpus (Project Gutenberg, public domain). 113 queries.

Queries and labels. 113 queries (hand-crafted plus model-generated), each labeled with its ground-truth chapter. We are explicit that partly model-generated queries and labels are a threat to validity (§ 7); the QuALITY results (§ 5.1) use that benchmark’s independent gold labels as a check.

ConditionAccuracyDifficult subset
Full-article context (long-context ceiling)79.3%78.3%
Flat kNN top-570.4%68.7%
Hierarchical (pseudo-segmented)81.0%79.1%

Table 3. QuALITY answer accuracy, N=179N=179. Paired McNemar between conditions.

Embeddings and infrastructure. A 1024-dim commercial text embedding model (normalized) for all dense retrieval; sentence-level embeddings cached to disk. OpenSearch 2.11 (local, Lucene kNN engine). Chapter recaps for the LLM-recap condition are generated with a Claude model (temperature 0.2); this is the sole non-deterministic input and is stress-tested in § 5.4. Retrieval over built indices is deterministic — two independent runs are byte-identical — so reported significances are not sampling artifacts.

Metrics. Accuracy (binary correct-chapter hit), MRR, Recall@3, and Precision (fraction of returned chunks from the correct chapter). Significance uses exact-binomial McNemar for Accuracy/Recall@3 and Wilcoxon signed-rank for MRR/Precision, paired per query, with bootstrap 95% CIs (B=10000B=10000).

Reproducibility note. All headline numbers derive from a clean, from-scratch re-ingestion (live embeddings + recaps) with full per-query logging. Two historical figures (a 1.7×1.7 \times and a 1.25×1.25 \times precision ratio) came from an aggregate-only run whose per-query data and recaps no longer exist and which a clean re-ingestion did not reproduce; they are not used as claims anywhere in this paper.

Results

QuALITY: significant over flat, on par with full context

To move beyond the in-house set we ran QuALITY [6] as an end-to-end RAG-answer-accuracy evaluation on 20 dev articles (179 questions, 115 marked difficult), feeding three context conditions to the same answerer.

Hierarchical retrieval significantly beats flat top-kk (81.0% vs 70.4%, p=0.0019p=0.0019) and is statistically indistinguishable from full-article context (p=0.74p=0.74) — it recovers the long-context ceiling from a fraction of the text — while flat retrieval loses ∼\sim9pp relative to full context (p=0.029p=0.029). The efficiency is concrete: the Stage-3 budget caps the answerer’s context at 1500 tokens, roughly a quarter of a typical 5–7K-token QuALITY article, so hierarchical retrieval matches full-article accuracy while reading about 4×4 \times less text. This is a clean positive external-benchmark result. Scope caveat, stated plainly: QuALITY articles are short single articles (~5–7K tokens) with no native chapter structure, so the hierarchical arm is pseudo-segmented and the hierarchy is under-exercised relative to book-scale documents, and full context often fits the whole article, so the retrieval advantage is understated here relative to books. The construct-appropriate benchmark is NovelQA [9] (89 novels, >200>200K tokens), which we evaluate next (§ 5.2).

SystemSettingMultichoice
GPT-4-128Kfull novel in context71.8%
Claude 2.1-200Kfull novel in context66.8%
InternLM2-Chat-20bfull novel in context49.2%
InternLM2-Chat-7bfull novel in context43.5%
Flat kNN top-8retrieval (public-domain)56.8%
Hierarchicalretrieval (public-domain)55.7%

Table 4. NovelQA multichoice accuracy. Top: reference long-context LLMs from Wang et al. [9], which read the entire novel and include the copyright novels we cannot access — a band, not a controlled comparison. Bottom: our two retrieval conditions on the 60 public-domain novels (N=1,526N=1,526), same answerer.

NovelQA: on par with flat retrieval on 200K-token novels

The construct-appropriate test is NovelQA [9]: multiple-choice questions over full-length English novels averaging more than 200K tokens. We evaluate on the 60 public-domain novels whose text is redistributable (1,526 questions); the 28 copyright-restricted novels have no downloadable text and are necessarily absent from our run (the leaderboard scores them 0, and we exclude them from every comparison below). Each novel is ingested with our pipeline and answered by the same Claude answerer (temperature 0) under two retrieval conditions — hierarchical, and flat kNN top-8 — and scored on the official held-out leaderboard.

Two findings, both reported plainly. First, hierarchical and flat retrieval are statistically indistinguishable on NovelQA: 55.7% vs 56.8%, a paired McNemar test over the 183 discordant questions giving p=0.24p=0.24. This is a tie, not a win — and the opposite direction from the significant hierarchical advantage on QuALITY (§ 5.1). Second, a retriever that reads only a small fraction of each novel lands between the open-source and commercial full-context LLMs — above InternLM2-20b (49.2%) and below the frontier models that ingest the whole 200K-token book. We stress this is a reference band, not a head-to-head: different book set, full context vs retrieval, and a different answerer.

The aspect breakdown (Table 5) makes the tie interpretable. Hierarchical retrieval holds a small edge on aggregation questions — times (counting occurrences across the whole book) and meaning (interpreting a symbol or passage) — which reward broad, book-wide coverage via chapter recaps. Flat kNN wins on localized-fact questions — setting, span, character, relation — where one exact passage answers the question and routing through chapter summaries only dilutes precision. The two effects roughly cancel. We report these aspect-level deltas as descriptive: across seven aspects with no multiple-comparison correction, and with small samples for the rarer aspects, the individual differences are indicative of a direction rather than individually significant; only the overall tie (p=0.24p=0.24) is a tested claim.

AspectHierFlatΔ\Delta (pp)
times (counting)31.5%29.6%+1.9
meaning (interpretation)55.2%53.3%+1.9
plot78.8%79.1%−0.3
relation69.7%73.0%−3.3
character69.3%72.7%−3.4
span37.5%45.8%−8.3
setting75.7%84.2%−8.6

Table 5. NovelQA accuracy by question aspect, hierarchical vs flat (N=1,526N=1,526). Hierarchical edges flat on aggregation-style aspects; flat wins on localized-fact ones.

We read this as a boundary on the method, not a defeat: the hierarchical advantage demonstrated on QuALITY does not extend uniformly to 200K-token novels dominated by localized-fact questions, where both retrievers surface only a sliver of the text (the 1500-token Stage-3 budget is well under 1% of a >200K-token novel) and the answerer carries most of the load. It is consistent with our central framing — native structure helps precise localization and aggregation, not every question type — and it is why we report both external benchmarks rather than the flattering one alone.

In-house retrieval: a configuration-controlled tradeoff

Table 6 reports four retrieval configurations against the shared flat baseline on the clean re-ingested indices, all per-query-logged and significance-tested (replicated byte-identically across two runs). Exactly two effects clear p<0.05p<0.05 and both replicate exactly. Precision improves significantly when section expansion is off (26.4%→29.7%, +3.3pp, Wilcoxon p=0.014p=0.014): the retriever returns a higher fraction of chunks from the correct chapter. Ranking (MRR) improves significantly when expansion is on (0.622→0.677, Wilcoxon p=0.040p=0.040): expansion pulls in coherent neighboring passages that raise the rank of the correct chapter, at the cost of the precision edge. Accuracy and Recall@3 are not significant in any configuration (McNemar p≥0.63p \ge0.63), so the choice of configuration is a precision-vs-ranking decision, not an accuracy one. Capping top_chapters at 3 helps nothing and slightly hurts every metric — the precision lever is section expansion, not chapter count. Effect sizes are modest (∼1.13× precision, +0.055 MRR) and we report them as such.

ConfigurationAccMRRR@3Prec
Flat kNN (baseline)80.5%0.62274.3%26.4%
Hier., expansion ON (dyn. chapters)83.2%0.677*80.5%26.9%
Hier., expansion OFF (Stage-2 top-5)81.4%0.67380.5%29.7%*
Hier., fixed top_chapters=379.6%0.66478.8%28.0%
p-values vs. flat:
expansion ON0.6290.040*—0.733
expansion OFF1.0000.060—0.014*
top_chapters=31.0000.201—0.286

Table 6. Config ablation, N=113N=113. Flat baseline: Acc 80.5%, MRR 0.622, R@3 74.3%, Prec 26.4%. * marks p<0.05p<0.05 vs. flat (McNemar for Acc/R@3, Wilcoxon for MRR/Prec).

Recap-seed stability

Because LLM chapter recaps (temperature 0.2) drive Stage-1 selection and are the only non-deterministic input, we regenerated all 153 recaps two additional times (fresh calls; chunk index untouched) and re-ran the full significance ablation on each — three recap realizations in total.

Effectseed0seed1seed2Verdict
No-expansion Precision (pp)0.0140.00070.021stable — sig 3/3
Expansion-ON MRR (pp)0.0400.0140.060seed-sensitive — sig 2/3

Table 7. Seed stability of the two significant effects across three recap realizations.

ArmAccMRRR@3Prec
COVERAGE view
flat80.5%0.61171.7%26.4%
ours (default)84.1%0.65274.3%27.9%
ours (no-expand)81.4%0.64874.3%30.1%
RAPTOR94.7%0.75989.4%19.9%
DOMINANT view (fair)
flat80.5%0.61171.7%26.4%
ours (default)84.1%0.65274.3%27.9%
ours (no-expand)81.4%0.64874.3%30.1%
RAPTOR84.1%0.60369.0%20.2%

Table 8. RAPTOR head-to-head, N=113N=113. COVERAGE credits a summary node for every chapter it spans; DOMINANT credits it for one chapter (fair localization).

Only the no-expansion precision gain is robust to recap non-determinism (significant in all three seeds, max p=0.021p=0.021). The MRR-with-expansion effect fails significance in one seed (p=0.060p=0.060) and is therefore demoted to suggestive rather than a claim. Point-estimate accuracy varied 83.2–84.1% across seeds and was never significant. This directly answers the robustness question a reviewer raises about LLM-generated summaries, and it fixes the paper’s headline on precision. On multiplicity: the precision effect is the only claim we promote, and it survives a Bonferroni correction over the full family of ablation tests by a wide margin (per-seed pp down to 0.0007, all three seeds below a corrected threshold); the MRR effect does not survive correction and is reported as suggestive for exactly this reason, not as a headline claim.

Head-to-head vs. RAPTOR

We built a faithful RAPTOR tree over the same five books with the same embeddings: leaves are our chunks, soft-clustered with PCA→\toGMM (a documented substitute for UMAP→\toGMM, which RAPTOR uses only to make clustering tractable), LLM-summarized, and recursed into a collapsed-tree pool of 4,501 nodes (4,350 leaves + 141 level-1 + 10 level-2 summaries). We evaluate collapsed-tree RAPTOR (top-8) against flat and our two arms on the same 113 queries.

Interpretation requires care: a RAPTOR summary node covers many descendant chapters, so a naive “expected chapter ∈ covered set” (COVERAGE view) is nearly trivially satisfied, inflating RAPTOR’s coverage metrics and deflating its precision. We therefore also report a DOMINANT view in which each node is credited for its single main chapter (the mode of its covered set) — the fair per-node localization comparison.

Under the COVERAGE metric RAPTOR appears to dominate accuracy and recall — but that is an artifact of low-specificity abstraction nodes spanning most of the book. Under the fair DOMINANT metric the picture inverts: RAPTOR’s accuracy edge over flat is not significant (McNemar p=0.29p=0.29); our default arm’s MRR is significantly higher than RAPTOR’s (Wilcoxon p=0.044p=0.044); and our precision advantage over RAPTOR is large and significant in both views (p<0.001p<0.001). This precision gap is not an artifact of an unequal retrieval budget: RAPTOR is given a collapsed-tree top-8 pool whose nodes include multi-chapter summary nodes, so it reads at least as many tokens as our top-5 chunk arm — if anything a larger context, not a smaller one — yet returns a lower fraction of on-chapter passages. The comparison therefore does not understate RAPTOR by starving it of budget.

We therefore claim a complementary tradeoff, not superiority: RAPTOR suits broad coverage and multi-hop recall on unstructured corpora, while a structure-exploiting retriever suits precise, coherent localization on natively-structured documents. This is what the head-to-head licenses, and no more.

Delta-ingestion cost

We measured content-hash embedding reuse across all 21 available books under five revision scenarios (Table 9), pricing re-embedding at the embedding model’s list rate.

ScenarioEmbedding reuseNote
Add a paragraph94.4–99.6%localized insert
Rewrite one chapter87.1–99.7%one chapter changed
Typo fixes94.4–99.0%one sentence/chapter touched
Append a chapter94.2–98.8%new chapter appended
Full rewrite0.0%honest worst case — everything changes

Table 9. Embedding reuse under content-hash delta ingestion (21 books).

Realistic incremental edits reuse 95%+ of embeddings; the full-rewrite case correctly bottoms out at 0% (no reuse is possible), which is the honest boundary of the claim. Because RAPTOR-style trees must re-cluster and re-summarize on update, delta ingestion is a concrete maintenance-cost advantage of exploiting native structure.

Chunking-threshold calibration

Our semantic chunker grows a chunk while consecutive-sentence cosine similarity exceeds a threshold τ\tau. Sweeping τ\tau on the 8 cached books, intra-chunk coherence rises monotonically with τ\tau while chunk size collapses; the operating point τ≈0.15\tau\approx0.15–0.200.20 sits at the coherence/granularity knee (coherence 0.64–0.75 at ∼\sim90–230-word passages) and is consistent across books, supporting a single global τ\tau rather than per-book tuning. (We note that the originally hypothesized τ=0.7\tau= 0.7 is invalid: consecutive-sentence similarity is far lower than that.)

A measured negative: no chapter-boundary inference

We tested whether the sequential-agglomerative chunker’s boundaries recover the books’ author chapter boundaries (8 books, τ\tau sweep, ±5\pm5-sentence tolerance). They do not: best F1≈0.11F_1 \approx0.11, and at the retrieval operating point boundary precision is ≈0.01\approx0.01–0.030.03 because the chunker emits hundreds to thousands of sub-chapter passages. This is a granularity mismatch, not a broken component — the chunker is a passage segmenter, and the hierarchy consumes the document’s given chapter structure. We therefore make no semantic boundary-inference claim; chapter structure is an input, and the agglomerative step is coherence-driven passage chunking within chapters.

Discussion

The consistent thread across experiments is precision through structure. When the task is to localize an answer inside a structured document, exploiting the authored hierarchy returns tighter, more on-target passages than either flat retrieval (which ignores structure) or learned abstraction (which manufactures coarse structure that spans too much to localize). The QuALITY result sharpens this: even on short articles with only pseudo-structure, coarse-to-fine retrieval matches full-context accuracy while flat retrieval falls well short — evidence that the gain is about how evidence is selected, not merely how much. The RAPTOR comparison then clarifies the boundary of the claim: the two methods are complementary, and the fair-metric analysis guards against the easy over-claim that a coverage-inflated summary tree “wins.”

The section-expansion knob is the practical takeaway for practitioners: turn it off when downstream generation is sensitive to distractor passages (precision matters), turn it on when the answer benefits from contiguous context and ranking matters more than purity. Delta ingestion makes either choice cheap to keep current, which is the operational argument for structure-native hierarchies over ones that must be periodically rebuilt.

Limitations and Threats to Validity

  • Scope. All in-house results are on English narrative and classical prose. We make no empirical claim about legal, medical, educational, or non-English corpora; the method also assumes documents with exploitable native structure and would degenerate on flat text, where RAPTOR-style learned hierarchies are expected to win.

  • Query/label provenance. In-house queries and chapter labels are partly model-generated, which can bias the evaluation toward what the method does well. The QuALITY results use independent gold labels as a partial check.

  • Effect sizes. The robust in-house effect is modest (∼1.13×\sim1.13\times precision). We deliberately do not report the larger historical figures because a clean re-ingestion could not reproduce them.

  • Recap dependence. The coarse stage relies on chapter recaps; a poor recap is a single point of failure, whereas RAPTOR’s redundant soft clusters are more robust to a bad summary. The seed-stability test bounds, but does not eliminate, this risk.

  • Benchmark fit. QuALITY under-exercises a book-scale hierarchy; the construct-appropriate benchmark (NovelQA, § 5.2) is run only on the 60 public-domain novels, since the 28 copyright-restricted novels have no downloadable text.

Reproducibility

The corpus is public-domain Project Gutenberg, so the book IDs, query set, gold chapter labels, chunking/retrieval/significance code, and all hyperparameters (Appendix § 10) are releasable; the embedding/summarization plumbing is abstracted behind a generic embed(text)→vector / summarize(text)→str interface. Retrieval over built indices is deterministic (byte-identical across runs); the only non-deterministic input, LLM recaps, is stress-tested across three seeds (§ 5.4). Significance uses standard paired tests (McNemar; Wilcoxon signed-rank) with bootstrap CIs.

Conclusion

We presented a structure-exploiting hierarchical retriever for long narrative documents and evaluated it with an emphasis on reproducible, honestly-scoped claims. The robust findings are a seed-stable, significant passage-precision gain over flat retrieval controlled by a section-expansion knob; a significant win over flat retrieval on QuALITY that matches the full-context ceiling from a fraction of the text; a statistical tie with flat retrieval on the harder NovelQA benchmark, with a per-aspect breakdown that bounds where native hierarchy helps (aggregation) and where it does not (localized facts); a complementary (not superior) relationship to RAPTOR under a fair localization metric; and large maintenance savings from content-hash delta ingestion. We explicitly disclaim semantic chapter-boundary inference and non-narrative generalization. The natural next step is a book-scale long-context baseline.

Retrieval hyperparameters

  • Embeddings. A 1024-dim commercial text embedding model, normalized, input truncated to 8000 chars; sentence-level embeddings cached to disk.

  • Chunking. Sequential-agglomerative: grow a chunk while cosine⁡(centroid, next sentence)≥τ\operatorname{cosine}(\text{centroid},\ \text{next sentence}) \ge\tau and word count <1500< 1500; τ=0.15\tau=0.15. Bridge sentences flagged when a boundary sentence is ≥0.85τ\ge0.85\tau similar to both adjacent centroids.

  • Stage 1. top_chapters = min⁡(max⁡(3,⌊n/8⌋),7)\min(\max(3,\lfloor n/8\rfloor),7); kNN k=max⁡(3⋅top_chapters,10)k=\max(3\cdot\text{top\_chapters},10); merged with BM25 match on chapter recap, dedup preserving kNN-first order.

  • Stage 2. top_chunks = 8; kNN k=max⁡(5⋅top_chunks,25)k=\max(5\cdot\text{top\_chunks},25), filtered to selected chapters + is_latest.

  • Stage 3. Keep Stage-2 top-5 chunks; expand distinct sections in rank order up to a 1500-token budget; dedup by chunk_hash.

  • Flat baseline. kNN over all chunks, top-5, k=max⁡(5⋅5,25)k = \max(5 \cdot5, 25), is_latest filter only.

  • Delta ingestion. SHA-256 content hashing at chapter and chunk granularity; unchanged hashes reuse embeddings; changed content re-embedded and marked is_latest.

OpenSearch kNN + filter interaction

Placing a kNN clause inside bool.must alongside bool.filter causes OpenSearch to run approximate kNN globally first and then post-filter; with small kk the global top-kk neighbors are rarely inside the filtered subset, yielding zero results. The fix is the kNN-native filter parameter (Lucene engine), which applies the filter during the ANN search:

{"knn": {"embedding": {"vector": v, "k": 25, "filter": {"bool": {"must": [...]}}}}}

References

  1. [1]V. Karpukhin, B. Oğuz, S. Min, P. Lewis, L. Wu, S. Edunov, D. Chen, W. Yih. Dense Passage Retrieval for Open-Domain Question Answering. EMNLP, 2020.arxiv.org/abs/2004.04906
  2. [2]T. Kočiský, J. Schwarz, P. Blunsom, C. Dyer, K. M. Hermann, G. Melis, E. Grefenstette. The NarrativeQA Reading Comprehension Challenge. TACL, 2018.arxiv.org/abs/1712.07040
  3. [3]P. Lewis, E. Perez, A. Piktus, F. Petroni, et al. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. NeurIPS, 2020.arxiv.org/abs/2005.11401
  4. [4]N. F. Liu, K. Lin, J. Hewitt, A. Paranjape, M. Bevilacqua, F. Petroni, P. Liang. Lost in the Middle: How Language Models Use Long Contexts. TACL, 2023.arxiv.org/abs/2307.03172
  5. [5]Y. A. Malkov, D. A. Yashunin. Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World Graphs. IEEE TPAMI, 2018.DOI
  6. [6]R. Y. Pang, A. Parrish, N. Joshi, N. Nangia, J. Phang, et al. QuALITY: Question Answering with Long Input Texts, Yes! NAACL, 2022.arxiv.org/abs/2112.08608
  7. [7]S. Robertson, H. Zaragoza. The Probabilistic Relevance Framework: BM25 and Beyond. Foundations and Trends in Information Retrieval, 2009.
  8. [8]P. Sarthi, S. Abdullah, A. Tuli, S. Khanna, A. Goldie, C. D. Manning. RAPTOR: Recursive Abstractive Processing for Tree-Organized Retrieval. ICLR, 2024.arxiv.org/abs/2401.18059
  9. [9]C. Wang, R. Ning, B. Pan, T. Wu, Q. Guo, et al. NovelQA: Benchmarking Question Answering on Documents Exceeding 200K Tokens. arXiv:2403.12766, 2024.arxiv.org/abs/2403.12766

Paper details

vlnc:W_xmw7s7yp
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 7

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents