Hallucination in LLMs occur when a model generates text that is incorrect and not grounded in reality.Several factors contribute to hallucination:
- LLMs might be trained on datasets lacking the necesaary knowledge to answer specific questions
- These models often lack mechanisms to verify the factual accuracy of their outputs , leading to potentially convincing yet incorrect responses
- Hallucinations can also arise from this discrepancy because the primary aim of a language model is to learn a language's word distribution patterns , not to differentate between true and false statements
- Tuning the Text Generation parameters : Parameters such as temperature, frequency penalty, presence penalty and top-p significantly influence LLM output- a lower temperature value results in more predictable and reproducible results
- Leveraging External documents with Retrievers Architectures: .. LLM accuracy can be improved by incorporating domain-specific knowledge through external documents...LLM uses the top-ranked retrieved texts as contexts to provide the final response. This method makes the model less prone to hallucinations by guiding it to produce accurate and contextually appropriate responses
Constitutional AI is a framework developed by Anthropic researchers to align Ai systems with human values, focusing on making them beneficial, safe and trustworthy
Evaluating LLM Performance: Objective functions and evaluation metrics are critical components of machine learning models
- The cross-entropy is the commonly used objective function for LLMs. In casual anguage modeling, where the model predicts the subsequent token from a predetermined list
- Evaluation metrics are tools to measure the model's performance in terms that are understandable to humans.
- Intrinsic metrics which are directly related to the training objective--perplexity... first step... measure perplexity is calculating the probability of a sentence. This is done by multiplying the probabilities assigned to each word
Resource: