When a question-answering system reads a long contract or manual, it usually retrieves a few passages and answers from them. It stops after a fixed number of passages or steps, whether or not the last passage it read says "except as provided in Section 9" or "subject to the conditions below." Chess programs hit this same failure fifty years ago and named it the horizon effect: a search that stops at a fixed depth confidently judges a position safe because the disaster sits one move past the cutoff. The chess fix was quiescence search. The program refuses to score a position while it is still "noisy," for example while a piece is hanging or a check is unanswered, and it keeps searching along forcing moves until things settle. We propose the same discipline for retrieval over structured documents. The system should not answer while its retrieved evidence is still volatile, and it should extend its search cheaply along the links most likely to overturn that evidence.
The opportunity is concrete. Contract models are good at spotting that a clause supports a hypothesis and bad at noticing that another clause overrides it. On ContractNLI, a strong span-based model reaches 88.5% accuracy but only about 0.36 F1 on the Contradiction class (ContractNLI), and about 30% of its evidence is discontinuous across distant clauses. Hierarchical retrieval systems keep a chunk attached to its parent headings. They do not look for the exception clause that lives under a different heading. That is a horizon problem, and we treat it as one.
Core Claim
Our claim is that, at the same average retrieval cost, a retriever that uses a variable-depth stopping rule answers more accurately than one with a fixed budget. It gains most on questions whose answer is flipped by an override outside the retrieved clause's own branch of the document tree. The stopping rule has two tests. The first is a quiescence test: the retrieved set is "quiet" only if the generator's answer does not change when the most volatile pending link is expanded. The second is a threat probe, which plays the role of chess's null move. The system searches the document for the strongest text that would contradict its current answer, and if such text scores highly, the position counts as non-quiet.
The new ingredient is the threat probe. Following explicit cross-references is an obvious heuristic, and a reviewer would rightly ask for it as a baseline. The probe is aimed at overrides that are not referenced from the clause they override, such as a "notwithstanding the foregoing" paragraph in a later section. Reference-following cannot reach those by construction.
Prior work motivates this without doing it. TreeRAG prefixes each chunk with its ancestor titles and walks up and down the tree, but only vertically, with a depth set by a binary intent classifier. PDFTriage lets an agent fetch sections and tables until a fixed step budget runs out. DOCHOPPER explicitly assumes the number of reasoning hops is known in advance and names dynamic stopping as an open problem. PAKTON keeps asking follow-up questions until a confidence threshold or turn limit is reached. HTSIR avoids the traversal problem by pooling every tree level into one candidate set for reranking, which gives up structure rather than searching it well. None of these systems conditions its stopping decision on whether the current evidence is stable.
Research Program
The method comes from Searching to Variable Depth in Computer Chess. That paper's MERLIN program combines three mechanisms: quiescence search, null-move threat detection, and fractional ply counting, in which forcing moves cost less than a full unit of depth. The older papers on the horizon effect set the constraint. Computer Game Playing and An Examination of Brute Force Intelligence show that a fixed-depth search does not merely miss threats. It chooses moves that push them past the cutoff. So we also look for the retrieval analogue of that stalling behaviour.
We work over a document tree built with an existing parser: PDF-to-Tree for PDFs, native HTML structure following HtmlRAG, or TreeRAG's LLM-derived tree. From each retrieved node, the frontier of pending expansions includes three kinds of step: moving to a parent or preamble, following an explicit reference, and taking a threat-probe hit. Each expansion $e$ has a cost $c(e) \in (0, 1]$. Following a parent preamble or an explicit reference is "forcing" and costs $c = 0.5$. A generic similarity hit costs $c = 1$. Search continues while
$$\sum_{e \in \text{expanded}} c(e) \le B \quad \text{or} \quad \text{the evidence set is non-quiet},$$
where $B$ is the nominal budget. There is also a hard cap of $2B$ so that cost stays bounded.
Volatility is measured behaviourally rather than by keyword. Let $a(E)$ be the generator's answer distribution given evidence set $E$. The set is quiet when
$$\max_{e \in F(E)} \mathrm{TV}\big(a(E),\, a(E \cup \{e\})\big) < \tau,$$
where $F(E)$ is the top few pending expansions ranked by a cheap volatility scorer and $\tau$ is a threshold tuned on development data. TV is total-variation distance, which here simply measures how much the answer shifts. The volatility scorer is a small classifier over surface cues such as "subject to," "except," "notwithstanding," and defined-term uses, trained from the cases where expansion flipped an answer. It only orders the frontier; the answer-flip test makes the decision.
The threat probe works as follows. The generator states its current answer, an LLM rewrites that answer as its negation or strongest exception, and the rewrite is used as a retrieval query over the whole document with BM25 and dense retrieval combined. The top hit is admitted to the frontier at cost 0.5 if it lies outside the current evidence's subtree. This is the step that crosses branches, which TreeRAG's vertical walk cannot do.
Finally, we define a horizon-sensitivity diagnostic. For any fixed-budget system, it is the fraction of questions whose answer changes between budget $k$ and $k+1$, plotted against $k$. A system suffering the horizon effect shows a flat, non-vanishing tail. A quiescent system should show near-zero sensitivity at its own stopping point.
Baselines
The naive reference point is flat chunked retrieval. It uses fixed-size chunks and dense top-$k$ retrieval with no structure, and it is run with the same generator. It tells us how much any structure buys.
The strongest structured competitor on contracts is PAKTON, which reports Recall@1 of 53.14% on ContractNLI (PAKTON). For contradiction detection specifically, the supervised reference is Span NLI BERT, with 88.5% accuracy and about 0.36 Contradiction F1 (ContractNLI). Our system beats this baseline if it improves Contradiction F1 without lowering overall accuracy. Span NLI BERT is supervised and our system is not, so we report both a zero-shot comparison and a comparison where our generator is fine-tuned on the same training split.
On Dragonball, the strongest competitor is TreeRAG, which reports 83.63% Top-10 recall on the finance subset against 29.02% for late chunking (TreeRAG). Dragonball questions are mostly local, so there the goal is to match TreeRAG while spending no more cost. A large gain is not expected.
Every structured baseline is run on the same parsed trees with the same generator LLM. Fairness is enforced by budget matching. Each fixed-budget baseline (TreeRAG traversal, a PDFTriage-style agent, reranked top-$k$) is re-run with its $k$ or step cap raised until its mean retrieved tokens and LLM calls equal ours. Beating a baseline therefore means higher accuracy at equal mean cost, which is the comparison MERLIN made against fixed-depth search. Each method gets the same development-set tuning budget of twenty configurations.
Two further baselines isolate the key ingredient. The first is deterministic reference-following: TreeRAG plus parsing and following every explicit "Section X" reference and every parent preamble. The second is our own system with the threat probe removed. The gap between the full system and these two is the claim.
Why not just…?
Why not just give a long-context model the whole document? On UDA's FinHybrid subset, GPT-4 with retrieval scored 45.9 while GPT-4 given the full document scored 0.4 (UDA). QASPER found that a 16k-token encoder-decoder with the full paper in context reached only 33.6 Answer F1 against 60.9 for humans. That evidence predates current models, though, so it is not decisive. We include a full-document condition with the same current generator. If it matches our system on the override-distance probes described below, the retrieval contribution disappears for documents that fit in context, and we will say so.
Why not just follow every explicit cross-reference and preamble? This is the real threat. On questions whose override is explicitly referenced, it should do about as well as our system at lower cost. We therefore split every evaluation into explicit-link and implicit-override questions. The proposal survives only if the threat probe wins on the implicit split. If it does not, our honest conclusion will be that reference-following plus quiescent stopping is sufficient, and that the probe is not worth its cost.
Why not just raise $k$ or the agent's step budget? A larger budget moves the horizon without removing it, and it spends cost uniformly on easy questions. The budget-matched comparison and the horizon-sensitivity curve test this directly. If a uniformly larger budget reaches our accuracy at our mean cost, variable depth adds nothing.
Why not just use HTSIR's collapsed pool? Pooling every tree level avoids routing errors, but the pool is ranked by similarity to the question, and an override clause is usually dissimilar to the question. We run it budget-matched. We expect it to fail on the implicit-override split for the same reason flat retrieval does.
Proposed Experiments
The main evaluation uses ContractNLI, with Contradiction F1, accuracy, and evidence Recall@1. It also uses CUAD with its AUPR metric, QASPER with Answer and Evidence F1, and Dragonball recall as a check that local-question performance is not harmed. Cost is reported as retrieved tokens and LLM calls per question.
The decisive experiment is a controlled override-distance probe. We take ContractNLI documents whose gold label is Entailment and insert a single overriding exception that flips the label to Contradiction. The insertion point varies in tree distance from the supporting clause: same paragraph, parent preamble, sibling section, or distant section. The exception is either explicitly referenced from the supporting clause or unreferenced. We then plot accuracy against distance for every system.
The prediction is falsifiable. Fixed-budget systems should fall sharply once the override leaves the supporting clause's ancestor chain. Reference-following should hold up only when the override is explicitly referenced. Our system should stay flat across distances. The horizon-sensitivity curves for every baseline, computed on the natural ContractNLI questions, test whether real contracts show the same pattern the probes do.
We also look directly for stalling. We count how often a budget-limited agent spends its final steps on low-volatility fetches while a high-volatility link stays pending on its frontier. This is the retrieval analogue of the "spite check" that pushes a loss past the horizon.
If our system does not beat budget-matched reference-following on the implicit-override split, the core claim is false.
References
- ContractNLI: A Dataset for Document-level Natural Language Inference for Contracts
- TreeRAG: Unleashing the Power of Hierarchical Storage for Enhanced Knowledge Retrieval in Long Documents
- PDFTriage: Question Answering over Long, Structured Documents
- Iterative Hierarchical Attention for Answering Complex Questions over Long Documents
- PAKTON: A Multi-Agent Framework for Question Answering in Long Legal Agreements
- Improving Long-Context Summarization with Multi-Granularity Retrieval Optimization
- Searching to Variable Depth in Computer Chess
- Computer Game Playing
- An Examination of Brute Force Intelligence
- PDF-to-Tree: Parsing PDF Text Blocks into a Tree
- HtmlRAG: HTML is Better Than Plain Text for Modeling Retrieved Knowledge in RAG Systems
- UDA: A Benchmark Suite for Retrieval Augmented Generation in Real-World Document Analysis
- A Dataset of Information-Seeking Questions and Answers Anchored in Research Papers