What if the retrieval goes wrong? 🐕
text
What if the retrieval goes wrong? 🐕
new_line
new_line
Retrieval Augmented Generation (RAG) is a strategy to alleviate LLM hallucinations and improve the quality of generated responses.
text
Retrieval Augmented Generation (RAG) is a strategy to alleviate LLM hallucinations and improve the quality of generated responses.
new_line
new_line
A standard RAG architecture has two main blocks: a Retriever and a Generator.
text
A standard RAG architecture has two main blocks: a Retriever and a Generator.
new_line
new_line
1️⃣ When the system receives an input sequence, it uses the Retriever to retrieve the top-K most relevant documents associated with the input sequence. These documents typically come from an external source (e.g., Wikipedia) and are then concatenated to the original input's context.
text
1️⃣ When the system receives an input sequence, it uses the Retriever to retrieve the top-K most relevant documents associated with the input sequence. These documents typically come from an external source (e.g., Wikipedia) and are then concatenated to the original input's context.
new_line
new_line
2️⃣ It then uses the Generator to generate a response given the gathered information in the first step.
text
2️⃣ It then uses the Generator to generate a response given the gathered information in the first step.
new_line
new_line
But what happens if the retrieval goes wrong and the retrieved documents are of very low quality?
text
But what happens if the retrieval goes wrong and the retrieved documents are of very low quality?
new_line
new_line
Well, in such cases, the generated response will probably be of low quality, too. 🫠
text
Well, in such cases, the generated response will probably be of low quality, too. 🫠
new_line
new_line
But here is where CRAG (Corrective RAG) *might* help. I say it might help because the paper is very new — only one week old, and I don't know if someone has actually tried this in practice 😅
text
But here is where CRAG (Corrective RAG) *might* help. I say it might help because the paper is very new — only one week old, and I don't know if someone has actually tried this in practice 😅
new_line
new_line
However, the idea is to add a Knowledge Correction block between the Retrieval and Generation steps to evaluate the retrieved documents and correct them if necessary.
text
However, the idea is to add a Knowledge Correction block between the Retrieval and Generation steps to evaluate the retrieved documents and correct them if necessary.
new_line
new_line
This step goes as follows:
text
This step goes as follows:
new_line
new_line
🟢 If the documents are correct, they will be refined into more precise knowledge strips and concatenated to the original context to generate a response.
text
🟢 If the documents are correct, they will be refined into more precise knowledge strips and concatenated to the original context to generate a response.
new_line
new_line
🔴 If the documents are incorrect, they will be discarded, and instead, the system searches the web for complementary knowledge. This external knowledge is then concatenated to the original context to generate a response.
text
🔴 If the documents are incorrect, they will be discarded, and instead, the system searches the web for complementary knowledge. This external knowledge is then concatenated to the original context to generate a response.
new_line
new_line
🟡 If the documents are ambiguous, a combination of the previous two resolutions is triggered.
text
🟡 If the documents are ambiguous, a combination of the previous two resolutions is triggered.
new_line
new_line
The experimental results from the paper show how the CRAG strategy outperforms traditional RAG approaches in both short and long-form text generation tasks.
text
The experimental results from the paper show how the CRAG strategy outperforms traditional RAG approaches in both short and long-form text generation tasks.
new_line
new_line
Paper: 
text
Paper: 
Corrective Retrieval Augmented Generation (2401.15884)
https://huggingface.co/papers/2401.15884
2401.15884
paper
resource
https://huggingface.co/papers/2401.15884
What if the retrieval goes wrong? 🐕

Retrieval Augmented Generation (RAG) is a strategy to alleviate LLM hallucinations and improve the quality of generated responses.

A standard RAG architecture has two main blocks: a Retriever and a Generator.

1️⃣ When the system receives an input sequence, it uses the Retriever to retrieve the top-K most relevant documents associated with the input sequence. These documents typically come from an external source (e.g., Wikipedia) and are then concatenated to the original input's context.

2️⃣ It then uses the Generator to generate a response given the gathered information in the first step.

But what happens if the retrieval goes wrong and the retrieved documents are of very low quality?

Well, in such cases, the generated response will probably be of low quality, too. 🫠

But here is where CRAG (Corrective RAG) *might* help. I say it might help because the paper is very new — only one week old, and I don't know if someone has actually tried this in practice 😅

However, the idea is to add a Knowledge Correction block between the Retrieval and Generation steps to evaluate the retrieved documents and correct them if necessary.

This step goes as follows:

🟢 If the documents are correct, they will be refined into more precise knowledge strips and concatenated to the original context to generate a response.

🔴 If the documents are incorrect, they will be discarded, and instead, the system searches the web for complementary knowledge. This external knowledge is then concatenated to the original context to generate a response.

🟡 If the documents are ambiguous, a combination of the previous two resolutions is triggered.

The experimental results from the paper show how the CRAG strategy outperforms traditional RAG approaches in both short and long-form text generation tasks.

Paper: https://huggingface.co/papers/2401.15884
👍
osanseviero samusenps NeuralNovel nickandbro abellion