G
nurgoni
← Back to writing
AIMath2026-08-31 · 8 min read

Understanding softmax activation function

Back to Fundamental, learn softmax in intuitive ways

Foundation

For me, the best way to understand a mathematical function is by observing its behavior.

By doing this, we can see how a function behaves when we input different types of parameters and observe the outputs it produces. This is actually a general approach we can use to analyze mathematical functions.

I’ll start by looking at the behavior of the Exponential function. Pay attention to the graph below. Ignore the Python code, because that is not the focus here.

# Creating a range of x values from -5 to 5
x = np.linspace(-5, 5, 1000)
 
# Exponential function
y = np.exp(x)
 
# Creating the plot
plt.figure(figsize=(10, 6))
plt.plot(x, y, label='y = e^x')
 
# Adding details
plt.title('Plot of the Exponential Function y = e^x')
plt.xticks(range(-5, 5 + 1, 1))
plt.xlabel('x')
plt.ylabel('y')
plt.legend()
plt.grid(True)
 
# Displaying the plot
plt.show()

Exponential function

From the graph above, we can identify several properties of the exponential function:

  1. The curve is always increasing (monotonically increasing) from left to right.
  2. It never crosses the x-axis because:
ex>0e^x > 0
  1. It crosses the y-axis at x=0x = 0, where y=1y = 1.

These three properties are basic conclusions that we can derive directly from the behavior of the curve.

We can also observe that when xx is positive, the growth of yy becomes extremely fast. On the other hand, when xx is negative, yy decreases slowly toward 00, but never actually reaches 00.

In other words, y=0y = 0 acts as a horizontal asymptote.

This function shows us an important characteristic: the larger the input value, the faster the output grows.

The growth is not linear. Instead, it is self-accelerating: as the input increases, the output grows at an increasingly faster rate.

From this perspective, x=0x = 0 can be viewed as an important transition point where the output starts moving from values below 11 to values above 11, and the exponential growth becomes increasingly dominant as xx increases.

Softmax Correlation

Softmax is a function that intentionally takes advantage of this property of the exponential function.

The exponential function does something very important for Softmax:

It amplifies differences between values.

A relatively small difference in the input can become a much larger difference after applying the exponential function.

For example:

e12.72e^1 \approx 2.72 e320.09e^3 \approx 20.09 e454.60e^4 \approx 54.60

Notice what happens here.

The difference between 33 and 44 is only:

43=14 - 3 = 1

But after applying the exponential function, the values become:

e320e^3 \approx 20

and

e454.6e^4 \approx 54.6

The gap has become much larger:

54.620.134.554.6 - 20.1 \approx 34.5

So, exponential amplification makes larger input values increasingly dominant.

This behavior is exactly what Softmax takes advantage of when it converts a set of arbitrary scores into a probability distribution.