--- language: - ko library_name: transformers pipeline_tag: text-generation datasets: - Infinity08/KAWK500M-Korean-SFT-v1 tags: - llama - korean - causal-lm - instruction-tuned - kawk --- # KAWK 500M Korean Instruct v1 한국어 중심 말뭉치로 처음부터 사전학습한 505M 파라미터 KAWK 베이스 모델에 한국어 대화·지시 데이터로 supervised fine-tuning(SFT)을 적용한 모델입니다. ## 모델 구조 - 아키텍처: Llama 계열 decoder-only Transformer - 파라미터: 505,350,400 - 어휘: 한국어 SentencePiece Unigram 32,000 - 레이어 / hidden / MLP: 26 / 1,280 / 3,584 - Attention / KV heads: 20 / 5 (GQA) - 최대 문맥: 2,048토큰 - 입력·출력 임베딩 공유 ## 학습 - 베이스 사전학습량: 한국어 중심 약 100억 토큰 - SFT 데이터: `Infinity08/KAWK500M-Korean-SFT-v1` - 데이터 revision: `0a8e914359a063b916cfd9a3ee068a38ddcc1f79` - SFT: 2 epochs, 739 optimizer steps, 약 9,080만 packed-token capacity - Assistant 응답 토큰에만 loss 적용 - 유효 배치: 60 sequences × 2,048 tokens - Precision / GPU: BF16 / NVIDIA A100 80GB - Learning rate: 2e-5 → 2e-6 cosine decay - step 700 validation loss / perplexity: 1.9786 / 7.2327 - 전체 설정과 로그: `training/` ## 사용 예시 ```python import torch from transformers import AutoModelForCausalLM, AutoTokenizer repo_id = "Infinity08/KAWK-500M-Korean-Instruct-v1" tokenizer = AutoTokenizer.from_pretrained(repo_id, use_fast=False) model = AutoModelForCausalLM.from_pretrained( repo_id, dtype=torch.bfloat16, device_map="auto", ) messages = [{"role": "user", "content": "대한민국의 수도를 간단히 설명해줘."}] prompt = tokenizer.apply_chat_template( messages, tokenize=False, add_generation_prompt=True, ) inputs = tokenizer(prompt, return_tensors="pt").to(model.device) outputs = model.generate( **inputs, max_new_tokens=128, do_sample=True, temperature=0.7, top_p=0.9, repetition_penalty=1.05, ) new_tokens = outputs[0, inputs["input_ids"].shape[1]:] print(tokenizer.decode(new_tokens, skip_special_tokens=True)) ``` 대화 템플릿은 `### 지침:`, `### 사용자:`, `### 도우미:` 역할 헤더를 사용하며 토크나이저의 `chat_template.jinja`에 포함되어 있습니다. ## 평가 KoBEST·KMMLU 0-shot 평가는 진행 중이며 완료 후 원시 결과와 요약을 `evaluation/`에 추가합니다. ## 한계 500M급 모델이므로 복잡한 추론, 정확한 사실 회상, 긴 지시 수행을 보장하지 않습니다. SFT 데이터의 편향이나 잘못된 답을 재현할 수 있으며, 사실성·안전성·개인정보 재현에 대한 포괄적 평가가 완료되지 않았습니다. 고위험 의사결정에 사용하지 마십시오.