AI Hallucinations occur when LLM’s make up answers that are not factual. This mostly occurs when the model tries to be extra helpful by fabrication information when the model does not have a factual backing for the data presented. This also occurs when the model has not been trained on that topic.
Prompt engineering techniques focus on guiding models to produce truthful or factual data for any query. By refining these prompts, we can minimize the number of hallucinations produced by AI and increase the overall performance of the AI system. Some of the practices we can follow to reduce hallucinations ae listed below.,
1) Give clear and precise prompts avoiding ambiguity that may provide irrelevant output
2) Explicitly state the context with some additional background information
3) Break down the tasks into smaller manageable steps ensuring that AI models understand it easily
4) If need arises specify the output format required for the answer
5) Incorporate examples to get the desired output
6) Ask the model to differentiate between factual vs speculative answers
7) Ask the model to prove the references for the source of the information and prove its limits or in simpler terms ask the model to validate its own responses
8) Usage of domain specific terminology also helps to align responses reducing nonsensical information
When working with highly specialized domains, we can use some of the below mentioned methods to reduce hallucination.,
1) RAG – Retrieval Augmented Generation: This method combines the model’s capability to generate information with reliable information sources like knowledge bases.
Example: Who is called the “Father of the nation” in India? This will make the model look up information in the knowledge base before generating a response. Likewise, if any question is asked pertaining to a specific domain the model will investigate the relevant knowledge bases before responding
2) ReAct Prompting – Reasoning + Acting: This method is used reduce hallucination by incorporating a step-by-step reasoning and an external tool such as an API to ensure that the responses are grounded in factual data.
Example: In medical diagnosis, instead of asking for symptoms of a disease, we break down the question into smaller steps and narrow down to the specifics based on reliable medical data and then ask it to respond with prognosis
There are several other methods to reduce the impact of hallucination in generative AI but there is still a long way to go to build trustworthy intelligence as the knowledge bases are vast and susceptibility to nonfactual information which is a reality today.