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ean
|
| 8 |
+
- reasoning
|
| 9 |
+
- instruction-tuning
|
| 10 |
+
- fine-tuning
|
| 11 |
+
- gemma3
|
| 12 |
+
- sft
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# π§ gemma-3-12b-it-Ko-Reasoning
|
| 16 |
+
|
| 17 |
+
> A large-scale Korean reasoning model fine-tuned from **google/gemma-3-12b-it**, designed to excel in logical and multi-hop reasoning tasks in Korean.
|
| 18 |
+
|
| 19 |
+
---
|
| 20 |
+
|
| 21 |
+
## π Overview
|
| 22 |
+
|
| 23 |
+
**gemma-3-12b-it-Ko-Reasoning** is a fine-tuned version of [google/gemma-3-12b-it](https://huggingface.co/google/gemma-3-12b-it), specifically optimized for **logical reasoning in Korean**. This model is part of a broader research initiative to explore:
|
| 24 |
+
|
| 25 |
+
- The **transition from multilingual reasoning LLMs** to **Korean-specialized reasoning models**
|
| 26 |
+
- The enhancement of **non-reasoning Korean language models** into **reasoning-capable variants**
|
| 27 |
+
- The development of open-access models that rival proprietary alternatives in complex reasoning tasks
|
| 28 |
+
|
| 29 |
+
This model was fine-tuned using a large-scale Korean-English instruction dataset containing diverse multi-hop questions, symbolic logic tasks, and human-crafted reasoning steps.
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
## π§ͺ Benchmark Results
|
| 34 |
+
|
| 35 |
+
> - π All benchmarks were measured using the **0-shot CoT (Chain-of-Thought)** method.
|
| 36 |
+
> - π The **Score** represents either the **accuracy (%)** of correct answers or a rating on a **1-10 scale** from a judge model.
|
| 37 |
+
> - π **LLM-as-a-judge** benchmarks were evaluated using **GPT-4o (2024-08-01-preview)**.
|
| 38 |
+
|
| 39 |
+
| **Benchmark** | **Score** |
|
| 40 |
+
|------------------|---------------|
|
| 41 |
+
| GPQA diamond | 61.3 |
|
| 42 |
+
| GSM8K | 59.6 |
|
| 43 |
+
| HAERAE | 73.9 |
|
| 44 |
+
| KSM | 66.7 |
|
| 45 |
+
| LogicKor | 8.56 |
|
| 46 |
+
| Math500 | 77.8 |
|
| 47 |
+
| MT-Bench | 8.54 |
|
| 48 |
+
| MT-Bench(Ko) | 8.80 |
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## π§βπ» Usage
|
| 53 |
+
|
| 54 |
+
Install Transformers >= 4.50:
|
| 55 |
+
|
| 56 |
+
```bash
|
| 57 |
+
pip install -U transformers
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
Basic example:
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
|
| 64 |
+
from PIL import Image
|
| 65 |
+
import requests
|
| 66 |
+
import torch
|
| 67 |
+
|
| 68 |
+
model_id = "DimensionSTP/gemma-3-12b-it-Ko-Reasoning"
|
| 69 |
+
|
| 70 |
+
model = Gemma3ForConditionalGeneration.from_pretrained(
|
| 71 |
+
model_id, device_map="auto"
|
| 72 |
+
).eval()
|
| 73 |
+
|
| 74 |
+
processor = AutoProcessor.from_pretrained(model_id)
|
| 75 |
+
|
| 76 |
+
messages = [
|
| 77 |
+
{
|
| 78 |
+
"role": "system",
|
| 79 |
+
"content": [{"type": "text", "text": "You are a helpful assistant."}]
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"role": "user",
|
| 83 |
+
"content": [
|
| 84 |
+
{"type": "text", "text": "μμΈκ³Ό λΆμ° μ€ μ΄λκ° λ 컀?"}
|
| 85 |
+
]
|
| 86 |
+
}
|
| 87 |
+
]
|
| 88 |
+
|
| 89 |
+
inputs = processor.apply_chat_template(
|
| 90 |
+
messages, add_generation_prompt=True, tokenize=True,
|
| 91 |
+
return_dict=True, return_tensors="pt"
|
| 92 |
+
).to(model.device, dtype=torch.bfloat16)
|
| 93 |
+
|
| 94 |
+
input_len = inputs["input_ids"].shape[-1]
|
| 95 |
+
|
| 96 |
+
with torch.inference_mode():
|
| 97 |
+
generation = model.generate(**inputs, max_new_tokens=8192, do_sample=False)
|
| 98 |
+
generation = generation[0][input_len:]
|
| 99 |
+
|
| 100 |
+
decoded = processor.decode(generation, skip_special_tokens=True)
|
| 101 |
+
print(decoded)
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
---
|
| 105 |
+
|
| 106 |
+
## π§ Base Model: google/gemma-3-12b-it
|
| 107 |
+
|
| 108 |
+
The base model, [google/gemma-3-12b-it](https://huggingface.co/google/gemma-3-12b-it), is a VLM developed by the Google team.
|
| 109 |
+
For more technical details, refer to the [Gemma 3 Technical Report](https://arxiv.org/abs/2503.19786).
|
| 110 |
+
|
| 111 |
+
---
|
| 112 |
+
|
| 113 |
+
## π§± Model Architecture
|
| 114 |
+
|
| 115 |
+
| Property | Value |
|
| 116 |
+
|------------------|--------------------------------------|
|
| 117 |
+
| Architecture | Gemma3ForConditionalGeneration |
|
| 118 |
+
| Parameters | 12B |
|
| 119 |
+
| Context Length | 128,000 tokens |
|
| 120 |
+
| Tokenizer | Gemma3Tokenizer (BPE) |
|
| 121 |
+
|
| 122 |
+
---
|
| 123 |
+
|
| 124 |
+
## π
Release Date
|
| 125 |
+
|
| 126 |
+
**Mar 2025**
|
| 127 |
+
This model was released in March 2025 as part of the **Ko-Reasoning Series**, which focuses on pushing the boundaries of open-source reasoning in Korean using modern LLMs.
|
| 128 |
+
|
| 129 |
+
---
|
| 130 |
+
|
| 131 |
+
## π¬ Contact
|
| 132 |
+
|
| 133 |
+
For questions, collaborations, or deployment inquiries, please contact:
|
| 134 |
+
|
| 135 |
+
- π€ Hugging Face: [https://huggingface.co/DimensionSTP](https://huggingface.co/DimensionSTP)
|
| 136 |
+
- βοΈ Email: [[email protected]]
|
| 137 |
+
|
| 138 |
+
---
|
| 139 |
+
|
| 140 |
+
## π¦ Available Checkpoints
|
| 141 |
+
|
| 142 |
+
- β
`main`: Final stable version from the `last` branch
|
| 143 |
+
- β
All training artifacts available (tokenizer, config, model weights)
|