Add citations to AI answers
Citations turn an unverifiable answer into a checkable one. Here is how to get a model to cite its sources, and to cite them honestly.
An answer without a source is something you have to trust. An answer with a source is something you can check. That difference is the entire value of citations: they convert a model's confident prose into a claim a reader can trace back to its origin. This guide is about getting a language model to cite the sources behind its answers, and — just as important — getting it to cite them honestly rather than inventing plausible-looking references.
Why citations are worth the effort
Citations do three jobs at once. They let a reader verify a claim instead of taking it on faith. They build trust, because a sourced answer signals that the system is grounded in real material rather than improvising. And they give you, the builder, a detection mechanism: a claim the model can't attribute to a source is exactly the kind of claim most likely to be fabricated. The act of citing forces a check that pure generation skips.
That last point is the one people underrate. Asking a model to cite isn't only a feature for the reader — it changes the model's behavior. When the instruction is "answer and cite the source for each claim," the model has to find support for what it says, and statements with no support become visible. Citations are a quality control built into the output format, not just a courtesy.
Provide sources the model can actually point to
A model can only cite honestly if there are real sources in front of it to cite. If you ask a model to answer from its training memory and add citations, it will produce citations — and a meaningful fraction of them will be invented, because it is generating plausible-looking references the same way it generates plausible-looking facts. The fix is structural: supply the source material in the prompt, and ask the model to cite from that material only.
Give each source a stable identifier the model can reference — a number, a short label, a title. Then the citation is a pointer into material you control, not a reach into the model's memory. When the answer says "according to source 2," you can look at source 2 and confirm. This is the foundation everything else rests on: citations are trustworthy only when they point at provided text, never when they point at recalled text.
Ask for the citation format explicitly
Models don't guess your preferred citation style; tell them. Decide what a citation should look like in your output — an inline marker after each claim, a numbered reference list at the end, a quoted snippet with its source label — and specify it precisely, ideally with one short example. Vague instructions like "include sources" produce inconsistent results: sometimes a list, sometimes inline, sometimes a vague gesture at "the document."
Match the format to how the answer will be used. For a UI where readers click through, inline markers tied to a reference list work well. For an answer that will be audited, a quoted snippet alongside each claim makes verification immediate. Whatever you choose, show the exact shape once and require the model to follow it for every claim. Consistency in citation format is what makes the citations usable downstream rather than decorative.
Tie each claim to its support, not the whole answer to a pile of links
A common weak pattern is a confident answer followed by a bibliography of every source that was provided, with no indication of which source supports which claim. That isn't really citation — it's a gesture. It tells the reader the answer is "based on these documents somewhere" without letting them check any specific statement. The whole point of a citation is the link between a particular claim and the particular text that backs it.
Ask for that granularity explicitly: each factual claim should carry its own citation pointing at the specific source that supports it. This is more work for the model and produces a more honest answer, because a claim that can't be tied to any source now has nowhere to hide. When every statement must name its support, the unsupported statements stand out — to the model as it writes, and to you as you read.
Handle the case where there is no support
Sometimes the provided sources don't contain the answer. If you don't plan for this, the model will paper over the gap with an uncited assertion or, worse, a fabricated citation that points at a source that doesn't actually say what's claimed. Instruct the model on what to do when support is missing: say that the sources do not contain the answer, rather than inventing one or citing something that doesn't back the claim.
This connects citation to honesty. A system that must cite every claim, and must admit when it can't, is one that can only say things it can support. The "no support" path is what keeps the citation requirement from quietly turning into a fabrication requirement — without it, a model determined to satisfy "cite every claim" may simply manufacture the citations it needs.
Verify the citations, don't just display them
A citation the model produces is a claim like any other, and it can be wrong: pointing at the right source for the wrong reason, or at a source that doesn't actually contain the cited fact. Showing citations to readers without checking them gives a false sense of rigor. The strongest systems verify, at least programmatically, that each cited source contains text supporting the claim it's attached to.
This is feasible precisely because you provided the sources and required granular citations. You can check that a cited source ID exists, that the quoted snippet appears in it, that the claim is plausibly supported by the cited passage. Citations that fail the check are flagged or stripped. The result is a pipeline where a citation means what it appears to mean, rather than a decoration that readers assume has been checked when it hasn't.
The takeaway
Citations are how an AI answer earns trust: they let claims be checked, signal grounding, and force the model to find support for what it says. To make them honest, give the model real sources to point at, specify the citation format exactly, and require each claim to carry its own support rather than gesturing at a pile of links. Plan for the case where there's no support so the requirement doesn't breed fabricated references, and verify the citations rather than displaying them on faith. Done this way, a citation stops being decoration and becomes what it should be — a thread the reader can pull to confirm the answer is real.
