LLM 사전학습 데이터 파이프라인: 수집·정제·중복 제거·혼합 (1/10)
원시 문서를 학습 가능한 토큰 시퀀스로 바꾸는 LLM 사전학습 데이터 파이프라인을 출처·라이선스, 품질 필터, PII, 중복 제거, 오염 검사, 데이터 혼합, 패킹, manifest까지 설계합니다.
Series · Folio
데이터에서 분산 추론까지 이어지는 초·중급 10편
원시 문서를 학습 가능한 토큰 시퀀스로 바꾸는 LLM 사전학습 데이터 파이프라인을 출처·라이선스, 품질 필터, PII, 중복 제거, 오염 검사, 데이터 혼합, 패킹, manifest까지 설계합니다.
Causal LM의 next-token loss부터 parameter·token·compute 관계, Kaplan·Chinchilla scaling law, pilot run과 안정성, inference 비용을 반영한 over-training 판단까지 설명합니다.
현대 decoder-only LLM block을 pre-norm·RMSNorm, RoPE, SwiGLU, MHA·MQA·GQA, KV cache, dense·MoE로 분해하고 각 구조가 학습 안정성, 메모리, 통신, latency에 미치는 영향을 계산합니다.
Base LLM을 instruct model로 바꾸는 SFT를 chat template, assistant-only loss mask, packing, tool·grounding 데이터, 오염 방지, behavior·retention 평가까지 설계합니다.
RLHF·PPO, DPO·IPO, KTO, GRPO를 feedback 형태와 online·offline 학습으로 비교하고 reward hacking, KL drift, verifiable reward, RAG Agent 평가를 설계합니다.
LoRA의 low-rank update 수식과 trainable parameter를 계산하고 rank·alpha·target module을 고르는 법, QLoRA의 4-bit frozen base, DoRA, adapter merge·동적 serving·평가 계약까지 설계합니다.
LLM 양자화를 weight-only, weight·activation, KV cache로 나누고 scale·zero point·granularity를 계산하며 GPTQ, AWQ, SmoothQuant, FP8, KIVI의 memory·kernel·품질을 설계합니다.
LLM 분산 학습을 parameter·gradient·optimizer·activation 원장으로 계산하고 DDP, ZeRO, FSDP, tensor·pipeline·context parallel의 통신, checkpoint, 확장 효율을 설계합니다.
LLM 추론을 queue·prefill·decode로 분해하고 TTFT·ITL·goodput을 계산하며 PagedAttention, continuous batching, prefix cache, speculative decoding, P/D 분리와 SLO를 설계합니다.
RAG Agent 모델을 grounding·tool calling·long context·latency·cost·license로 비교하고 hard gate와 Pareto frontier를 거쳐 offline, shadow, canary, rollback으로 안전하게 배포합니다.