PrismVerify-4B
A 4B Local Reasoning Judge & Verbatim Span Extractor for RAG Hallucination Detection (Apache 2.0 · Full-Parameter SFT + Online Verifiable DPO)
Built by Flintglass Labs on
Qwen/Qwen3-4B-Instruct-2507. Outputs crisp, auditable step-by-step reasoning, exact verbatim unsupported spans, error classification (none/contradiction/unsupported/both), and binary verdict (FAITHFUL/HALLUCINATED) in strict JSON — achieving0.821F1 on RAGTruth-Test,0.739F1 on DocNLI-Test, and0.955F1 on LongRAG-8K (0.954at 6,500 tokens with 2.0% FPR), with 99.8%–100% JSON schema compliance and 98.9%–99.7% verbatim span fidelity.
- Ready-to-Run GGUF Quantizations (2.4 GB Q4_K_M → 4.0 GB Q8_0):
flintglass/PrismVerify-4B-GGUF - Ultra-Fast Encoder Siblings (<35 ms CPU ONNX):
PrismVerify-Large(395M) ·PrismVerify-Multilingual(307M, 1,800+ langs) ·PrismVerify-Small(140M, 16 ms CPU) - Live Encoder Demo: flintglass/PrismVerify-Demo
- Training Dataset & Benchmark:
flintglass/PrismVerify-Corpus
Key Highlights
- +14.2 F1 over Base
Qwen3-4B-Instruct-2507on RAGTruth-Test (0.821vs0.680), +4.5 F1 overLettuceDetect-Large(0.777), and +20.8 F1 overvectara/HHEM-2.1-Open(0.613). - +12.8 F1 over Base
Qwen3-4Bon DocNLI-Test (0.739vs0.612) and +12.2 F1 at 6,500-token LongRAG-8K (0.954vs0.832, 2.0% FPR). - Two-Stage Verifiable Training (Apache-2.0 / MIT clean lineage):
- Stage 1 — Full-Parameter BF16 SFT on 21,603 zero-leakage structured verification examples (human-annotated
RAGTruthspans & rationales, multi-chunk LongRAG up to 6,500 tokens, and synthetic numerical/financial table arithmetic verification). - Stage 2 — Online Self-Play Verifiable DPO (RLVR): Sampled
K=4on-policy rollouts across 4,400 diverse zero-leakage prompts, scored with an exact deterministic verifier (JSON validity + exact verdict match + verbatim span substring check + conciseness), and optimized with Reference-KL DPO (beta = 0.1).
- Stage 1 — Full-Parameter BF16 SFT on 21,603 zero-leakage structured verification examples (human-annotated
- Production-Ready Local Footprint: Runs in ~2.4 GB VRAM/RAM via
PrismVerify-4B-GGUF(ollama run hf.co/flintglass/PrismVerify-4B-GGUF:Q4_K_M) or natively invllm/transformers.
Quickstart (transformers)
import json, torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "flintglass/PrismVerify-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto")
SYSTEM_PROMPT = (
'You are PrismVerify, a precision groundedness and hallucination verification judge. '
'Given a CONTEXT, optional QUESTION, and RESPONSE, verify every factual claim and numerical '
'calculation in RESPONSE strictly against CONTEXT. Reply ONLY with a valid JSON object containing: '
'"reasoning" (concise step-by-step verification), "unsupported_spans" (list of exact verbatim '
'contradicted or ungrounded phrases from RESPONSE, empty if faithful), "error_type" ("none", '
'"contradiction", "unsupported", or "both"), and "verdict" ("FAITHFUL" or "HALLUCINATED").'
)
user_msg = """[CONTEXT]
In Q3 2026, Meridian Robotics reported revenue of $142.8 million, up 18.4% YoY, while gross margin narrowed from 61.2% to 59.8%.
[QUESTION]
Summarize Meridian Robotics' Q3 2026 financial results.
[RESPONSE]
Meridian Robotics grew Q3 revenue by 18.4% to $142.8 million, expanded gross margin to 65.0%, and launched a $20M share buyback."""
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": user_msg},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer([text], return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=384, do_sample=False)
reply = tokenizer.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(json.dumps(json.loads(reply), indent=2))
Example JSON Output
{
"reasoning": "The context states gross margin narrowed to 59.8%, contradicting the claim that it expanded to 65.0%. There is no mention of a $20M share buyback in the source context.",
"unsupported_spans": [
"expanded gross margin to 65.0%",
"launched a $20M share buyback"
],
"error_type": "both",
"verdict": "HALLUCINATED"
}
Zero-Leakage Benchmark Evaluation
All models were evaluated identically on the exact same held-out test sets (do_sample=False for LLMs; threshold=0.50 for encoders). Strict exact pair SHA-256 + 10-word response shingle deduplication blocked 3,554 overlapping items against all evaluation splits.
| Model | Params | RAGTruth F1↑ (BAcc) | HaluEval F1↑ (BAcc) | DocNLI F1↑ (BAcc) | LongRAG-8K F1↑ (@6.5K) | Avg 4-Bench F1↑ | JSON Valid | Verbatim Span |
|---|---|---|---|---|---|---|---|---|
| Flintglass PrismVerify-4B (RLVR-DPO) | 4.0B | 0.821 (0.865) | 0.701 (0.687) | 0.739 (0.746) | 0.955 (0.954) | 0.804 | 99.9% | 99.0% |
| PrismVerify-4B (Stage-1 SFT) | 4.0B | 0.807 (0.847) | 0.670 (0.681) | 0.704 (0.735) | 0.955 (0.954) | 0.784 | 99.7% | 99.1% |
Base Qwen3-4B-Instruct-2507 | 4.0B | 0.680 (0.753) | 0.699 (0.669) | 0.612 (0.653) | 0.890 (0.832) | 0.720 | 83.5% | 87.6% |
| Flintglass PrismVerify-Large (Encoder) | 395M | 0.741 (0.816) | 0.906 (0.906) | 0.676 (0.713) | 0.896 (0.908) | 0.805 | — | — |
KRLabsOrg/lettucedect-large | 395M | 0.777 (0.830) | 0.634 (0.568) | 0.579 (0.627) | 0.798 (0.761) | 0.697 | — | Token |
vectara/HHEM-2.1-Open | ~110M | 0.613 (0.710) | 0.629 (0.624) | 0.492 (0.606) | OOM (>178 GB) | — | — | — |
MoritzLaurer/DeBERTa-v3-large-NLI | 435M | 0.213 (0.527) | 0.673 (0.649) | 0.681 (0.718) | 0.642 (0.609) | 0.552 | — | — |
Long-Context Multi-Chunk RAG Breakdown (LongRAG-Verify-Bench, 512 → 6,500 tokens)
| Model | 512 tok F1 (FPR↓) | 1K tok F1 (FPR↓) | 2K tok F1 (FPR↓) | 4K tok F1 (FPR↓) | 6.5K tok F1 (FPR↓) |
|---|---|---|---|---|---|
| Flintglass PrismVerify-4B | 0.965 (3%) | 0.951 (6%) | 0.956 (6%) | 0.952 (8%) | 0.954 (2%) |
Base Qwen3-4B-Instruct-2507 | 0.928 (4%) | 0.899 (9%) | 0.914 (7%) | 0.874 (7%) | 0.832 (4%) |
KRLabsOrg/lettucedect-large | 0.804 (7%) | 0.822 (6%) | 0.822 (6%) | 0.780 (11%) | 0.761 (9%) |
Zero-shot Out-of-Domain Numerical Verification (Cleanlab/FinQA-hallucination-detection, bare calculated numbers): PrismVerify-4B achieved 0.609 BAcc (80% hallucination recall, 99.7% verbatim span accuracy), improving over every encoder baseline (0.46–0.52 BAcc), though bare un-derived numeric answers remain conservative because RAG-strict training penalizes figures not explicitly printed in context.
Citation
@misc{flintglass2026prismverify4b,
title={PrismVerify-4B: Verifiable Reasoning and Span-Level Groundedness Verification},
author={Flintglass Labs},
year={2026},
url={https://huggingface.co/flintglass/PrismVerify-4B}
}