Skip to content
Science, DecodedContext Jamming

Rosetta Stone · 24 of 30

log⁡\log

Logarithm

Function

In plain English

"How many times do I multiply the base to get this number?" log⁡101000=3\log_{10} 1000 = 3; log⁡28=3\log_2 8 = 3. Logs turn multiplication into addition (log⁡ab=log⁡a+log⁡b\log ab = \log a + \log b), compress huge ranges into readable ones, and turn power laws into straight lines on a log-log plot. −log⁡p-\log p is the surprise of an event with probability pp: rare events are very surprising. The base sets the units (base 2 gives bits, base e gives nats) and is often omitted in papers.

As code

Math.log10(1000);   // 3
Math.log2(8);       // 3
Math.log(Math.E);   // 1   (natural log, base e)
-Math.log2(1 / 8);  // 3 bits of surprise

See it

log⁡\log is the inverse of the exponential: it counts multiplications. Equal ratios become equal distances, which is why log axes straighten power laws.

What it means, field by field

Mathematics

Inverse of exponentiation; log-log plots linearise power laws.

AI / ML

Log-likelihood and cross-entropy loss; log-scale axes for compute and parameters; log-probabilities (logits are unnormalised log-probabilities).

Physics

Boltzmann entropy S = k_B log W; decibels; magnitudes in astronomy.

Biology

pH (−log₁₀ of hydrogen-ion concentration); log fold-change in gene expression; sequence logos measured in bits.

In a research paper

Boltzmann’s entropy formula (engraved on his tombstone in Vienna): entropy as the log of the number of microstates W.
S=kBlog⁡WS = k_B \log W

Entropy grows with the number of microscopic arrangements consistent with what you observe, but only logarithmically.

Common misreadings

  • Assuming log means base 10. In ML and physics it is usually the natural log, but check.

  • Reading straight lines on log-log plots as proof of a power law. Many curves look straight over two decades.

  • Treating a small change in log loss as small. 0.1 nats is a substantial improvement at the frontier.

Connected symbols

Where it appears on this site