THaMES:用于大型语言模型中幻觉缓解与评估的端到端工具
THaMES: An End-to-End Tool for Hallucination Mitigation and Evaluation in Large Language Models
AI总结:
本文提出THaMES,一个端到端工具,用于自动化生成测试集、多面评估并应用ICL、RAG和PEFT等策略来缓解和评估LLM幻觉,实验表明不同模型对策略偏好不同。
摘要:
幻觉,即生成事实不正确的内容,是大型语言模型(LLM)中日益严峻的挑战。现有的检测和缓解方法往往相互孤立,且不足以满足特定领域的需求,缺乏标准化的流程。本文介绍了THaMES(幻觉缓解与评估工具),一个填补这一空白的集成框架和库。THaMES提供了一个端到端的解决方案,用于评估和缓解LLM中的幻觉,具备自动化测试集生成、多面基准测试和适应性缓解策略。它从任何语料库自动生成测试集,通过批量处理、加权采样和反事实验证等技术,确保高数据质量、多样性和成本效益。THaMES评估模型在各种任务(包括文本生成和二元分类)中检测和减少幻觉的能力,并应用最优缓解策略,如上下文学习(ICL)、检索增强生成(RAG)和参数高效微调(PEFT)。使用学术论文、政治新闻和维基百科的知识库对最先进的LLM进行评估,结果显示,像GPT-4o这样的商业模型从RAG中获益多于ICL,而像Llama-3.1-8B-Instruct和Mistral-Nemo这样的开放权重模型则更多地从ICL中获益。此外,PEFT显著提升了Llama-3.1-8B-Instruct在两项评估任务中的性能。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。