KoGum-0.5B-16k
KoGum(코껌)은 Korean + Gum(껌)의 합성어입니다. 작은 모델에서 시작하여 크게 부풀어 오르는 풍선껌처럼, 점진적인 성장을 지향합니다.
KoGum은 LLM의 아키텍처 설계부터 pre-training, mid-training, SFT까지 전체 학습 파이프라인을 직접 구현하고 경험하기 위해 만든 한국어 특화 0.5B 소형 언어 모델입니다.
모델 아키텍처를 scratch로 구현하고 처음부터 학습하여 설계 → 구현 → 학습 → 평가의 전 과정을 직접 수행했습니다. 아키텍처 설계, 학습 데이터 구성, 학습 파이프라인 등에서 KORMo를 많이 참고하였으며, KORMo에서 공개한 tokenizer와 데이터셋을 활용하였습니다.
이 모델은 pre-training 단계의 base 모델입니다.
결론: 대 실패작입니다..! 성능이 너무 안좋습니다. 하지만 이를 계기로 LLM의 전체 학습 파이프라인(아키텍처 설계 → pre-training → mid-training → SFT)을 직접 경험하고 이해할 수 있었으며, 이 경험을 바탕으로 더 발전된 모델을 만들어 나갈 예정입니다.
Model Family
| Model | Stage | Description |
|---|---|---|
| KoGum-0.5B-16k | Pre-train | Base model (this) |
| KoGum-0.5B-16k-mid | Mid-train | Continued pre-training (math, code, reasoning 강화) |
| KoGum-0.5B-16k-Instruct | SFT | Instruction-tuned chat model |
Architecture
LLaMA 스타일 아키텍처를 기반으로 설계되었습니다 (GQA + RMSNorm + SwiGLU + RoPE).
| Parameters | ~581M |
| Hidden Size | 1024 |
| Layers | 24 |
| Attention Heads | 16 (GQA, 8 KV heads) |
| Intermediate Size | 5120 |
| Vocab Size | 125,041 |
| Max Context | 16,384 tokens |
| RoPE Theta | 500,000 |
| Precision | BFloat16 |
- Grouped Query Attention (GQA): 16 query heads / 8 KV heads — 메모리 효율과 성능 균형
- RMSNorm: Pre-normalization으로 학습 안정성 확보
- SwiGLU: Feed-forward layer에 SwiGLU activation 적용
- RoPE (θ=500K): 16K 긴 문맥을 안정적으로 처리
Training
Data
한국어 70% + 영어 30% 비율로 혼합 학습:
| Dataset | Language | Ratio |
|---|---|---|
| KORMo-Team/korean-web-collection | Korean | 70% |
| KORMo-Team/dclm-baseline-filtered | English | 30% |
Hyperparameters
- Optimizer: AdamW (β1=0.9, β2=0.95)
- LR Scheduler: Cosine with warmup
- Context Length: 16,384 tokens
- Gradient Checkpointing: Enabled
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
tokenizer = AutoTokenizer.from_pretrained("jiwon9703/KoGum-0.5B-16k", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
"jiwon9703/KoGum-0.5B-16k",
trust_remote_code=True,
torch_dtype=torch.bfloat16,
)
input_text = "한국의 수도는"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Evaluation
Benchmark 결과는 추후 업데이트 예정입니다.
Tokenizer
KORMo-Team/KORMo-tokenizer 사용 — 한국어에 최적화된 125K vocab BPE tokenizer.
License
Apache 2.0
- Downloads last month
- 4