Views
No views yet

| group | n | span-F1 | span-P | span-R | example-F1 | IoU |
|---|---|---|---|---|---|---|
| ALL | 10698 | 0.603 | 0.669 | 0.549 | 0.854 | 0.620 |
| lettucedetect-acl | 440 | 0.488 | 0.671 | 0.383 | 0.798 | 0.529 |
| lettucedetect-code-agent | 2015 | 0.443 | 0.582 | 0.357 | 0.744 | 0.496 |
| lettucedetect-readme | 641 | 0.711 | 0.763 | 0.665 | 0.879 | 0.727 |
| lettucedetect-tool-output | 617 | 0.525 | 0.688 | 0.424 | 0.719 | 0.576 |
| lettucedetect-wikipedia | 1388 | 0.668 | 0.729 | 0.617 | 0.875 | 0.704 |
| psiloqa (14 languages) | 2897 | 0.690 | 0.684 | 0.696 | 0.945 | 0.588 |
| ragtruth | 2700 | 0.463 | 0.696 | 0.347 | 0.744 | 0.702 |
| source | this (350M) | mmbert-base (307M) | qwen-2b (2B) |
|---|---|---|---|
| ALL | 0.603 | 0.642 | 0.689 |
| acl | 0.488 | 0.579 | 0.749 |
| code-agent | 0.443 | 0.508 | 0.602 |
| readme | 0.711 | 0.751 | 0.866 |
| tool-output | 0.525 | 0.588 | 0.719 |
| wikipedia | 0.668 | 0.708 | 0.817 |
| psiloqa (14 languages) | 0.690 | 0.714 | 0.732 |
| ragtruth | 0.463 | 0.528 | 0.574 |
1# pip install lettucedetect
2from lettucedetect.models.inference import HallucinationDetector
3
4detector = HallucinationDetector(
5 method="transformer",
6 model_path="KRLabsOrg/LFM2.5-Encoder-350M-hallucination-detector",
7 trust_remote_code=True,
8)
9
10predictions = detector.predict(
11 context=["The Eiffel Tower is 330 metres tall and stands in Paris, France."],
12 question="How tall is the Eiffel Tower and where is it?",
13 answer="The Eiffel Tower is 330 metres tall and stands in Berlin.",
14 output_format="spans",
15)
16print(predictions)
17# [{'start': 49, 'end': 56, 'confidence': 0.92, 'text': ' Berlin'}]1import torch
2from transformers import AutoTokenizer, AutoModelForTokenClassification
3
4repo = "KRLabsOrg/LFM2.5-Encoder-350M-hallucination-detector"
5tokenizer = AutoTokenizer.from_pretrained(repo)
6model = AutoModelForTokenClassification.from_pretrained(repo, trust_remote_code=True).eval()
7
8enc = tokenizer("context text ... answer text", return_tensors="pt")
9with torch.no_grad():
10 labels = model(**enc).logits.argmax(-1)[0] # 0 = supported, 1 = hallucinatedLiquidAI/LFM2.5-Encoder-350M (bidirectional), linear head, dropout 0.1[question, context, answer], answer tokens labeled supported/hallucinated, max length 8,1921@misc{kovács2026documentgroundingspanlevelhallucination,
2 title={Beyond Document Grounding: Span-Level Hallucination Detection over Code, Tool Output, and Documents},
3 author={Ádám Kovács and Bowei He and Xue Liu and István Boros and Szilveszter Tóth and Gábor Recski},
4 year={2026},
5 eprint={2607.00895},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2607.00895},
9}