AI and Deep Learning

What are the most effective techniques for reducing AI hallucinations in RAG systems?

CH Asked by Christopher Hall · 12-11-2023
0 upvotes 9,886 views 0 comments
The question

Even with Retrieval-Augmented Generation, I'm seeing cases where the AI ignores the provided context and makes things up. What are the best strategies to force the model to stay grounded? Should I focus on the prompt engineering side or the vector database retrieval quality? 

3 answers

0
ME
Answered on 14-11-2024

You need to tackle this from both ends. First, improve your retrieval by using "Hybrid Search" (combining semantic vector search with keyword-based BM25). This ensures the most relevant documents are actually in the context. Second, use "Chain of Verification" (CoVe) in your prompts. Tell the model to first extract facts from the context, then verify them, and only then write the final answer. You can also add a system prompt instruction like: "Answer ONLY using the provided context. If the answer isn't there, say you do not know." 

0
R
Answered on 15-11-2024

Have you tried adjusting the "temperature" setting of your LLM to a lower value like 0.1 to make the output more deterministic? 

JO 16-11-2024

Lowering the temperature is a great quick fix, Richard! It reduces the randomness of the token selection. However, if the retrieved data is garbage, a low temperature will just produce "confidently incorrect" garbage. Quality of data is still king.

0
SU
Answered on 17-11-2024

Implementing a "Citation" requirement helps; ask the model to provide the specific source line for every claim it makes. 

ME 18-11-2024

I agree, Susan. This "attribution" method makes it much easier for the end-user to spot when the AI is hallucinating versus quoting the source.

Share your thoughts

Your email address will not be published. Required fields are marked (*)

Professional Counselling Session

Still have questions?
Schedule a free counselling session

Our experts are ready to help you with any questions about courses, admissions, or career paths. Get personalized guidance from industry professionals.

Request a Call Back

Search Online

We Accept

We Accept

Follow Us

"PMI®", "PMBOK®", "PMP®", "CAPM®" and "PMI-ACP®" are registered marks of the Project Management Institute, Inc. | "CSM", "CST" are Registered Trade Marks of The Scrum Alliance, USA. | COBIT® is a trademark of ISACA® registered in the United States and other countries.

World globe icon Country: Canada

Book Free Session