Downloads · 30 days
14
4% of all-time downloads
kez-lab/gemma-2-2b-quiz-korean
gemma-2-2b-quiz-korean is a text generation model from kez-lab. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as gemma.
Base Model: Google Gemma-2-2B • Benchmark Score: 0.985 / 1.000 • 100% Grounded • Android LiteRT Ready
Downloads · 30 days
14
4% of all-time downloads
All-time downloads
340
Public
Parameters
2.6B
10.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors10.5 GB · 100%
From the Hugging Face model README
Base Model: Google Gemma-2-2B • Benchmark Score: 0.985 / 1.000 • 100% Grounded • Android LiteRT Ready
gemma-2-2b-quiz-korean is a specialized lightweight language model fine-tuned from Google Gemma-2-2B. It is engineered specifically for source-grounded Multiple Choice Question (MCQ) generation directly from Korean blog posts, technical documentation, and long-form articles.
The model strictly restricts question synthesis to facts explicitly verified within the provided source text, eliminating hallucinations while generating pedagogically meaningful 4-choice questions with hard-negative distractors and exact evidence citations.
<thought>) Reasoning:
Unlike standard single-pass generators, the model utilizes an internal autoregressive reasoning phase before producing the final JSON payload. It systematically plans the evidence sentence, target concept, unambiguous correct answer, and three same-category distractors.evidence quote from the source text, ensuring strict factual alignment and auditability.Evaluated against a held-out test suite of 100 document-level isolated articles across 10 domains (Android, Distributed Systems, AI/ML, Economics, Medicine, Natural Sciences, History, Philosophy, UX Design, and Architecture).
$$\text{QuizScore} = 0.30 \times \text{Groundedness} + 0.25 \times \text{Uniqueness} + 0.20 \times \text{DistractorQuality} + 0.15 \times \text{Importance} + 0.10 \times \text{LanguageQuality}$$
| Evaluation Metric | Base Gemma-2-2B (Prompted) | Gemma-2-2B Quiz Korean (Ours) | Improvement |
|---|---|---|---|
| Overall QuizScore | 0.9380 | 0.9850 / 1.000 | +5.0% |
| Groundedness (Factuality) | 0.940 | 1.000 (100%) | Zero Hallucination |
| Answer Uniqueness | 0.950 | 1.000 (100%) | Single Deterministic Answer |
| Distractor Plausibility | 0.920 | 1.000 | Semantic Category Match |
| Language Quality | 0.900 | 1.000 | Pure Korean Syntax |
| System Prompt Overhead | ~500 tokens | 0 tokens | Fully Embedded Behavior |
The model generates an internal <thought> trace followed by a structured JSON payload:
{
"questions": [
{
"question": "Specific question grounded in the source text",
"options": [
"Option A (same semantic category)",
"Option B (same semantic category)",
"Option C (same semantic category)",
"Option D (same semantic category)"
],
"answer_index": 2,
"explanation": "Clear educational explanation of why the answer is correct",
"evidence": "Verbatim excerpt from the article proving the answer"
}
]
}
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_ID = "kez-lab/gemma-2-2b-quiz-korean"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.bfloat16,
device_map="auto"
)
article = """
Jetpack Compose에서 derivedStateOf를 사용하면 원본 상태의 잦은 변화 중에서
우리가 관심 있는 특정 조건(firstVisibleItemIndex > 0)이 변경되는 순간에만
다운스트림 Recomposition을 트리거하도록 캐싱 및 완충 역할을 합니다.
"""
messages = [
{
"role": "user",
"content": f"주어진 글만을 근거로 핵심 개념을 분석하고 4지선다 객관식 문제를 생성하라.\n\n[ARTICLE]\n{article}"
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.01,
repetition_penalty=1.1
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
print(response)
This model can be compiled into .task / .tflite format for on-device execution using Google MediaPipe Tasks GenAI:
// Android SDK Usage
val generator = LocalQuizGenerator.builder(context)
.fromHuggingFace("kez-lab/gemma-2-2b-quiz-korean")
.setMaxTokens(1024)
.setTemperature(0.01f)
.build()
viewModelScope.launch {
val result = generator.generateQuiz(articleText)
result.onSuccess { quizzes ->
// Render verified quiz cards with evidence quotes
}
}
unsloth/gemma-2-2b-it, 2.6B parameters)q, k, v, o, gate, up, down)bfloat16