Quiescence Search for Reading Long Structured Documents

When a language model answers a question about a contract, it usually reads only a few retrieved passages. If the clause that overturns the answer ("notwithstanding the foregoing…", "except for entities under License A") sits one heading deeper or in a sibling section, the model never sees it and answers confidently and wrongly. Chess programs have a name for this failure. The horizon effect is what happens when a search cut off at a fixed depth misjudges a position because the decisive event lies just past the cutoff. Chess also has a well-tested remedy. Quiescence search keeps extending the search along "noisy" lines, such as pending captures, until the position is quiet, and only then trusts the evaluation. We propose to carry this remedy over to document question answering. The system treats a document's section tree as a search tree and reads it by iterative deepening: repeated passes with a growing budget, each pass ordered by what the previous one found. It stops only when the frontier is quiescent, meaning no read clause has an unresolved exception, condition, or cross-reference, and one more level of reading does not change the answer.

Put in two sentences: today's hierarchical retrievers decide ahead of time how deep into a document tree to look, so exceptions buried below that depth silently flip their answers. We make depth adaptive by deepening the read only along clauses that are still "open", and we stop when the answer has stopped moving. We also measure how often answers flip with extra depth, which gives a direct estimate of how much of current error is horizon error.

Core Claim

The main claim is that a large share of the failures on exception-heavy structured documents are horizon errors. These are wrong verdicts that would flip if the reader expanded one more structural level or followed one more reference. A stopping rule based on structural quiescence removes most of them at a retrieved-token cost comparable to fixed-depth hierarchical retrieval. The motivating evidence comes from ContractNLI, which builds document-level inference over NDAs against fixed hypotheses. It reports that "negation by exception" drives contradiction F1 to about 0.36, against about 0.85 for entailment. That asymmetry is what one expects if the defeating clause lies beyond the reader's horizon.

The contribution is not "iterative deepening over a document tree" in the abstract. The pieces nearest to that already exist. StyleDFS runs a single depth-first pass over a style-parsed manual at chunking time and copies parent headers into child chunks. TreeRAG builds a heading tree and traverses up or down, with the direction fixed by an initial intent classification. HTSIR collapses a three-level summary tree into one flat candidate pool because top-down traversal propagates errors. Stop-RAG learns a value function that decides when to stop retrieval, but over flat passage collections and counting sequential turns rather than structural depth.

What none of these does is make the stopping decision depend on whether the evidence read so far is closed. The new ingredient is a quiescence test that is defined on the document's structure and on the stability of the model's verdict. Selective extension is applied only to the nodes that fail that test.

Research Program

The substrate is a parsed section tree whose nodes are headings, clauses, and sub-clauses. For contracts we recover this tree from section numbering. For PDFs we use a table-of-contents parser such as PDF-to-Tree. Cross-reference edges ("subject to Section 14.3") are added wherever they can be resolved. We keep parser quality as a controlled variable, because PDFTriage shows downstream structure-aware QA collapses when the parser is wrong.

The reader works in passes $d = 0, 1, 2, \dots$ with a token budget $B_d = \gamma^d B_0$. Here $B_0$ is the first-pass budget and $\gamma$ the growth factor. We borrow geometric growth from Iterative Deepening Sampling, which expands a reasoning model's token budget by $\gamma = 2$ each time it fails to finish. We use it for a structural reason as well. The informativeness pathology of IDA* shows that iterations adding almost nothing to the frontier cause re-expansion blow-up.

Pass 0 reads headings and section summaries. It produces a provisional verdict and a relevance score for each section. Each later pass expands children of the highest-scoring open nodes, in the order set by the previous pass. This reuses the classic game-engine trick, analysed in Relative Efficiency of Alpha-Beta Implementations, of spending shallow iterations to order deeper ones. Following Depth-First Versus Best-First Search, re-reading shallow levels is cheap only when branching is large. Document trees are often narrow, so we cache shallow reads across passes and never re-send them. We report total retrieved tokens honestly rather than assuming the overhead is negligible.

A node is non-quiescent if it contains an unresolved reference, an exception or condition marker, or a scope-setting preamble whose governed items have not been read. These markers are detected by a small LLM tagger checked against a lexical detector. The frontier is quiescent when no read node is non-quiescent. We then add a stability requirement. Writing $v_d$ for the verdict after pass $d$, the reader stops at the first $d$ with

$$ \text{Q}(F_d) = 1 \quad\text{and}\quad v_d = v_{d+1}, $$

where $F_d$ is the set of read nodes and $\text{Q}$ is the quiescence indicator. The second condition costs one extra pass. The ablations test whether it is worth that cost.

Non-quiescent nodes are extended beyond the uniform depth: their children and reference targets are read even if the budget for that depth is exhausted. This mirrors quiescence search in chess, as studied by Harris, where noisy positions are extended while quiet ones are cut off. A hard cap on total tokens prevents runaway reading.

The analysis half of the program is a horizon curve for every reader: accuracy and verdict-flip rate as a function of structural depth read. We count an error as a horizon error if the reader's verdict at its own stopping point is wrong and becomes correct under full-tree reading. This decomposition is useful whether or not our method wins. It says how much of the contradiction-F1 gap in ContractNLI is about reach and how much is about reasoning.

Baselines

The naive reference point is flat chunk retrieval with a fixed top-k, the same LLM, and the same retrieved-token budget. This is the standard RAG setting that PAKTON compares against. PAKTON is a three-agent legal QA system with hierarchical parsing, hybrid retrieval, and an iterative "Interrogator". It reports ContractNLI evidence Recall@1 of 53.14%, which it describes as nearly five times standard RAG.

Four existing methods follow. PAKTON is the strongest existing competitor on our primary benchmark, because it is the only cited system with a reported ContractNLI number and it already iterates with an LLM. We re-run it with our backbone and cap its Interrogator at our token budget. Beating it means higher evidence Recall@1 than 53.14% under matched tokens, plus higher contradiction F1.

TreeRAG is the strongest hierarchical traversal method. It reports 83.63% Top-10 recall on Dragonball Finance against 29.02% for late chunking. It is the most direct test of whether adaptive depth beats intent-classified bidirectional traversal. No reported result was found on Lacuna for TreeRAG on ContractNLI or CUAD, so we will re-implement it. Beating it means matching its Dragonball recall while improving contradiction F1 on legal data.

HTSIR's collapsed-tree retrieval is the strongest argument against structured traversal. It reports 62.50% accuracy on QuALITY-HRAD with GPT-4o mini and NarrativeQA F1 37.4. We run it at equal reranker and token budget. No reported result was found on Lacuna for HTSIR on ContractNLI.

A Stop-RAG-style learned stopping controller is ported to our tree actions. It reports MuSiQue F1 of 47.0 against 44.8 for LLM-judged stopping. This baseline tells us whether a learned value function already captures quiescence without an explicit structural test.

For reference we also include the fully supervised Span NLI BERT from ContractNLI, which reports 88.5% NLI accuracy and evidence mAP 0.933. It reads the whole document with task-specific fine-tuning, so it is a ceiling from a different regime rather than a competitor.

All systems share the backbone LLM, the parsed tree, the embedding model, and a common token cap per question. They get the same development-set tuning budget of 20 configurations each.

The ablations isolate the key ingredient. Uniform iterative deepening without quiescence extension tests whether depth alone helps. Quiescence extension without verdict stability tests the stability check. Fixed-depth reading at each depth tests the horizon curve itself. Deepening with random rather than previous-pass ordering tests whether reusing move ordering matters.

Why not just…?

Why not just put the whole contract into a long-context model? This is a real threat on ContractNLI, because many NDAs fit in a modern context window. The evidence against it is dated. QuALITY found that long-input models such as Longformer and LED did worse than short-context retrieve-then-read pipelines, and HTSIR attributes retrieval gains to "lost in the middle" effects. Neither result settles the question for current models, so full-context reading is a baseline, not a strawman. We expect it to be competitive on short NDAs. The comparison that matters is on CUAD's 100-plus-page contracts, where CUAD notes that 99% of text is irrelevant, and on our controlled insertion set with padded documents. If full-context reading matches us there, the honest conclusion is that the structural horizon is a retrieval artifact that disappears with enough context, and our remaining contribution is cost.

Why not just attach ancestors and resolve "Section X" references by string matching? This is the most dangerous simple alternative, because many exceptions are explicit cross-references. TreeRAG's hierarchical prefixes and StyleDFS's parent retention already handle the upward direction. We will build exactly this system, with prefix anchoring plus regex reference resolution, and stratify every result into explicitly referenced and implicit exceptions. An example of an implicit exception is a "notwithstanding" clause in a sibling section that names no section number. If the simple system matches ours on both strata, we will report that the structural horizon effect is mostly a link-resolution problem and drop the search machinery. Our method is justified only if it wins on the implicit stratum.

Why not just let an agent keep asking follow-up questions until it is satisfied? Stop-RAG's comparison shows that LLM self-assessed stopping is worse than value-based stopping on MuSiQue (44.8 against 47.0 F1). MCTS-RAG, which searches over reasoning and retrieval actions with Monte Carlo tree search, reports early-error amplification and high latency. PAKTON's Interrogator is our instance of this alternative, run at matched budget. The Stop-RAG port tests the stronger version, learned stopping. If it matches the quiescence rule, we will report that the explicit structural test adds nothing beyond a learned value function.

Why not just collapse the tree and retrieve more candidates? HTSIR's collapsed pool avoids traversal error, and raising k is cheap. But PDFTriage's human preference results (50.7% structured navigation versus 22.1% chunk retrieval) and TreeRAG's 83.63% against 29.02% recall suggest similarity search does not track logical governance. The depth-controlled insertion experiment below tests this directly. In it the defeating exception is lexically dissimilar to the query, so it should be invisible to a collapsed pool at any reasonable k.

Proposed Experiments

The primary benchmark is ContractNLI. The metrics are NLI accuracy, contradiction F1 specifically, and evidence Recall@1, each plotted against mean retrieved tokens per question. CUAD, measured by AUPR and precision at 80% recall, supplies long contracts; its best reported model is DeBERTa-xlarge at 47.8% AUPR. Dragonball, measured by Top-10 recall and effective information rate, and the PDFTriage question set, with its structure-question category and token counts (1,568 against 3,600 to 3,900), test whether the method generalises beyond legal text without losing ground to TreeRAG. QuALITY-HRAD serves as a check that deepening does not hurt narrative text, where structure is weak.

The decisive experiment is a controlled horizon probe. We take ContractNLI and CUAD documents and insert an exception clause that flips the gold label. The clause is placed at controlled structural depth (sibling, child, grandchild) and at controlled distance from the governing rule, in both explicitly referenced and implicit form, and it is written to be lexically dissimilar to the hypothesis.

If horizon error is real and our stopping rule addresses it, three things should hold. Fixed-depth readers should show a sharp accuracy cliff exactly at their cutoff depth. The quiescence reader's curve should stay flat across depths. The gap should concentrate in the implicit stratum.

On natural data we report the horizon-error decomposition for every baseline. The decisive number is the share of each baseline's ContractNLI contradiction errors that flip to correct under full-tree reading, together with how much of that share our reader recovers at matched tokens.

The proposal fails cleanly in three cases. It fails if horizon errors are a small share of contradiction errors. It fails if the ancestor-plus-regex baseline recovers the same share. It fails if full-context reading on long CUAD contracts matches us at comparable cost. Each of these outcomes is informative about where the ContractNLI contradiction gap actually comes from.