Hallucinations in the tutorial #8247
-
Hi there, I was working through the tutorials and particularly enjoyed the
But the correct measurements should be:
I understand that this tutorial is intended to provide an overview of the general concept and utilizes a specific embedder along with a relatively small LLM. That said, this is a fairly simple task. My question is: What strategies can be employed to prevent such errors? Could there be some form of double-checking implemented? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello @feinmann and thank you for providing feedback on the tutorial! We could add a note to the tutorial about hallucinations @bilgeyucel @TuanaCelik # replace
pipe.add_component("retriever", InMemoryEmbeddingRetriever(document_store=document_store))
# with
pipe.add_component("retriever", InMemoryEmbeddingRetriever(document_store=document_store, top_k=3)) By default, 10 documents are added to the prompt but that many documents might be confusing for the LLM. If the top 3 and not relevant, the next step would be to improve the retriever or add an additional reranker. |
Beta Was this translation helpful? Give feedback.
Hello @feinmann and thank you for providing feedback on the tutorial! We could add a note to the tutorial about hallucinations @bilgeyucel @TuanaCelik
If I understand your example correctly, the retriever retrieved the correct documents and provided them in the prompt to the LLM but then the LLM hallucinated. A first countermeasure is a better model. As you already pointed out HuggingFaceH4/zephyr-7b-beta is a relatively small model and was chosen here for that reason. A second countermeasure I assume could help is to reduce the number of retrieved documents. For that you just need to change one line: