Grounded Synthesis, Safe Fallbacks, and Spot Checks
Understand how to enforce grounded synthesis by validating citations only against retrieved and budgeted chunks, preventing ungrounded answers. Learn to implement safe fallbacks that skip generation when retrieval returns insufficient data, thereby improving reliability and user trust in AI systems handling support tickets.
The retrieval step returns a ranked list of candidate documents or chunks. The token budget fitter from the previous chapter then removes items that exceed the available context budget. This creates two distinct sets:
What retrieval returned
What the model actually received after budgeting
Citation validation must compare against the second set. Validating against the first accepts citations to chunks that were retrieved and then dropped, which are exactly the citations most likely to be wrong, because the model never saw that text.
Labeling chunks so citing is easy
Retrieved text goes inside <retrieved_context> tags, for the same reason ticket text does: it is untrusted input, and a prompt injection sitting inside a stored document should not ...