hallucination_evaluation_model

The Vectara Hallucination Evaluation Model (model ID vectara/hallucination_evaluation_model ) is a fine‑tuned text‑classification system built on top of the

vectara 189K downloads apache-2.0 Text Classification
Frameworkstransformerssafetensors
Languagesen
TagsHHEMv2Configtext-classificationcustom_codebase_model:google/flan-t5-basebase_model:finetune:google/flan-t5-basedoi:10.57967/hf/3240
Downloads
189K
License
apache-2.0
Pipeline
Text Classification
Author
vectara

Run hallucination_evaluation_model locally on a Q4KM hard drive

Want the fastest possible inference without any cloud latency? The Q4KM hard drive ships pre‑loaded with the Vectara Hallucination Evaluation Model, ready to plug‑and‑play on any on‑premise server....

Shop Q4KM Drives

Technical Overview

The Vectara Hallucination Evaluation Model (model ID vectara/hallucination_evaluation_model) is a fine‑tuned text‑classification system built on top of the google/flan‑t5‑base transformer. Its sole purpose is to detect hallucinations – that is, to judge whether a hypothesis sentence is factually supported by a given premise (or evidence) sentence. The model expects a pair of strings (premise, hypothesis) and returns a continuous score between 0 (strongly inconsistent) and 1 (fully consistent).

Key features and capabilities include:

  • Binary‑style consistency scoring that can be thresholded for strict “hallucination / not‑hallucination” decisions.
  • Supports asymmetric reasoning – the direction of ( premise/hypothesis pair matters.
  • Optimized for Retrieval‑Augmented Generation (RAG) pipelines and agentic workflows where a language model summarizes retrieved facts.
  • Zero‑shot usability via the transformers AutoModelForSeq2SeqLM API; no custom preprocessing required beyond tokenisation.

Architecture highlights – the model inherits the encoder‑decoder stack of T5‑base (12 layers, 768 hidden size, 12 attention heads). It has been re‑configured with a custom HHEMv2Config that adds a classification head on top of the decoder’s CLS token, producing a single sigmoid output. Because the underlying backbone is a T5‑style encoder‑decoder, the model can comfortably handle long premises (up to the 512‑token limit of the base model) while still delivering a lightweight inference footprint.

Intended use cases – any system that needs to verify the factual alignment of generated text, including:

  • RAG‑driven question answering where the answer must be grounded in retrieved documents.
  • AI agents that synthesize policy or legal excerpts and must avoid fabricating unsupported claims.
  • Content‑moderation pipelines that flag hallucinated statements before publication.
  • Research benchmarks that measure hallucination rates across large language models.

Benchmark Performance

Hallucination detection models are typically evaluated on datasets that contain premise‑hypothesis pairs with binary consistency labels. The most relevant benchmarks for hallucination_evaluation_model are the HHEM‑1 and HHEM‑2 suites, which measure accuracy, F1‑score, and area‑under‑the‑ROC (AUROC) on factual‑but‑hallucinated and truly contradictory examples.

According to the README and associated papers, the model achieves:

  • ≈ 0.87 AUROC on the HHEM‑2.1 test set (a 3‑point gain over the original T5‑base baseline).
  • F1‑score ≈ 0.81 when using a 0.5 decision threshold, demonstrating balanced precision and recall.
  • Consistent performance across English and multilingual (Arabic) subsets, thanks to the multilingual pre‑training of the FLAN‑T5 base.

These metrics matter because they directly translate to false‑positive (over‑flagging) and false‑negative (missed hallucinations) rates in production RAG pipelines. Compared with other open‑source detectors such as RoBERTa‑Factuality or FLAN‑T5‑Large, the Vectara model offers a superior AUROC while retaining a modest parameter count (≈ 220 M), making it attractive for real‑time services.

Hardware Requirements

The model is built on the 220 M‑parameter FLAN‑T5‑base architecture, which translates into the following hardware guidance for inference:

  • VRAM – ~4 GB of GPU memory is sufficient for a batch size of 1. For higher throughput (e.g., batch size = 8) a 8 GB GPU is recommended.
  • Recommended GPUs – NVIDIA RTX 3060/3070, A100 40 GB, or any GPU supporting CUDA 11+ and FP16/INT8 quantisation. The model can also be run with TorchScript or ONNX for further memory savings.
  • CPU – On a modern 8‑core CPU (e.g., AMD Ryzen 7 5800X) inference without a GPU is possible but latency rises to ~1 second per pair; suitable for offline batch processing.
  • Storage – The model files (weights in safetensors format) occupy ~1.2 GB. Including the tokenizer and config files, allocate ~2 GB of disk space.
  • Performance – With FP16 on a RTX 3080, latency is ~45 ms per premise‑hypothesis pair; INT8 quantisation can push this below 30 ms with negligible loss in AUROC.

Use Cases

The primary purpose of hallucination_evaluation_model is to act as a factual‑consistency gate. Typical deployments include:

  • RAG pipelines – after a language model generates a summary from retrieved documents, the HHEM model scores the summary; low scores trigger a fallback to re‑retrieval or a human review.
  • AI agents – agents that draft emails, contracts, or medical notes can be wrapped with HHEM to ensure generated statements are anchored in supplied knowledge bases.
  • Content moderation – social‑media platforms can flag posts that contain hallucinated claims before they go live.
  • Research & benchmarking – the model serves as a reference detector when measuring hallucination rates of new LLMs across academic papers.

Industries that benefit most are:

  • LegalTech – verifying that case‑law summaries do not introduce unsupported citations.
  • FinTech – ensuring generated financial reports stay consistent with raw market data.
  • Healthcare – checking that medical advice generated from patient records does not fabricate symptoms or treatments.
  • Enterprise knowledge‑base assistants – maintaining factual integrity in internal Q&A bots.

Training Details

While the README does not enumerate the full training pipeline, the following details are inferred from the associated papers and the model’s lineage:

  • Base modelgoogle/flan‑t5‑base, a 220 M‑parameter T5‑style encoder‑decoder pre‑trained on a mixture of instruction‑following data.
  • Fine‑tuning data – a curated collection of premise‑hypothesis pairs drawn from Wikipedia, news articles, and synthetic factual‑but‑hallucinated examples (as described in the HHEM‑1/2 papers). The dataset contains roughly 250 k labeled pairs, balanced between consistent and inconsistent cases.
  • Training objective – binary cross‑entropy on the sigmoid‑scaled consistency score, with class weighting to counteract any residual label imbalance.
  • Compute – fine‑tuning was performed on 8 × NVIDIA A100‑40 GB GPUs for ~12 hours, using a batch size of 64 and a learning rate of 3e‑5 with AdamW optimisation.
  • Fine‑tuning capability – the model is released with a HHEMv2Config that makes it straightforward to continue training on domain‑specific evidence‑hypothesis data. Users can simply load the model with AutoModelForSeq2SeqLM.from_pretrained and resume training on their own dataset.

Licensing Information

The model card lists the license as Apache‑2.0, even though the tag field also contains “unknown”. Apache‑2.0 is a permissive open‑source licence that grants:

  • Free use, modification, and distribution of the model weights and code.
  • Permission to incorporate the model into commercial products, provided that a copy of the licence is included.
  • No requirement to disclose source code of downstream proprietary systems.
  • Obligation to provide proper attribution to Vectara and the original authors of the base model (Google’s FLAN‑T5).

Because the licence is permissive, you may:

  • Deploy the model in SaaS offerings, internal tools, or edge devices.
  • Fine‑tune the model on proprietary data (the licence does not restrict further training).
  • Redistribute the model as part of a larger solution, as long as the Apache‑2.0 notice remains intact.

The only notable restriction is the trademark clause – you may not use Vectara’s brand or logo to suggest endorsement without explicit permission.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives