Skip to content
Retrieval & context · 4 of 4 · about 15 minutes · With a year

Check cited sources

A document assistant answers from retrieved documents and names its sources. But a model can cite a source id that looks right and was never retrieved, or does not exist at all: one kind of hallucination. A cheap first check catches this. Every id the answer cites must be among the ids that were retrieved for this request. Passing the check does not prove the source supports the claim; it only proves the source was retrieved.

About this lesson

Words to know

citation
A reference from an answer to the source document it is based on, usually by id.
grounding
Tying each claim in an answer to a source the model was given, so that the claim can be checked.
hallucination
Something a model states with confidence that is not in its sources or is not true, such as an invented source id.

Why it matters

The first portfolio project returns source ids with every answer. This check is its first line of defence. Grounding, which is checking that the source really supports the claim, comes after it.

With a year

How it works, a worked example, the exercise with its tests, three hints and the explained solution are in the app, with a year of Algo150 for $19. The first chapter, Model foundations, is free for everyone: start with Vector dot product.

What a year includes