Grounded answers
Read · 1 of 2
Trust, but verify the citations
Label each retrieved chunk, like [2], and ask the model to cite the labels it used. Now a person (or your code) can check the answer against the source.
Then check mechanically: an answer with no citations, or citing a chunk you never gave it, is a red flag. Models do invent citations, and catching that is your job.
Read this lesson as text
Make the model cite its sources, then check every citation.
Trust, but verify the citations
Label each retrieved chunk, like [2], and ask the model to cite the labels it used. Now a person (or your code) can check the answer against the source.
Then check mechanically: an answer with no citations, or citing a chunk you never gave it, is a red flag. Models do invent citations, and catching that is your job.
Exercise: Check the citations
Line 1: the ids of the chunks you gave the model, like 1 2 5. Line 2: the model's answer, citing chunks as [n].
Print ok if the answer cites at least one chunk and every citation was given. Otherwise print no citations, or cites [n] which wasn't given for each bad one (in the order they appear, each once).