The Log Sightings Cheat Sheet
Once you know what to look for, logs are everywhere in AI. A short field guide:
- Cross-entropy loss —
F.cross_entropyin PyTorch isNLLLoss(log_softmax(x))under the hood. - Information / entropy — Shannon entropy is . Bits per token in a language model.
- KL divergence — . Used in distillation, RLHF, variational autoencoders.
- Logit transformation — . Maps probabilities (0,1) to all of ℝ. Inside every binary classifier.
- Log scales in plotting — training curves on log y-axis, learning rate schedules on log scales, perplexity (exp of NLL) on log scales.
- Quantization scaling — Q-format and dynamic-range encoding often use log spacing.
- Boltzmann / softmax temperature — . Energy = -log probability up to constants.
If a model is computing probabilities, it's almost certainly computing log-probabilities under the hood. Numerical stability demands it.
Track Reward
Logs are the universe's natural normalizer. Your ears do them. AI does them. Loss functions live in log-space. The next time you seeF.log_softmaxorcross_entropyorlogsumexp, you'll see the underlying compression spell, not the syntax.
로봇의 뇌(코드) 속에는 cross_entropy라는 공식이 있다. 그 껍질을 까보면 그 속에는 항상 로그가 숨어 있다. 로그는 사라질 뻔한 작은 숫자들을 안전하게 지켜주고, 복잡한 계산을 길찾기 쉬운 지도로 바꾸어준다. 인공지능의 학습은 로그가 만들어준 공간 위에서 정답이라는 보물을 찾아가는 여정이다.