Improve model card and add metadata
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,12 +1,65 @@
|
|
| 1 |
---
|
| 2 |
-
license: mit
|
| 3 |
-
language:
|
| 4 |
-
- en
|
| 5 |
base_model:
|
| 6 |
- meta-llama/Llama-3.1-8B-Instruct
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
base_model:
|
| 3 |
- meta-llama/Llama-3.1-8B-Instruct
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
license: mit
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
library_name: transformers
|
| 9 |
+
tags:
|
| 10 |
+
- hallucination-detection
|
| 11 |
+
- faithfulness
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# FaithLens: Detecting and Explaining Faithfulness Hallucination
|
| 15 |
+
|
| 16 |
+
FaithLens is a cost-efficient and effective model for **faithfulness hallucination detection** that jointly provides binary predictions and human-readable explanations. It helps in recognizing whether outputs from large language models (LLMs) contain faithfulness hallucination, which is crucial for applications like retrieval-augmented generation and summarization.
|
| 17 |
+
|
| 18 |
+
The model is an 8B-parameter model, initialized with `meta-llama/Llama-3.1-8B-Instruct`, and optimized through a two-stage process involving cold-start supervised fine-tuning (SFT) and rule-based reinforcement learning (RL). It has been shown to outperform advanced models such as GPT-4.1 and o3 across 12 diverse tasks.
|
| 19 |
+
|
| 20 |
+
- **Paper:** [FaithLens: Detecting and Explaining Faithfulness Hallucination](https://huggingface.co/papers/2512.20182)
|
| 21 |
+
- **Repository:** [https://github.com/S1s-Z/FaithLens](https://github.com/S1s-Z/FaithLens)
|
| 22 |
+
|
| 23 |
+
## Usage
|
| 24 |
+
|
| 25 |
+
You can use FaithLens by installing its dedicated package and running the provided inference script.
|
| 26 |
+
|
| 27 |
+
First, install the package:
|
| 28 |
+
```sh
|
| 29 |
+
pip install "faithlens @ git+https://github.com/S1s-Z/FaithLens.git@master"
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
Then, you can use the following Python code for inference:
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
from faithlens.inference import FaithLensInfer
|
| 36 |
+
import json
|
| 37 |
+
|
| 38 |
+
# Predicted Label:
|
| 39 |
+
# 0 indicates the claim is hallucinated (the claim is not supported by the document)
|
| 40 |
+
# 1 indicates the claim is faithful (supported by the document)
|
| 41 |
+
|
| 42 |
+
detection_model = FaithLensInfer(model_name="ssz1111/FaithLens", device="cuda:0")
|
| 43 |
+
single_result = detection_model.infer(
|
| 44 |
+
docs=["Relegation-threatened Romanian club Ceahlaul Piatra Neamt have sacked Brazilian coach Ze Maria for the second time in a week. Former Brazil defender Ze Maria was fired on Wednesday after a poor run, only to be reinstated the next day after flamboyant owner Angelo Massone decided to 'give the coaching staff another chance.' But the 41-year-old former Inter Milan and Parma right back, capped 25 times by Brazil, angered Massone again after Ceahlaul were beaten 2-0 by mid-table FC Botosani on Saturday. Ze Maria represented Brazil on 25 occasions during an international career spanning five years . The result left Ceahlaul 16th in the standings, six points adrift of safety. Ze Maria replaced Florin Marin in January to become Ceahlaul's third coach this season. He will be replaced by Serbian Vanya Radinovic."],
|
| 45 |
+
claims=["Former brazil defender ze maria was fired on wednesday after a poor run. The 41-year-old was reinstated the next day after flamboyant owner angelo massone decided to'give the coaching staff another chance' but the 41-year-old angered massone again after ceahlaul were beaten 2-0 by mid-table fc botosani on saturday."],
|
| 46 |
+
)
|
| 47 |
+
print("Single Result:")
|
| 48 |
+
print(json.dumps(single_result, ensure_ascii=False, indent=2))
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## Citation
|
| 52 |
|
| 53 |
+
If you use FaithLens in your research, please cite the following paper:
|
| 54 |
|
| 55 |
+
```bibtex
|
| 56 |
+
@misc{si2025faithlensdetectingexplainingfaithfulness,
|
| 57 |
+
title={FaithLens: Detecting and Explaining Faithfulness Hallucination},
|
| 58 |
+
author={Shuzheng Si and Qingyi Wang and Haozhe Zhao and Yuzhuo Bai and Guanqiao Chen and Kangyang Luo and Gang Chen and Fanchao Qi and Minjia Zhang and Baobao Chang and Maosong Sun},
|
| 59 |
+
year={2025},
|
| 60 |
+
eprint={2512.20182},
|
| 61 |
+
archivePrefix={arXiv},
|
| 62 |
+
primaryClass={cs.CL},
|
| 63 |
+
url={https://arxiv.org/abs/2512.20182},
|
| 64 |
+
}
|
| 65 |
+
```
|