Views
No views yet

| Model | Parameters | F1 (%) |
|---|---|---|
| TinyLettuce-32M | 32M | 72.15 |
| 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
3detector = HallucinationDetector(
4 method="transformer",
5 model_path="KRLabsOrg/tinylettuce-ettin-32m-en",
6)
7
8spans = detector.predict(
9 context=[
10 "Ibuprofen is an NSAID that reduces inflammation and pain. The typical adult dose is 400-600mg every 6-8 hours, not exceeding 2400mg daily."
11 ],
12 question="What is the maximum daily dose of ibuprofen?",
13 answer="The maximum daily dose of ibuprofen for adults is 3200mg.",
14 output_format="spans",
15)
16print(spans)
17# 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}