Downloads · 30 days
128
58% of all-time downloads
varunchundru/hallucination-detector-deberta
hallucination-detector-deberta is a text classification model from varunchundru. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
Paper: Domain-Specific Hallucination Detection in Large Language Models
Downloads · 30 days
128
58% of all-time downloads
All-time downloads
222
Public
Parameters
184M
738 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors738 MB · 99%
From the Hugging Face model README
Paper: Domain-Specific Hallucination Detection in Large Language Models
Code: GitHub Repository
A fine-tuned DeBERTa-v3-base model for detecting hallucinations in LLM-generated text.
This model classifies whether an LLM-generated response is factual or hallucinated given a knowledge context. It was fine-tuned on the HaluEval benchmark.
| Metric | Score |
|---|---|
| Accuracy | 0.9127 |
| Precision | 0.8819 |
| Recall | 0.9505 |
| F1 Score | 0.9149 |
| AUROC | 0.9771 |
| Task | F1 Score |
|---|---|
| QA | 0.97 |
| Summarization | 0.96 |
| Dialogue | 0.82 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model
tokenizer = AutoTokenizer.from_pretrained("varunteja99/hallucination-detector-deberta")
model = AutoModelForSequenceClassification.from_pretrained("varunteja99/hallucination-detector-deberta")
# Prepare input
text = """Knowledge: The Eiffel Tower is located in Paris, France.
Question: Where is the Eiffel Tower?
Answer: The Eiffel Tower is in London."""
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
# Predict
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1).item()
print("Hallucinated" if prediction == 1 else "Factual")
# Output: Hallucinated
The model expects input in the following format:
Knowledge: [relevant context/facts]
Question: [the query or prompt]
Answer: [the LLM-generated response to verify]
| ID | Label | Description |
|---|---|---|
| 0 | Factual | Response is supported by knowledge |
| 1 | Hallucinated | Response contradicts or is unsupported |
@misc{chundru2026hallucination,
author = {Chundru, Varun and Biswas, Debasmita},
title = {Domain-Specific Hallucination Detection in Large Language Models},
year = {2026},
publisher = {GitHub},
url = {https://github.com/varunteja99/hallucination-detection-nlp}
}