Downloads · 30 days
6
16% of all-time downloads
jismsy/ko-hallucheck-4b
ko-hallucheck-4b is a text classification model from jismsy. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as gemma.
한국어 (context, answer) 쌍을 받아 답변이 문맥에 의해 뒷받침되는지 판정하는 4B sequence classifier입니다.
Downloads · 30 days
6
16% of all-time downloads
All-time downloads
37
Public
Parameters
4.3B
8.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.6 GB · 100%
From the Hugging Face model README
한국어 (context, answer) 쌍을 받아 답변이 문맥에 의해 뒷받침되는지 판정하는 4B sequence classifier입니다.
HALLUCINATED = 0: 문맥과 모순되거나 문맥에 없는 주장을 포함SUPPORTED = 1: 답변의 주장이 문맥에 의해 뒷받침됨이 모델은 ko-hallucheck-v3의 대체품이라기보다 재판정용 강력 티어입니다. v3로 전량을 빠르게 선별하고, 불확실하거나 고위험인 사례만 이 4B 모델로 올리는 구성을 권장합니다.
성능은 저희 모델에 불리한 결과와 생성기 독립 평가를 포함해 그대로 공개합니다. 아래 수치는 정확도이며 괄호 안은 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 출제, 학습·표준 벤치와 생성기 분리. 보수적 실전 추정치 |
추가 검증에서 in-distribution 0.932 (AUROC 0.980), KLUE 기반 뉴스 OOD 0.958 (AUROC 0.977)을 기록했습니다. 평가 데이터와 스크립트 설계는 Ko-FaithBench를 참고하세요.
transformers>=5.5.0과 PyTorch가 필요합니다. 병합된 BF16 가중치는 약 8.6GB입니다.
참고용 실측: NVIDIA GB10에서 프로세스 최초 로드는 40.8초, 로드 후 짧은 입력 2개 배치의 warm forward는 0.235초(약 8.5쌍/초)였습니다. 입력 길이·배치·런타임에 따라 달라지므로 모델을 요청마다 다시 로드하지 말고 상주 서비스로 운영하세요. GB10에서는 compute capability 12.1을 정식 지원하는 PyTorch 빌드를 권장합니다.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "jismsy/ko-hallucheck-4b"
device = "cuda" if torch.cuda.is_available() else "cpu"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSequenceClassification.from_pretrained(
model_id,
dtype="auto",
).to(device).eval()
context = "세종대왕은 조선의 제4대 왕이며 훈민정음을 창제했다."
answer = "세종대왕은 훈민정음을 창제했다."
inputs = tokenizer(
context,
answer,
truncation="longest_first",
max_length=512,
return_tensors="pt",
).to(device)
if "token_type_ids" not in inputs:
inputs["token_type_ids"] = torch.zeros_like(inputs["input_ids"])
with torch.inference_mode():
logits = model(**inputs).logits.float()
prob_supported = torch.softmax(logits, dim=-1)[0, 1].item()
label = "SUPPORTED" if prob_supported >= 0.5 else "HALLUCINATED"
print({"label": label, "prob_supported": prob_supported})
저장소의 inference_4b.py는 동일한 로직의 CLI 예제입니다.
ko-hallucheck-v3로 전체 요청을 저비용 선별합니다.점수는 도메인 간에 완전히 보정된 확률이 아닙니다. 실제 데이터의 검증셋으로 임계값을 다시 선택하세요.
unsloth/gemma-3-4b-it이 파생 모델은 Gemma 기반 모델입니다. 사용자는 Gemma Terms of Use를 준수해야 합니다.
@misc{kohallucheck4b2026,
title={ko-hallucheck-4b: A Strong-Tier Korean Faithfulness Classifier},
author={ianwoo},
year={2026},
url={https://huggingface.co/jismsy/ko-hallucheck-4b}
}