Views
No views yet
(context, answer) 쌍을 받아 답변이 문맥에 의해 뒷받침되는지 판정하는 4B sequence classifier입니다.HALLUCINATED = 0: 문맥과 모순되거나 문맥에 없는 주장을 포함SUPPORTED = 1: 답변의 주장이 문맥에 의해 뒷받침됨성능은 저희 모델에 불리한 결과와 생성기 독립 평가를 포함해 그대로 공개합니다. 아래 수치는 정확도이며 괄호 안은 AUROC입니다.
| 평가 | n | v3.1 (0.6B) | 4B | 해석 |
|---|---|---|---|---|
| Ko-FaithBench Standard | 982 | 0.882 (0.951) | 0.970 (0.994) | 같은 생성기 계열의 영향으로 다소 후한 평가 |
| Ko-FaithBench Hard | 380 | 0.758 (0.824) | 0.808 (0.920) | 프런티어도 어려워한 적대적 문항 |
| 교차 생성기 | 162 | 0.704 (0.776) | 0.833 (0.931) | DeepSeek 출제, 학습·표준 벤치와 생성기 분리. 보수적 실전 추정치 |
transformers>=5.5.0과 PyTorch가 필요합니다. 병합된 BF16 가중치는 약 8.6GB입니다.1import torch
2from transformers import AutoModelForSequenceClassification, AutoTokenizer
3
4model_id = "jismsy/ko-hallucheck-4b"
5device = "cuda" if torch.cuda.is_available() else "cpu"
6
7tokenizer = AutoTokenizer.from_pretrained(model_id)
8model = AutoModelForSequenceClassification.from_pretrained(
9 model_id,
10 dtype="auto",
11).to(device).eval()
12
13context = "세종대왕은 조선의 제4대 왕이며 훈민정음을 창제했다."
14answer = "세종대왕은 훈민정음을 창제했다."
15inputs = tokenizer(
16 context,
17 answer,
18 truncation="longest_first",
19 max_length=512,
20 return_tensors="pt",
21).to(device)
22if "token_type_ids" not in inputs:
23 inputs["token_type_ids"] = torch.zeros_like(inputs["input_ids"])
24
25with torch.inference_mode():
26 logits = model(**inputs).logits.float()
27prob_supported = torch.softmax(logits, dim=-1)[0, 1].item()
28label = "SUPPORTED" if prob_supported >= 0.5 else "HALLUCINATED"
29print({"label": label, "prob_supported": prob_supported})inference_4b.py는 동일한 로직의 CLI 예제입니다.ko-hallucheck-v3로 전체 요청을 저비용 선별합니다.unsloth/gemma-3-4b-it1@misc{kohallucheck4b2026,
2 title={ko-hallucheck-4b: A Strong-Tier Korean Faithfulness Classifier},
3 author={ianwoo},
4 year={2026},
5 url={https://huggingface.co/jismsy/ko-hallucheck-4b}
6}