Instructions to use ThakiCloud/FactGuard-General-4B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ThakiCloud/FactGuard-General-4B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ThakiCloud/FactGuard-General-4B-v2") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ThakiCloud/FactGuard-General-4B-v2") model = AutoModelForMultimodalLM.from_pretrained("ThakiCloud/FactGuard-General-4B-v2", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ThakiCloud/FactGuard-General-4B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ThakiCloud/FactGuard-General-4B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThakiCloud/FactGuard-General-4B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ThakiCloud/FactGuard-General-4B-v2
- SGLang
How to use ThakiCloud/FactGuard-General-4B-v2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ThakiCloud/FactGuard-General-4B-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThakiCloud/FactGuard-General-4B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ThakiCloud/FactGuard-General-4B-v2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ThakiCloud/FactGuard-General-4B-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ThakiCloud/FactGuard-General-4B-v2 with Docker Model Runner:
docker model run hf.co/ThakiCloud/FactGuard-General-4B-v2
FactGuard-General-4B-v2 (research preview)
FactGuard-General-4B-v2 is a small claim–evidence verification model. Given evidence lines (F1–F9) and one atomic claim, it reads the probability of four label tokens at the answer position and returns one of:
| Token | Label | Meaning |
|---|---|---|
A |
SUPPORTED | The evidence entails the whole claim. |
B |
CONTRADICTED | The evidence explicitly states something incompatible with the claim. |
C |
NOT_VERIFIABLE | The evidence neither confirms nor refutes the claim. Information that is simply absent is NOT_VERIFIABLE, not CONTRADICTED. |
D |
STALE | Supported only by past (dated) evidence. |
It judges only the relation between a claim and the evidence you pass in. It does not know whether a fact is true in the world, and it does not search for evidence.
This is the Generalist member of the FactGuard family, trained from the base model on data whose rights were reviewed (see Training data). The Specialist models (ThakiCloud/FactGuard-4B, 8B, 9B, 27B) are trained for SaaS pricing claims and are unchanged. The repository contains merged BF16 weights (LoRA merged into Qwen/Qwen3.5-4B); no adapter setup is needed.
Status
Research preview. This checkpoint (internal name C1) did not pass its own pre-registered acceptance test: on the Specialist development set it scored 0.896 under the legacy label contract against a 0.910 threshold. That result stands. It is released as a research preview because it passed a separate release check (data rights, merge parity, reload) and because its balance of general and numeric verification was the best among the rights-reviewed candidates we trained. Every number below comes from development or synthetic sets built by us; performance on real, naturally occurring AI answers is not verified.
Usage
See example_inference.py and label_contract.json. Use the prompt exactly as specified: raw text, no chat template, add_special_tokens=False, at most 1,024 input tokens. Take the softmax over the four label-token logits at the last position.
head_general: the prompt for any domain (use this by default).head_saas_pricing: the FactGuard Specialist prompt, kept for compatibility.
AutoModelForCausalLM loads the text model. The checkpoint keeps the base model's full multimodal layout (vision tower, MTP weights, processor files) unchanged. Vision weights were not trained, and no image-verification ability is claimed.
Training
- Base:
Qwen/Qwen3.5-4B, revision851bf6e806efd8d0a36b00ddf55e13ccb7b8cd0a(Apache-2.0). - Start point: a new LoRA on the base model. No earlier FactGuard adapter was used.
- Method: LoRA r=16, alpha=32 on attention, linear-attention and MLP projections of the language model (vision excluded), 1 epoch (2,594 steps), batch 4×4, lr 5e-5, max length 1,024, seed 0. Merge:
W' = W + (B·A)·alpha/rin fp32, stored as BF16. - Hardware: one NVIDIA B200, 2,551 s of training.
Training data (41,515 rows, not released)
| Source | Rows | Labels | Origin and terms |
|---|---|---|---|
| Synthetic numeric/temporal verification (own) | 28,519 | A/B/C/D | Generated by our own code with fictional names; no external data, no language-model generation |
| MultiNLI, non-fiction genres only (government, slate, telephone, travel) | 9,996 | A/B/C | Open American National Corpus portion; the dataset card describes OANC terms as permitting free use, modification and sharing. The FICTION genre, which mixes Creative Commons ShareAlike works, was excluded |
| Synthetic pricing/feature tables (own) | 3,000 | A/B/C | Generated by our own code with fictional brands |
No AI-Hub data, no data generated by commercial language-model APIs, and no FEVER, TabFact, CUAD, FaithDial, KLUE, KorNLI or WildChat content was used. A scan of all 41,515 rows for these sources found none. Leakage filters: no training row shares its claim and evidence with any development or evaluation set.
Changes made to the source data. MultiNLI pairs were converted into the Korean instruction format above (premise as evidence lines, hypothesis as the claim; entailment → A, contradiction → B, neutral → C). Other rows are our own synthetic data.
Data is not released. Only the merged weights, this card, the label contract and the inference example are published.
Evaluation (development and synthetic sets — not sealed)
General development set (2,700 rows, 300 per source). These sources are an internal benchmark only; except MultiNLI they were not used for training this model:
| Source | This model |
|---|---|
| FEVER | 0.897 |
| MultiNLI | 0.903 |
| TabFact | 0.813 |
| AttributionBench | 0.723 |
| FaithDial | 0.753 |
| CUAD | 0.813 |
| KLUE-NLI | 0.907 |
| KorNLI | 0.803 |
| Synthetic general (own) | 0.863 |
| Overall | 0.831 (excluding MultiNLI 0.822) |
Recall: SUPPORTED 0.805, CONTRADICTED 0.814, NOT_VERIFIABLE 0.879. False SUPPORTED 122 / 2,700. Decisive evidence was marked NOT_VERIFIABLE in 15.0% of supported or contradicted rows. An internal model trained on additional sources whose rights are not confirmed reaches 0.891 on this set; that model is not released, and this model is about 6 points below it, mostly on CUAD, TabFact, FaithDial and our synthetic set.
| Set | This model | Note |
|---|---|---|
| Numeric/temporal verification (our generator, held-out) | 0.973 | Same generator family as training |
| Small numeric difference must be CONTRADICTED | 0.988 | Same generator family |
| SaaS pricing dev, evidence-semantic contract (4,348) | 0.934 | Specialist head; legacy contract 0.896 (pre-registered threshold 0.910 not met) |
| Synthetic web pricing pages (600, new generator) | 0.847 | Weakest: explicit "not included" / FAQ "only" rebuttals 0.625, footnote conditions 0.722 |
Single-stream latency (B200, batch 1): p50 81.6 ms, p95 83.7 ms.
Real-page AI answers (exploratory, already-analyzed set). On 450 claims from AI answers about real public pricing pages, with the verifying evidence given and no post-processing guard: 0.509 (no false SUPPORTED); the earlier FactGuard-4B Specialist scored 0.456 and a 27B reference model 0.547 on the same items. These labels are automatic, not human-reviewed, and most are model-assisted: a 27B model chose which page value to compare for 336 of the 450 claims. On the 114 claims where code alone re-confirms the plan-to-value attribution, this model scores 0.711 (Specialist 0.623, 27B reference 0.737; the 27B difference is not statistically clear). The 27B weights used are not pinned to a recorded checksum, and the set was analyzed before this card was written. Treat these as indications, not benchmark results.
Limitations
- Not a sealed evaluation. Development and synthetic sets share sources or generators with training and overstate performance on new data.
- Real AI-answer performance is not verified.
- The model often returns NOT_VERIFIABLE when the evidence does decide the claim, especially for "not included"/"only" statements and footnote conditions in pricing pages.
- It does not find evidence; wrong or missing evidence leads to wrong decisions.
- Not validated for legal, medical or financial-regulatory decisions. Pair it with an evidence-coverage check and human review for high-stakes use.
Provenance
- Adapter sha256:
7b0b789743fbe2c00beac5714bd84151c91a65097295ed7b1b46ffa823bcf07e - Training data sha256:
381f72a55410995a111830b591657387ad700e5173df863359974783bbfdfbaf - Merged shard sha256 and merge parity: see
eval_manifest.json(LoRA vs merged: 51/51 identical decisions, max probability difference 0.021, smallest decision margin 0.231) - License metadata: Apache-2.0, the base model's license. Training data terms are summarized above; this is not a legal conclusion.
- Downloads last month
- 37