Instructions to use Infinity08/KAWK-1.5-50M-Korean-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Infinity08/KAWK-1.5-50M-Korean-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Infinity08/KAWK-1.5-50M-Korean-Base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Infinity08/KAWK-1.5-50M-Korean-Base") model = AutoModelForCausalLM.from_pretrained("Infinity08/KAWK-1.5-50M-Korean-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Infinity08/KAWK-1.5-50M-Korean-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Infinity08/KAWK-1.5-50M-Korean-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-1.5-50M-Korean-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Infinity08/KAWK-1.5-50M-Korean-Base
- SGLang
How to use Infinity08/KAWK-1.5-50M-Korean-Base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Infinity08/KAWK-1.5-50M-Korean-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-1.5-50M-Korean-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Infinity08/KAWK-1.5-50M-Korean-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinity08/KAWK-1.5-50M-Korean-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Infinity08/KAWK-1.5-50M-Korean-Base with Docker Model Runner:
docker model run hf.co/Infinity08/KAWK-1.5-50M-Korean-Base
KAWK-1.5-50M Korean Base
ํ๊ตญ์ด์ ์ง์คํ ์์ ์ธ์ด๋ชจ๋ธ์ ๋ฐ์ดํฐ ์์ง, ํ ํฌ๋์ด์ , ์ฌ์ ํ์ต, ํ๊ฐ๊น์ง ์ง์ ๋ง๋ค๊ณ , ์ ์ ํ๋ผ๋ฏธํฐ๋ก ์ด๋ ์ ๋์ ํ๊ตญ์ด ๋ฅ๋ ฅ์ ์ป์ ์ ์๋์ง ๊ฒ์ฆํ๊ธฐ ์ํด ๊ฐ๋ฐํ 51.5M ํ๋ผ๋ฏธํฐ ๋ฒ ์ด์ค ๋ชจ๋ธ์ ๋๋ค.
๊ธฐ์กด ๋ค๊ตญ์ด ๋ชจ๋ธ์ ํ๊ตญ์ด๋ก ๋ฏธ์ธ์กฐ์ ํ ๋ชจ๋ธ์ด ์๋๋๋ค. ํ๊ตญ์ด ์ค์ฌ ๋ง๋ญ์น๋ก SentencePiece ํ ํฌ๋์ด์ ๋ฅผ ์๋ก ํ์ตํ๊ณ , Llama ๊ณ์ด ๋ชจ๋ธ์ ์ฒ์๋ถํฐ ์ฌ์ ํ์ตํ์ต๋๋ค. Supra-50M ๊ณ์ด์ ์์ ๋ชจ๋ธ์ ๊ฐ๋ฐ ์์๋ฅผ ์ฐธ๊ณ ํ๋ ์ถ๋ฐ์ ์ด์์ผ๋ฉฐ, ์ดํ ํฌ๊ธฐ, ๋ ์ด์ด ์, ๋ฐ์ดํฐ ๊ตฌ์ฑ์ ํ๊ตญ์ด์ ๋ง๊ฒ ๋ค์ ์ค๊ณํ์ต๋๋ค.
์ด ๋ชจ๋ธ์ ๋ฒ ์ด์ค next-token predictor์ ๋๋ค. ์ง๋ฌธ์ ๋ตํ๋๋ก ํ์ต๋ ์ฑ๋ด์ด ์๋๋ฉฐ, ์ ๋ ฅ ๋ค์ ์ด์ด์ง ํ๊ตญ์ด ํ ์คํธ๋ฅผ ์์ฑํ๋ ์ฉ๋๋ก ์ฌ์ฉํด์ผ ํฉ๋๋ค.
์ 50M๋ถํฐ ๋ง๋ค์๋
50M์ ์ต๊ณ ์ฑ๋ฅ์ ์ฑ๋ด์ ๋ง๋ค๊ธฐ ์ํ ํฌ๊ธฐ๋ผ๊ธฐ๋ณด๋ค, ๊ฐ์ธ์ด ์ ๊ทผํ ์ ์๋ GPU์์ ๋ค์ ์ ์ฒด ํ์ดํ๋ผ์ธ์ ๊ฒ์ฆํ๊ธฐ ์ํ ์์ง๋์ด๋ง ํ๋กํ ํ์ ์ ๋๋ค.
- ํ๊ตญ์ด ์ ์ฉ ํ ํฌ๋์ด์ ์ค๊ณ
- ์น ๋ง๋ญ์น ์ ์ ยท์ค๋ณต ์ ๊ฑฐยทํจํน
- scratch pretraining๊ณผ checkpoint ์ฌ๊ฐ
- ์ฌ๋ฐ๋ฅธ causal LM objective ๊ฒ์ฆ
- validation loss์ UTF-8 byte-normalized ํ๊ฐ
- Hugging Face ๊ณต๊ฐ์ ์ฌํ ๊ฐ๋ฅํ ํ์ต ์ด๋ ฅ ๋ณด์กด
์ด 50M ๊ฒฝํ๊ณผ ํ ์คํธ๋ฅผ ๋ฐํ์ผ๋ก ์ดํ KAWK-500M์ ๋ง๋ค์์ต๋๋ค.
๋ชจ๋ธ ๊ตฌ์กฐ
| ํญ๋ชฉ | ๊ฐ |
|---|---|
| ์ํคํ ์ฒ | LlamaForCausalLM, decoder-only |
| ํ๋ผ๋ฏธํฐ | 51,542,528 |
| ์ดํ | ํ๊ตญ์ด SentencePiece Unigram 20,000 |
| ๋ ์ด์ด | 14 |
| Hidden / MLP | 512 / 1,408 |
| Attention / KV heads | 8 / 4 |
| Head dimension | 64 |
| ์ต๋ ๋ฌธ๋งฅ | 1,024 tokens |
| ํ์ฑํ / ์ ๊ทํ | SwiGLU(SiLU) / RMSNorm |
| ์์น ํํ | RoPE, theta 10,000 |
| ์ ๋ ฅยท์ถ๋ ฅ ์๋ฒ ๋ฉ | ๊ณต์ |
32K ์ดํ๋ฅผ ๊ทธ๋๋ก ์ฌ์ฉํ๋ฉด 50M ๋ชจ๋ธ์ ๋ง์ ํ๋ผ๋ฏธํฐ๊ฐ ์๋ฒ ๋ฉ์ ์๋น๋ฉ๋๋ค. KAWK-50M์ ์ดํ๋ฅผ 20K๋ก ์ค์ด๊ณ ๋จ๋ ์์ฐ์ 14๊ฐ Transformer ๋ ์ด์ด์ ๋ฐฐ๋ถํ์ต๋๋ค.
ํ๊ตญ์ด ํ ํฌ๋์ด์ ์ ๋ฐ์ดํฐ ์์น
- ์ธ๋ถ Unicode NFC ์ ๊ทํ
- SentencePiece Unigram, ๋ด๋ถ normalization์ identity
- byte fallback๊ณผ ์ซ์ ๋ถ๋ฆฌ ์ฌ์ฉ
- ์์ดยท์ฝ๋ยท์ํ ์ ์ฉ ๋ง๋ญ์น๋ ์ฌ์ฉํ์ง ์์
- KTX, Windows, ์ ํ๋ช , ์ซ์, ๋จ์์ฒ๋ผ ํ๊ตญ์ด ๋ฌธ์ฅ์ ์์ฐ์ค๋ฝ๊ฒ ํฌํจ๋ ์๋ฌธยท์ซ์๋ ์ ์ง
- HTML, URL ๊ณผ๋ค, ๋ฐ๋ณต ๋ฌธ์ฅ, code/math-heavy ๋ฌธ์, ๋ฎ์ ํ๊ธ ๋น์จ ๋ฌธ์ ํํฐ๋ง
- ์ด๋ฉ์ผยท์ ํ๋ฒํธ ๋ฑ ๊ฐ์ธ์ ๋ณด ํํ ๋ง์คํน
- exact/near duplicate ์ ๊ฑฐ
์ฃผ์ ์ฌ์ ํ์ต ์์ฒ์ HuggingFaceFW/fineweb-2์ kor_Hang์ด๋ฉฐ, ์์ฒ revision๊ณผ ์ด์ฉ ์กฐ๊ฑด์ ํ์ต ์์นด์ด๋ธ์ ๊ณ ์ ํ์ต๋๋ค.
ํ์ต ์ด๋ ฅ๊ณผ ์ค์ํ ์ ์
ํ์ฌ ๊ณต๊ฐ ๋ชจ๋ธ์ ์ฌ๋ฐ๋ฅธ next-token objective๋ก ๋ณต๊ตฌยท๊ฒ์ฆํ ์ฝ 6B-token Base ๋ฆด๋ฆฌ์ค์ ๋๋ค.
๊ฐ๋ฐ ์ค ์ด๊ธฐ ๋๊ท๋ชจ ์คํ์์๋ dataset์ด labels๋ฅผ ํ token ์ด๋ํ ์ํ๋ก ๋ฐํํ๊ณ LlamaForCausalLM์ด ๋ด๋ถ์์ ๋ค์ shiftํ์ฌ ์ฌ์ค์ ๋ token ์์ ์์ธกํ๋ ์ค๋ฅ๊ฐ ์์์ต๋๋ค. ๊ฐ์ ์๋ชป๋ ๊ธฐ์ค์ผ๋ก training/validation loss๋ฅผ ๊ณ์ฐํด ๋ฆ๊ฒ ๋ฐ๊ฒฌ๋์ต๋๋ค.
- ์ด๊ธฐ ์๋ชป๋ 20B Base + 3B CPT ์คํ์ ์ ์์ ์ธ 23B next-token ํ์ต๋์ผ๋ก ๊ณ์ฐํ์ง ์์ต๋๋ค.
- raw next-token NLL, generation, unit test๋ก ์์ธ์ ํ์ธํ์ต๋๋ค.
- objective ์์ ํ 100M A/B ๊ฒ์ฆ โ 1B recovery โ ์ถ๊ฐ 5B recovery๋ฅผ ์งํํ์ต๋๋ค.
- ์คํจ run์ ์ฌํ์ ์ํด ๋ณ๋ archive์ ๋ณด์กดํ์ง๋ง ์ต์ข ์ ์ ๋ชจ๋ธ๋ก ์ทจ๊ธํ์ง ์์ต๋๋ค.
์ด ์ ์ ์ ํ์ต๋์ ํฌ๊ฒ ๋ณด์ด๊ฒ ๋ง๋๋ ๊ฒ๋ณด๋ค ์ค์ objective์ ์ฌํ์ฑ์ ์ฐ์ ํ ๊ฒฐ๊ณผ์ ๋๋ค.
ํ๊ฐ
| ํญ๋ชฉ | ๊ฒฐ๊ณผ |
|---|---|
| Validation loss | 2.89026 |
| Validation perplexity | 17.9979 |
| Bits per UTF-8 byte | 0.92329 |
| ์ด์ 1B checkpoint loss | 2.97448 |
| Gate | passed |
ํ๊ฐ๋ ๊ณ ์ ๋ ํ๊ตญ์ด validation ๋ฌธ์์์ ์ํํ์ต๋๋ค. ๋ค๋ฅธ ํ ํฌ๋์ด์ ๋ฅผ ์ฐ๋ ๋ชจ๋ธ๊ณผ token-level perplexity๋ฅผ ์ง์ ๋น๊ตํ๋ฉด ์ ๋ฉ๋๋ค.
์ฌ์ฉ ์์
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Infinity08/KAWK-1.5-50M-Korean-Base"
tokenizer = AutoTokenizer.from_pretrained(repo_id, use_fast=False)
model = AutoModelForCausalLM.from_pretrained(repo_id)
prompt = "๋ํ๋ฏผ๊ตญ์ ์๋๋"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_new_tokens=80,
do_sample=True,
temperature=0.8,
top_p=0.9,
repetition_penalty=1.1,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
์ ํฉํ ์ฉ๋
- ์ํ ํ๊ตญ์ด LM ์ฐ๊ตฌ์ ๊ต์ก
- ํ ํฌ๋์ด์ ยท์ฌ์ ํ์ตยทCPT ์คํ
- ํ๊ตญ์ด ์๋์์ฑ๊ณผ ์ ํ์ ์ธ ํ ์คํธ ์์ฑ
- ์๋น์ GPU/CPU ์ถ๋ก ํ ์คํธ
- ๋ ํฐ ํ๊ตญ์ด ๋ชจ๋ธ์ ํ์ดํ๋ผ์ธ ๊ฒ์ฆ
ํ๊ณ
- 50M๊ธ์ด๋ฏ๋ก ์ง์๋, ์ฌ์ค์ฑ, ๋ณต์กํ ์ถ๋ก ๋ฅ๋ ฅ์ด ๋งค์ฐ ์ ํ์ ์ ๋๋ค.
- ์ฑ๋ด์ฒ๋ผ ์ง์๋ฅผ ๋ฐ๋ฅด๋๋ก ํ์ต๋์ง ์์์ต๋๋ค.
- ๋ฐ๋ณต, ์๋ชป๋ ์ฌ์ค, ์น ๋ฐ์ดํฐ์ ํธํฅยท๊ด๊ณ ์ฑ ๋ฌธ๊ตฌ๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.
- ์๋ฃยท๋ฒ๋ฅ ยท๊ธ์ตยท์์ ๊ด๋ จ ํ๋จ์ ์ฌ์ฉํ๋ฉด ์ ๋ฉ๋๋ค.
- ๊ฐ์ธ์ ๋ณด ์ฌํ, ํธํฅ, ์ ํด์ฑ์ ๋ํ ํฌ๊ด์ ์ธ ์์ ํ๊ฐ๊ฐ ์๋ฃ๋์ง ์์์ต๋๋ค.
๊ด๋ จ ์๋ฃ
- 5,120-token Base CPT
- 50M Instruct
- ํ๋ก์ ํธ ์ฝ๋ยท์ค์ archive
- ํ์ต ๋ฐ์ดํฐ archive
- ํ์ต run archive
์์ฒ ๋ฐ์ดํฐ์๋ ์๋ก ๋ค๋ฅธ ์ด์ฉ ์กฐ๊ฑด์ด ์ ์ฉ๋ ์ ์์ต๋๋ค. ์ด ๋ชจ๋ธ ์นด๋๋ ์์ฒ ๋ฐ์ดํฐ์ ์ฌ๋ฐฐํฌ ๊ถ๋ฆฌ๋ฅผ ๋ณ๋๋ก ๋ถ์ฌํ์ง ์์ผ๋ฉฐ, ์ฌ์ฉ์๋ ๊ฐ upstream dataset์ ๋ผ์ด์ ์ค์ ๊ท์ ์กฐ๊ฑด์ ํ์ธํด์ผ ํฉ๋๋ค.
- Downloads last month
- 16