THaMES一站式解决大模型幻觉问题,自动评估并优化生成准确性。
THaMES: An End-to-End Tool for Hallucination Mitigation and Evaluation in Large Language Models
- 自动化构建高质量测试集,支持多种数据源和验证策略
- 实测显示商用模型用RAG效果更好,开源模型用ICL更优
- 提供可定制的幻觉缓解方案,适合模型评估与优化研究者
幻觉——即生成事实性错误内容——是大型语言模型(LLMs)面临的日益严峻挑战。现有检测与缓解方法往往孤立且难以满足特定领域需求,缺乏标准化流程。本文提出THaMES(Hallucination Mitigation and EvaluationS工具),一个集成框架与库,填补这一空白。THaMES提供端到端的幻觉评估与缓解解决方案,包含自动化测试集生成、多维度基准测试及可适配的缓解策略。其通过批处理、加权采样和反事实验证等技术,从任意语料库自动生成高质量、多样化且成本高效的测试集。THaMES在文本生成与二分类任务中评估模型检测和减少幻觉的能力,并应用最优缓解策略,如上下文学习(ICL)、检索增强生成(RAG)和参数高效微调(PEFT)。基于学术论文、政治新闻和维基百科知识库对前沿大模型的评估表明,商业模型GPT-4o在使用RAG时获益更大,而开源模型Llama-3.1-8B-Instruct与Mistral-Nemo则更依赖ICL。此外,PEFT显著提升了Llama-3.1-8B-Instruct在两项任务中的表现。
原文摘要 · Abstract (English)
Hallucination, the generation of factually incorrect content, is a growing challenge in Large Language Models (LLMs). Existing detection and mitigation methods are often isolated and insufficient for domain-specific needs, lacking a standardized pipeline. This paper introduces THaMES (Tool for Hallucination Mitigations and EvaluationS), an integrated framework and library addressing this gap. THaMES offers an end-to-end solution for evaluating and mitigating hallucinations in LLMs, featuring automated test set generation, multifaceted benchmarking, and adaptable mitigation strategies. It automates test set creation from any corpus, ensuring high data quality, diversity, and cost-efficiency through techniques like batch processing, weighted sampling, and counterfactual validation. THaMES assesses a model's ability to detect and reduce hallucinations across various tasks, including text generation and binary classification, applying optimal mitigation strategies like In-Context Learning (ICL), Retrieval Augmented Generation (RAG), and Parameter-Efficient Fine-tuning (PEFT). Evaluations of state-of-the-art LLMs using a knowledge base of academic papers, political news, and Wikipedia reveal that commercial models like GPT-4o benefit more from RAG than ICL, while open-weight models like Llama-3.1-8B-Instruct and Mistral-Nemo gain more from ICL. Additionally, PEFT significantly enhances the performance of Llama-3.1-8B-Instruct in both evaluation tasks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。