Hallucination Augmented Recitations for Language Models

Abdullatif Köksal, Renat Aksitov, Chung-Ching Chang

TL;DR

This paper introduces Hallucination Augmented Recitations (HAR), a novel method for generating counterfactual question-answering datasets by leveraging LLM hallucinations. These datasets significantly improve LLMs' text grounding and attribution capabilities, outperforming models trained on factual data, even with smaller datasets and models.

What Problem Does This Paper Address?

Large Language Models (LLMs) often struggle with "attribution" – the ability to trace their generated information back to its source. This is crucial for ensuring factuality and control over LLM outputs. While open-book question answering (QA) tasks aim to improve attribution by providing context, existing factual datasets can inadvertently reward LLMs for recalling information they already know from their pre-training data, rather than truly grounding their answers in the provided text. This creates a trade-off where models might prioritize memorization over attribution. The paper addresses this by proposing a way to create datasets that force attribution by presenting information that contradicts the model's internal knowledge.

Methods

The core of the paper is the Hallucination Augmented Recitations (HAR) pipeline. It works in three main steps:

  1. Recitation Generation: This step uses a "recitation-augmented language model" approach. LLMs are prompted to generate multiple document-answer pairs for a given question. The key here is that the LLM is encouraged to "hallucinate" or generate plausible-sounding but incorrect information.
  2. Factuality Filtering: This crucial step filters out generated examples where the answer is actually factual, even if it's presented counterfactually. This is done using another LLM to compare the generated answer with the gold answer, looking for true contradictions rather than just surface-level differences (like synonyms).
  3. Attribution Filtering: This final step ensures that the generated answer is indeed grounded in the generated document. LLMs are used again to assess whether the answer can be reasonably inferred only from the provided text, removing examples where the answer is not supported by the document.

The output is a counterfactual open-book QA dataset.

Datasets

The primary dataset introduced and used in this paper is CF-TriviaQA. It's a counterfactual version of the TriviaQA dataset, generated using the HAR pipeline. The authors created approximately 19,327 examples for CF-TriviaQA.

For evaluation, the authors used various open-book QA datasets, including:

  • SQuAD
  • Natural Questions (NQ)
  • HotpotQA
  • BioASQ
  • AmbigQA
  • Adversarial QA (AQA)

Key Insights and Ideas

  • Hallucination as a Tool: The paper cleverly repurposes LLM "hallucinations" – a known problem – as a constructive tool to create challenging counterfactual data.
  • Counterfactuals Force Attribution: By presenting information that contradicts an LLM's pre-trained knowledge, counterfactual datasets compel the model to rely solely on the provided context for its answer, thereby improving attribution.
  • HAR Outperforms Factual Data: The HAR pipeline generates high-quality counterfactual data that leads to better text grounding performance than traditional factual datasets, even when those factual datasets are larger or the models are bigger.
  • LLM-Generated Data is Powerful: The study shows that LLM-generated factual data (F-TriviaQA) also improves performance over human-annotated data, highlighting the general benefit of synthetic data generation, but counterfactuals offer an additional boost.

Key Results

  • Performance Boost: Models finetuned on CF-TriviaQA achieved up to an 8.0% increase in F1 score compared to models finetuned on factual TriviaQA.
  • Efficiency: CF-TriviaQA enabled significant performance gains even with 4x smaller datasets and 4x smaller models.
  • Consistency: Improvements were observed across various model sizes (from 60M to 11B parameters) and diverse QA datasets (multi-hop, biomedical, adversarial).
  • LLM-Generated Factual Data: F-TriviaQA (LLM-generated factual data) also outperformed human-annotated TriviaQA, showing a 1.2 point increase in token-level F1 score.
  • Counterfactuals Lead: CF-TriviaQA showed a 3.3 point increase in token-level F1 score over TriviaQA, demonstrating the superior impact of counterfactuals.
  • Smaller LLMs for HAR: Smaller LLMs (PaLM 2-Small) can be used for the HAR pipeline to generate counterfactual data, achieving similar performance improvements as larger models.

Limitations and Future Work

  • Factuality Impact: The paper acknowledges that finetuning on counterfactual data could negatively impact model factuality. The current work focuses solely on improving attribution and does not analyze this potential trade-off. Careful consideration is recommended before using counterfactual datasets for finetuning.
  • LLM Imperfections: Despite filtering, LLMs can still make mistakes, and some generated examples might have shortcomings. The reliability of LLMs used for filtering itself is a consideration.
  • Future Work: The authors suggest that the HAR pipeline and generated counterfactual datasets could be used to analyze LLM hallucination more deeply, evaluate text grounding abilities, and improve natural language inference models for better attribution scoring.

Summary updated

BibTeX
@inproceedings{koksal2024hallucination,
  author = {Abdullatif Köksal and Renat Aksitov and Chung-Ching Chang},
  title = {{Hallucination Augmented Recitations for Language Models}},
  booktitle = {DPFM @ ICLR},
  year = {2024},
  url = {https://openreview.net/forum?id=Nr72SX1MER},
}

Loading related content...

Figure