Detecting Hallucinated Citations Automatically
Bottom line: A citation is verifiable or it is noise. Check the identifier resolves, then check the retrieved span actually contains the claim. Both checks are cheap and catch ~90% of fabricated references before a human reads them.
Two checks, different jobs
- Existence — does the DOI/arXiv id/URL resolve to a real document?
- Support — does the cited span in that document entail the sentence citing it?
Fabricated citations almost always pass neither. Misattributed ones pass the first and fail the second.
Existence check
1 | import requests |
arxiv ids resolve against export.arxiv.org/api/query?id_list=. Cache results; identifiers do not change.
Real-world pass rates on model-generated reference lists run 55–75%. Roughly a third are pure invention — plausible author names, real journals, sequential volume numbers.
Support check
Retrieve the cited document, extract the paragraph around the matched string, ask a small model a yes/no question with the sentence and the span. Constrain the answer to yes/no/partial.
1 | prompt = (f"Sentence: {claim}\n\nSource: {span}\n\n" |
Treat no as fail, partial as needing human review. Score on a labelled set of 100 citations first — a 0.7 precision detector still saves reviewer time if it is ordered ahead of the queue.
Silent failure modes
- DOI prefix resolves to a landing page, not the article. Check the returned title against the cited title with fuzzy match ≥ 0.8.
- Retracted papers. Query the Retraction Watch API or Crossref
update-torelations. - Preprint cited as the published version. Compare venue string to actual container-title.
- Correct paper, wrong claim. Only the support check catches this one.
Wiring it in
Run both checks on every generated reference, store per-citation status, and only mark the document publishable when every citation resolves and none is no. Emit partial as a warning with the offending span, not a block.
What is not worth automating
Judging whether a supportable citation is relevant to the argument. That is editorial taste and a cheap heuristic will mislabel it. Keep the automated layer to existence and entailment, and leave relevance to the writer.
A reference list without an automated gate is a liability once you are generating more than a handful of documents a week — one invented DOI in a published piece costs more trust than the whole detector costs to build.
Designing the measurement
Label 100 generated citations by hand: valid, fabricated identifier, real-but-unsupporting, real-and-supporting. Run both detectors over the set and compute precision and recall separately. Existence checks catch fabrications; support checks catch misattribution. Neither catches the other’s class.
1 | for row in labelled: |
Ship when the existence check is above 0.95 precision. Below that, reviewers learn to ignore it.
Boundary conditions
Retrievals need the full text, and many publishers block automated fetch — an existence check that passes while the support check cannot fetch reports “verified” for an unread paper. Mark fetch failure as unchecked, never as pass.
Multi-source claims (three papers behind one sentence) need support from any one source, not all. Splitting the sentence per source is more accurate and more work; start with the coarse version and measure how often it misfires.
Failure triage
- High precision, low recall → resolver too strict, add mirror resolution
- Supported claims flagged → entailment prompt too long, split the span
- Everything flagged → the claim has no extracted span; extraction bug, not detection
- Detector passes an invented DOI → resolver hitting a soft-404 page; verify the title match too
Rollout
Start in shadow mode: run the detectors, publish anyway, log the results. Once precision is measured and stable, make no a hard block and partial a review queue. Different severities per document type — a technical post tolerates a bad citation better than a medical one.
FAQ
How do I check whether a DOI actually resolves to a real document?
Send a HEAD request to https://doi.org/{doi} with redirects disabled and a timeout, then treat status codes 301, 302, or 303 as a pass. Cache the results, since identifiers do not change. This existence check catches fabricated citations, which almost always fail it.
What’s the difference between an existence check and a support check?
The existence check asks whether the DOI, arXiv id, or URL resolves to a real document. The support check asks whether the cited span in that document actually entails the sentence citing it. Fabricated citations usually fail both; misattributed ones pass existence and fail support.
Why does a citation that resolves still turn out to be wrong?
Several silent failure modes pass the existence check. A DOI prefix can resolve to a landing page rather than the article, so compare the returned title against the cited title with fuzzy match ≥ 0.8. Retracted papers, preprints cited as published versions, and correct papers cited for the wrong claim also slip through unless you check.
What should I do when the support check returns “partial”?
Treat no as a fail and partial as needing human review. Emit partial as a warning with the offending span attached, not a block. Only mark a document publishable when every citation resolves and none is no.
What should I do when the full text can’t be fetched for the support check?
Mark fetch failure as unchecked, never as pass. Many publishers block automated fetch, so an existence check can pass while the support check cannot retrieve the paper — reporting “verified” for an unread paper.











