TruthTorchLM:一个用于预测LLM输出真实性的综合库
TruthTorchLM: A Comprehensive Library for Predicting Truthfulness in LLM Outputs
AI总结:
本文提出开源Python库TruthTorchLM,包含30多种涵盖不同计算成本、访问级别和监督类型的真实性预测方法,兼容HuggingFace和LiteLLM,并在TriviaQA、GSM8K和FactScore-Bio数据集上进行了评估。
摘要:
生成式大型语言模型(LLMs)不可避免地会产生不真实的回复。准确预测这些输出的真实性至关重要,尤其是在高风险场景中。为了加速该领域的研究并使真实性预测方法更易于获取,我们引入了TruthTorchLM,这是一个开源、全面的Python库,包含30多种真实性预测方法,我们将其称为TruthMethods。与Guardrails等现有工具包(仅专注于基于文档的验证)或LM-Polygraph(仅限于基于不确定性的方法)不同,TruthTorchLM提供了广泛且可扩展的技术集合。这些方法在计算成本、访问级别(例如黑盒与白盒)、基础文档要求以及监督类型(自监督或监督)方面涵盖了多样的权衡。TruthTorchLM与HuggingFace和LiteLLM无缝兼容,从而支持本地托管和基于API的模型。它还为生成、评估、校准和长文本真实性预测提供了统一接口,并附带一个灵活的框架以便用新方法扩展该库。我们在三个数据集TriviaQA、GSM8K和FactScore-Bio上对具有代表性的真实方法进行了评估。代码可在https://github.com/Ybakman/TruthTorchLM获取。
英文摘要:
Generative Large Language Models (LLMs)inevitably produce untruthful responses. Accurately predicting the truthfulness of these outputs is critical, especially in high-stakes settings. To accelerate research in this domain and make truthfulness prediction methods more accessible, we introduce TruthTorchLM an open-source, comprehensive Python library featuring over 30 truthfulness prediction methods, which we refer to as Truth Methods. Unlike existing toolkits such as Guardrails, which focus solely on document-grounded verification, or LM-Polygraph, which is limited to uncertainty-based methods, TruthTorchLM offers a broad and extensible collection of techniques. These methods span diverse tradeoffs in computational cost, access level (e.g., black-box vs white-box), grounding document requirements, and supervision type (self-supervised or supervised). TruthTorchLM is seamlessly compatible with both HuggingFace and LiteLLM, enabling support for locally hosted and API-based models. It also provides a unified interface for generation, evaluation, calibration, and long-form truthfulness prediction, along with a flexible framework for extending the library with new methods. We conduct an evaluation of representative truth methods on three datasets, TriviaQA, GSM8K, and FactScore-Bio. The code is available at https://github.com/Ybakman/TruthTorchLM
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。