MSc Computer Science · University of Twente

Does Document Structure Still Pay?

A Controlled Benchmark for Repeated-Context Long-Document Question Answering

I measured four ways of answering questions about one long document — full-context prompting, Naive RAG, RAPTOR and GraphRAG — on the same documents, questions, answerer and cost model. The verdict: with long-context models, added document structure does not pay for fixed documents answering repeated questions.

Beau Jonkhout signing the MSc diploma after the defense, University of Twente, 28 August 2026
Thesis grade
9 / 10
GPA
8.2
Duration
Nominal
Defended
28 Aug 2026

The setting

The document never changes

Zoom in on one client. Their document does not change, and the questions keep coming. The thesis calls this the repeated-context setting, and it is the setting of everything that follows.

The obvious first build needs no cleverness at all: put the whole document, and the question, into the model's context window, like filling in a prompt template. The engine is a large language model, the technology behind GPT, Claude and Gemini. And it works: the reply streams straight out.

Whatever you build is judged on exactly two axes: the quality of the answers, and the cost of producing them. Every design here trades one against the other.

One fixed document, a stream of different questions, and two axes to be judged on.

Background

The workarounds outlived their reason

Not long ago that approach was simply impossible. A flagship context window held a fraction of this 282,039-token novel: the question fit, the book did not. So people worked around it, and put only the relevant parts into the window instead of the whole document.

Then the windows grew: to hundreds of thousands of tokens, and now to a million and more, some roughly two million. The whole novel sits inside. The founding reason was gone, but the workarounds did not disappear.

Context windows caught up with the length of one 282,039-token novel.

Background

Three letters, three steps

The workaround family got a name.

R, retrieval: find the few pieces of the document that matter for this question. A, augment: put those pieces next to the question, inside the model's context window — this is the prompt the model will read. G, generate: the model answers from what it was given, and only from that.

Retrieval, augmentation, generation: the three steps every RAG variant shares.

Background

Cut, condense, connect

There are dozens of published RAG variants, and each one cuts, condenses or connects the document differently. Following the grouping in the Gao et al. survey, they recur as three families: cut into chunks, condense into a summary tree, or connect into an entity graph.

The study benchmarks a widely used representative of each family.

Dozens of published variants recur as three families of document structuring.

The baseline

The worry about paying for every re-read

Back to the naive approach: the whole novel and the question, composed in one context window. In this study it is the baseline, and it has a name. Flat: full-context prompting, no structuring at all.

The worry is that every question re-reads the same unchanged text, and every re-read bills the full price. Then providers started caching. The first question still pays the full read, and that read fills the cache; from the second question on, re-read text is billed at a quarter of the fresh price.

One worry stays. The answer is a single line somewhere in that wall of text, and models can miss details buried in very long prompts.

Caching: the first question pays the full read, every later one a quarter of it.

The question

Three research questions

Back to the two axes from the start: whatever the company runs is judged on quality and on cost. Once the document fits, and re-reading is cheap, does structure still pay?

Three research questions make it precise. Which approach gives the best quality for the cost. Which structural features explain the differences. And does the one-time build pay off. That open question is, word for word, the title of the thesis, and everything from here on is the answer.

The question the thesis holds open, and the title it became.

Setup

Papers and novels

Two datasets. QASPER: 249 research papers carrying 955 questions, scored with Answer-F1. NovelQA: 55 full novels carrying 1,381 questions, scored as multiple-choice accuracy.

They differ where it matters: length. Papers run a few thousand tokens; novels reach ~770,000, and the average novel is 46 times the length of the average paper.

QASPER: 249 papers, 955 questions. NovelQA: 55 novels, 1,381 questions.

One example

One sentence, and the two phases

I brought the library's copy of Robinson Crusoe to the defense. On the benchmark side it is one NovelQA item: 282,039 tokens, answered by all four architectures. The answer is a single sentence, somewhere in those tokens.

Before the four pipelines, one frame to read them all with. Every method splits into the same two phases. Build time reads the document once and turns it into a reusable artifact: chunks, a summary tree, an entity graph, or, for the baseline, nothing at all. Query time consults that artifact instead of the raw novel, and the model answers from what it returns.

The split is also the shape of the bill: the build is paid once per document, the querying on every single question.

One NovelQA item of 282,039 tokens, and the build/query split every method shares.

The four pipelines

Four ways to answer the same question

All four architectures face that one Crusoe question. The meters below are the NovelQA averages, in thousandths of a dollar (m$): what each pays once to build a novel's artifact, and what it pays on every question after that.

Flat·No build. All 282,039 tokens go back into the window for every question: 7.62 m$ per question. Reads the sentence directly, correct on all 5 repeats.

Naive RAG·Chunk and embed the book once, 0.30 m$ per novel. Each question fetches its eight nearest chunks for 0.28 m$. Correct, at a fraction of the reading.

RAPTOR·A summary tree costs 121 m$ per novel, then 0.21 m$ per question, the cheapest read of the four. Answers “No, never” — wrong on all 5 repeats.

GraphRAG·The entity graph is the most expensive build in the study at 497 m$ per novel, then 0.61 m$ per question. Same wrong letter as RAPTOR.

The anecdote

Right, right, wrong, wrong

Flat and Naive RAG answer correctly; RAPTOR and GraphRAG agree on the same wrong option. Build once, then answer: the same meters, side by side, in thousandths of a dollar per novel and per question.

One anecdote proves nothing. The study measures the pattern: 2,336 questions, 5 repeats each.

The four architectures side by side: build cost, per-question cost, and answer.

Cost

Paid once, plus paid forever

Everything an architecture spends fits on one ruler: what it pays once per document to build, plus the small charge on every single question, forever. Input the model has already read bills at a quarter of the fresh price, and that discount is priced into every number here.

Now remember the setting. The document is fixed and the questions keep coming, so the build is a pie that every new question cuts into more slices. The slice only shrinks, it never reaches zero, and chunk and tree retrieval stay cheaper per question too; GraphRAG's per-question pipeline already costs more than Flat's cached re-read of a short paper. Whether a build ever fully pays for itself depends on how many questions a document really gets, and that is measured, not guessed.

One ruler per architecture: a one-time build per document plus a charge per question.

Setup

Only the architecture differs

One shared answerer, gemini-3.1-flash-lite-preview, at temperature 0. One scorer. Every question answered 5 times.

That is the whole setup. Behind every number that follows: 2,336 questions, each one answered 5 times by every architecture.

One answerer, one scorer, 5 repeats per question — the architecture is the only variable.

Results

The same ranking on both datasets

Each dataset's native metric, Answer-F1 on the papers and accuracy on the novels, with 95% document-clustered confidence intervals. The dashed line is the model with no document at all. On the novels that floor is high, because famous novels are partly memorized, but the ranking survives it: reading the book lifts Flat by +0.16 over the floor and GraphRAG by only +0.01. On the papers the floor sits at 0.16, far below every score.

Three claims. The order is the same on both datasets: Flat, then Naive RAG, then RAPTOR, then GraphRAG, with one statistical tie in the middle on each (Naive RAG and RAPTOR on the novels, RAPTOR and GraphRAG on the papers). Flat scores highest everywhere, significantly so except for its narrow lead over Naive RAG on the papers, which survives the confidence interval but not the multiple-comparison correction. And adding structure never improves quality.

NovelQA accuracy: Flat 0.757, Naive RAG 0.654, RAPTOR 0.646, GraphRAG 0.600.

Results

The frontier is two points

Each point is one architecture's quality against everything it spends on the whole dataset. The efficient frontier is two points: Flat for quality, Naive RAG for budget. The tree and the graph are dominated, because another architecture is better on one axis and no worse on the other.

Same picture on the novels, at wider margins. Dominated on both datasets.

Quality against total dataset cost. RAPTOR and GraphRAG sit inside the frontier.

Why

Whether the sentence survives

The whole Crusoe question hangs on one sentence of the novel: “I observed the tears run down his face”. Whoever keeps that wording can answer; whoever loses it cannot. So ask every architecture the same thing: does that sentence reach the window?

Flat·Cannot fail this test. It copies every line of the book into the window, so the sentence rides along.

Naive RAG·Passes for a different reason: it refills the window with the eight chunks whose wording sits closest to the question's crying and father, and the right chunk is among them.

RAPTOR·Answers from its tree: chunks along the bottom, LLM-written summaries above them. At query time it fills the window with three pieces, and the chunk holding the sentence is not one of them; a summary of that part of the book is.

GraphRAG·Packed nine text pieces here to RAPTOR's three and still missed the line: its community report is itself a summary, and its ranking follows entities and communities rather than the question's own words.

The gap widens with how fine a fact the question needs, and in the 63 questions shaped like this one.

In both cases the exact wording was gone before the model ever read the window.

In aggregate, that failure widens with how fine a fact the question needs. The gap from Flat to the worst architecture is 0.08 on plot questions, 0.16 on scene facts and 0.20 on fine-grained detail; QASPER, the short-document control, shows no such gradient, with a maximum gap of 0.105. And of the 63 questions of that same shape that Flat gets right, where the scene is in the book and “never” is an option, RAPTOR answers never 35 times, GraphRAG 37 times, and even plain chunk retrieval 24.

Results

When a build repays itself

A build is an up-front investment, repaid only if enough questions arrive per document. Papers ask about 4 questions each, and RAPTOR's build is repaid only past 9, so on the papers the investment never pays; GraphRAG never gets below Flat's line at all.

Novels ask about 25 questions each, and there the picture changes. RAPTOR's investment is repaid at about 16, inside what the dataset actually asks, but only on the standard price card: a deeper cache discount pushes the break-even to 28, above it. GraphRAG would need about 71 questions per novel before its build pays back.

Questions per document needed to break even: RAPTOR 9 and 16, GraphRAG 71.

Scope

What this does not settle

Four honest threats. One: another answerer might rank the four differently, since a single model family carried the study, and the pilot's rank-stability gate is a mitigation, not proof. Two: only papers and novels were tested, so beyond those two datasets the verdict is extrapolation.

Three: each architecture ran one fixed configuration, so the comparison is the claim, not the absolute levels. Four: the model partly knows famous novels by heart, and the closed-book control bounds that; the ranking is unaffected.

Inside that scope, the verdict holds. And every threat doubles as the next experiment.

Four threats to validity, and the follow-up experiment each one suggests.

The answer

Three answers

Best quality for the cost: the frontier is two points, Flat for quality and Naive RAG for budget. What explains the differences: whether the answer's wording survives into what the model reads. Does the build pay off: only RAPTOR, only on novels, only on the standard price card, and even a repaid build buys no quality.

One sentence carries the study. With long-context models, added document structure does not pay, for fixed documents answering repeated questions.

Three research questions, answered, and the sentence that carries the study.
Beau presenting the thesis defense at the University of Twente

The defense

From the defense

I defended on 28 August 2026 at the University of Twente, on a research question my own company needed answered. Nominal duration, a 9 for the thesis, and an outcome that was the opposite of what I hoped for.

My pilot study said structure wins. My main study, with better controls, refuted it. I withdrew my own finding and made the unexpected result the core of the thesis.

Thanks to Tiago Prince Sales, Patricia Ferreira da Silva and Mariet Theune, and to Geert Haisma, PrudAI's managing director, my internal supervisor there and a member of my graduation committee, which sums up the setup rather well.

Graduation committee

  • Tiago Prince SalesSupervisor
  • Patricia Ferreira da SilvaCommittee member
  • Mariet TheuneSecond examiner
  • Geert HaismaInternal supervisor (PrudAI), additional member

From the questions

“You opened with starting an AI company. Knowing everything you have researched now, would you still start one?”— Audience

100% yes. Getting high-quality answers to professionals is a hard question, and starting an AI company is a lot harder than this benchmark: it brings in effects you have to answer one by one before you have a reliable product. Maybe not the answer you hoped for, but the study did help put the vision in the right place.

“Your experiment shows they underperform flat context, and not only on cost. So what is the use case for RAG now?”— Tiago Prince Sales

The sharp observation from my thesis is that this is one setting, with the methods I tested. It does not say that RAG is a worse method in general, and there are still settings where it pays off. When the source simply does not fit in the window, retrieval is the fit rather than a way to save money.

“Are you still happy with the datasets you picked, or would you have changed them?”— Committee

It is a difficult choice, and looking back these two did carry the argument. There is one I would have liked to include from the start: NoCha. It is built from recent books, where you can be sure the model was not trained on them, so it isolates the memorization effect.

Beau at the University of Twente sign after the defense, 28 August 2026

Read it

Read the thesis

This page keeps to the story I told at the defense. The method, the cost accounting, the significance tests and every table are in the thesis itself: 39 pages, free to download.

Abstract

Modern long-context large language models (LLMs) can read an entire document in one prompt, and cache-aware serving makes re-reading an unchanged document far cheaper than reading it cold. This unsettles the premise behind retrieval and document-structuring methods—chunk-based RAG, tree-based summarization such as RAPTOR, and graph-based community summarization such as GraphRAG—which were built for small context windows, when fitting a long document into one prompt was impossible and selecting or summarizing the relevant parts was the only option. This thesis asks whether document structuring still pays once the model can read the whole document, in the repeated-context setting where many questions arrive over one fixed document. Its contribution is methodological: a controlled benchmark that evaluates four QA approaches—flat full-context prompting (with cache-aware serving), Naive RAG, RAPTOR, and GraphRAG—on the same documents, questions, answerer, and metrics. One cost-accounting rule prices each method's one-time preprocessing and its per-query answering together, so approaches whose costs fall at different points in the pipeline meet on one cost-quality plane. We instantiate the benchmark on QASPER and NovelQA across 2,336 questions, each answered five times by a single fixed answerer, with NovelQA scored against held-out gold answers and a closed-book control separating reading from memorization. The full run record and analysis code are released, and every reported number, table, and figure regenerates from them. The ranking is identical on both datasets. Flat full-context prompting reaches the highest answer quality: significantly so on the novels under a document-clustered bootstrap, which resamples whole documents, and narrowly over Naive RAG on the short papers. The cost-quality frontier collapses to two points—flat full-context prompting for quality, Naive RAG for budget—and the added tree and graph structure of RAPTOR and GraphRAG improves neither answer quality nor cost-quality position. With long-context models, added document structure does not pay in this setting.

Cite it

@mastersthesis{jonkhout2026structure,
  author  = {Jonkhout, Beau},
  title   = {Does Document Structure Still Pay? A Controlled Benchmark for Repeated-Context Long-Document Question Answering},
  school  = {University of Twente},
  year    = {2026},
  month   = aug,
  address = {Enschede, The Netherlands},
  url     = {https://jonkhout.ai/msc}
}