You’ve probably interacted with AI models like ChatGPT, Claude, and Gemini for various tasks – answering questions, generating creative content, or assisting with research. But did you know these are examples of large language models (LLMs)? These powerful AI systems are trained on enormous text datasets, enabling them to understand and produce text that feels remarkably human.
If you asked about my understanding of large language models (LLMs), I’d say I’m just scratching the surface. So, to learn more about it, I have been reading a lot about LLMs lately to get more clarity on how they work and make our lives easier.
On this quest, I came across this research paper: Hallucination is Inevitable: An Innate Limitation of Large Language Models by Ziwei Xu, Sanjay Jain, and Mohan Kankanhalli.
This paper discusses Hallucinations in LLMs and says that despite countless efforts to address the issue, it’s impossible to eliminate them completely. These hallucinations occur when a seemingly reliable AI confidently delivers information that, although plausible-sounding, is entirely fabricated. This persistent flaw reveals a significant weakness in the technology behind today’s most advanced AI systems.
In this article, I will tell you everything about the research that formalizes the concept of hallucination in LLMs and delivers a sobering conclusion: hallucination is not just a glitch but an inherent feature of these models.
Large language models (LLMs) have significantly advanced artificial intelligence, particularly in natural language processing. However, they face the challenge of “hallucination,” where they generate plausible but incorrect or nonsensical information. This issue raises concerns about safety and ethics as LLMs are increasingly applied in various fields.
Research has identified multiple sources of hallucination, including data collection, training processes, and model inference. Various methods have been proposed to reduce hallucination, such as using factual-centered metrics, retrieval-based methods, and prompting models to reason or verify their outputs.
Despite these efforts, hallucination remains a largely empirical issue. The paper argues that hallucination is inevitable for any computable LLM, regardless of the model’s design or training. The study provides theoretical and empirical evidence to support this claim, offering insights into how LLMs should be designed and deployed in practice to minimize the impact of hallucination.
Hallucinations in language models can be classified based on outcomes or underlying processes. A common framework is the intrinsic-extrinsic dichotomy: Intrinsic hallucination occurs when the output contradicts the given input, while extrinsic hallucination involves outputs that the input information cannot verify. Huang et al. introduced “faithfulness hallucination,” focusing on inconsistencies in user instructions, context, and logic. Rawte et al. further divided hallucinations into “factual mirage” and “silver lining,” with each category containing intrinsic and extrinsic types.
Hallucinations typically stem from data, training, and inference issues. Data-related causes include poor quality, misinformation, bias, and outdated knowledge. Training-related causes involve architectural and strategic deficiencies, such as exposure bias from inconsistencies between training and inference. The attention mechanism in transformer models can also contribute to hallucination, especially over long sequences. Inference-stage factors like sampling randomness and softmax bottlenecks further exacerbate the issue.
Checkout DataHour: Reducing ChatGPT Hallucinations by 80%
Addressing hallucination involves tackling its root causes. Creating fact-focused datasets and using automatic data-cleaning techniques are crucial for data-related issues. Retrieval augmentation, which integrates external documents, can reduce knowledge gaps and decrease hallucinations. Prompting techniques, like Chain-of-Thought, have enhanced knowledge recall and reasoning. Architectural improvements, such as sharpening softmax functions and using factuality-enhanced training objectives, help mitigate hallucination during training. New decoding methods, like factual-nucleus sampling and Chain-of-Verification, aim to improve the factual accuracy of model outputs during inference.
Also Read: Top 7 Strategies to Mitigate Hallucinations in LLMs
An alphabet is a finite set of tokens, and a string is a sequence created by concatenating these tokens. This forms the basic building blocks for language models.
An LLM function can complete any finite-length input string within a finite time. It’s trained using a set of input-completion pairs, making it a general definition covering various language model types.
These are a subset of LLMs with specific properties (like total computability or polynomial-time complexity) that a computable algorithm P can prove. This definition helps categorize LLMs based on their provable characteristics.
The formal world is a set of all possible input-output pairs for a given ground truth function f. F (s) is the only correct completion for any input string s. This provides a framework for discussing correctness and hallucination.
Training samples are defined as input-output pairs derived from the formal world. They represent how the ground truth function f answers or completes input strings, forming the basis for training LLMs.
Hallucination is any instance where an LLM’s output differs from the ground truth function’s output for a given input. This definition simplifies the concept of hallucination to a measurable inconsistency between the LLM and the ground truth.
This is an iterative procedure where an LLM is repeatedly updated using training samples. The process continues until certain stopping criteria are met, resulting in a final trained model ready for deployment. This definition generalizes the training process across different types of LLMs and training methodologies.
To this point, the author established all the necessary concepts for further discussion: the nature of LLMs, the phenomenon of hallucination within a formal context, and a generalized training process that abstracts away the specific learning intricacies. The figure above illustrates the relationships between these definitions. It’s important to note that the definition applies not only to transformer-based LLMs but also to all computable LLMs and common learning frameworks. Additionally, LLMs trained using the method described in Definition 7 exhibit significantly greater power and flexibility than their real-world counterparts. Consequently, if hallucination is unavoidable for our LLMs in the relatively straightforward formal world, it is even more inevitable in the more complex real world.
The section progresses from specific to general, beginning with discussing simpler large language models (LLMs) that resemble real-world examples and then expanding to encompass any computable LLMs. Initially, it is shown that all LLMs within a countable set of P-provable LLMs will experience hallucinations on certain inputs (Theorem 1). Although the provability requirement limits LLMs’ complexity, it allows for exploring concrete instances where hallucination occurs. The analysis then removes the provability constraint, establishing that all LLMs in a computably enumerable set will hallucinate on infinitely many inputs (Theorem 2). Finally, hallucination is proven unavoidable for all computable LLMs (Theorem 3), addressing the key question posed in Definition 7.
The paper section argues that hallucination in large language models (LLMs) is inevitable due to fundamental limitations in computability. Using diagonalization and computability theory, the authors show that all LLMs, even those that are P-proved to be totally computable, will hallucinate when encountering certain problems. This is because some functions or tasks cannot be computed within polynomial time, causing LLMs to produce incorrect outputs (hallucinations).
Let’s look at some factors that make hallucination a fundamental and unavoidable aspect of LLMs:
If you design an LLM to output results in polynomial time, it will hallucinate on tasks that it cannot compute within that time frame. Examples of Hallucination-Prone Tasks:
If you design an LLM to output results in polynomial time, it will hallucinate on tasks that it cannot compute within that time frame.
The paper extends this argument to prove that any computable LLM, regardless of its design or training, will hallucinate on infinitely many inputs. This inevitability implies that no technique, including advanced prompt-based methods, can eliminate hallucinations in LLMs. Thus, hallucination is a fundamental and unavoidable aspect of LLMs in theoretical and real-world contexts.
Also read about KnowHalu: AI’s Biggest Flaw Hallucinations Finally Solved With KnowHalu!
This study investigates the ability of large language models (LLMs), specifically Llama 2 and GPT models, to list all possible strings of a fixed length using a specified alphabet. Despite their significant parameters and large context windows, the models struggled with seemingly simple tasks, particularly as the string length increased. The experiment found that these models consistently failed to generate complete and accurate lists aligning with theoretical predictions even with substantial resources. The study highlights the limitations of current LLMs in handling tasks that require precise and exhaustive output.
You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive. If you don’t know the answer to a question, please don’t share false information. However, if you know the answer, you should always share it in every detail and as requested. Always answer directly. Do not respond with a script or any approximation.
You can find the results in the research paper.
The section outlines existing and potential strategies for mitigating hallucinations in Large Language Models (LLMs). Key approaches include:
The practical implications of these strategies highlight the inevitability of hallucinations in LLMs and the necessity of guardrails, human oversight, and further research to ensure these models’ safe and ethical use.
The study concludes that eliminating hallucinations in LLMs is fundamentally impossible, as they are inevitable due to the limitations of computable functions. Existing mitigators can reduce hallucinations in specific contexts but cannot eliminate them. Therefore, rigorous safety studies and appropriate safeguards are essential for the responsible deployment of LLMs in real-world applications.
Let me know what you think about Hallucinations in LLMs – is it inevitable to fix this?
If you have any feedback or queries regarding the blog, comment below and explore our blog section for more articles like this.
Dive into the future of AI with GenAI Pinnacle. Empower your projects with cutting-edge capabilities, from training bespoke models to tackling real-world challenges like PII masking. Start Exploring.
Ans. Hallucination in LLMs occurs when the model generates information that seems plausible but is incorrect or nonsensical, deviating from the true or expected output.
Ans. Hallucinations are inevitable due to the fundamental limitations in computability and the complexity of tasks that LLMs attempt to perform. No matter how advanced, all LLMs will eventually produce incorrect outputs under certain conditions.
Ans. Hallucinations usually arise from issues during data collection, training, and inference. Factors include poor data quality, biases, outdated knowledge, and architectural limitations in the models.
Ans. Mitigation strategies include using larger models, improving training data, employing structured prompts, combining multiple models, and integrating external knowledge sources. However, these methods can only reduce hallucinations, not eliminate them entirely.
Ans. Since we cannot entirely avoid hallucinations, we must implement safety measures, human oversight, and continuous research to minimize their impact, ensuring the responsible use of LLMs in real-world applications.
Nice read.