Large language models (LLMs) like GPT-4, PaLM, and Llama have unlocked remarkable advances in natural language generation capabilities. Nevertheless, a persistent challenge limiting their reliability and protected deployment is their tendency to hallucinate – generating content that seems coherent but is factually incorrect or ungrounded from the input context.
As LLMs proceed to grow more powerful and ubiquitous across real-world applications, addressing hallucinations becomes imperative. This text provides a comprehensive overview of the newest techniques researchers have introduced to detect, quantify, and mitigate hallucinations in LLMs.
Understanding Hallucination in LLMs
Hallucination refers to factual inaccuracies or fabrications generated by LLMs that will not be grounded in point of fact or the provided context. Some examples include:
- Inventing biographical details or events not evidenced in source material when generating text a couple of person.
- Providing faulty medical advice by confabulating drug side-effects or treatment procedures.
- Concocting non-existent data, studies or sources to support a claim.
This phenomenon arises because LLMs are trained on vast amounts of online text data. While this enables them to realize strong language modeling capabilities, it also means they learn to extrapolate information, make logical leaps, and fill in gaps in a fashion that seems convincing but could also be misleading or erroneous.
Some key aspects liable for hallucinations include:
- Pattern generalization – LLMs discover and extend patterns within the training data which can not generalize well.
- Outdated knowledge – Static pre-training prevents integration of latest information.
- Ambiguity – Vague prompts allow room for incorrect assumptions.
- Biases – Models perpetuate and amplify skewed perspectives.
- Insufficient grounding – Lack of comprehension and reasoning means models generating content they do not fully understand.
Addressing hallucinations is critical for trustworthy deployment in sensitive domains like medicine, law, finance and education where generating misinformation may lead to harm.
Taxonomy of Hallucination Mitigation Techniques
Researchers have introduced diverse techniques to combat hallucinations in LLMs, which might be categorized into:
1. Prompt Engineering
This involves rigorously crafting prompts to supply context and guide the LLM towards factual, grounded responses.
- Retrieval augmentation – Retrieving external evidence to ground content.
- Feedback loops – Iteratively providing feedback to refine responses.
- Prompt tuning – Adjusting prompts during fine-tuning for desired behaviors.
2. Model Development
Creating models inherently less liable to hallucinating via architectural changes.
- Decoding strategies – Generating text in ways in which increase faithfulness.
- Knowledge grounding – Incorporating external knowledge bases.
- Novel loss functions – Optimizing for faithfulness during training.
- Supervised fine-tuning – Using human-labeled data to boost factuality.
Next, we survey distinguished techniques under each approach.
Notable Hallucination Mitigation Techniques
Retrieval Augmented Generation
Retrieval augmented generation enhances LLMs by retrieving and conditioning text generation on external evidence documents, quite than relying solely on the model’s implicit knowledge. This grounds content in up-to-date, verifiable information, reducing hallucinations.
Distinguished techniques include:
- RAG – Uses a retriever module providing relevant passages for a seq2seq model to generate from. Each components are trained end-to-end.
- RARR – Employs LLMs to research unattributed claims in generated text and revise them to align with retrieved evidence.
- Knowledge Retrieval – Validates unsure generations using retrieved knowledge before producing text.
- LLM-Augmenter – Iteratively searches knowledge to construct evidence chains for LLM prompts.
Feedback and Reasoning
Leveraging iterative natural language feedback or self-reasoning allows LLMs to refine and improve their initial outputs, reducing hallucinations.
CoVe employs a series of verification technique. The LLM first drafts a response to the user’s query. It then generates potential verification inquiries to fact check its own response, based on its confidence in various statements made. For instance, for a response describing a brand new medical treatment, CoVe may generate questions like “What’s the efficacy rate of the treatment?”, “Has it received regulatory approval?”, “What are the potential unwanted side effects?”. Crucially, the LLM then tries to independently answer these verification questions without being biased by its initial response. If the answers to the verification questions contradict or cannot support statements made in the unique response, the system identifies those as likely hallucinations and refines the response before presenting it to the user.
DRESS focuses on tuning LLMs to align higher with human preferences through natural language feedback. The approach allows non-expert users to supply free-form critiques on model generations, comparable to “The unwanted side effects mentioned seem exaggerated” or refinement instructions like “Please also discuss cost effectiveness”. DRESS uses reinforcement learning to coach models to generate responses conditioned on such feedback that higher align with human preferences. This enhances interactability while reducing unrealistic or unsupported statements.
MixAlign deals with situations where users ask questions that do indirectly correspond to the evidence passages retrieved by the system. For instance, a user may ask “Will pollution worsen in China?” whereas retrieved passages discuss pollution trends globally. To avoid hallucinating with insufficient context, MixAlign explicitly clarifies with the user when unsure methods to relate their query to the retrieved information. This human-in-the-loop mechanism allows obtaining feedback to appropriately ground and contextualize evidence, stopping ungrounded responses.
The Self-Reflection technique trains LLMs to judge, provide feedback on, and iteratively refine their very own responses using a multi-task approach. As an example, given a response generated for a medical query, the model learns to attain its factual accuracy, discover any contradictory or unsupported statements, and edit those by retrieving relevant knowledge. By teaching LLMs this feedback loop of checking, critiquing and iteratively improving their very own outputs, the approach reduces blind hallucination.
Prompt Tuning
Prompt tuning allows adjusting the educational prompts provided to LLMs during fine-tuning for desired behaviors.
The SynTra method employs an artificial summarization task to reduce hallucination before transferring the model to real summarization datasets. The synthetic task provides input passages and asks models to summarize them through retrieval only, without abstraction. This trains models to rely completely on sourced content quite than hallucinating latest information during summarization. SynTra is shown to scale back hallucination issues when fine-tuned models are deployed heading in the right direction tasks.
UPRISE trains a universal prompt retriever that gives the optimal soft prompt for few-shot learning on unseen downstream tasks. By retrieving effective prompts tuned on a various set of tasks, the model learns to generalize and adapt to latest tasks where it lacks training examples. This enhances performance without requiring task-specific tuning.
Novel Model Architectures
FLEEK is a system focused on assisting human fact-checkers and validators. It routinely identifies potentially verifiable factual claims made in a given text. FLEEK transforms these check-worthy statements into queries, retrieves related evidence from knowledge bases, and provides this contextual information to human validators to effectively confirm document accuracy and revision needs.
The CAD decoding approach reduces hallucination in language generation through context-aware decoding. Specifically, CAD amplifies the differences between an LLM’s output distribution when conditioned on a context versus generated unconditionally. This discourages contradicting contextual evidence, steering the model towards grounded generations.
DoLA mitigates factual hallucinations by contrasting logits from different layers of transformer networks. Since factual knowledge tends to be localized in certain middle layers, amplifying signals from those factual layers through DoLA’s logit contrasting reduces incorrect factual generations.
The THAM framework introduces a regularization term during training to reduce the mutual information between inputs and hallucinated outputs. This helps increase the model’s reliance on given input context quite than untethered imagination, reducing blind hallucinations.
Knowledge Grounding
Grounding LLM generations in structured knowledge prevents unbridled speculation and fabrication.
The RHO model identifies entities in a conversational context and links them to a knowledge graph (KG). Related facts and relations about those entities are retrieved from the KG and fused into the context representation provided to the LLM. This data-enriched context steering reduces hallucinations in dialogue by keeping responses tied to grounded facts about mentioned entities/events.
HAR creates counterfactual training datasets containing model-generated hallucinations to raised teach grounding. Given a factual passage, models are prompted to introduce hallucinations or distortions generating an altered counterfactual version. Wonderful-tuning on this data forces models to raised ground content in the unique factual sources, reducing improvisation.
Supervised Wonderful-tuning
- Coach – Interactive framework which answers user queries but additionally asks for corrections to enhance.
- R-Tuning – Refusal-aware tuning refuses unsupported questions identified through training-data knowledge gaps.
- TWEAK – Decoding method that ranks generations based on how well hypotheses support input facts.
Challenges and Limitations
Despite promising progress, some key challenges remain in mitigating hallucinations:
- Techniques often trade off quality, coherence and creativity for veracity.
- Difficulty in rigorous evaluation beyond limited domains. Metrics don’t capture all nuances.
- Many methods are computationally expensive, requiring extensive retrieval or self-reasoning.
- Heavily rely upon training data quality and external knowledge sources.
- Hard to ensure generalizability across domains and modalities.
- Fundamental roots of hallucination like over-extrapolation remain unsolved.
Addressing these challenges likely requires a multilayered approach combining training data enhancements, model architecture improvements, fidelity-enhancing losses, and inference-time techniques.
The Road Ahead
Hallucination mitigation for LLMs stays an open research problem with lively progress. Some promising future directions include:
- Hybrid techniques: Mix complementary approaches like retrieval, knowledge grounding and feedback.
- Causality modeling: Enhance comprehension and reasoning.
- Online knowledge integration: Keep world knowledge updated.
- Formal verification: Provide mathematical guarantees on model behaviors.
- Interpretability: Construct transparency into mitigation techniques.
As LLMs proceed proliferating across high-stakes domains, developing robust solutions to curtail hallucinations shall be key to making sure their protected, ethical and reliable deployment. The techniques surveyed in this text provide an summary of the techniques proposed thus far, where more open research challenges remain. Overall there’s a positive trend towards enhancing model factuality, but continued progress necessitates addressing limitations and exploring latest directions like causality, verification, and hybrid methods. With diligent efforts from researchers across disciplines, the dream of powerful yet trustworthy LLMs might be translated into reality.