In the first lesson the loss was “given”: squared error for regression, cross-entropy for classification. But why these in particular? The answer comes down to one principle: view the model as a probability distribution, and maximise the probability of the observed data. From this single viewpoint we derive MSE and cross-entropy, and the same line of reasoning explains why the LLM pre-training loss is “the probability of the next token” and why the RLHF KL penalty points the way it does.
Maximum likelihood estimation
Suppose the model outputs a conditional distribution over outputs . If the data are i.i.d., the probability of seeing this data, the likelihood, is a product.
Maximum likelihood estimation (MLE) picks the that maximises it. A product quickly underflows to 0 and is awkward to differentiate, so we take the log, flip the sign to make it a minimisation problem, and divide by . The log is monotonically increasing, so the optimum does not move.
This is exactly the ERM of the first lesson with the loss . Now we only need to choose the shape of , and the loss follows automatically.
Gaussian → MSE
Assume the regression model outputs the mean and the noise is Gaussian with variance . Since ,
If is fixed, the second term is a constant and the first is the squared error times a constant. MLE under Gaussian noise = least squares. Conversely, the moment you use MSE you have assumed that “the residuals are Gaussian with the same variance everywhere”. That is why MSE is fragile on data with many outliers: the Gaussian has thin tails, so it treats large residuals as extremely rare and pulls the model hard to get rid of them. Assuming a Laplace distribution, the same logic yields the absolute-error loss (MAE).
Bernoulli → binary cross-entropy
If and the model outputs , then and
Categorical → cross-entropy
If and the model outputs a probability vector , only the probability of the correct answer remains.
The last form is “the cross-entropy between the one-hot target distribution and ”. The LLM next-token loss is exactly this; the vocabulary size is and the target is just the actual next token .
Information, entropy, cross-entropy, KL
The quantity has an information-theoretic name: the surprisal, or information content, of an event with probability . An event of probability 1 carries 0 nats, and the rarer the event, the larger it is (nats with base , bits with base 2).
- Entropy : the average length of the best lossless compression of samples from (Shannon’s source coding theorem). The optimal code spends on outcome , so this is also the average surprisal — the uncertainty of itself: 0 for a one-hot (nothing to send), maximal at for the uniform distribution (nothing to compress). See Information theory for the derivation.
- Cross-entropy : the average surprisal when events actually come from but you believe . In compression terms, it is the average length when encoding samples of with a code fitted to .
- KL divergence : the difference — the extra surprisal caused by the wrong belief.
KL is always non-negative, and zero only when (Gibbs’ inequality). Since is concave, it follows directly from Jensen’s inequality.
So cross-entropy is minimised at , and its minimum is . This is exactly the “noise floor” of the first lesson: no model can reduce the uncertainty in the data itself.
첫 레슨에서 손실 은 “주어진 것”이었다. 회귀에는 제곱 오차, 분류에는 cross-entropy. 그런데 왜 하필 이것들인가? 답은 하나의 원리로 정리된다. 모델을 확률분포로 보고, 관측된 데이터의 확률을 최대화하라. 이 관점 하나로 MSE와 cross-entropy가 유도되고, LLM 사전학습 손실이 왜 “다음 토큰의 확률”인지, RLHF의 KL 페널티가 왜 그 방향인지까지 한 줄로 이어진다.
최대우도 추정
모델이 출력 에 대한 조건부 분포 를 내놓는다고 하자. 데이터 가 i.i.d.라면 이 데이터가 나올 확률, 즉 우도(likelihood) 는 곱이다.
최대우도 추정(MLE, maximum likelihood estimation) 은 이것을 최대화하는 를 고른다. 곱은 숫자가 금방 0으로 사라지고 미분도 불편하니 로그를 씌우고, 최소화 문제로 바꾸려 부호를 뒤집고, 으로 나눈다. 로그는 단조증가라서 최적점은 그대로다.
이것은 정확히 첫 레슨의 ERM에 손실 를 넣은 것이다. 이제 의 모양만 정하면 손실이 저절로 나온다.
가우시안 → MSE
회귀 모델 가 평균을 내고 잡음은 분산 의 가우시안이라고 가정하자. 이므로
가 고정이면 둘째 항은 상수이고 첫째 항은 제곱 오차에 상수배다. 가우시안 잡음 가정 아래의 MLE = 최소제곱이다. 거꾸로 말하면, MSE를 쓰는 순간 “잔차는 가우시안이고 분산은 어디서나 같다”고 가정한 셈이다. 이상치가 많은 데이터에 MSE가 약한 이유가 이것이다. 가우시안은 꼬리가 얇아서 큰 잔차를 극도로 드물다고 보고, 그것을 없애려고 모델을 크게 끌어당긴다. 라플라스 분포를 가정하면 같은 논리로 절댓값 손실(MAE)이 나온다.
베르누이 → binary cross-entropy
이고 모델이 를 낸다면 이고
범주형 → cross-entropy
이고 모델이 확률 벡터 를 낸다면, 정답의 확률 하나만 남는다.
마지막 꼴이 “원-핫 정답 분포와 의 cross-entropy”다. LLM의 다음 토큰 손실이 정확히 이것이다. 어휘 크기가 이고 정답이 실제 다음 토큰 일 뿐이다.
정보량, entropy, cross-entropy, KL
라는 양에는 정보이론적인 이름이 있다. 확률 인 사건의 놀람(surprisal) 혹은 정보량이다. 확률 1인 사건은 0 nat, 드문 사건일수록 크다(밑이 면 nat, 2면 bit).
- Entropy : 의 표본을 가장 효율적으로 무손실 압축했을 때의 평균 길이(Shannon의 원천 부호화 정리). 최적 부호는 결과 에 를 쓰므로 이는 평균 놀람이기도 하다. 자체의 불확실성이다. 원-핫이면 0(보낼 것이 없음), 균등이면 최대 (압축할 여지가 없음). 유도는 정보 이론에 있다.
- Cross-entropy : 실제로는 에서 사건이 나오는데 라고 믿고 놀랄 때의 평균 놀람. 압축으로 말하면, 에 맞춘 부호로 의 표본을 부호화할 때의 평균 길이다.
- KL divergence : 그 차이. 틀린 믿음 때문에 추가로 드는 놀람이다.
KL은 항상 0 이상이고, 일 때만 0이다(Gibbs 부등식). 가 오목하므로 Jensen 부등식으로 바로 나온다.
따라서 cross-entropy는 에서 최소가 되고 그 최솟값은 다. 이 가 바로 첫 레슨의 “잡음 바닥”에 해당한다. 데이터 자체의 불확실성은 어떤 모델로도 줄일 수 없다.
- In the initial state KL(p‖q) ≈ 0.26 and KL(q‖p) ≈ 0.16 — they differ. q underestimates the tail of p (‘sat’, ‘ran’), and forward KL penalises that more heavily.
- Press “q misses a mode” and KL(p‖q) jumps. Where p puts a lot of probability and q is almost 0, blows up.
- Press “p = one-hot” and H(p) = 0, so cross-entropy and KL(p‖q) become equal: both are the correct token’s . KL(q‖p), on the other hand, is ∞, because q puts probability on tokens where p = 0.
- Perplexity can be read as “how many tokens the model is, on average, hesitating between”. With q uniform it is exactly 6.
MLE is forward-KL minimisation
Consider the empirical distribution of the data (a distribution with mass on each observed sample). The NLL can be written as an expectation under .
does not depend on , so minimising NLL = minimising . This direction, with the data distribution first, is called forward KL. As , , so MLE fits the model to the data distribution in forward KL.
The same holds for conditional models. A language model’s per-token loss is , and its lower bound is the conditional entropy of the text itself. This is why pre-training loss curves converge towards some value rather than 0, and why scaling laws contain an “irreducible loss” term.
The asymmetry of KL: what goes on which side
KL is not a distance. , and when the shape of the approximating distribution is restricted (say, to a single Gaussian), which direction you minimise gives completely different answers.
- Forward : the expectation is taken under . Where has mass and , , an infinite penalty. So spreads wide to cover every mode of . This is called mode-covering (or zero-avoiding).
- Reverse : the expectation is taken under . Places where has no mass are never evaluated at all. Instead, if puts mass where , the penalty is infinite. So hides safely inside one mode. This is called mode-seeking (or zero-forcing).
Minimising forward KL with a Gaussian has a closed-form answer. Differentiating with respect to and and setting it to 0 gives
That is moment matching. For , and . The peak of lands in the valley between the two humps, where is almost 0.
Reverse KL has no closed-form solution, but the limit where the modes are far apart can be computed. Place exactly on top of the right mode; where has mass, , so
With this is . A wide pays a penalty for putting mass in the valley, so once the modes are far enough apart, hiding in one mode wins. Watch that transition in the figure below.
- 처음 상태에서 KL(p‖q) ≈ 0.26, KL(q‖p) ≈ 0.16으로 서로 다르다. q가 p의 꼬리(‘sat’, ‘ran’)를 과소평가하고 있고, forward KL은 이것을 더 무겁게 벌한다.
- “q가 모드를 놓침” 을 누르면 KL(p‖q)가 크게 뛴다. p가 확률을 많이 둔 곳에서 q가 거의 0이면 가 폭발한다.
- “p = 원-핫” 을 누르면 H(p) = 0이 되고 cross-entropy와 KL(p‖q)가 같아진다. 둘 다 정답 토큰의 이다. 반면 KL(q‖p)는 ∞다. q가 p=0인 토큰에 확률을 두기 때문이다.
- perplexity 는 “모델이 평균적으로 몇 개의 토큰 사이에서 고민하는가”로 읽을 수 있다. q = 균등이면 정확히 6이다.
MLE는 forward KL 최소화다
데이터의 경험분포 (관측된 표본마다 씩 질량을 둔 분포)를 생각하자. NLL은 에 대한 기댓값으로 쓸 수 있다.
는 와 무관하므로 NLL 최소화 = 최소화다. 데이터 분포가 앞에 오는 이 방향을 forward KL이라 부른다. 이면 이니 MLE는 모델을 데이터 분포에 forward KL로 맞추는 일이다.
조건부 모델도 마찬가지다. 언어 모델의 토큰당 손실은 이고, 그 하한은 텍스트 자체의 조건부 entropy다. 사전학습 loss 곡선이 0이 아니라 어떤 값으로 수렴해 가는 이유, 그리고 스케일링 법칙에 “줄일 수 없는 손실(irreducible loss)” 항이 들어가는 이유가 이것이다.
KL의 비대칭: 어느 쪽에 무엇을 놓는가
KL은 거리가 아니다. 이고, 근사 분포 의 모양이 제한되어 있을 때(예를 들어 가우시안 하나) 어느 방향을 최소화하느냐에 따라 전혀 다른 답이 나온다.
- Forward : 기댓값을 로 잰다. 가 질량을 둔 곳에서 이면 라 무한대 벌점이다. 그래서 는 의 모든 모드를 덮으려고 넓게 퍼진다. 이것을 mode-covering(혹은 zero-avoiding)이라 부른다.
- Reverse : 기댓값을 로 잰다. 가 질량을 두지 않은 곳은 아예 평가되지 않는다. 대신 인 곳에 가 질량을 두면 무한대 벌점이다. 그래서 는 한 모드 안에 안전하게 숨는다. 이것을 mode-seeking(혹은 zero-forcing)이라 부른다.
가우시안 로 forward KL을 최소화하면 답이 닫힌 꼴로 나온다. 를 , 로 미분해 0으로 놓으면
모멘트 매칭이다. 이면 , . 두 봉우리 사이의 골짜기, 즉 가 거의 0인 곳에 의 꼭대기가 놓인다.
Reverse KL에는 닫힌 해가 없지만 모드가 멀리 떨어진 극한은 계산할 수 있다. 을 오른쪽 모드에 정확히 겹쳐 놓으면, 가 질량을 두는 곳에서는 이므로
이면 . 넓게 퍼진 는 골짜기에 질량을 두는 벌점을 받으므로, 모드가 충분히 떨어지면 한 모드에 숨는 쪽이 이긴다. 아래 그림에서 그 전환을 직접 보자.
- Raise d slowly from 0. While d is small the two solutions are almost the same ( looks like a single hump).
- Around d ≈ 2.8 the reverse-KL solution (red) suddenly jumps to one of the humps. It is the moment the single valley in the right-hand map splits in two. Blue (forward) keeps widening continuously.
- Lower w to 0.4 and reverse KL picks the heavier right mode. Its KL value is close to .
- In the right-hand map, click the valley that was not chosen. It is also a local minimum. Minimising reverse KL by gradient descent gets stuck in one of the two depending on the initialisation.
Computing it
import numpy as np
def entropy(p):
p = np.asarray(p, float)
nz = p > 0 # 0 log 0 = 0
return -np.sum(p[nz] * np.log(p[nz]))
def cross_entropy(p, q):
p, q = np.asarray(p, float), np.asarray(q, float)
nz = p > 0
with np.errstate(divide="ignore"):
return -np.sum(p[nz] * np.log(q[nz])) # inf if p>0 where q=0
def kl(p, q):
return cross_entropy(p, q) - entropy(p)
p = np.array([0.34, 0.22, 0.18, 0.12, 0.09, 0.05])
q = np.array([0.45, 0.30, 0.20, 0.03, 0.015, 0.005])
print(f"H(p)={entropy(p):.4f} H(p,q)={cross_entropy(p, q):.4f} H(p)+KL(p||q)={entropy(p) + kl(p, q):.4f}")
print(f"KL(p||q)={kl(p, q):.4f} KL(q||p)={kl(q, p):.4f} ← asymmetric")
onehot = np.eye(6)[2] # target token is 'cat' (index 2)
print(f"one-hot target: H(y,q)={cross_entropy(onehot, q):.4f} = -log q[2] = {-np.log(q[2]):.4f},"
f" KL(q||y)={kl(q, onehot)}")
# Checking MLE: the mean NLL of token samples equals the cross-entropy of the empirical p̂ and q
rng = np.random.default_rng(0)
tokens = rng.choice(6, size=10_000, p=p)
p_hat = np.bincount(tokens.astype(np.intp), minlength=6) / len(tokens)
print(f"\nmean NLL = {-np.log(q[tokens]).mean():.4f} H(p̂, q) = {cross_entropy(p_hat, q):.4f}")
print(f"the MLE of q is p̂ itself: {np.round(p_hat, 3)} → mean NLL = H(p̂) = {entropy(p_hat):.4f}")Now we reproduce the figure’s experiment with a grid search: integrate both KLs numerically over a grid and find each minimum.
def log_normal(x, mu, s):
return -0.5 * ((x - mu) / s) ** 2 - np.log(s) - 0.5 * np.log(2 * np.pi)
x = np.linspace(-12, 12, 961); dx = x[1] - x[0] # integration grid
mus = np.linspace(-6, 6, 121)
sigmas = np.exp(np.linspace(np.log(0.3), np.log(6), 120))
def kl_landscapes(d, w=0.5):
logp = np.logaddexp(np.log(w) + log_normal(x, -d, 1), np.log(1 - w) + log_normal(x, d, 1))
p_x = np.exp(logp)
fwd = np.empty((len(mus), len(sigmas))); rev = np.empty_like(fwd)
for j, s in enumerate(sigmas):
logq = log_normal(x[None, :], mus[:, None], s) # (number of μ, number of x)
fwd[:, j] = np.sum(p_x * (logp - logq), axis=1) * dx # KL(p||q)
rev[:, j] = np.sum(np.exp(logq) * (logq - logp), axis=1) * dx # KL(q||p)
return fwd, rev
def argmin2(L):
i, j = np.unravel_index(np.argmin(L), L.shape)
return mus[i], sigmas[j], L[i, j]
for d, w in [(1.5, 0.5), (2.5, 0.5), (3.2, 0.5), (3.2, 0.4)]:
fwd, rev = kl_landscapes(d, w)
fm, fs, _ = argmin2(fwd)
rm, rs, rk = argmin2(rev)
mom_mu = (1 - 2 * w) * d
mom_sd = np.sqrt(1 + d**2 - mom_mu**2)
print(f"d={d} w={w}: forward μ={fm:+.2f} σ={fs:.2f} (moments {mom_mu:+.2f}, {mom_sd:.2f}) | "
f"reverse μ={rm:+.2f} σ={rs:.2f} KL={rk:.3f}")
print(f"\n-log(0.5) = {-np.log(0.5):.3f}, -log(0.6) = {-np.log(0.6):.3f}")At d = 1.5 and 2.5, reverse KL also places a wide Gaussian in the middle. At d = 3.2 it moves to one mode (σ ≈ 1), and the KL value is close to . The forward-KL answer always agrees with moment matching.
You approximate a multimodal distribution p with a model q of limited capacity. If the most important thing is 'never put near-zero probability on any mode of p', which should you minimise?
becomes infinite if where , so it forces to cover every mode (mode-covering). The price is that it also puts probability in the empty space between modes. MLE, i.e. pre-training, is this direction.
You trained a regression model with MSE. Probabilistically, this is the same as MLE under which assumption?
. Only when is a constant independent of the input does the second term drop out, leaving exactly a constant multiple of MSE. If the noise differs per input (heteroscedastic), you need an NLL that also predicts . The Laplace assumption gives MAE.
Summary
- MLE minimises the NLL . Gaussian → MSE, Bernoulli → BCE, categorical → cross-entropy.
- , with (Jensen). The floor of cross-entropy is the entropy of the data.
- MLE = forward-KL minimisation against the empirical distribution. The token cross-entropy of LLM pre-training is exactly this. Perplexity is .
- Forward KL is mode-covering (covers every mode; moment matching for a Gaussian); reverse KL is mode-seeking (hides in one mode, with several local minima).
- The RLHF KL penalty is reverse KL over the model’s own samples, and its optimum is proportional to .
- d를 0에서 천천히 올리자. d가 작을 때는 두 해가 거의 같다(가 봉우리 하나처럼 생겼다).
- d ≈ 2.8 근처에서 reverse KL 해(빨강)가 갑자기 한쪽 봉우리로 점프한다. 오른쪽 지도에서 하나였던 골짜기가 둘로 갈라지는 순간이다. 파랑(forward)은 계속 연속적으로 넓어진다.
- w를 0.4로 내리면 reverse KL은 무거운 오른쪽 모드를 고른다. 그 KL 값은 에 가깝다.
- 오른쪽 지도에서 선택되지 않은 골짜기를 클릭해 보자. 그곳도 국소 최소다. 경사하강법으로 reverse KL을 최소화하면 초기화에 따라 둘 중 하나에 갇힌다.
직접 계산하기
import numpy as np
def entropy(p):
p = np.asarray(p, float)
nz = p > 0 # 0 log 0 = 0
return -np.sum(p[nz] * np.log(p[nz]))
def cross_entropy(p, q):
p, q = np.asarray(p, float), np.asarray(q, float)
nz = p > 0
with np.errstate(divide="ignore"):
return -np.sum(p[nz] * np.log(q[nz])) # q=0 인 곳에 p>0 이면 inf
def kl(p, q):
return cross_entropy(p, q) - entropy(p)
p = np.array([0.34, 0.22, 0.18, 0.12, 0.09, 0.05])
q = np.array([0.45, 0.30, 0.20, 0.03, 0.015, 0.005])
print(f"H(p)={entropy(p):.4f} H(p,q)={cross_entropy(p, q):.4f} H(p)+KL(p||q)={entropy(p) + kl(p, q):.4f}")
print(f"KL(p||q)={kl(p, q):.4f} KL(q||p)={kl(q, p):.4f} ← 비대칭")
onehot = np.eye(6)[2] # 정답 토큰이 'cat'(index 2)
print(f"원-핫 타깃: H(y,q)={cross_entropy(onehot, q):.4f} = -log q[2] = {-np.log(q[2]):.4f},"
f" KL(q||y)={kl(q, onehot)}")
# MLE 확인: 토큰 표본의 평균 NLL은 경험분포 p̂와 q의 cross-entropy와 같다
rng = np.random.default_rng(0)
tokens = rng.choice(6, size=10_000, p=p)
p_hat = np.bincount(tokens.astype(np.intp), minlength=6) / len(tokens)
print(f"\n평균 NLL = {-np.log(q[tokens]).mean():.4f} H(p̂, q) = {cross_entropy(p_hat, q):.4f}")
print(f"q의 MLE는 p̂ 자체: {np.round(p_hat, 3)} → 평균 NLL = H(p̂) = {entropy(p_hat):.4f}")이제 그림의 실험을 격자 탐색으로 재현한다. 격자 위에서 두 KL을 수치 적분하고 각각의 최소점을 찾는다.
def log_normal(x, mu, s):
return -0.5 * ((x - mu) / s) ** 2 - np.log(s) - 0.5 * np.log(2 * np.pi)
x = np.linspace(-12, 12, 961); dx = x[1] - x[0] # 적분 격자
mus = np.linspace(-6, 6, 121)
sigmas = np.exp(np.linspace(np.log(0.3), np.log(6), 120))
def kl_landscapes(d, w=0.5):
logp = np.logaddexp(np.log(w) + log_normal(x, -d, 1), np.log(1 - w) + log_normal(x, d, 1))
p_x = np.exp(logp)
fwd = np.empty((len(mus), len(sigmas))); rev = np.empty_like(fwd)
for j, s in enumerate(sigmas):
logq = log_normal(x[None, :], mus[:, None], s) # (μ 개수, x 개수)
fwd[:, j] = np.sum(p_x * (logp - logq), axis=1) * dx # KL(p||q)
rev[:, j] = np.sum(np.exp(logq) * (logq - logp), axis=1) * dx # KL(q||p)
return fwd, rev
def argmin2(L):
i, j = np.unravel_index(np.argmin(L), L.shape)
return mus[i], sigmas[j], L[i, j]
for d, w in [(1.5, 0.5), (2.5, 0.5), (3.2, 0.5), (3.2, 0.4)]:
fwd, rev = kl_landscapes(d, w)
fm, fs, _ = argmin2(fwd)
rm, rs, rk = argmin2(rev)
mom_mu = (1 - 2 * w) * d
mom_sd = np.sqrt(1 + d**2 - mom_mu**2)
print(f"d={d} w={w}: forward μ={fm:+.2f} σ={fs:.2f} (모멘트 {mom_mu:+.2f}, {mom_sd:.2f}) | "
f"reverse μ={rm:+.2f} σ={rs:.2f} KL={rk:.3f}")
print(f"\n-log(0.5) = {-np.log(0.5):.3f}, -log(0.6) = {-np.log(0.6):.3f}")d = 1.5, 2.5에서는 reverse KL도 가운데에 넓은 가우시안을 놓는다. d = 3.2에서는 한 모드로 옮겨 가고(σ ≈ 1), KL 값이 에 가깝다. forward KL의 답은 언제나 모멘트 매칭과 일치한다.
표현력이 제한된 모델 q로 다봉(multimodal) 분포 p를 근사한다. 'p의 어떤 모드에도 확률을 거의 0으로 두지 않는 것'이 가장 중요하다면 어느 것을 최소화해야 하는가?
는 인 곳에서 이면 무한대가 되므로 모든 모드를 덮게 만든다(mode-covering). 대가로 모드 사이의 빈 곳에도 확률을 둔다. MLE, 즉 사전학습이 이 방향이다.
회귀 모델을 MSE로 학습했다. 이것은 확률적으로 어떤 가정 아래의 MLE와 같은가?
. 가 입력과 무관한 상수일 때만 둘째 항이 사라지고 정확히 MSE의 상수배가 된다. 입력마다 잡음이 다르면(heteroscedastic) 도 함께 예측하는 NLL을 써야 한다. 라플라스 가정에서는 MAE가 나온다.
정리
- MLE는 NLL 의 최소화다. 가우시안 → MSE, 베르누이 → BCE, 범주형 → cross-entropy.
- , (Jensen). cross-entropy의 바닥은 데이터의 entropy다.
- MLE = 경험분포에 대한 forward KL 최소화. LLM 사전학습의 토큰 cross-entropy가 그대로 이것이다. perplexity는 .
- forward KL은 mode-covering(모든 모드를 덮음, 가우시안이면 모멘트 매칭), reverse KL은 mode-seeking(한 모드에 숨음, 국소 최소가 여러 개).
- RLHF의 KL 페널티는 자기 표본 위의 reverse KL이고, 최적해는 에 비례한다.
더 읽을거리Further reading
- Goodfellow, Bengio, Courville, Deep Learning §3.13, §5.5 (MIT Press, 2016) — 정보이론 기초와 MLE. 그림 3.6이 이 레슨의 forward/reverse KL 그림의 원형이다.Information-theory basics and MLE. Figure 3.6 is the model for this lesson's forward/reverse KL figure.
- Bishop, Pattern Recognition and Machine Learning §1.2.5, §1.6 (Springer, 2006) — 가우시안 잡음 가정에서 최소제곱이 MLE가 되는 유도와 정보이론 입문.The derivation of least squares as MLE under Gaussian noise, and an introduction to information theory.
- Murphy, Probabilistic Machine Learning: An Introduction, Ch. 4, 6 (MIT Press, 2022) — MLE와 정보이론을 현대적 표기로 정리. 무료 PDF.MLE and information theory in modern notation. Free PDF.
- Cover & Thomas, Elements of Information Theory, Ch. 2 (Wiley, 2006) — entropy, KL, Gibbs 부등식의 표준 교과서.The standard textbook for entropy, KL and Gibbs' inequality.
- Minka, Divergence Measures and Message Passing (Microsoft Research Tech. Report, 2005) — KL 방향과 α-divergence가 근사 분포를 어떻게 바꾸는지(zero-forcing vs inclusive) 정리.How the direction of KL and α-divergences change the approximating distribution (zero-forcing vs inclusive).
- Ouyang et al., Training language models to follow instructions with human feedback (NeurIPS 2022) — InstructGPT. 보상에 π_ref 대비 KL 페널티를 붙인 RLHF 목적함수.InstructGPT. The RLHF objective that adds a KL penalty against π_ref to the reward.