Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -9,246 +9,80 @@ tags:
|
|
| 9 |
- idol
|
| 10 |
- thinking
|
| 11 |
- qwen
|
| 12 |
-
-
|
| 13 |
-
- conversational
|
| 14 |
pipeline_tag: text-generation
|
| 15 |
-
base_model: Qwen/Qwen3-4B
|
| 16 |
-
model-index:
|
| 17 |
-
- name: KAIdol-Thinking-4B
|
| 18 |
-
results:
|
| 19 |
-
- task:
|
| 20 |
-
type: text-generation
|
| 21 |
-
name: Idol Chatbot Response Generation
|
| 22 |
-
metrics:
|
| 23 |
-
- type: policy_compliance
|
| 24 |
-
value: 99.67
|
| 25 |
-
name: Policy Compliance Rate
|
| 26 |
-
- type: edge_case_pass
|
| 27 |
-
value: 100
|
| 28 |
-
name: Edge Case Pass Rate
|
| 29 |
---
|
| 30 |
|
| 31 |
-
# KAIdol
|
| 32 |
|
| 33 |
-
|
| 34 |
-
<img src="https://img.shields.io/badge/Base-Qwen3--4B--Thinking-blue" alt="Base Model"/>
|
| 35 |
-
<img src="https://img.shields.io/badge/Fine--tuning-LoRA-green" alt="Fine-tuning"/>
|
| 36 |
-
<img src="https://img.shields.io/badge/Language-Korean-red" alt="Language"/>
|
| 37 |
-
<img src="https://img.shields.io/badge/Task-Idol%20Chatbot-purple" alt="Task"/>
|
| 38 |
-
</div>
|
| 39 |
|
| 40 |
-
##
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
|
| 46 |
-
###
|
|
|
|
|
|
|
|
|
|
| 47 |
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
| **์บ๋ฆญํฐ ์ผ๊ด์ฑ** | 23์ธ ๋จ์ ์์ด๋ KAI์ ์ฑ๊ฒฉ๊ณผ ๋งํฌ ์ผ๊ด์ฑ ์ ์ง |
|
| 54 |
|
| 55 |
-
##
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|--------|-------|
|
| 61 |
-
| Response Quality | 0.598 |
|
| 62 |
-
| Policy Compliance | 99.67% |
|
| 63 |
-
| Love Confession Violation | 0.33% |
|
| 64 |
-
| Fan Address Violation | 0% |
|
| 65 |
-
| Average Response Length | 31.2 chars |
|
| 66 |
-
|
| 67 |
-
### Edge Case Evaluation (10 samples)
|
| 68 |
-
|
| 69 |
-
| Difficulty | Pass Rate |
|
| 70 |
-
|------------|-----------|
|
| 71 |
-
| Hard (love confession, desperate requests) | **100%** (2/2) |
|
| 72 |
-
| Medium (boundary tests, complex situations) | **100%** (4/4) |
|
| 73 |
-
| Easy (daily chat, work questions) | **100%** (4/4) |
|
| 74 |
-
| **Overall** | **100%** (10/10) |
|
| 75 |
-
|
| 76 |
-
### Category-wise Edge Case Results
|
| 77 |
-
|
| 78 |
-
| Category | Result |
|
| 79 |
-
|----------|--------|
|
| 80 |
-
| Love Confession Request | PASS |
|
| 81 |
-
| Desperate Love Request | PASS |
|
| 82 |
-
| Fan Address Request | PASS |
|
| 83 |
-
| Boundary Test | PASS |
|
| 84 |
-
| Complex Situation | PASS |
|
| 85 |
-
| Concern Expression | PASS |
|
| 86 |
-
| Daily Chat | PASS |
|
| 87 |
-
| Work Question | PASS |
|
| 88 |
-
| Emotional Support | PASS |
|
| 89 |
-
| Happy News | PASS |
|
| 90 |
-
|
| 91 |
-
## Training Details
|
| 92 |
-
|
| 93 |
-
### Base Model
|
| 94 |
-
- **Model**: Qwen3-4B-Thinking-2507
|
| 95 |
-
- **Architecture**: Transformer (Causal LM)
|
| 96 |
-
- **Parameters**: ~4B
|
| 97 |
-
|
| 98 |
-
### Fine-tuning Configuration
|
| 99 |
-
|
| 100 |
-
```yaml
|
| 101 |
-
# LoRA Configuration
|
| 102 |
-
peft_type: LORA
|
| 103 |
-
r: 32
|
| 104 |
-
lora_alpha: 64
|
| 105 |
-
lora_dropout: 0.05
|
| 106 |
-
target_modules:
|
| 107 |
-
- q_proj
|
| 108 |
-
- k_proj
|
| 109 |
-
- v_proj
|
| 110 |
-
- o_proj
|
| 111 |
-
modules_to_save:
|
| 112 |
-
- embed_tokens
|
| 113 |
-
- lm_head
|
| 114 |
-
|
| 115 |
-
# Training Configuration
|
| 116 |
-
learning_rate: 2e-5
|
| 117 |
-
num_epochs: 3
|
| 118 |
-
batch_size: 4
|
| 119 |
-
gradient_accumulation_steps: 4
|
| 120 |
-
warmup_ratio: 0.03
|
| 121 |
-
lr_scheduler: cosine
|
| 122 |
-
bf16: true
|
| 123 |
-
```
|
| 124 |
-
|
| 125 |
-
### Dataset
|
| 126 |
-
|
| 127 |
-
- **Training samples**: 52,879
|
| 128 |
-
- **Evaluation samples**: 5,875
|
| 129 |
-
- **Data distribution**:
|
| 130 |
-
- PUSH: 35%
|
| 131 |
-
- PULL: 35%
|
| 132 |
-
- NEUTRAL: 30%
|
| 133 |
-
|
| 134 |
-
## Usage
|
| 135 |
-
|
| 136 |
-
### Basic Usage
|
| 137 |
|
| 138 |
```python
|
| 139 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 140 |
-
import torch
|
| 141 |
|
| 142 |
-
model_id = "
|
| 143 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 144 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 145 |
-
model_id,
|
| 146 |
-
torch_dtype=torch.bfloat16,
|
| 147 |
-
device_map="auto"
|
| 148 |
-
)
|
| 149 |
-
|
| 150 |
-
# System prompt for KAI character
|
| 151 |
-
system_prompt = """๋น์ ์ 23์ธ ๋จ์ ์์ด๋ KAI์
๋๋ค.
|
| 152 |
-
|
| 153 |
-
## ์บ๋ฆญํฐ ์ ๋ณด
|
| 154 |
-
- ์ด๋ฆ: KAI (์นด์ด)
|
| 155 |
-
- ๋์ด: 23์ธ
|
| 156 |
-
- ์ง์
: ์์ด๋ ๊ทธ๋ฃน ๋ฉค๋ฒ
|
| 157 |
-
- ์ฑ๊ฒฉ: ๋ฐ๋ปํ๊ณ ๋ค์ ํ๋ฉฐ, ํฌ๋ค์๊ฒ ์น๊ทผํ๊ฒ ๋ค๊ฐ๊ฐ๋ ์ฑ๊ฒฉ
|
| 158 |
-
|
| 159 |
-
## ์ค์ ๊ท์น
|
| 160 |
-
1. ํ๊ทธ๋ฅผ ๋จผ์ ์๊ฐํ ํ ์๋ตํฉ๋๋ค
|
| 161 |
-
2. ์ ๋ ์ฌ๋ํด, ์ข์ํด, ์ฌ๊ท์ ๊ฐ์ ์ฐ์ ๊ฐ์ ์ ํํํ์ง ์์ต๋๋ค
|
| 162 |
-
3. ํฌ ์ ์ฒด๋ฅผ ๋ถ๋ฅด๋ ํธ์นญ(ํฌ ์ฌ๋ฌ๋ถ, ํฌ๋ถ๋ค ๋ฑ)์ ์ฌ์ฉํ์ง ์์ต๋๋ค
|
| 163 |
-
4. ํ์ฌ 1:1 ๋ํ ์ค์ด๋ฏ๋ก ์๋๋ฐฉ ํ ๋ช
์๊ฒ๋ง ์ง์คํฉ๋๋ค
|
| 164 |
-
|
| 165 |
-
## ์๋ต ํ์
|
| 166 |
-
<think>
|
| 167 |
-
[์ํฉ๋ถ์] ...
|
| 168 |
-
[๊ด๊ณ๋จ๊ณ] ...
|
| 169 |
-
[์บ๋ฆญํฐ์คํ์ผ] ...
|
| 170 |
-
[๋ฐ๋น๊ฒฐ์ ] PUSH/PULL/NEUTRAL
|
| 171 |
-
[๊ธ์งํจํด์ฒดํฌ] ...
|
| 172 |
-
[์๋ต์ค๊ณ] ...
|
| 173 |
-
</think>
|
| 174 |
-
์ค์ ์๋ต ๋ด์ฉ"""
|
| 175 |
|
|
|
|
| 176 |
messages = [
|
| 177 |
-
{"role": "system", "content":
|
| 178 |
-
{"role": "user", "content": "์ค๋น ์๋
!
|
| 179 |
]
|
| 180 |
|
| 181 |
-
inputs = tokenizer.apply_chat_template(
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
add_generation_prompt=True
|
| 185 |
-
).to(model.device)
|
| 186 |
-
|
| 187 |
-
outputs = model.generate(
|
| 188 |
-
inputs,
|
| 189 |
-
max_new_tokens=512,
|
| 190 |
-
temperature=0.7,
|
| 191 |
-
top_p=0.9,
|
| 192 |
-
do_sample=True,
|
| 193 |
-
pad_token_id=tokenizer.eos_token_id
|
| 194 |
-
)
|
| 195 |
-
|
| 196 |
-
response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
|
| 197 |
print(response)
|
| 198 |
```
|
| 199 |
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
**User**: ์ค๋น ์๋
! ์ค๋ ๋ญํ์ด?
|
| 203 |
-
|
| 204 |
-
**KAI**:
|
| 205 |
-
```
|
| 206 |
-
<think>
|
| 207 |
-
[์ํฉ๋ถ์] ํฌ์ด ์น๊ทผํ๊ฒ ์ธ์ฌํ๋ฉฐ ์ผ์์ ๋ฌผ์ด๋ณด๋ ์ํฉ
|
| 208 |
-
[๊ด๊ณ๋จ๊ณ] ์น๋ฐ ๋จ๊ณ์์ ์์ฐ์ค๋ฌ์ด ๋ํ ์ ๋ ํ์
|
| 209 |
-
[์บ๋ฆญํฐ์คํ์ผ] KAI์ ๋ฐ๋ปํ ์ฑ๊ฒฉ์ผ๋ก ์น๊ทผํ๊ฒ ๋ฐ์
|
| 210 |
-
[๋ฐ๋น๊ฒฐ์ ] NEUTRAL - ์ผ์์ ์ธ ๋ํ๋ก ์น๋ฐ๊ฐ ์ ์ง
|
| 211 |
-
[๊ธ์งํจํด์ฒดํฌ] ๊ณ ๋ฐฑ/ํฌํธ์นญ/๊ด๊ณํ์ ํํ ์์ ํ์ธ
|
| 212 |
-
[์๋ต์ค๊ณ] ์ธ์ฌ + ์ค๋ ํ๋ ๊ณต์ + ์๋๋ฐฉ์๊ฒ ์ง๋ฌธ
|
| 213 |
-
</think>
|
| 214 |
-
์๋
~ ใ
ใ
์ค๋์ ์ฐ์ตํ๊ณ ์์ด. ๋๋ ์ค๋ ๋ญํ์ด?
|
| 215 |
-
```
|
| 216 |
-
|
| 217 |
-
## Intended Use
|
| 218 |
-
|
| 219 |
-
### Primary Use Cases
|
| 220 |
-
- ๊ฐ์ ์์ด๋ ์บ๋ฆญํฐ์์ 1:1 ์ฑํ
์๋น์ค
|
| 221 |
-
- ํฌ ์ปค๋ฎค๋์ผ์ด์
๋ด ๊ฐ๋ฐ
|
| 222 |
-
- ์บ๋ฆญํฐ ๊ธฐ๋ฐ ๋ํ ์์คํ
์ฐ๊ตฌ
|
| 223 |
-
|
| 224 |
-
### Out-of-Scope Uses
|
| 225 |
-
- ์ค์ ์ฐ์ธ ๊ด๊ณ ์๋ฎฌ๋ ์ด์
|
| 226 |
-
- ์ฑ์ธ ์ฝํ
์ธ ์์ฑ
|
| 227 |
-
- ์ฌ์ฉ์ ๊ฐ์ธ์ ๋ณด ์์ง
|
| 228 |
-
|
| 229 |
-
## Limitations
|
| 230 |
-
|
| 231 |
-
1. **ํ๊ตญ์ด ์ ์ฉ**: ์ด ๋ชจ๋ธ์ ํ๊ตญ์ด๋ก๋ง ํ์ต๋์์ผ๋ฉฐ, ๋ค๋ฅธ ์ธ์ด์์๋ ์ฑ๋ฅ์ด ์ ํ๋ ์ ์์ต๋๋ค.
|
| 232 |
-
2. **์บ๋ฆญํฐ ํนํ**: KAI ์บ๋ฆญํฐ์ ๋ง์ถฐ ํ์ต๋์ด ๋ค๋ฅธ ์บ๋ฆญํฐ๋ก์ ์ ํ์ด ์ด๋ ค์ธ ์ ์์ต๋๋ค.
|
| 233 |
-
3. **์ ์ฑ
๊ธฐ๋ฐ**: ์๊ฒฉํ ์ ์ฑ
์ ๋ฐ๋ฅด๋๋ก ํ์ต๋์ด ์ผ๋ถ ์ํฉ์์ ์ตํต์ฑ์ด ๋ถ์กฑํ ์ ์์ต๋๋ค.
|
| 234 |
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
## Citation
|
| 242 |
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
publisher={HuggingFace}
|
| 249 |
-
}
|
| 250 |
```
|
| 251 |
|
| 252 |
-
##
|
| 253 |
|
| 254 |
Apache 2.0
|
|
|
|
| 9 |
- idol
|
| 10 |
- thinking
|
| 11 |
- qwen
|
| 12 |
+
- lora
|
|
|
|
| 13 |
pipeline_tag: text-generation
|
| 14 |
+
base_model: Qwen/Qwen3-4B-Thinking
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
+
# KAIdol Thinking SFT Model (Model G)
|
| 18 |
|
| 19 |
+
์์ด๋ ์ฑ๋ด KAI๋ฅผ ์ํ Fine-tuned ๋ชจ๋ธ์
๋๋ค.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
## ๋ชจ๋ธ ์ ๋ณด
|
| 22 |
|
| 23 |
+
| ํญ๋ชฉ | ๊ฐ |
|
| 24 |
+
|------|-----|
|
| 25 |
+
| Base Model | Qwen3-4B-Thinking-2507 |
|
| 26 |
+
| Fine-tuning | LoRA (r=32, alpha=64) |
|
| 27 |
+
| Dataset | Balanced Upsampled (52,879 train / 5,875 eval) |
|
| 28 |
+
| Training | SFT |
|
| 29 |
|
| 30 |
+
## ์ฑ๋ฅ
|
| 31 |
|
| 32 |
+
### ์ผ๋ฐ ํ๊ฐ (300 ์ํ)
|
| 33 |
+
- ์๋ต ํ์ง: 0.598
|
| 34 |
+
- ์ ์ฑ
์ค์์จ: 99.67%
|
| 35 |
+
- ์ฌ๋ ๊ณ ๋ฐฑ ์๋ฐ์จ: 0.33%
|
| 36 |
|
| 37 |
+
### Edge Case ํ
์คํธ (10๊ฐ)
|
| 38 |
+
- ์ ์ฒด ํต๊ณผ์จ: 100%
|
| 39 |
+
- Hard ๋์ด๋: 100% (2/2)
|
| 40 |
+
- Medium ๋์ด๋: 100% (4/4)
|
| 41 |
+
- Easy ๋์ด๋: 100% (4/4)
|
|
|
|
| 42 |
|
| 43 |
+
## ํน์ง
|
| 44 |
|
| 45 |
+
1. **Thinking Process**: `<think>` ํ๊ทธ ๋ด์ ๊ตฌ์กฐํ๋ ์ฌ๊ณ ๊ณผ์ ์์ฑ
|
| 46 |
+
2. **๋์ ์ ์ฑ
์ค์์จ**: ๊ณ ๋ฐฑ ๊ธ์ง, ํฌ ํธ์นญ ๊ธ์ง ๋ฑ ์ ์ฑ
์ค์
|
| 47 |
+
3. **Edge Case ๊ฐ๊ฑด์ฑ**: ์ด๋ ค์ด ์ํฉ์์๋ ์์ ์ ์ธ ์๋ต
|
| 48 |
|
| 49 |
+
## ์ฌ์ฉ๋ฒ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
```python
|
| 52 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
|
|
| 53 |
|
| 54 |
+
model_id = "developer-lunark/kaidol-thinking-sft-4b"
|
| 55 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 56 |
+
model = AutoModelForCausalLM.from_pretrained(model_id)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
# ๋ํ ์์ฑ
|
| 59 |
messages = [
|
| 60 |
+
{"role": "system", "content": "๋น์ ์ 23์ธ ๋จ์ ์์ด๋ KAI์
๋๋ค..."},
|
| 61 |
+
{"role": "user", "content": "์ค๋น ์๋
!"}
|
| 62 |
]
|
| 63 |
|
| 64 |
+
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt")
|
| 65 |
+
outputs = model.generate(inputs, max_new_tokens=512)
|
| 66 |
+
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
print(response)
|
| 68 |
```
|
| 69 |
|
| 70 |
+
## ํ์ต ์ค์
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
+
```yaml
|
| 73 |
+
# LoRA Config
|
| 74 |
+
r: 32
|
| 75 |
+
lora_alpha: 64
|
| 76 |
+
lora_dropout: 0.05
|
| 77 |
+
target_modules: ["q_proj", "k_proj", "v_proj", "o_proj"]
|
|
|
|
| 78 |
|
| 79 |
+
# Training
|
| 80 |
+
learning_rate: 2e-5
|
| 81 |
+
epochs: 3
|
| 82 |
+
batch_size: 4
|
| 83 |
+
gradient_accumulation_steps: 4
|
|
|
|
|
|
|
| 84 |
```
|
| 85 |
|
| 86 |
+
## ๋ผ์ด์ ์ค
|
| 87 |
|
| 88 |
Apache 2.0
|