Skip to content

LearnGenerate & answer

Citation

Source attribution · Inline citation

A marker in a generated answer that points to the passage a claim came from, so a reader can open the source and check it.

In DocSlurpIllustrated explainer

On this page
Three checks for a citationFour claims from one answer, which was given sources 1 to 3, are checked three ways. "FY2027 revenue is projected at $48.2M [2]" resolves, is supported and is covered. "The CFO signs off the London budget [7]" fails to resolve because there is no source 7, so it is not covered. "Operating margin reaches 30% [1]" resolves, but source 1 projects 24%, so it is not supported or covered. "Revenue is up 31% year over year" has no marker, so it is not covered. One of four claims passes all three checks.CLAIMS IN THE ANSWERResolvespoints somewhere realSupportspassage says itCoveredclaim backed by a citeFY2027 revenue is projected at $48.2M [2]growth-plan-2027.pdf p.12 says exactly this✓✓✓The CFO signs off the London budget [7]only sources [1] to [3] were given✗–✗Operating margin reaches 30% [1][1] projects 24%, not 30%✓✗✗Revenue is up 31% year over yeartrue, but carries no marker––✗1 of 4 claims pass all three checks · two of the failures carry a marker
A citation is three claims, not one. The pointer must land on a real passage, that passage must say what the sentence says, and every claim needs one. Each pointer stops at its first failed check. Code can enforce the first check; the other two need a reader, an entailment model or an LLM judge.

The problem: a footnote nobody can follow

A chat answer ends with “[2]”. The reader clicks it and lands on page 1 of a 40-page PDF, or on a passage about something else, or on nothing at all because the answer cited a source that was never retrieved. Each of those is a broken citation, and each fails in a different way.

Citations are what make a generated answer checkable. Without them, a reader has to trust the model or redo the search. With them, every claim comes with a pointer: this sentence came from that passage. But a pointer is only useful if it holds up, and “holds up” means three separate things.

Three checks, not one

1. Does the pointer resolve? The marker must lead somewhere real: a source that was actually given to the model, and a location precise enough to find the passage. “growth-plan-2027.pdf” is weak. “growth-plan-2027.pdf, page 12, characters 210 to 268, with a highlight box” lets the reader land on the exact line. This is mechanical and can be enforced in code: drop or flag any [n] with no matching source.

2. Does the passage support the claim? The cited text must actually say what the sentence says. “FY2027 revenue is projected at $52M [2]” fails if passage 2 says $48.2M. This is a judgment about meaning, so it takes a person, an entailment model or an LLM-as-judge.

3. Is every claim covered? A sentence with a factual claim and no marker is unaccountable, however true it is. Coverage asks whether each claim in the answer has a supporting citation.

Run the three checks on four claims from one answer about FY2027 earnings, where the model received three sources:

Claim Resolves Supports Covered
“FY2027 revenue is projected at $48.2M [2]” yes yes yes
“The CFO signs off the London budget [7]” no: there is no source 7 n/a no
“Operating margin reaches 30% [1]” yes no: [1] projects 24% no
“Revenue is up 31% year over year” n/a n/a no: no marker

Only 1 of the 4 claims passes all three checks. Two of the failures look cited. That is the point of separating the checks: a system that only guarantees the first one, valid pointers, will still show readers confident markers on claims the sources don’t support.

The research literature measures the second and third checks as citation precision and citation recall. Precision asks what share of citations support their claim; recall asks what share of claims are fully supported by their citations. Counting the two markers that resolve, precision here is 1 of 2: [2] supports its claim and [1] doesn’t. Recall is 1 of 4 claims.

What a good citation points at

The more precise the locator, the cheaper the check. Useful locators by source type:

  • Page: page number, character offsets in the extracted text, and a box on the page image.
  • Slide: slide number, and whether the text came from the slide or the speaker notes.
  • Spreadsheet: sheet name and a cell range such as B7:D8.
  • Recording: start and end time, and whether the evidence was said (transcript) or shown (on screen).
  • Image: a region on the image.

Each locator only works if provenance was kept during ingestion. A chunk that lost its page number can’t be cited precisely later.

How systems produce citations

The common pattern: number the retrieved passages in the prompt, tell the model to cite claims with [n], then parse the markers out of the answer and join them back to the passages. The parser handles check 1. Some systems also map each marker to the sentence around it, so the interface can highlight the claim and its source side by side.

Prompt rules help with checks 2 and 3: “cite each claim, not each paragraph”, “a citation covers only what its passage says”, “don’t renumber sources”. They improve behavior; they don’t verify it.

Where it breaks

  • Plausible but wrong pairings. Models sometimes attach the nearest-looking source, especially when two passages use similar words. Identical sentences on different pages are not interchangeable citations.
  • One marker for many claims. A sentence that merges three facts with one citation at the end is usually only partly supported.
  • Over-citing. Marking every sentence with every source passes a lazy coverage check and makes the citations useless.
  • Post-hoc citation. Adding sources after writing an answer from memory produces markers that decorate rather than ground. Generate from the passages, don’t hunt for passages to fit an answer.

When to use them

Whenever a reader might act on the answer. Show citations inline, make each one open the exact location, and evaluate support and coverage offline on a sample, alongside faithfulness. Treat an answer’s citations as a claim the system makes about itself, and check that claim.

In DocSlurp

In DocSlurp

Chat answers cite with [n] markers. Each marker becomes an evidence span pairing its answer sentence with a source span, and markers that point past the citation list are dropped (buildProjectChatEvidenceSpans in core/server/src/services/project-chat.ts). Locators cover pages, slides, sheet ranges, media time ranges and image regions (core/packages/shared/src/citation-locator.ts). Support is not verified at runtime. See chat.

Sources

Jump to