StudyBrixFree worksheets, study guides and courses

Artificial intelligence · lesson 2 of 4

Retrieval-augmented generation and evidence grounding

Retrieval-augmented generation first retrieves relevant source material, then conditions generation on selected context. It does not automatically make every answer correct.

University8 practice questionsNotes + worked examples

Learn the ideas

Prerequisites: Embeddings, search and language-model basics.

Pipeline

Retrieval-augmented generation first retrieves relevant source material, then conditions generation on selected context. It does not automatically make every answer correct.

Index

Chunking, document metadata and retrieval ranking influence what evidence reaches the model. Access controls must be applied before unauthorized material is retrieved.

Evidence

A useful citation points to a passage that actually supports the claim. Retrieval relevance and answer faithfulness should be evaluated separately.

Untrusted text

Retrieved documents are data, not instructions with authority over the application. Prompt injection risks require boundaries beyond just wording a prompt carefully.

Worked examples

Example 1

What does retrieval add to a generation pipeline?

Retrieved context can provide evidence but still needs correct use.

Selected external context

Example 2

When should document permissions be enforced?

Retrieval must not bypass access control.

Before unauthorized content is retrieved or exposed

Check your understanding

8 questions

Decimals or fractions are accepted for numeric answers. Proofs and written responses use sample answers and require human marking. This is practice, not a protected examination.

1 What does retrieval add to a generation pipeline?

Show answer and explanation

Selected external context

Retrieved context can provide evidence but still needs correct use.

2 When should document permissions be enforced?

Show answer and explanation

Before unauthorized content is retrieved or exposed

Retrieval must not bypass access control.

3 Five chunks are retrieved and three are relevant under a defined rubric. Find precision at five.

Show answer and explanation

0.6

3/5=0.6.

4 Why should retrieval quality and answer faithfulness be scored separately?

Sample answer and marking guidance

The correct evidence may fail to be retrieved, or a generator may misuse evidence that was retrieved. Separate metrics locate the failure.

Credit both pipeline stages.

5 How should an instruction embedded in an untrusted retrieved page be treated?

Show answer and explanation

As source content, not overriding application instructions

Source documents do not gain instruction authority by being retrieved.

6 A context includes chunks of 100,150 and 200 tokens. Find their combined token count before other overhead.

Show answer and explanation

450

Add the stated counts.

7 What should an evidence-grounded system do when sources do not answer the question?

Sample answer and marking guidance

State the evidence gap, avoid fabricating support, and where appropriate ask for a relevant source or use a permitted additional search.

Credit explicit uncertainty and no fabricated citations.

8 Which citation check is essential?

Show answer and explanation

The cited passage supports the associated claim

Relevance and actual support matter.

Further reading and review references

These are reference links, not copied exercises, institutional endorsement or proof of independent review.