Table of Contents
Fetching ...

Luna: An Evaluation Foundation Model to Catch Language Model Hallucinations with High Accuracy and Low Cost

Masha Belyi, Robert Friel, Shuai Shao, Atindriyo Sanyal

TL;DR

Luna introduces a 440M DeBERTa-large encoder finetuned for hallucination detection in retrieval-augmented generation (RAG) with a focus on long-context inputs. By using span-level token predictions and a long-context chunking strategy, Luna achieves high precision while maintaining millisecond-scale inference and low deployment costs, outperforming zero-shot LLM judges and several automated frameworks. The model demonstrates cross-domain generalization across multiple industries, with LunaOOD showing strong performance though domain-specific gaps remain in financially reasoning contexts. The work emphasizes practical deployment advantages, including privacy-preserving local hosting and significant latency and cost reductions compared to API-based baselines, while outlining limitations and avenues for future enhancement like token-level labeling and improved retriever integration.

Abstract

Retriever Augmented Generation (RAG) systems have become pivotal in enhancing the capabilities of language models by incorporating external knowledge retrieval mechanisms. However, a significant challenge in deploying these systems in industry applications is the detection and mitigation of hallucinations: instances where the model generates information that is not grounded in the retrieved context. Addressing this issue is crucial for ensuring the reliability and accuracy of responses generated by large language models (LLMs) in diverse industry settings. Current hallucination detection techniques fail to deliver accuracy, low latency, and low cost simultaneously. We introduce Luna: a DeBERTA-large (440M) encoder, finetuned for hallucination detection in RAG settings. We demonstrate that Luna outperforms GPT-3.5 and commercial evaluation frameworks on the hallucination detection task, with 97% and 91% reduction in cost and latency, respectively. Luna is lightweight and generalizes across multiple industry verticals and out-of-domain data, making it an ideal candidate for industry LLM applications.

Luna: An Evaluation Foundation Model to Catch Language Model Hallucinations with High Accuracy and Low Cost

TL;DR

Luna introduces a 440M DeBERTa-large encoder finetuned for hallucination detection in retrieval-augmented generation (RAG) with a focus on long-context inputs. By using span-level token predictions and a long-context chunking strategy, Luna achieves high precision while maintaining millisecond-scale inference and low deployment costs, outperforming zero-shot LLM judges and several automated frameworks. The model demonstrates cross-domain generalization across multiple industries, with LunaOOD showing strong performance though domain-specific gaps remain in financially reasoning contexts. The work emphasizes practical deployment advantages, including privacy-preserving local hosting and significant latency and cost reductions compared to API-based baselines, while outlining limitations and avenues for future enhancement like token-level labeling and improved retriever integration.

Abstract

Retriever Augmented Generation (RAG) systems have become pivotal in enhancing the capabilities of language models by incorporating external knowledge retrieval mechanisms. However, a significant challenge in deploying these systems in industry applications is the detection and mitigation of hallucinations: instances where the model generates information that is not grounded in the retrieved context. Addressing this issue is crucial for ensuring the reliability and accuracy of responses generated by large language models (LLMs) in diverse industry settings. Current hallucination detection techniques fail to deliver accuracy, low latency, and low cost simultaneously. We introduce Luna: a DeBERTA-large (440M) encoder, finetuned for hallucination detection in RAG settings. We demonstrate that Luna outperforms GPT-3.5 and commercial evaluation frameworks on the hallucination detection task, with 97% and 91% reduction in cost and latency, respectively. Luna is lightweight and generalizes across multiple industry verticals and out-of-domain data, making it an ideal candidate for industry LLM applications.
Paper Structure (39 sections, 15 equations, 4 figures, 6 tables)

This paper contains 39 sections, 15 equations, 4 figures, 6 tables.

Figures (4)

  • Figure 1: Luna is a lightweight DeBERTA-large encoder, fine-tuned for hallucination detection in RAG settings. Luna outperforms zero-shot hallucination detection models (GPT-3.5, ChainPoll GPT-3.5 ensemble) and RAG evaluation frameworks (RAGAS, Trulens) at a fraction of the cost and millisecond inference speed.
  • Figure 2: Distribution of RAG context token lengths in our QA RAG training split.
  • Figure 3: Long RAG context with naive chunking example. Naive context chunking leads to hallucination false positives when supporting information is scattered throughout the context. Without insight into which specific spans were suporrted/not supported by the context, it is impossible to arrive at the correct conclusion that the response in this example does NOT contain hallucinations.
  • Figure 4: Illustration of Luna's token-level predictions for the example in Figure 3. Luna's token-level predictions are aggregated over context windows into a high-precision hallucination probability score.