Updated: 2026-07-17

The step function is the most elementary activation function in neural networks: it maps any input to a binary output, making a hard decision about whether a neuron “fires” or not. It is the conceptual starting point of artificial neural networks, although more flexible alternatives have since taken over.

Key takeaways

  • The step function returns 1 if the input exceeds a threshold and 0 otherwise.
  • It is computationally cheap and intuitive, ideal for simple binary classification.
  • Its main limitation is non-differentiability, which excludes it from modern backpropagation algorithms.
  • In modern neural networks it serves as a conceptual reference, not a production function.
  • Functions like ReLU and sigmoid have replaced it in practice.

What is the step function

The Heaviside step function is a simple mathematical function that takes an input and returns a binary output:

  • If input x ≥ 0, output is 1.
  • If input x < 0, output is 0.

Look at the curve: it is flat at 0 to the left of the origin and flat at 1 to the right, with an instant vertical jump at x = 0. That jump is exactly why its derivative is 0 across almost the whole domain (and undefined right at x = 0): there is no slope to propagate backward. That is precisely the limitation that sigmoid and ReLU each solve in their own way.

Heaviside step function plot showing the discontinuous jump at x=0

Heaviside step function plot showing the discontinuous jump at x=0

This discontinuity at the origin is precisely what makes it so direct. It is also what limits its use in modern training environments.

Why it was essential in early models

Artificial neural networks simulate the behaviour of biological neurons: each neuron receives signals, weights them, and decides whether to transmit or not. The step function captures exactly that all-or-nothing decision.

In Rosenblatt’s original perceptron (1958), the step function was the central decision mechanism:

  1. The weighted sum of inputs was computed.
  2. If it exceeded the threshold, the neuron activated (output = 1).
  3. If not, it remained inactive (output = 0).

This approach worked for linearly separable problems, such as distinguishing spam from legitimate email or detecting whether a pixel exceeds a certain brightness level.

Multi-layer neural network diagram where each neuron applies an activation function

Multi-layer neural network diagram where each neuron applies an activation function

Advantages and disadvantages

Advantages:

  • Computational simplicity: evaluating f(x) is virtually free.
  • Direct interpretability: the output represents a binary decision.
  • Useful for binary classification in resource-constrained systems.

Disadvantages:

  • Not differentiable at x = 0, which prevents gradient computation and backpropagation.
  • Does not capture uncertainty or probabilities: output is always 0 or 1, with no nuance.
  • In multi-layer networks, zero gradients block learning in earlier layers.

Real-world applications

The step function has a place in systems where binary output is sufficient:

  • Spam detection: is it spam or not?
  • Embedded control: does the sensor exceed the temperature threshold?
  • Feature maps in computer vision: binarising filter responses in classical preprocessing.

For contexts where probability or continuous output is needed, the sigmoid function or hyperbolic tangent are better choices. For multi-class classification, a comparison with softmax is relevant.

To understand the broader context of activation functions within deep learning, it helps to study them together: each function has a specific role depending on the architecture and the network’s objective. Models such as those used in image analysis with computer vision typically combine ReLU in inner layers with sigmoid or softmax at the output layer.

Frequently asked questions

Why doesn’t the step function work for training modern neural networks?

Because its derivative is 0 across almost the entire domain and undefined at x = 0. Gradient descent and backpropagation need a non-zero slope to know which direction to adjust each weight; with a zero derivative, the error signal never reaches earlier layers. That exact problem is what motivated differentiable functions such as sigmoid and ReLU.

How is the step function different from the sigmoid function?

The step function can only return 0 or 1, with a hard jump at x = 0. The sigmoid returns any continuous value between 0 and 1 and is differentiable across its whole domain, so it approximates the same “binary decision” idea while still allowing gradients to be computed and the network trained with backpropagation.

Is the step function still used for anything today?

Yes, outside of gradient-based training: in fixed threshold logic (for example, firing an alarm when a sensor crosses a value), in digital electronics, and as a teaching device to introduce the artificial neuron before moving on to differentiable functions.

Conclusion

The step function is the historical and conceptual starting point of activation functions in neural networks. Its simplicity makes it ideal for understanding the fundamentals, but its non-differentiability excludes it from modern training pipelines. Knowing it is essential for any AI professional; using it in production is increasingly rare.

Sources: Heaviside step function, Wikipedia[1], Deep Learning, the multilayer perceptron chapter (Goodfellow, Bengio and Courville)[2], Stanford CS231n notes on activation functions[3], and IBM’s guide to Rosenblatt’s perceptron[4].

Sources

  1. Heaviside step function, Wikipedia
  2. Deep Learning, the multilayer perceptron chapter (Goodfellow, Bengio and Courville)
  3. Stanford CS231n notes on activation functions
  4. IBM’s guide to Rosenblatt’s perceptron

Route: The Neuron and Activation Functions