Views
No views yet

| Model | Parameters | F1 (%) |
|---|---|---|
| TinyLettuce-17M | 17M | 68.52 |
| LettuceDetect-base (ModernBERT) | 150M | 76.07 |
| LettuceDetect-large (ModernBERT) | 395M | 79.22 |
| Llama-2-13B (RAGTruth FT) | 13B | 78.70 |
pip install lettucedetect1from lettucedetect.models.inference import HallucinationDetector
2
3# Load tiny but powerful model
4detector = HallucinationDetector(
5 method="transformer",
6 model_path="KRLabsOrg/tinylettuce-ettin-17m-en"
7)
8
9# Detect hallucinations in medical context
10spans = detector.predict(
11 context=[
12 "Ibuprofen is an NSAID that reduces inflammation and pain. The typical adult dose is 400-600mg every 6-8 hours, not exceeding 2400mg daily."
13 ],
14 question="What is the maximum daily dose of ibuprofen?",
15 answer="The maximum daily dose of ibuprofen for adults is 3200mg.",
16 output_format="spans",
17)
18print(spans)
19# Output: [{"start": 51, "end": 57, "text": "3200mg"}]1@misc{Kovacs:2025,
2 title={LettuceDetect: A Hallucination Detection Framework for RAG Applications},
3 author={Ádám Kovács and Gábor Recski},
4 year={2025},
5 eprint={2502.17125},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2502.17125},
9}