Sub topic 10
Writing a grounded answer and attaching citations
This chapter covers the last stage of the pipeline: how an answer engine turns retrieved passages into a written answer with links. It assumes you know the retrieve-then-generate pipeline from earlier chapters, that you can read basic HTML and HTTP, and that you know what a large language model (LLM) does at a high level.
What "grounded" means
A grounded answer is one whose claims are meant to come from the passages placed in the model's context, not from what the model absorbed during training. Grounding is a goal of the prompt and the system design. It is not a guarantee about the output.
By the time generation starts, the earlier stages have finished. The engine has rewritten the question into search queries, retrieved candidate pages, ranked them, and extracted passages. The model now receives roughly three things:
- Instructions, such as "answer using only the sources below and cite them".
- The user's question, often with earlier conversation turns.
- A numbered set of source passages, each tied to a URL and usually a title.
The model writes the answer from this input. The exact prompts are private and differ between ChatGPT search, Perplexity, and Copilot, so treat the description here as the general pattern, not a specification of any one product.
How citations get attached
There are two common mechanisms. Products may use either or both.
- Inline markers written by the model. The prompt labels sources as [1], [2], and so on. The model writes those markers next to the sentences it believes they support. The engine then replaces each marker with a link or a footnote pointing to the matching URL.
- Structured citation output. The model returns the answer together with a structured list that says which span of text is supported by which source. The interface uses the list to place links.
In both cases the model chooses where citations go. Nothing in the process mechanically proves that a cited passage supports the sentence next to it. Some systems add a verification step that checks claims against sources, but you should not assume one exists.
Citation is not the same as retrieval
A page can be retrieved and still not cited. The engine may extract ten passages, and the model may use only three. The pages that were retrieved but unused count as "considered" and never show up in the answer. This is why a page can be crawled, indexed, and ranked well and still receive no visible citation for a given question.
Common ways grounding fails
Knowing the failure modes helps you read answers critically, and it explains some of the variability you will see when checking your own pages.
| Failure | What happens | Typical cause |
|---|---|---|
| Unsupported claim | A sentence carries a citation, but the source does not say it | The model blended its training knowledge with the passage |
| Misattributed claim | The fact is true and appears in the sources, but the marker points to the wrong one | Similar passages from several pages, with the marker placed loosely |
| Stale claim | The answer repeats an outdated figure | The retrieved passage came from an old index copy |
| Over-generalization | A narrow statement becomes a broad one | The passage was cut out of the context that limited it |
| Missing citation | A claim appears with no link | The model wrote from memory or paraphrased several sources at once |
Why your page's wording matters at this stage
The model sees only the extracted passage, not your whole page and not your layout. This has direct consequences for how you write.
- Self-contained sentences survive extraction. A sentence like "It expires after 90 days" is useless once cut from its paragraph, because "it" no longer has a referent. "An API key in this service expires after 90 days" still works alone.
- Explicit claims are easier to cite than implied ones. A model can attach a marker to a stated fact. It has a harder time attaching one to a conclusion the reader is expected to infer.
- Qualifiers should stay in the same sentence as the claim. If "only on the paid plan" sits two paragraphs away, the extracted passage may drop it, and the answer may state the claim without the limit.
- Dates and numbers need labels. "Updated June 2026" or "as of version 4.2" next to a figure lets both the model and the reader judge whether it is current.
Compare two passages about the same fact:
Weak:
After that, you'll need to do it again. This applies to most cases.
Stronger:
Rotate an API key every 90 days. This rule applies to all keys created
through the dashboard; keys created through the legacy CLI do not expire.The second passage names the action, the interval, the scope, and the exception in two sentences. If the engine extracts only these two sentences, the model still has enough to write a correct, citable statement.
Which source gets the link
When several retrieved passages say the same thing, the model usually cites one or two of them, not all. Several factors plausibly influence the choice, though engines do not publish the rules:
- Position in the prompt. Passages listed earlier may get used more often than later ones.
- Directness. A passage that states the answer in plain terms is easier to quote than one that requires summarizing.
- Specificity. A passage with a concrete number or step often beats a general overview.
- Source ordering from ranking. If the ranker placed your page first, it tends to enter the prompt earlier.
These are tendencies observed by practitioners, not documented behavior. Test them against your own pages before acting on them.
Variability between runs
Language models sample their output, so the same question can produce different wording and different citations on different runs. Retrieval can also vary, because query rewriting may produce different search queries, and because the index and ranking change over time. The result is that your page may be cited in one run and absent in the next.
For this reason, a single check tells you very little. If you want to know whether a page is cited, ask the question several times, on different days, and record how often the page appears. Report a rate, not a yes or no.
Reading citations in practice
When you inspect an answer from any engine, a short routine helps:
- Click each cited link and confirm it loads and is the page you expect.
- Find the specific sentence that supports the claim next to the marker.
- Check the page date against the claim, especially for prices, versions, and rules.
- Note any claims in the answer that have no marker.
- Repeat the question to see whether the same sources return.
Doing this on questions related to your own content shows you how the engine actually quotes you, including cases where it quotes you inaccurately. If it does, the usual fix is on your side: rewrite the passage so that the claim, its scope, and its qualifier sit together in plain sentences.
Summary of the working model
- Grounding means the model is given passages and told to rely on them. It reduces unsupported claims but does not remove them.
- Citations are placed by the model, either as inline markers or as structured output, and then mapped to URLs by the engine.
- Retrieval does not equal citation. Many retrieved pages are never used.
- Passages are read in isolation, so each important claim should be understandable alone.
- Results vary between runs, so measure rates over repeated checks.
Exercise
An answer from an answer engine states "Keys expire after 30 days" and attaches a citation to your page. Your page actually says "Keys created through the dashboard expire after 90 days; legacy keys do not expire." Name two failure modes from this chapter that could explain the result, and describe one change to your page that would reduce the chance of it happening again.
Show answer
Two plausible explanations are an unsupported claim (the model mixed in a figure from its training data or from another retrieved source and attached your citation anyway) and a stale or misattributed claim (the number came from a different page or an older copy, and the marker pointed to the wrong source). A page change is to state the claim, its scope, and its exception together in self-contained sentences, such as "An API key created through the dashboard expires after 90 days. Keys created through the legacy CLI do not expire," and to add a visible "last updated" date. You should also open the citation yourself and repeat the question several times, because a single wrong result may not recur.
Exercise
You want to know whether a page of yours is being cited for a particular question. Why is asking once not enough, and what would you record instead?
Show answer
Output wording, query rewriting, retrieval, and the index all vary between runs, so one answer may include or omit your page by chance. Ask the question multiple times across different days and record, for each run, whether your page was cited, which other sources were cited, and whether the claim attributed to you was accurate. Then report the citation rate (for example, cited in 6 of 10 runs) along with the accuracy of the quoted claim.