Fine-tune LLMs to ignore misleading retrieved documents and cut RAG hallucinations by ~21%

May 16, 20256 min

Overview

Production Readiness

0.6

Novelty Score

0.6

Cost Impact Score

0.5

Citation Count

0

Authors

Zhan Peng Lee, Andre Lin, Calvin Tan

Links

Abstract / PDF

Why It Matters For Business

Training the generator to ignore bad retrieved documents reduces factual errors in RAG systems, lowering risk in applications like legal, medical, and finance without reworking retrieval stacks.

Summary TLDR

Finetune-RAG is a supervised fine-tuning method that trains instruction-tuned LLMs to ignore misleading retrieved documents. The authors build a 1,653-example dataset pairing one factual and one fictitious document per query, fine-tune Llama 3.1-8B-Instruct, and evaluate with Bench-RAG (GPT-4o as judge). On the paper's testbed, accuracy rose from 76.97% to 98.18% (Baseline format). The method is open-sourced with checkpoints and dataset.

Problem Statement

Retrieval in RAG is imperfect and can feed incorrect documents to the generator. Models often blend that noise into fluent but false answers. The paper asks: can we train the generator itself to ignore misleading retrieved content instead of only improving retrievers?

Main Contribution

A simple fine-tuning method (Finetune-RAG) that trains models on examples containing both factual and fictitious retrieved chunks so the model learns to ignore the fiction.

A curated multi-domain dataset (1,653 examples) pairing one factual and one fictitious chunk per question, released publicly.

Bench-RAG: an automated evaluation pipeline using GPT-4o as an LLM judge to score accuracy, helpfulness, relevance, and depth.

Open-source release of code, checkpoints, and dataset for reuse.

Key Findings

Finetune-RAG substantially increases factual accuracy on the paper's RAG test set.

NumbersAccuracy 76.97% → 98.18% (Baseline, step 0→20)

Unstructured (Baseline) prompts outperformed structured XML prompts on this task.

NumbersStep 20 accuracy: Baseline 98.18% vs XML 96.97%

Accuracy gains did not come at the cost of answer quality on automated metrics.

NumbersBaseline step 20: Helpfulness 9.77, Relevance 9.95, Depth 9.02 (scale 1–10)

Results

Accuracy

Value98.18% (Baseline, step 20)

Baseline76.97% (Baseline, step 0)

Helpfulness

Value9.77 (Baseline, step 20)

Baseline8.81 (Baseline, step 0)

Relevance

Value9.95 (Baseline, step 20)

Baseline9.55 (Baseline, step 0)

Depth

Value9.02 (Baseline, step 20)

Baseline8.32 (Baseline, step 0)

Accuracy

Value96.97% (XML, step 20)

Baseline78.79% (XML, step 0)

Who Should Care

What To Try In 7 Days

Run Bench-RAG on your RAG pipeline using a small held-out set to measure baseline hallucination rate.

Create a few hundred dual-context examples (one factual, one misleading) in your domain and fine-tune a small instruct model.

Compare plain-text vs structured input formats; prefer the one that yields higher accuracy on your tests.

Reproducibility

Code Available

Data Available

Open Source Status

  • yes

Risks & Boundaries

Limitations

  • Fictitious content was generated by GPT-4o and may not match real retrieval errors.
  • Training uses exactly one factual and one fictitious chunk per example; real systems return many mixed-quality docs.
  • Supervision treats hallucination as binary; partial or subtle errors may not be captured.
  • Fine-tuning long-context models still requires high-memory GPUs and nontrivial compute.

When Not To Use

  • When retrieval quality is already near-perfect and generator errors are rare.
  • When you cannot afford extra fine-tuning compute or checkpoints.
  • When your production retrieval returns many (>2) documents and you cannot adapt dataset to that setting.

Failure Modes

  • May overfit to synthetic artifact patterns introduced by GPT-4o generation.
  • May still fail on nuanced partial-truth hallucinations not covered by binary labels.
  • May not generalize when many retrieved documents compete or when fiction closely mimics real sources.

Core Entities

Models

  • Llama 3.1-8B-Instruct

Metrics

  • Accuracy
  • Helpfulness
  • Relevance
  • Depth

Datasets

  • Finetune-RAG (1,653 examples)

Benchmarks

  • Bench-RAG