Deep-Research Agents › Synthesis with enforced citations
Language AI HandbookAll chapters Synthesis is where the model writes prose. The critical requirement is that every factual claim carries a citation, and every citation refers to a real evidence span. A common failure mode is citation laundering. The model writes fluent prose and then sprinkles citation markers at sentence ends without actually mapping each claim to any specific evidence. The output looks cited, but the citations are decorative. This failure is common because it is easy for a language model. Citing is a token-level behavior that can be pattern-completed without any link to the underlying evidence.
There are two ways to enforce citation integrity during synthesis:
- Post-hoc verification. Let the model write freely, then run a verifier that parses the output, extracts each claim, matches it to evidence spans, and rejects the answer if any claim lacks support. Rejected answers are re-synthesized with stricter instruction, or a human is called in.
- Constrained decoding. Constrain the decoder (see Constrained Decoding: Structured LLM Output) to emit citation markers at structurally required positions. This is more complex and not typically necessary if the post-hoc path is robust.
For the demonstration, we start with a prepared list of atomic claims and audit the candidate evidence before rendering. It is simpler to reason about, simpler to audit, and it degrades more gracefully. Instead of enforcing an unnatural generation grammar, the prepared claims stand in for the draft. The verifier output becomes part of the trace, so any downstream reader can see which claims were accepted, which were discarded, and why. A rejected answer is not a wasted run; it is a trace artifact that tells the next attempt what not to say.
The example begins with a fixed list of claims. It locates candidate spans, checks their exact text and recorded document snapshot, then filters them against a hand-reviewed quote map before rendering. An application with arbitrary generated prose would also need to extract claims and verify their attribution.
Comments
Add to the conversation
A question, a correction, or an example from your own work.
No comments yet. Be the first to share your thoughts!