Upload folder using huggingface_hub
Browse files- README.md +107 -0
- benchmark_result.json +59 -0
- config.json +16 -0
- pytorch_model.bin +3 -0
- tokenizer.json +0 -0
README.md
CHANGED
|
@@ -1,3 +1,110 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- ko
|
| 5 |
+
tags:
|
| 6 |
+
- reasoning
|
| 7 |
+
- math
|
| 8 |
+
- code
|
| 9 |
+
- from-scratch
|
| 10 |
+
- korean
|
| 11 |
+
- gpt
|
| 12 |
+
model-index:
|
| 13 |
+
- name: SOVYN-85M
|
| 14 |
+
results:
|
| 15 |
+
- task:
|
| 16 |
+
type: reasoning
|
| 17 |
+
name: Custom Reasoning Benchmark
|
| 18 |
+
metrics:
|
| 19 |
+
- type: accuracy
|
| 20 |
+
value: 86.5
|
| 21 |
+
name: Overall Accuracy
|
| 22 |
---
|
| 23 |
+
|
| 24 |
+
# SOVYN-85M
|
| 25 |
+
|
| 26 |
+
**85.4M ํ๋ผ๋ฏธํฐ ํ๊ตญ์ด ์ถ๋ก ํนํ GPT ๋ชจ๋ธ**
|
| 27 |
+
|
| 28 |
+
์์ ํ ์ฒ์๋ถํฐ(from scratch) ํ์ต๋ ํ๊ตญ์ด ์ถ๋ก AI์
๋๋ค.
|
| 29 |
+
์ํ, ์ฝ๋ฉ, ๋
ผ๋ฆฌ, ๊ณผํ ๋ฑ ๋ค์ํ ์ถ๋ก ๋ฌธ์ ๋ฅผ ๋จ๊ณ๋ณ๋ก ํ์ดํฉ๋๋ค.
|
| 30 |
+
|
| 31 |
+
## ๋ชจ๋ธ ๊ตฌ์กฐ
|
| 32 |
+
|
| 33 |
+
| ํญ๋ชฉ | ๊ฐ |
|
| 34 |
+
|------|-----|
|
| 35 |
+
| Architecture | GPT (Decoder-only Transformer) |
|
| 36 |
+
| Parameters | 85.4M |
|
| 37 |
+
| Layers | 12 |
|
| 38 |
+
| Heads | 12 |
|
| 39 |
+
| Embed Dim | 768 |
|
| 40 |
+
| Context Length | 512 |
|
| 41 |
+
| Vocab Size | 16,384 (BPE) |
|
| 42 |
+
| Attention | Flash Attention (SDPA) |
|
| 43 |
+
|
| 44 |
+
## ํ์ต ๋ฐ์ดํฐ
|
| 45 |
+
|
| 46 |
+
- **591,261๊ฐ** ํฉ์ฑ ์ถ๋ก ๋ฌธ์ (119 ์นดํ
๊ณ ๋ฆฌ)
|
| 47 |
+
- **27.97M ํ ํฐ** (BPE, vocab 16,384)
|
| 48 |
+
- ์นดํ
๊ณ ๋ฆฌ: ์ํ, ๋์, ๋ฏธ์ ๋ถ, ๋ฌผ๋ฆฌ, ํํ, ์๋ฌผ, ์ง๊ตฌ๊ณผํ, ํ๊ตญ์ฌ, ์ฝ๋ฉ, ๋
ผ๋ฆฌ, ์์ด, ํ๊ตญ์ด, ํจ์ ๋ฑ
|
| 49 |
+
|
| 50 |
+
## ํ์ต ์ค์
|
| 51 |
+
|
| 52 |
+
- Optimizer: AdamW (lr=3e-4, weight_decay=0.1)
|
| 53 |
+
- Schedule: Cosine decay with warmup (500 steps)
|
| 54 |
+
- Batch: 16 ร 4 grad_accum = effective 64
|
| 55 |
+
- Steps: 20,000
|
| 56 |
+
- Mixed Precision: AMP + GradScaler
|
| 57 |
+
- Hardware: NVIDIA RTX 5080 (16GB)
|
| 58 |
+
|
| 59 |
+
## ๋ฒค์น๋งํฌ ๊ฒฐ๊ณผ
|
| 60 |
+
|
| 61 |
+
| ์นดํ
๊ณ ๋ฆฌ | ์ ํ๋ |
|
| 62 |
+
|---------|--------|
|
| 63 |
+
| ์ฐ์ _๊ธฐ๋ณธ | 100% |
|
| 64 |
+
| ์ฝ๋_ํธ๋ ์ด์ฑ | 100% |
|
| 65 |
+
| ์ซ์_์ฑ์ง | 100% |
|
| 66 |
+
| ์์ ํ | 100% |
|
| 67 |
+
| ์ฐ์ฐ_์ฐ์ ์์ | 88% |
|
| 68 |
+
| ๋ฆฌ์คํธ_์ฐ์ฐ | 83% |
|
| 69 |
+
| ๊ดํธ_์ฐ์ฐ | 80% |
|
| 70 |
+
| ๋ฐฉ์ ์ | 80% |
|
| 71 |
+
| ๋
ผ๋ฆฌ | 80% |
|
| 72 |
+
| ์์ด | 33% |
|
| 73 |
+
| **์ ์ฒด** | **86.5% (A๋ฑ๊ธ)** |
|
| 74 |
+
|
| 75 |
+
## ์ฌ์ฉ๋ฒ
|
| 76 |
+
|
| 77 |
+
```python
|
| 78 |
+
import torch
|
| 79 |
+
from tokenizers import Tokenizer
|
| 80 |
+
|
| 81 |
+
# ๋ชจ๋ธ ๋ก๋ (์ปค์คํ
์ํคํ
์ฒ ํ์)
|
| 82 |
+
from train_125m import GPT125M, ModelConfig
|
| 83 |
+
|
| 84 |
+
cfg = ModelConfig()
|
| 85 |
+
model = GPT125M(cfg)
|
| 86 |
+
state_dict = torch.load("pytorch_model.bin", map_location="cpu")
|
| 87 |
+
model.load_state_dict(state_dict)
|
| 88 |
+
model.eval()
|
| 89 |
+
|
| 90 |
+
# ํ ํฌ๋์ด์
|
| 91 |
+
tokenizer = Tokenizer.from_file("tokenizer.json")
|
| 92 |
+
|
| 93 |
+
# ์ถ๋ก
|
| 94 |
+
prompt = "๋ฌธ์ : 3x + 7 = 22์ผ ๋, x์ ๊ฐ์ ๊ตฌํ์์ค.\nํ์ด:\n"
|
| 95 |
+
input_ids = tokenizer.encode(prompt).ids
|
| 96 |
+
input_tensor = torch.tensor([input_ids])
|
| 97 |
+
|
| 98 |
+
with torch.no_grad():
|
| 99 |
+
output = model.generate(input_tensor, max_new_tokens=200)
|
| 100 |
+
result = tokenizer.decode(output[0].tolist())
|
| 101 |
+
print(result)
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
## ๋ผ์ด์ ์ค
|
| 105 |
+
|
| 106 |
+
Apache-2.0
|
| 107 |
+
|
| 108 |
+
## ๋ง๋ ์ด
|
| 109 |
+
|
| 110 |
+
SOVYN
|
benchmark_result.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"total_correct": 45,
|
| 3 |
+
"total_count": 52,
|
| 4 |
+
"overall_accuracy": 86.5,
|
| 5 |
+
"grade": "A (์ฐ์)",
|
| 6 |
+
"total_time": 6.4,
|
| 7 |
+
"categories": {
|
| 8 |
+
"์ฐ์ _๊ธฐ๋ณธ": {
|
| 9 |
+
"correct": 5,
|
| 10 |
+
"total": 5,
|
| 11 |
+
"accuracy": 100.0
|
| 12 |
+
},
|
| 13 |
+
"์ฐ์ฐ_์ฐ์ ์์": {
|
| 14 |
+
"correct": 7,
|
| 15 |
+
"total": 8,
|
| 16 |
+
"accuracy": 87.5
|
| 17 |
+
},
|
| 18 |
+
"๊ดํธ_์ฐ์ฐ": {
|
| 19 |
+
"correct": 4,
|
| 20 |
+
"total": 5,
|
| 21 |
+
"accuracy": 80.0
|
| 22 |
+
},
|
| 23 |
+
"๋ฐฉ์ ์": {
|
| 24 |
+
"correct": 4,
|
| 25 |
+
"total": 5,
|
| 26 |
+
"accuracy": 80.0
|
| 27 |
+
},
|
| 28 |
+
"๋ฆฌ์คํธ_์ฐ์ฐ": {
|
| 29 |
+
"correct": 5,
|
| 30 |
+
"total": 6,
|
| 31 |
+
"accuracy": 83.33333333333334
|
| 32 |
+
},
|
| 33 |
+
"์ฝ๋_ํธ๋ ์ด์ฑ": {
|
| 34 |
+
"correct": 5,
|
| 35 |
+
"total": 5,
|
| 36 |
+
"accuracy": 100.0
|
| 37 |
+
},
|
| 38 |
+
"๋
ผ๋ฆฌ": {
|
| 39 |
+
"correct": 4,
|
| 40 |
+
"total": 5,
|
| 41 |
+
"accuracy": 80.0
|
| 42 |
+
},
|
| 43 |
+
"์ซ์_์ฑ์ง": {
|
| 44 |
+
"correct": 5,
|
| 45 |
+
"total": 5,
|
| 46 |
+
"accuracy": 100.0
|
| 47 |
+
},
|
| 48 |
+
"์์ ํ": {
|
| 49 |
+
"correct": 5,
|
| 50 |
+
"total": 5,
|
| 51 |
+
"accuracy": 100.0
|
| 52 |
+
},
|
| 53 |
+
"์์ด": {
|
| 54 |
+
"correct": 1,
|
| 55 |
+
"total": 3,
|
| 56 |
+
"accuracy": 33.33333333333333
|
| 57 |
+
}
|
| 58 |
+
}
|
| 59 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "sovyn-gpt",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPT125M"
|
| 5 |
+
],
|
| 6 |
+
"vocab_size": 16384,
|
| 7 |
+
"context_length": 512,
|
| 8 |
+
"embed_dim": 768,
|
| 9 |
+
"num_heads": 12,
|
| 10 |
+
"num_layers": 12,
|
| 11 |
+
"dropout": 0.1,
|
| 12 |
+
"bias": false,
|
| 13 |
+
"parameters": "85.4M",
|
| 14 |
+
"training_steps": 10000,
|
| 15 |
+
"best_val_loss": 0.46251316606998444
|
| 16 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3e0b1683b8c5a53e597782f223b28205b6f52d54e91cc8a5418450ad662fc23d
|
| 3 |
+
size 391833139
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|