Capstone Research Project캡스톤 연구 프로젝트
Morpheme-Aware PTQ Calibration for Korean LLMs 한국어 LLM을 위한 형태소 인지 PTQ 캘리브레이션
Investigates whether morpheme-diversity-optimized calibration sets preserve model performance better than random sampling when quantizing Korean and multilingual LLMs using GPTQ 4-bit quantization. Validated across five model families on KoBEST and KMMLU benchmarks.
GPTQ 4비트 양자화로 한국어·다국어 LLM을 양자화할 때, 형태소 다양성이 최적화된 캘리브레이션 셋이 무작위 샘플링보다 모델 성능을 더 잘 보존하는지 검증한 연구입니다. KoBEST와 KMMLU 벤치마크에서 5개 모델 패밀리에 걸쳐 검증했습니다.
Key Finding. Calibration data quality significantly impacts quantization outcomes. Morpheme-diversity-optimized Korean calibration (C_v3) achieved 97.4% FP16 retention on KoBEST — compared to 91.7% with English random sampling — a 3.5× reduction in performance degradation. Language-aligned calibration consistently outperformed generic English baselines across 5 model families.
핵심 결과. 캘리브레이션 데이터 품질이 양자화 결과에 큰 영향을 미칩니다. 형태소 다양성이 최적화된 한국어 캘리브레이션(C_v3)은 KoBEST에서 FP16 성능의 97.4%를 유지했습니다 — 영어 무작위 샘플링의 91.7%와 비교하면 성능 저하가 3.5배 감소한 수치입니다. 언어 정렬 캘리브레이션은 5개 모델 패밀리 전반에서 일반 영어 베이스라인을 일관되게 앞섰습니다.
Results결과
KoBEST RetentionKoBEST 성능 유지율
VRAM ReductionVRAM 절감
Cross-Model Validation교차 모델 검증
Method: Greedy Morpheme Diversity Selection (C_v3)방법: 그리디 형태소 다양성 선택 (C_v3)
- Extract 100K candidate sentences from NamuWiki
- Filter sentences requiring ≥8 morphological units and ≥70% Korean character ratio
- Score candidates using
α × coverage_bonus + β × length_bonus + γ × sentence_final_bonus - Greedily select 128 sentences maximizing cumulative morpheme coverage
- 나무위키에서 10만 개의 후보 문장 추출
- 형태소 단위 8개 이상, 한국어 문자 비율 70% 이상인 문장만 필터링
α × coverage_bonus + β × length_bonus + γ × sentence_final_bonus로 후보 점수화- 누적 형태소 커버리지를 최대화하는 128개 문장을 그리디하게 선택
The C_v3 design fixes a core issue in earlier versions: non-Korean character inflation artificially increased subword token counts, degrading GPTQ weight approximation quality. By enforcing Korean character ratio and morpheme unit thresholds, the calibration set better reflects the true token distribution of Korean text.
C_v3 설계는 이전 버전의 핵심 문제를 해결합니다. 비한국어 문자의 증가는 서브워드 토큰 수를 인위적으로 늘려 GPTQ 가중치 근사 품질을 저하시켰습니다. 한국어 문자 비율과 형태소 단위 기준을 강제함으로써 캘리브레이션 셋이 한국어 텍스트의 실제 토큰 분포를 더 잘 반영하도록 했습니다.
What I Built구현 내용
- Calibration set builders for English, Korean, and Chinese data with morpheme diversity scoring
- GPTQ quantization wrappers using AutoGPTQ and Hugging Face Optimum
- Evaluation harness integration for KoBEST and KMMLU benchmarks
- vLLM serving performance benchmarking tools
- Activation distribution analysis and visualization utilities
- 형태소 다양성 점수화를 포함한 영어·한국어·중국어 캘리브레이션 셋 빌더
- AutoGPTQ와 Hugging Face Optimum을 활용한 GPTQ 양자화 래퍼
- KoBEST, KMMLU 벤치마크용 평가 하네스 통합
- vLLM 서빙 성능 벤치마킹 도구
- 활성화 분포 분석 및 시각화 유틸리티
Related Writing관련 글
I documented the motivation behind this work in a Velog post about on-device AI and quantization: 성능만 보던 시선에서, On-device AI와 양자화를 다시 보게 되었다 .
이 연구의 동기를 On-device AI와 양자화에 관한 Velog 글로 정리했습니다: 성능만 보던 시선에서, On-device AI와 양자화를 다시 보게 되었다 .