How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="flintglass/PrismVerify-4B")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("flintglass/PrismVerify-4B")
model = AutoModelForCausalLM.from_pretrained("flintglass/PrismVerify-4B", device_map="auto")
messages = [
    {"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links

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 โ€” achieving 0.821 F1 on RAGTruth-Test, 0.739 F1 on DocNLI-Test, and 0.955 F1 on LongRAG-8K (0.954 at 6,500 tokens with 2.0% FPR), with 99.8%โ€“100% JSON schema compliance and 98.9%โ€“99.7% verbatim span fidelity.


Key Highlights

  • +14.2 F1 over Base Qwen3-4B-Instruct-2507 on RAGTruth-Test (0.821 vs 0.680), +4.5 F1 over LettuceDetect-Large (0.777), and +20.8 F1 over vectara/HHEM-2.1-Open (0.613).
  • +12.8 F1 over Base Qwen3-4B on DocNLI-Test (0.739 vs 0.612) and +12.2 F1 at 6,500-token LongRAG-8K (0.954 vs 0.832, 2.0% FPR).
  • Two-Stage Verifiable Training (Apache-2.0 / MIT clean lineage):
    1. Stage 1 โ€” Full-Parameter BF16 SFT on 21,603 zero-leakage structured verification examples (human-annotated RAGTruth spans & rationales, multi-chunk LongRAG up to 6,500 tokens, and synthetic numerical/financial table arithmetic verification).
    2. Stage 2 โ€” Online Self-Play Verifiable DPO (RLVR): Sampled K=4 on-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).
  • 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 in vllm / 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}
}
Downloads last month
-
Safetensors
Model size
4B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for flintglass/PrismVerify-4B

Finetuned
(2,838)
this model
Quantizations
1 model

Dataset used to train flintglass/PrismVerify-4B