The advent of sophisticated language generation technologies has revolutionized various domains, from automated customer service to advanced research aids. However, a significant challenge persists in the form of contextual hallucinations, where models generate text that is factually incorrect or contextually inappropriate. The novel approach of dynamically adjusting attention weights within the Llama model addresses this issue by enhancing the relevance and accuracy of the generated content. The methodology involved collecting a diverse dataset, fine-tuning the model, and implementing attention map modifications to steer the model's focus towards pertinent information, thereby reducing hallucinations. Empirical evaluations demonstrated substantial improvements in factual consistency, context relevance, and semantic coherence scores, validating the efficacy of the proposed modifications. Comparative analysis with baseline models further highlighted the superior performance of the modified Llama model, revealing its potential for reliable application in critical tasks. Insights gained from attention pattern analysis provided a deeper understanding of hallucination mechanisms, informing future strategies for model refinement. The study's implications extend to the broader field of language model reliability, offering a robust framework for enhancing text generation quality across various applications.