Mathematics for LLM
공식을 외우지 않고 모델의 계산 경로를 읽는다
선형대수, 확률·정보이론, 미분·최적화부터 Transformer, 검색, 정렬과 도구 사용에 필요한 수학을 손계산과 tensor shape로 연결합니다.
Mathematics for LLM 기록
LLM 수학 00 — 논문을 읽기 위한 전체 지도
선형대수부터 확률, 미분, Transformer, 검색, fine-tuning과 MCP까지 무엇을 어느 깊이로 알아야 하는지 논문 속 질문을 기준으로 연결한다.
2026. 07. 21. · 7분 읽기LLM 수학 01 — 선형대수와 tensor shape
vector와 matrix의 연산을 embedding, attention, cosine similarity, SVD와 LoRA에 연결하고 모든 계산을 tensor shape로 검증한다.
2026. 07. 21. · 8분 읽기LLM 수학 02 — 확률과 정보이론
조건부확률에서 softmax, negative log-likelihood, entropy, KL divergence와 decoding까지 LLM이 분포를 학습하고 token을 뽑는 계산을 잇는다.
2026. 07. 21. · 10분 읽기LLM 수학 03 — 미분과 최적화
derivative와 chain rule에서 backpropagation을 유도하고, mini-batch gradient, AdamW, clipping, normalization과 numerical precision까지 학습 경로를 계산한다.
2026. 07. 21. · 9분 읽기LLM 수학 04 — Transformer를 식으로 한 바퀴
token id가 embedding, causal self-attention, FFN, vocabulary logit과 loss를 지나고 생성 시 KV cache로 이어지는 전 과정을 식·shape·비용으로 추적한다.
2026. 07. 21. · 10분 읽기LLM 수학 05 — 검색과 RAG
BM25, dense embedding, contrastive loss, ANN, hybrid fusion과 reranking을 비교하고 Recall·MRR·nDCG로 RAG 실패를 retrieval과 generation 단계로 나눈다.
2026. 07. 21. · 11분 읽기LLM 수학 06 — Fine-tuning, agent와 MCP
SFT·LoRA·preference 학습의 objective를 계산하고, tool 선택과 실행 신뢰도를 분리한 뒤 최신 MCP의 host·client·server 계약과 수학의 경계를 정리한다.
2026. 07. 21. · 12분 읽기