Beyond Traditional Fine-tuning: Exploring Advanced Techniques to Mitigate LLM Hallucinations 

<p>

Large language models (LLMs) have revolutionized text generation, but their tendency to produce factually incorrect and nonsensical outputs, known as "hallucinations," remains a major concern. Yesterday I read an info-packed paper named <b>"A Comprehensive Survey of Hallucination Mitigation Techniques in Large Language Models"</b>. I guess it has all the prominent methods used for Hallucination Mitigation. So let's unpack what it has.</p>
<h3>Hallucination</h3>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/63e243c2419922d5a6d7a8dd/liU9nFA37kaCnhQZVquZ4.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/63e243c2419922d5a6d7a8dd/liU9nFA37kaCnhQZVquZ4.png"/></a></p>
<p>Hallucination in LLMs refers to the models' tendency to generate text that appears factual but is entirely fabricated or not grounded in reality. Leading to decreased model accuracy, misleading insights, biased and contradictory outputs, unrealistic narratives, and many more. So in simple terms, Hallucination is when the LLMs try to fluke when they don't know the answer(just kidding😃😃)</p>
<h3>Technique for hallucination mitigation</h3>
<p>Researchers have proposed a diverse range of techniques to mitigate hallucinations in LLMs.Hallucination mitigation techniques are divided into two types: <u>Prompt Engineering and Developing Methods.</u>
Prompt Engineering is further divided into 2 parts RAG and Self Refinement through Feedback and Reasoning and Prompt Tuning.</p>
<p><b>Retrieval-Augmented Generation (RAG) </b></p>
<p><a href="https://cdn-uploads.huggingface.co/production/uploads/63e243c2419922d5a6d7a8dd/PWkGf9zOHvtyugfuLKuXJ.png" rel="nofollow"><img alt="image/png" src="https://cdn-uploads.huggingface.co/production/uploads/63e243c2419922d5a6d7a8dd/PWkGf9zOHvtyugfuLKuXJ.png"/></a></p>
<p>RAG, short for Retrieval-Augmented Generation, is a technique that combines retrieval-based and generative-based methods to improve the performance of LLMs.The retrieval module searches for the relevant information from the external source and the generation module uses the retrieved information to produce the response of the LLM.
Many techniques go under RAG. Some of them are:</p>
<ol>
<li><i>LLM Augumentor</i> - It modifies the internal parameter to adapt LLM to specific tasks by adding small modules to the LLM architecture and then fine-tuning for the target task.</li>
<li><i>FreshPrompt</i>- Retrieve external information relevant to the user query from the updated search engine and create an LLM response using that.</li>
<li><i>Knowledge Retrieval</i>- LM uses relevant knowledge from the external source and uses keyword search and embedding-based retrieval to find relevant information to produce the response.</li>
<li><i>Decompose and Query</i> framework breaks the user query into small questions and for each sub-question, its relevant response is generated by the LLMs.</li>
<li><i>High Entropy Word Spotting and Replacement technique</i> improves the creativity and diversity of the LLMs by identifying words with high entropy and replacing them using synonym search, random sampling or knowledge replacement.</li>
</ol>
<p><b>Self Refinement through Feedback and Reasoning</b></p>
<p>Self-refinement through Feedback and Reasoning is a novel approach for large language models (LLMs) to improve their outputs iteratively. It leverages feedback-based learning and reasoning abilities to achieve better factuality, consistency, and relevance in generated text.
There are many techniques used in Self-Refinement through Feedback and Reasoning such as <u> ChatProtect, Self Reflection Method, Structured Comparative Reasoning, Chain of Verification(CoVe), Chain of Natural Language Inference(CoNLI), etc.</u></p>
<p><b>Prompt Tuning</b></p>
<p>It is the practice of tailoring prompts to guide LLMs to get desired outputs. It avoids the need for extensive retraining, making it a powerful and efficient tool.</p>
<p><b> Developing Methods </b></p>
<p>Many developing methods can also be effective techniques used for mitigating the hallucinations of LLMs.Some of them are:</p>
<p>1.<u>Context-Aware Decoding (CAD)</u> It combats LLM hallucinations by integrating semantic context vectors into the decoding process. These vectors capture the meaning of the entire context not just a specific word(such as in the attention mechanism).CAD is particularly effective in overriding a model’s prior knowledge when it contradicts the provided context, leading to substantial improvements in tasks where knowledge conflict is possible.</p>
<p>2.<u>Decoding by Contrasting Layers (DoLa)</u>It is a simple decoding strategy designed to mitigate hallucinations in pre-trained LLMs without the need for external knowledge conditioning or additional finetuning. DoLa achieves the next-token distribution by contrasting logit differences between later and earlier layers projected into the vocabulary space. It enhances the identification of factual
knowledge and minimizes the generation of incorrect facts.</p>
<p>3.<u>Supervised fine-tuning (SFT)</u> It is a technique to adapt a pre-trained LLM to a target task using labeled data by fine-tuning the LLM parameters according to the target task. As only a subset of parameters are updated, therefore, SFT usually requires less computational power and training time compared to full fine-tuning.</p>
<p>The journey to harnessing the full potential of LLMs requires tackling the persistent issue of hallucinations. While traditional fine-tuning has its limitations, exciting new techniques like RAG, Self-Refinement, and Context-Aware Decoding offer promising solutions. As we delve deeper into these methods, questions arise:</p>
<p>Which techniques hold the most potential for specific research domains or tasks?
Can we combine these methods for even more robust hallucination mitigation?</p>
<p>These are just a few sparks to ignite the discussion. Share your thoughts, experiences, and questions in the comments below! Let's work together to build a future where LLMs are not just powerful, but also reliable and trustworthy partners in our endeavors.</p>
