Sadeque, Farig YousufTaki, S.M. Abrar MustakimKar, ShowmickNiloy, Soumik DebRakib, Mazharul IslamBiswas, Abdullah Al Nahid2024-05-072024-05-07©20242024-01ID: 20301125ID: 20301177ID: 20301207ID: 20101408ID: 20301024http://hdl.handle.net/10361/22762Cataloged from PDF version of thesis.Includes bibliographical references (pages 78-83).This thesis is submitted in partial fulfillment of the requirements for the degree of Bachelor of Science in Computer Science, 2024.In recent years, Large Language Models(LLM) have shown excellent performance in a variety of Natural Language Processing tasks. However, they often produce hallucinated content. Contents that are seemingly correct and make sense linguistically, but are factually incorrect. Since researchers have started working on LLM hallucinations very recently, the problem of mitigating hallucination and understanding which factors play a role in correcting hallucinated content is relatively new. In this paper, we modified a multi-step pipeline called ’Chain of Verification’ that reduces hallucination in Large Language Models by itself without having to feed in external resources. This method is particularly useful for reasoning and reading comprehension types of language tasks. In addition, we extracted the decoder layers of an large language model Mistral 7B to interpret and analyze how the correction was done under the hood. A custom attention weight pruning method was used to prune the defective layers and after pruning, the LLM model passed 3/4 test cases to give proper and correct output results.84 pagesenBrac University theses are protected by copyright. They may be viewed from this source for any purpose, but reproduction or distribution in any format is prohibited without written permission.Mistral 7B AILarge language modelSelf attentionBlack-BoxNLPNeural networks (Computer science)Artificial intelligenceMitigation of hallucination and interpretations of self attention of Mistral 7B AI to analyze and visualize context understanding ability of large language modelsThesis