Instructions to use ThakiCloud/FactGuard-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ThakiCloud/FactGuard-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ThakiCloud/FactGuard-8B") 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("ThakiCloud/FactGuard-8B") model = AutoModelForCausalLM.from_pretrained("ThakiCloud/FactGuard-8B", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ThakiCloud/FactGuard-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ThakiCloud/FactGuard-8B" # 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-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ThakiCloud/FactGuard-8B
- SGLang
How to use ThakiCloud/FactGuard-8B 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-8B" \ --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-8B", "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-8B" \ --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-8B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ThakiCloud/FactGuard-8B with Docker Model Runner:
docker model run hf.co/ThakiCloud/FactGuard-8B
FactGuard-8B (v0.1, research preview)
FactGuard-8B is a claim–evidence verification model, the 8B member of the FactGuard family. Unlike the 4B/9B/27B members (Qwen3.5/3.8 hybrid linear-attention models), it is built on Qwen3-8B, a full-attention text-only model with a different tokenizer. Given a set of 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 (product, plan, number, condition, period). |
B |
CONTRADICTED | The evidence explicitly states something incompatible with the claim. |
C |
NOT_VERIFIABLE | The evidence does not say it, or plan/column attribution or conditions cannot be confirmed. |
D |
STALE | Supported only by past (dated) evidence. |
It is a specialist model. It was trained for SaaS product pricing, plan, limit, and feature claims (mostly Korean claims against English or Korean pricing pages). 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.
This repository contains the merged BF16 weights: the LoRA adapter merged into Qwen/Qwen3-8B. It loads like any Qwen3 checkpoint, and no adapter setup is needed.
Status
Research preview.
- Sealed evaluation pending. A new sealed Specialist benchmark (unseen brands, documents and phrasings) will compare FactGuard 4B/8B/9B/27B and their base models; this card will be updated when it is out.
- Performance on real AI answers is unverified.
- The 0.987 below is a development-set result. It is not a generalization accuracy.
- Not validated as a replacement for a 27B judge.
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), and take the softmax over the four label token logits at the last position.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tok = AutoTokenizer.from_pretrained("ThakiCloud/FactGuard-8B")
model = AutoModelForCausalLM.from_pretrained("ThakiCloud/FactGuard-8B", dtype=torch.bfloat16, device_map="auto")
# prompt = HEAD + evidence_packet + "\n\n판정:" (HEAD is in label_contract.json)
Qwen3-8B is text-only. Label token ids differ from the Qwen3.5 members: 362, 425, 356, 422 (see label_contract.json); example_inference.py computes them from the tokenizer.
Training
- Base:
Qwen/Qwen3-8B, revisionb968826d9c46dd6066d109eabc6255188de91218. All 15 files match the Hub LFS/blob hashes. - Method: LoRA (r=16, alpha=32, dropout 0.05) on all attention and MLP projections (q/k/v/o, gate/up/down). The adapter was merged with
W' = W + (B·A)·alpha/r, computed in fp32 and stored as BF16, on the unquantized base weights. - Curriculum. The same data, curriculum, and hyperparameters as FactGuard-4B v0.3. Each stage continued from the previous adapter, for 1 epoch at batch 4×4 and max length 1,024.
- v0: 18,000 synthetic counterfactual rows on fictional brands, labels set by the generating operation, lr 1e-4.
- v0.1: 10,000 rows (7,000 table/card/fragment formats on fictional brands + 3,000 replay), lr 5e-5.
- v0.3: 4,530 rows (1,530 deterministic counterfactuals built on official pricing pages of 25 real SaaS brands, using only cells where two extractors agreed + 3,000 replay), lr 5e-5, seed 2.
- An auxiliary head-free objective predicts the decision evidence id (weight 0.3).
- Hardware: a single NVIDIA B200 for all stages (about 36 minutes of training in total; final stage 284 steps).
- Data not released. The training data contains no customer data and no human or LLM labels. Sealed evaluation sets were never used in training. The training/eval brand and claim-string overlap with the evaluation sets is 0.
Evaluation
These are development sets, not sealed evaluations. They were used during FactGuard development (the 4B v0.3 seed was selected on them), so they are not a held-out estimate. A sealed family benchmark (unseen brands, documents and phrasings) is pre-registered and pending.
| Model | V03DEV (4,377) acc · S recall · FS · FC | DEV4ALL (513) | SLACKV22 (179) |
|---|---|---|---|
| Qwen3-8B base (no training) | 0.495 · 0.868 · 412 · 1 | 0.752 · 0.986 · 98 · 0 | 0.888 · 0.661 · 1 · 0 |
| FactGuard-8B v0.1 | 0.987 · 0.990 · 26 · 15 | 0.992 · 0.993 · 0 · 0 | 0.922 · 0.750 · 0 · 1 |
| FactGuard-9B v0.1 | 0.992 · 0.994 · 18 · 13 | 0.981 · 0.980 · 1 · 4 | 0.955 · 0.857 · 0 · 1 |
| FactGuard-4B v0.3 | 0.993 · 0.996 · 17 · 8 | 0.990 · 0.986 · 0 · 0 | 0.933 · 0.804 · 1 · 2 |
FS = false support. FC = false contradiction. V03DEV and DEV4ALL are counterfactual; SLACKV22 is 179 claims from real answers with labels that were not independently audited.
- The untrained base leans toward SUPPORTED (412 false supports on V03DEV). Training reduces this to 26.
- On these sets 8B is slightly below 4B and 9B, with the lowest SUPPORTED recall on SLACKV22. Architecture and tokenizer differ, so this is not a pure size effect.
- Single-stream latency (B200, batch 1, model only): p50 68.1 ms, p95 74.8 ms.
Merge check: the merged weights and the original LoRA adapter produce the same decisions on held-out development items (see eval_manifest.json).
Limitations
- Performance on real, naturally occurring AI answers is not established, and no sealed evaluation exists for this model yet. Do not read development or counterfactual accuracy as real-world accuracy.
- It has the lowest SUPPORTED recall in the family on SLACKV22 (0.750) and more false contradictions than FactGuard-4B.
- Single-model decisions can produce false support. Pair the model with an evidence-coverage guard and human review for high-stakes use.
- The model was trained for pricing, plan, and feature claims only. It is not validated for legal, financial-regulatory, medical, or general-knowledge verification.
- "Not found in the evidence" means NOT_VERIFIABLE, not "false". Wrong or incomplete evidence can lead to wrong SUPPORTED decisions.
Provenance
- Adapter sha256:
0f4028352751b268971f56809f039e9f5a1dab3a1695c480a1a1e60336935221 - Merged shard sha256: see
eval_manifest.json - License: Apache-2.0, following the base model.
- Downloads last month
- 29