숫자 하나부터 Agent RL까지,
직접 돌려 보며 배우는 커리큘럼
From a single loss value to agent RL —
a curriculum you learn by running it
머신러닝의 손실 함수에서 시작해 역전파, Transformer, LLM 사전·사후학습을 지나 GRPO와 멀티턴 agent RL, 미·중 frontier lab의 기술 보고서, 그리고 아키텍처·추론·frontier RL·RL 프레임워크 딥다이브까지 이어지는 열 개 트랙입니다. 모든 레슨에 손으로 만지는 그림이 있고, 핵심 알고리즘은 NumPy로 바닥부터 구현해 이 페이지 안에서 바로 실행됩니다.
Ten tracks that start from a loss function and run through backprop, Transformers, LLM pre- and post-training, GRPO and multi-turn agent RL and the technical reports of frontier labs in the US and China, to deep dives on architectures, inference, frontier RL and RL frameworks. Every lesson has figures you manipulate, and the key algorithms are implemented from scratch in NumPy and run right here in the page.
준비: 수학Math Foundations Math Foundations
선형대수·미분·최적화·확률·통계·정보 이론·수치 계산 — 이후 모든 트랙이 쓰는 수학을, 어디에 쓰이는지와 함께 손으로 만져 본다.Linear algebra, calculus, optimisation, probability, statistics, information theory and numerics — the maths every later track uses, handled hands-on and tied to where it is used.
- 벡터·행렬·텐서Vectors, matrices and tensors
- 고유값·SVD·저랭크Eigenvalues, SVD and low rank
- 미분·연쇄법칙·JacobianDerivatives, the chain rule and Jacobians
- 최적화의 수학The mathematics of optimisation
- 확률Probability
- 통계와 추정Statistics and estimation
- 정보 이론Information theory
- 수치 계산Numerics
- 극값과 Gumbel 트릭Extremes: maxima, tails and the Gumbel trick
- 정지 기울기와 대리 목적함수Stop-gradient and surrogate objectives
머신러닝 기초ML Fundamentals ML Fundamentals
손실·확률·최적화. 이후 모든 트랙이 기대는 언어를 만든다.Loss, probability, optimisation — the language every later track relies on.
- 학습이란 무엇인가What is learning?
- 경사하강법Gradient descent
- 확률로 보는 손실Losses through probability
- 선형 모델Linear models
- 일반화Generalization
- 옵티마이저와 학습률 스케줄Optimizers and learning-rate schedules
- Muon과 직교화 옵티마이저Muon and orthogonalised optimisers
- Frontier lab들의 Muon 변형Muon variants at frontier labs
- 비지도 학습Unsupervised learning
딥러닝 기초DL Fundamentals DL Fundamentals
역전파와 autograd에서 출발해 정규화·CNN·RNN을 거쳐 attention까지.From backprop and autograd through normalisation, CNNs and RNNs to attention.
LLM 기초LLM Fundamentals LLM Fundamentals
토크나이저부터 GPT 구현, 디코딩, 스케일링 법칙, 추론 최적화, SFT까지.Tokenizers, a GPT from scratch, decoding, scaling laws, inference optimisation and SFT.
강화학습 기초RL Fundamentals RL Fundamentals
MDP·가치·정책 경사·PPO. LLM 사후학습에 필요한 만큼, 정확하게.MDPs, values, policy gradients and PPO — exactly as much as LLM post-training needs.
LLM·Agent를 위한 RLRL for LLMs & Agents RL for LLMs & Agents
보상모델, RLHF, DPO, GRPO·RLVR, 멀티턴 agent RL, 학습-추론 불일치.Reward models, RLHF, DPO, GRPO and RLVR, multi-turn agent RL, training–inference mismatch.
- RLHF와 사후학습 개관Overview of RLHF and post-training
- 보상모델Reward models
- KL 정규화 RL과 PPO for LMsKL-regularised RL and PPO for LMs
- Best-of-N과 rejection samplingBest-of-N and rejection sampling
- Direct alignment: DPO와 그 변형들Direct alignment: DPO and its variants
- RLVR과 추론 — GRPO, RLOO, Dr. GRPO, DAPO, GSPORLVR and reasoning — GRPO, RLOO, Dr. GRPO, DAPO, GSPO
- 과최적화와 reward hackingOver-optimisation and reward hacking
- Agent RL — 멀티턴, tool use, credit assignment, 환경Agent RL — multi-turn, tool use, credit assignment, environments
- 학습–추론 불일치와 importance samplingTraining–inference mismatch and importance sampling
- 증류와 합성 데이터 — on-policy distillation, Constitutional AIDistillation and synthetic data — on-policy distillation, Constitutional AI
프론티어 기술 보고서 리뷰Frontier Tech Reports Frontier Tech Reports
DeepSeek·Qwen·Kimi·MiMo·MAI 등 미·중 frontier lab 보고서의 아키텍처·데이터·학습법·결과를 직접 돌려 보며 읽는다.Architecture, data, training and results of frontier-lab reports from the US and China — DeepSeek, Qwen, Kimi, MiMo, GLM, MAI and more — read by running them.
- 기술 보고서 읽는 법과 2024–2026 지도How to read a technical report, and a 2024–2026 map
- DeepSeek-V3 — MLA, aux-loss-free MoE, MTP, FP8DeepSeek-V3 — MLA, aux-loss-free MoE, MTP, FP8
- DeepSeek-R1 — 보상만으로 추론을 끌어내기DeepSeek-R1 — drawing out reasoning with rewards alone
- DeepSeek-V3.2 — sparse attention과 RL 스케일링, 에이전트 과제 합성DeepSeek-V3.2 — sparse attention, RL scaling, agentic task synthesis
- DeepSeek-V4 — 백만 토큰 문맥을 싸게 만드는 법 (+V4.1-Flash)DeepSeek-V4 — how to make a million-token context cheap (+V4.1-Flash)
- Qwen3 — thinking 모드 융합, thinking budget, strong-to-weak 증류Qwen3 — fusing thinking modes, thinking budgets, strong-to-weak distillation
- Qwen3-Next와 Qwen3.5 — Gated DeltaNet 하이브리드와 Gated AttentionQwen3-Next and Qwen3.5 — the Gated DeltaNet hybrid and gated attention
- Qwen3.8-Flash-Next — sparse attention, gated residual, n-gram 임베딩, MuonQwen3.8-Flash-Next — sparse attention, gated residual, n-gram embeddings, Muon
- Kimi k1.5 — 긴 문맥 RL과 online mirror descentKimi k1.5 — long-context RL and online mirror descent
- Kimi K2 — MuonClip, agentic 데이터 합성, 자기 비평 보상Kimi K2 — MuonClip, agentic data synthesis, self-critique rewards
- Kimi K3 — KDA 하이브리드, Attention Residuals, Stable LatentMoEKimi K3 — KDA hybrid, Attention Residuals, Stable LatentMoE
- Xiaomi MiMo-7B — 사전학습부터 추론용으로 만든 7BXiaomi MiMo-7B — a 7B model built for reasoning from pre-training on
- Xiaomi MiMo-V2 — hybrid SWA, 경량 MTP, MOPD, 그리고 V2.6의 RL 스케일링Xiaomi MiMo-V2 — hybrid SWA, light MTP, MOPD, and V2.6's RL scaling
- MiniMax-M1 → M2 — CISPO, 그리고 lightning attention을 내려놓은 이유MiniMax-M1 → M2 — CISPO, and why lightning attention was dropped
- MAI-Thinking-1 · MAI-Base-2 — Microsoft AI의 hill-climbing machineMAI-Thinking-1 · MAI-Base-2 — Microsoft AI's hill-climbing machine
- gpt-oss — attention sink, MXFP4, harmonygpt-oss — attention sink, MXFP4, harmony
- Nemotron 3 Ultra — 하이브리드 Mamba·LatentMoE와 다중 teacher 증류Nemotron 3 Ultra — hybrid Mamba, LatentMoE and multi-teacher distillation
- Olmo 3 — 데이터·코드·체크포인트까지 공개한 추론 모델Olmo 3 — a reasoning model released down to its data, code and checkpoints
- GLM-4.5 — 깊은 MoE, mid-training, expert 반복과 자기 증류GLM-4.5 — a deep MoE, mid-training, expert iteration and self-distillation
- GLM-5 — DSA, 비동기 agent RL, on-policy 교차 단계 증류GLM-5 — DSA, asynchronous agent RL and on-policy cross-stage distillation
Frontier 아키텍처 딥다이브Architecture Deep Dives Architecture Deep Dives
MoE, MLA, sparse·linear attention, Mamba 하이브리드, MTP — 부품을 하나씩 해부하고, frontier 모델들이 왜 그 조합을 골랐는지 직접 조작하며 따라간다.MoE, MLA, sparse and linear attention, Mamba hybrids, MTP — take each component apart, then follow why frontier models chose their combinations by manipulating them yourself.
- 설계 공간: 블록의 손잡이와 비용The design space: the knobs of a block and what they cost
- MoE 해부: routing, 세분화·shared expert, 부하 균형, dropless, LatentMoEAnatomy of MoE: routing, fine-grained and shared experts, load balancing, dropless, LatentMoE
- Attention과 KV: MHA → GQA → MLA, sliding window·sink, local/globalAttention and KV: MHA → GQA → MLA, sliding windows and sinks, local/global
- Sparse attention: NSA·DSA·QSA·CSA/HCA로 보는 top-k 선택Sparse attention: NSA, DSA, QSA, CSA/HCA
- Linear attention과 SSM — 고정 크기 상태로 문맥 압축하기Linear attention and SSMs — compressing context into a fixed-size state
- 안정화 부품 — norm 위치, logit 통제, residual 변형, 긴 문맥의 위치 인코딩Stability components — norm placement, logit control, residual variants, positions at long context
- 모델의 양 끝 — multi-token prediction, 어휘, tying, n-gram 임베딩Both ends of the model — multi-token prediction, vocabulary, tying, n-gram embeddings
- DeepSeek 계보: V2 → V3 → V3.2 → V4 → V4.1The DeepSeek lineage: V2 → V3 → V3.2 → V4 → V4.1
- Qwen 계보: Qwen3 → Qwen3-Next → Qwen3.5 → Qwen3.8-NextThe Qwen lineage: Qwen3 → Qwen3-Next → Qwen3.5 → Qwen3.8-Next
- Kimi 계보: K2 → Kimi Linear → K3The Kimi lineage: K2 → Kimi Linear → K3
- Nemotron — Mamba 하이브리드 계보Nemotron — the hybrid Mamba lineage
- 설계 선택 비교 — gpt-oss · MiMo · MiniMax · GLM-5 · MAIDesign choices compared — gpt-oss, MiMo-V2, MiniMax-M2, GLM-5, MAI-Base-2
추론과 추론 최적화Inference & Optimisation Inference & Optimisation
roofline부터 FlashAttention, KV cache 관리, 배칭·PD 분리, 양자화, speculative decoding, MoE 서빙, RL rollout용 추론까지.From the roofline to FlashAttention, KV-cache management, batching and prefill/decode disaggregation, quantisation, speculative decoding, MoE serving and inference for RL rollouts.
- Roofline과 추론 지표The roofline and inference metrics
- Attention kernelAttention kernels
- KV cache 관리KV-cache management
- 배칭과 스케줄링Batching and scheduling
- 양자화Quantisation
- Speculative decoding 심화Speculative decoding in depth
- 서빙을 위한 병렬화와 MoEParallelism for serving, and MoE
- 긴 문맥 서빙Long-context serving
- RL을 위한 추론Inference for RL
Frontier RL: 알고리즘과 안정화Frontier RL: Algorithms & Stability Frontier RL: Algorithms & Stability
frontier lab들의 RL 목적함수를 한 틀로 비교하고, long-horizon·비동기 staleness·학습–추론 불일치를 다루는 엔지니어링까지.The frontier labs' RL objectives in one frame, and the engineering behind long-horizon training, async staleness and training–inference mismatch.
- 프론티어 RL 목적함수 지도 — 하나의 틀The frontier RL landscape — one template for every objective
- 시퀀스냐 토큰이냐 — 집계, 정규화, ratio 단위Sequence vs token — aggregation, normalisation and the unit of the ratio
- Clipping과 importance sampling — 어떤 토큰의 gradient를 끄는가Clipping and importance sampling — which tokens lose their gradient
- 정규화 — KL, 엔트로피, 길이Regularisation — KL, entropy and length
- Long-horizon RL — 긴 궤적의 credit, context 관리, 예산Long-horizon RL — credit, context management and budgets over long trajectories
- 비동기 RL과 stalenessAsynchronous RL and staleness
- 학습–추론 불일치 엔지니어링Engineering away the training–inference mismatch
- Score centering — 불일치가 만드는 drift와 가산 보정Score centering — the drift a mismatch adds, and an additive fix
- 안정화 플레이북 — 지표로 읽는 RL 실패와 각 lab의 처방The stability playbook — reading RL failures from metrics, and what each lab did
- 보상과 환경 — 검증기, rubric·생성형 보상, 다중 환경 RLVR, 환경 합성, 난이도Rewards and environments — verifiers, rubric and generative rewards, multi-environment RLVR, environment synthesis, difficulty
Agent RL 프레임워크Agent RL Frameworks Agent RL Frameworks
verl·slime·AReaL 등 오픈 RL 프레임워크의 구조, 학습 스텝의 배치 단위, Megatron 병렬화, 비동기 rollout과 agent loop 동시성을 직접 계산해 본다.How open RL frameworks such as verl, slime and AReaL are built: the batch units of a training step, Megatron parallelism, async rollouts and agent-loop concurrency — computed hands-on.
- Agent RL 프레임워크 지형도The landscape of agent RL frameworks
- 학습 step 해부 — rollout, mini-batch, micro-batchAnatomy of a training step — rollout, mini-batch, micro-batch
- 학습 병렬화 — TP, PP, EP, CP, DP와 ZeRO·FSDPTraining parallelism — TP, PP, EP, CP, DP with ZeRO and FSDP
- verl 오늘 — single controller, hybrid engine, agent loop, 비동기 trainerverl today — single controller, hybrid engine, agent loop, async trainers
- verl rollout correction — 세 정책과 각 옵션의 수식verl rollout correction — three policies and the equation behind every option
- 비동기 RL 시스템 비교 — staleness, 가중치 동기화, partial rolloutAsynchronous RL systems compared — staleness, weight sync, partial rollouts
- Agent loop과 환경 — 동시성, sandbox, 병목Agent loops and environments — concurrency, sandboxes, bottlenecks
레슨 지도Lesson map
이 사이트를 쓰는 법
- 그림은 만지라고 있는 것입니다. 슬라이더를 끝까지 밀어 보고, 점을 끌어 보고, 망가뜨려 보세요. 각 그림 아래 설명은 무엇을 관찰해야 하는지 알려 줍니다.
- ▶ 실행을 누르면 브라우저 안의 Python(Pyodide)이 NumPy 코드를 돌립니다. 편집을 눌러 숫자를 바꾸고 Ctrl/⌘+Enter로 다시 실행하세요. 같은 페이지의 코드 블록은 변수를 공유합니다(노트북처럼).
- PyTorch 블록은 브라우저에서 돌지 않으니 로컬에서 실행합니다. 같은 알고리즘의 NumPy 판과 나란히 두었습니다.
- 레슨 끝의 완료 표시는 이 브라우저에만 저장되고, 위 진행 막대에 반영됩니다.
커리큘럼의 뼈대
Track I–III은 고전 교과서(Bishop, Goodfellow et al., Karpathy의 Zero to Hero)의 순서를 따르되, LLM 사후학습에 실제로 쓰이는 개념 — cross-entropy와 KL, softmax와 log-prob, AdamW, causal mask — 에 비중을 더 두었습니다. Track IV–V는 Nathan Lambert의 RLHF Book과 강의를 뼈대로 삼고, RL 고전(Sutton & Barto, Spinning Up)과 2025–26년의 GRPO 계열·agent RL 논문으로 살을 붙였습니다. Track VI는 frontier lab 보고서를 원문 그대로 읽고, 핵심 method를 직접 재구현합니다.
How to use this site
- The figures are there to be played with. Push sliders to the end, drag points, break things. The caption under each figure says what to look for.
- ▶ Run executes the NumPy code with Python running inside your browser (Pyodide). Press Edit, change numbers and re-run with Ctrl/⌘+Enter. Code blocks on a page share variables, like notebook cells.
- PyTorch blocks do not run in the browser; run them locally. They sit next to the NumPy version of the same algorithm.
- Mark as done at the end of a lesson is stored in this browser only and fills the progress bars above.
How the curriculum is built
Tracks I–III follow the classic textbooks (Bishop, Goodfellow et al., Karpathy's Zero to Hero) but weight the ideas that LLM post-training actually reuses — cross-entropy and KL, softmax and log-probs, AdamW, causal masks. Tracks IV–V use Nathan Lambert's RLHF Book and course as the skeleton, filled in with RL classics (Sutton & Barto, Spinning Up) and the 2025–26 GRPO-family and agent-RL papers. Track VI reads frontier-lab reports from the primary source and re-implements their key methods.