Deep-Research Agents › Evidence extraction: exact quote boundaries
Language AI HandbookAll chapters Once a document is selected, the agent must isolate the specific passage that bears on the claim. This is harder than it sounds because there is a strong temptation to paraphrase the source into a crisp evidence sentence that matches what we want it to say. This is exactly the mechanism by which a citation can look correct and be wrong. The paraphrase is faithful in gist but omits the qualifier ("in three of five jurisdictions studied") that flips the claim's meaning. The paraphrase then gets quoted as if it were the source, and the qualifier is gone from every downstream artifact.
The right discipline is to keep evidence spans verbatim. An evidence span is a contiguous substring of a source document , identified by character offsets such that the substring of from (inclusive) to (exclusive) equals :
where:
- : the quoted evidence substring
- : the source document text
- : the start character offset of the span
- : the end character offset of the span (exclusive)
Every claim points into evidence, not to a paraphrase. The offset discipline gives us two useful checks:
- Existence: is the span actually present in at offsets ? This catches hallucinated quotes.
- Sufficiency: does entail the claim? This is a semantic check, done either by a separate verifier model or by a human reviewer.
Existence is an exact quote check against the chosen snapshot. Comparing local offsets alone cannot detect an edit outside the quote. The code below also compares a digest of the document body. A separate semantic review asks whether the quote, in context, supports the claim.
A third check appears at synthesis time: citation attribution. Given the final answer text and each claim's associated evidence span, does the paragraph actually use that evidence? An LLM can produce a paragraph that cites a span while discussing something else the span does not cover. This is harder to automate than existence and is often where a human-in-the-loop step (from the Human Approval and Control Boundaries chapter, arriving shortly) is warranted for high-stakes reports. The three checks form a rough hierarchy of cost. Existence checks the source digest, the character bounds, and the text at those bounds. Sufficiency needs a model or a person, and attribution needs reading the answer in context. Spending the expensive checks only where they matter is what keeps the pipeline affordable.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!