Retrieval Augmented Generation

image

The Retriever

image
image
image
image
image

some of the snippets retrieved from the vector database are not always relevant or of good quality, e.g. the contents pages of a book

Solution?

Add another LLM of course!

Reranker

image

A common reranking model is the cross encoder:

image

We plug this reranking model into the rag pipeline...