pathcosmos/frankenstallm
FRANKENSTALLM 3B
⚠️ v2 모델 교체 공지 (2026-03-26) v2 GGUF 및 safetensors 파일이 변환 과정의 오류로 1.2B 모델(hidden_size=2048, 24 layers)로 잘못 배포되었습니다. 2026-03-26에 올바른 3B ORPO 체크포인트(hidden_size=3072, 28 layers, vocab_size=64256, byte-fallback 적용)로 교체 완료했습니다. 이전에 다운로드한 v2 파일이 있다면 재다운로드를 권장합니다.
한국어 3B LLM을 처음부터 직접 만들었습니다 — 토크나이저 학습부터 사전학습, SFT, ORPO까지, 8× NVIDIA B200 GPU 위에서.
빠른 시작
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "pathcosmos/frankenstallm"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.bfloat16, device_map="auto"
)
inputs = tokenizer(
"한국의 전통 음식 중 김치에 대해 설명해주세요.",
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
do_sample=True,
temperature=0.7,
repetition_penalty=1.2, # 권장
top_p=0.9,
max_new_tokens=512,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))Ollama (GGUF)
# GGUF + Modelfile 다운로드
huggingface-cli download pathcosmos/frankenstallm \
gguf/frankenstallm-3b-v2-Q4_K_M.gguf \
gguf/Modelfile.3b-v2-Q4_K_M \
--local-dir ./frankenstallm
# Modelfile 내 FROM 경로 수정 후 생성
ollama create frankenstallm -f ./frankenstallm/gguf/Modelfile.3b-v2-Q4_K_M
# 실행
ollama run frankenstallm파일 다운로드 링크
모델 파일
GGUF (Ollama / llama.cpp)
v1 GGUF (byte-fallback 미적용)도 gguf/frankenstallm-3b-*.gguf로 제공되지만, v2 사용을 권장합니다.학습 데이터 (SFT / ORPO 재현용)
<details> <summary>ORPO Preference 데이터 개별 소스 (7종)</summary>
</details>
데이터 파이프라인 스크립트
Phase별 보고서
모델 특징
- 처음부터 만든 한국어 토크나이저: SentencePiece Unigram, 64K 어휘, 한국어 문자 커버리지 99.95%
- 3단계 학습 파이프라인: 사전학습 (57K 스텝, ~600억 토큰) → SFT (25.5K 스텝, 240만 샘플) → ORPO (10K 스텝, 63만 선호도 쌍)
- B200 FP8 네이티브 학습: TransformerEngine MXFP8 — BF16 대비 이론적 2배 처리량
- GGUF 배포 지원: Q4KM (1.8GB), Q8_0 (3.0GB), F16 (5.7GB) + Ollama Modelfile 제공
아키텍처
학습 파이프라인
Phase 1: 사전학습
Phase 2: SFT (지도 미세조정)
Phase 3: ORPO (선호도 최적화)
총 학습 시간: 8× B200에서 약 86시간
벤치마크
학습 단계별 성능 변화 (Base → SFT → ORPO)
3B급 모델 비교 (Ollama, 35개 테스트)
FRANKENSTALLM은 한국어 NLU (Qwen과 동률), 한국어 지식 (75.0 vs 20.8/29.2), 지시 수행 (66.7 vs 55.6/33.3)에서 앞섭니다.
추론 속도 (Ollama, Q4KM)
Perplexity 보존율 (ORPO 지식 유지)
학습 데이터
사전학습 (~385억 토큰)
SFT (240만 샘플, 24개 소스)
ORPO (~63만 선호도 쌍, 7개 소스)
GGUF & Ollama
제공 양자화 파일
권장 샘플링 파라미터
⚠️ 반드시 repeat_penalty >= 1.2를 사용하세요. 적용하면 반복률이 0% 로 떨어집니다. 미적용 시 greedy 디코딩에서 ~31% 3-gram 반복이 발생합니다.제한 사항
- 영어 성능 제한: MMLU-EN ~23%, HellaSwag-EN ~29% — 한국어 특화 모델입니다
- 코드 생성: 거의 불가능 (학습 데이터에 코드 비중이 낮음)
- Greedy 반복:
repeat_penalty미사용 시 30.9% 3-gram 반복 — 반드시repeat_penalty >= 1.2사용 - 안전성: 안전 정렬(safety alignment) 데이터가 학습에 포함되지 않았으므로 적절한 가드레일과 함께 사용하세요
- 규모 차이: 수조 토큰으로 학습된 상용 3B 모델 대비 ~600억 토큰으로 학습 — 전반적 벤치마크 점수는 낮을 수 있습니다
하드웨어 및 학습 환경
인용
@misc{frankenstallm2026,
title={FRANKENSTALLM: A Korean 3B LLM Built From Scratch on B200 GPUs},
author={pathcosmos},
year={2026},
url={https://huggingface.co/pathcosmos/frankenstallm},
note={3-phase training (Pretrain, SFT, ORPO) with FP8 on 8x NVIDIA B200}
}링크 및 연락처
- GitHub: pathcosmos/FRANKENSTALLM — 전체 소스코드, 학습 스크립트, 빌더 로그
- HuggingFace: pathcosmos/frankenstallm
- 연락처: pathcosmos@gmail.com
감사의 글
이 프로젝트는 과학기술정보통신부의 「첨단 GPU 활용 지원 사업」 (과학기술정보통신부 공고 제2025-1068호)을 통해 제공된 GPU 컴퓨팅 자원을 활용하여 수행되었습니다.
국가 AI컴퓨팅자원 지원포털: https://aiinfrahub.kr - 주관: 과학기술정보통신부 (MSIT), 정보통신산업진흥원 (NIPA) - 운영: 한국정보통신진흥협회 (KAIT)
대한민국 정부의 AI 인프라 지원 사업 덕분에 8× NVIDIA B200 GPU 환경에서 한국어 3B LLM을 처음부터 학습할 수 있었습니다. 국가 차원의 AI 컴퓨팅 자원 지원에 깊이 감사드립니다.
🇺🇸 English version below
FRANKENSTALLM 3B
⚠️ v2 Model Replacement Notice (2026-03-26) The v2 GGUF and safetensors files were incorrectly deployed as a 1.2B model (hidden_size=2048, 24 layers) due to a conversion pipeline error. On 2026-03-26, they were replaced with the correct 3B ORPO checkpoint (hidden_size=3072, 28 layers, vocab_size=64256, byte-fallback applied). If you downloaded v2 files before this date, please re-download.
A Korean 3B LLM built entirely from scratch — tokenizer, pretraining, SFT, and ORPO — on 8× NVIDIA B200 GPUs.
Quick Start
Transformers
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "pathcosmos/frankenstallm"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id, torch_dtype=torch.bfloat16, device_map="auto"
)
inputs = tokenizer(
"한국의 전통 음식 중 김치에 대해 설명해주세요.",
return_tensors="pt"
).to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
do_sample=True,
temperature=0.7,
repetition_penalty=1.2, # recommended
top_p=0.9,
max_new_tokens=512,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))Ollama (GGUF)
# Download GGUF + Modelfile
huggingface-cli download pathcosmos/frankenstallm \
gguf/frankenstallm-3b-v2-Q4_K_M.gguf \
gguf/Modelfile.3b-v2-Q4_K_M \
--local-dir ./frankenstallm
# Fix FROM path in Modelfile, then create
ollama create frankenstallm -f ./frankenstallm/gguf/Modelfile.3b-v2-Q4_K_M
# Run
ollama run frankenstallmFile Downloads
Model Files
GGUF (Ollama / llama.cpp)
Training Data (for SFT / ORPO reproduction)
<details> <summary>Individual ORPO Preference Sources (7 datasets)</summary>
</details>
Data Pipeline Scripts
Phase Reports
Model Highlights
- From-scratch Korean tokenizer: SentencePiece Unigram, 64K vocab, 99.95% Korean character coverage
- 3-phase training pipeline: Pretrain (57K steps, ~60B tokens) → SFT (25.5K steps, 2.4M samples) → ORPO (10K steps, 630K preference pairs)
- B200 FP8 native training: TransformerEngine MXFP8 on NVIDIA B200 — 2× theoretical throughput vs BF16
- GGUF deployment ready: Q4KM (1.8GB), Q8_0 (3.0GB), F16 (5.7GB) with optimized Ollama Modelfiles
Architecture
Training Pipeline
Phase 1: Pretraining
Phase 2: Supervised Fine-Tuning (SFT)
Phase 3: ORPO (Odds Ratio Preference Optimization)
Total training time: ~86 hours on 8× B200
Benchmarks
Training Phase Progression (Base → SFT → ORPO)
3B-class Model Comparison (Ollama, 35 tests)
FRANKENSTALLM leads in Korean NLU (tied with Qwen), Korean Knowledge (75 vs 20.8/29.2), and Instruction Following (66.7 vs 55.6/33.3).
Inference Speed (Ollama, Q4KM)
Perplexity Preservation (ORPO Knowledge Retention)
Training Data
Pretraining (~38.5B tokens)
SFT (2.4M samples, 24 sources)
ORPO (~630K preference pairs, 7 sources)
GGUF & Ollama
Available Quantizations
Recommended Sampling Parameters
⚠️ Always use repeat_penalty >= 1.2. With it, repetition drops to 0%. Without it, greedy decoding produces ~31% 3-gram repetition.Limitations
- English performance is limited: MMLU-EN ~23%, HellaSwag-EN ~29% — this is a Korean-focused model
- Code generation: Near zero capability (limited code in training data)
- Greedy repetition: 30.9% 3-gram repetition without
repeat_penalty— always use sampling withrepeat_penalty >= 1.2 - Safety: Safety alignment data was not included in training; use with appropriate guardrails
- Scale gap: Compared to commercial 3B models trained on trillions of tokens, this model was trained on ~60B tokens — expect lower overall benchmark scores
Hardware & Training Environment
Citation
@misc{frankenstallm2026,
title={FRANKENSTALLM: A Korean 3B LLM Built From Scratch on B200 GPUs},
author={pathcosmos},
year={2026},
url={https://huggingface.co/pathcosmos/frankenstallm},
note={3-phase training (Pretrain, SFT, ORPO) with FP8 on 8x NVIDIA B200}
}Links & Contact
- GitHub: pathcosmos/FRANKENSTALLM — Full source code, training scripts, and builder's log
- HuggingFace: pathcosmos/frankenstallm
- Contact: pathcosmos@gmail.com
Related Projects
- [EVAFRILL-Mo](https://github.com/pathcosmos/EVAFRILL-Mo) | 🤗 HuggingFace — Hybrid Mamba-2 + Transformer sister project (2.94B params). While FRANKENSTALLM uses a pure Transformer architecture, EVAFRILL-Mo adopts Mamba-2 SSM + sparse Transformer attention. Both share the same tokenizer and training infrastructure.
Acknowledgment
This project was conducted using GPU computing resources provided through the "Advanced GPU Utilization Support Program" (MSIT Notice No. 2025-1068) by the Ministry of Science and ICT (MSIT) of the Republic of Korea.
National AI Computing Resource Support Portal: https://aiinfrahub.kr - Organized by: Ministry of Science and ICT (MSIT), National IT Industry Promotion Agency (NIPA) - Operated by: Korea Association of Information & Telecommunication (KAIT)
We are deeply grateful for the national-level AI computing infrastructure support from the Korean government, which made it possible to train a Korean 3B LLM from scratch on 8× NVIDIA B200 GPUs.
