Exponentials
Repeated multiplication instead of repeated addition. Exponential growth looks harmless for a long time and then becomes overwhelming — watch it outrun a polynomial that starts far ahead of it.
Repeated multiplication instead of repeated addition. Exponential growth looks harmless for a long time and then becomes overwhelming — watch it outrun a polynomial that starts far ahead of it.
Growth proportional to size — slow to start, then impossible to ignore.
In y = b^x the variable sits in the exponent. Each step of 1 in x multiplies y by b, rather than adding to it. That single difference is what separates exponential from linear behaviour.
Slide the base across 1 and watch the curve flip from climbing to falling.
Keep the polynomial comparison on and look at the left of the plot: x³ is far ahead. Now slide x rightward. There is a crossover point, and after it 2^x leaves x³ hopelessly behind.
This holds for any polynomial and any base above 1 — exponential growth always overtakes eventually. It is the reason exponential-time algorithms are considered intractable no matter how fast the hardware, and the reason a "small" compounding effect is never actually small.
A defining feature of exponentials: the time to double is constant. It takes just as long to go from 1 to 2 as from a million to two million. The panel computes this live — at base 2 it is exactly 1 step, at base 1.1 about 7.3 steps.
Set the base to e ≈ 2.71828. This is the base at which the curve's slope equals its own height at every point:
No other base has this property, which is why e turns up throughout calculus and why exp is the exponential in almost every ML formula — softmax, sigmoid, Gaussian densities and exponential learning-rate decay all use it.
Linear growth adds the same amount each step. Exponential growth multiplies by the same factor each step, so the amount added grows too.
f(x) = a × bˣ
a is the starting value and b is the growth factor. b > 1 grows, 0 < b < 1 decays.
The difference is easy to underestimate. Add 10 a day starting from 100 and after 30 days you have 400. Multiply by 1.1 a day and you have 1,745.
| Day | Linear (+10) | Exponential (×1.1) |
|---|---|---|
| 0 | 100 | 100 |
| 10 | 200 | 259 |
| 20 | 300 | 673 |
| 30 | 400 | 1,745 |
| 60 | 700 | 30,448 |
The exponential column starts slower and ends in a different universe. That is the shape behind compound interest, viral spread, and the growth of model sizes over the last decade.
e ≈ 2.71828 is the growth factor you get from compounding continuously — the limit of (1 + 1/n)ⁿ as n grows.
Its special property is the reason it is everywhere in calculus:
d/dx eˣ = eˣ
The function is its own derivative. No other base does this (any other base picks up a constant factor of ln(b)), and that is what makes e the natural choice for anything involving rates of change — which is to say, anything involving optimisation.
Its inverse is the natural logarithm: eln(x) = x, and ln(eˣ) = x.
The sigmoid. 1 / (1 + e^-x) squashes any real number into (0, 1). The exponential is what makes it smooth, and its derivative — s(x)(1 − s(x)) — is what makes it trainable.
Softmax. e^zi / Σ e^zj turns a vector of scores into probabilities that sum to 1. Exponentiating first is what guarantees positivity and exaggerates the differences between scores, so a small lead in logits becomes a large lead in probability.
Learning rate decay. lr = lr0 × e^(-kt) reduces the step size smoothly as training proceeds.
Exponential moving averages. Momentum, Adam and batch normalisation all keep a running average that weights recent values more heavily, with the weights falling off exponentially.
Radial basis kernels. e^(-γ||x-y||²) measures similarity that falls away rapidly with distance, and is what gives an RBF SVM its local behaviour.
With 0 < b < 1, or a negative exponent, the same shape runs downhill: fast at first, then a long thinning tail that never quite reaches zero.
The half-life is the time taken to halve. It is constant, which is the defining property of exponential decay: whatever the current amount, half of it disappears in the same interval.
That is exactly the behaviour of an exponential moving average with decay 0.9 — a value from ten steps ago carries 0.9¹⁰ ≈ 35% of its original weight, and from a hundred steps ago effectively none. Choosing the decay rate is choosing how long the memory is, and it is why Adam's default of 0.999 for the second moment corresponds to a window of roughly a thousand steps.
Linear, quadratic and exponential growth on the same table, plus the decay form used for learning-rate schedules.
Exponentials multiply rather than add, so they have a constant doubling time and eventually beat any polynomial. Bases above 1 explode, bases below 1 decay toward zero, and base e is the one whose slope equals its value — which is why it underlies softmax, sigmoid and every decay schedule you will configure.
Exponentials grow fast enough to break floating-point arithmetic. e^1000 is infinity as far as a 64-bit float is concerned, and once an infinity enters a calculation the result is NaN.
This is a real problem in softmax, where the inputs are unbounded logits. The standard fix is to subtract the maximum before exponentiating:
import numpy as np
def softmax(z):
z = z - np.max(z) # shift: does not change the result
e = np.exp(z)
return e / e.sum()
softmax(np.array([1000., 1001., 1002.])) # works
np.exp(np.array([1000., 1001., 1002.])) # inf, inf, infSubtracting a constant from every logit leaves the softmax unchanged, because the constant cancels between numerator and denominator — but it moves the largest exponent to e^0 = 1, safely inside range. Every framework does this internally, which is one reason you should pass logits to a loss function rather than probabilities you computed yourself.
The mirror problem is underflow: e^-1000 becomes exactly 0, and a subsequent log gives −infinity. Working in log space throughout, with logsumexp, avoids both.
Three habits stop exponential quantities from misleading you.
Use a log scale. On a logarithmic y-axis, exponential growth is a straight line, and a change in the growth rate becomes visible as a change in slope. On a linear axis everything before the last few periods looks flat and identical.
Quote the doubling time. "Growing 7% a month" is abstract; "doubling every ten months" is not. The rule of 72 gives it quickly: divide 72 by the percentage growth rate to get the doubling time.
Remember nothing grows exponentially for long. Real processes hit a limit and flatten into an S-curve — a logistic function, which is the sigmoid again. Extrapolating an exponential past that bend is how forecasts become absurd.
Why is e used instead of 2 or 10? Because eˣ is its own derivative, which makes every calculus expression cleaner. Other bases work and pick up a constant factor.
What is the difference between exponential and polynomial growth? A polynomial like x² grows by a shrinking proportion; an exponential grows by a constant proportion, and eventually overtakes any polynomial.
Why does softmax use exponentials? They are positive for any input, which is needed for probabilities, and they amplify differences between scores in a smooth, differentiable way.
What causes NaN in my training? Very often an overflow in an exponential, or a log(0). Numerically stable implementations of softmax and cross-entropy exist precisely for this.
What is an exponential moving average? A running average weighting recent values more heavily, with older values fading geometrically. It is what momentum and Adam are built on.
How do I fit an exponential relationship? Take the log of the target and fit a straight line — log(y) = log(a) + x log(b) is linear in x.
Say the answer out loud before you reveal it — recalling it is what makes it stick, and rereading it is not.
What does this module say about “Before the details”?
In y = b^x the variable sits in the exponent . Each step of 1 in x multiplies y by b, rather than adding to it. That single difference is what separates exponential from linear behaviour.
What does this module say about “Exponential Always Wins Eventually”?
Keep the polynomial comparison on and look at the left of the plot: x³ is far ahead. Now slide x rightward. There is a crossover point, and after it 2^x leaves x³ hopelessly behind.
What does this module say about “Doubling Time and Half-Life”?
A defining feature of exponentials: the time to double is constant . It takes just as long to go from 1 to 2 as from a million to two million. The panel computes this live — at base 2 it is exactly 1 step, at base 1.1 about 7.3 steps.
Repeated multiplication instead of repeated addition. Exponential growth looks harmless for a long time and then becomes overwhelming — watch it outrun a polynomial that starts far ahead of it.