Senior · Core path · 7 chapters
Citations and attribution
Span-level grounding, quote extraction, verifiable links, UI affordances
Broken attribution turns a retrieval defect into misplaced user trust, so citation correctness must be tested as part of the answer pipeline rather than treated as a UI detail.
Read these first
What you will know
Return answers with span-level citations that actually resolve
A document-level link cannot establish which passage supports a claim, especially when retrieved chunks contain several competing facts.
Show a citation pointing at text that does not support the claim
This adversarial case exposes systems that attach nearby or lexically similar evidence while leaving the claim ungrounded.
Build a UI where a citation can be checked in one click
Users should reach the quoted passage with enough surrounding context to detect truncation, stale content, or a misleading excerpt.
Measure whether users can verify cited claims without searching manually
A technically valid link still fails its purpose if reviewers cannot distinguish supporting evidence from adjacent context quickly.
Verify citations automatically rather than by sampling
Automated checks should catch missing spans, invalid offsets, inaccessible URLs, and claims whose extracted evidence fails a support test.
Chapters
- 1
A document link names a source; only a span names the evidence
Answering a pricing question with a link to the source document leaves the reader facing three tiers with different overage rates and no way to tell which number the sentence came from. This chapter draws the line between naming a document and asserting that this text supports this claim, then specifies the record that makes the second possible: chunk identity, character range, and the quoted text as it read at answer time.
- 2
A span exists only where the model quoted instead of paraphrasing
That record has to be produced, and the generator is what produces it: asked for evidence it will return a paraphrase unless the output format demands a verbatim quote per claim. You then match the quote back into the retrieved chunk to compute the character range, which drags in whitespace, unicode and hyphenation normalisation and a decision about how much fuzz a match may tolerate before it stops being the same text. Last comes the case with no clean answer — a claim synthesised from two sentences in different passages, where no single verbatim span exists — and the three ways out: emit two citations, narrow the claim, or decline to cite it.
- 3
Near-miss passages catch evidence attached to a claim it never entails
A system that attaches nearby or lexically similar text passes any test whose corpus contains only obviously right and obviously wrong passages. You will construct the adversarial cases that break it, seeding passages that echo the claim's wording while missing on scope or date, then asserting that the cited span entails the sentence hanging from it rather than merely resembling it.
- 4
One click to the highlighted span, with the paragraph around it
A citation that opens the source PDF at page 1 hands the verification work back to the reader, at roughly a minute per claim. Resolving it properly means deep-linking to page and offset, highlighting the quoted text, and rendering enough of the surrounding paragraph that a truncated quote or a stripped qualifying clause is visible without leaving the page. Covers what the answer pipeline must emit for the interface to do this.
- 5
A correct citation that costs a minute to check does not get checked
Citation accuracy at 0.94 alongside reviewers who re-read source documents by hand is a friction result, not an accuracy result, and pushing the number to 0.99 produces identical behaviour. Here you make the reviewers' problem visible on a dashboard: the share of claims confirmed without opening a search box or reading past the linked passage, and the time each check takes. Trust tracks cost per check, not verdict quality.
- 6
Sampling fifty answers a week cannot see eight percent offset drift
A reindex shifts chunk boundaries and 8% of stored spans now resolve a paragraph away: same document, same topic, nothing errors, and a range check still passes because the offsets remain in bounds. Weekly hand-checks would surface about four such answers, each plausible to a skimming reviewer. This chapter designs the automated checks and states what each asserts, including the comparison against the stored quote, names the uncited claim that never reaches a checker at all, and settles where the checks run — inline before the response returns, asynchronously behind it, or offline over a sample plus a full sweep after every reindex — and what production does when one fails: drop the citation, degrade to a document link, suppress the claim, or page someone.
- 7
Every citation correct, and the conclusion supported by none of them
A summarisation feature can carry a correct citation on every sentence and still reach a conclusion no cited span establishes. This chapter names that failure precisely, argues the strongest case for removing citations from the feature entirely, and weighs the obvious fix against its limits: entailment over a multi-sentence conclusion, with negation, quantities and evidence spread across passages, is exactly where those models are weakest.
External resources
- Enabling Large Language Models to Generate Text with Citations (ALCE)arxiv.org
Benchmark and definitions for citation precision and recall.
- Attribution and Citation: Sourcing LLM Outputs - Interactivembrenndoerfer.com
This is a substantive explainer that covers attribution mechanisms, citation accuracy metrics, practical challenges, and an NLI-based evaluation implementation rather than merely defining the topic.
- Citationsplatform.claude.com
API that returns span-level source references you can render directly.
- Citation extraction: tying RAG claims back to source spanszeroentropy.dev
This is a substantive explainer covering span-level attribution mechanics, post-hoc extraction architecture, structured offsets, evaluation metrics, and RAG pipeline placement, despite some unsupported performance claims and incomplete page content.
- Ask an AI about your documents and have them QUOTE it! Claude Citations | Unscripted CodingUnscripted Coding
Live demo of quote extraction and linking answers back to source spans.