TruthTorchLM: A Comprehensive Library for Predicting Truthfulness in LLM Outputs

Duygu Nur Yaldiz, Yavuz Faruk Bakman, Sungmin Kang, Alperen Öziş, Hayrettin Eren Yildiz +7 more
7/10/2025
cs.CL

Official code: Ybakman/TruthTorchLM (64 stars, MIT, last commit 2026-02-20).

Abstract

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

View on arXivView PDF

Code Implementations(1)

MIT
646Python, Jupyter NotebookMar 24, 20248 months agoMIT

Similar Papers

Cite this paper

@article{yaldiz2025truthtorchlm,
  title  = {TruthTorchLM: A Comprehensive Library for Predicting Truthfulness in LLM Outputs},
  author = {Duygu Nur Yaldiz and Yavuz Faruk Bakman and Sungmin Kang and Alperen Öziş and Hayrettin Eren Yildiz and Mitash Ashish Shah and Zhiqi Huang and Anoop Kumar and Alfy Samuel and Daben Liu and Sai Praneeth Karimireddy and Salman Avestimehr},
  year   = {2025},
  eprint = {2507.08203},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.08203v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.08203.svg)](https://codeofpaper.com/paper/2507.08203)

Discussion