Skip to main content
QUICK REVIEW

[Paper Review] Squareplus: A Softplus-Like Algebraic Rectifier

Jonathan T. Barron|arXiv (Cornell University)|Dec 22, 2021
Parallel Computing and Optimization TechniquesComputer Science10 citations
TL;DR

This paper introduces Squareplus, a differentiable, non-negative activation function that approximates softplus using only algebraic operations—addition, multiplication, and square root—making it ~6× faster than softplus on CPUs and numerically stable for large inputs. Unlike softplus, Squareplus avoids transcendental functions, enabling efficient deployment in resource-constrained deep learning environments while maintaining smoothness and ReLU-like behavior at scale.

ABSTRACT

We present squareplus, an activation function that resembles softplus, but which can be computed using only algebraic operations: addition, multiplication, and square-root. Because squareplus is ~6x faster to evaluate than softplus on a CPU and does not require access to transcendental functions, it may have practical value in resource-limited deep learning applications.

Motivation & Objective

  • To develop a softplus-like activation function that avoids expensive transcendental operations like exp and log.
  • To ensure numerical stability for large input values, which commonly breaks standard softplus implementations.
  • To maintain smoothness (C∞ continuity) and non-negativity while enabling faster inference in compute-constrained environments.
  • To provide a differentiable, differentiable activation that approaches ReLU asymptotically but with continuous gradients.
  • To offer a tunable hyperparameter b that controls curvature near zero, enabling shape control similar to softplus.

Proposed method

  • Squareplus is defined as $\operatorname{squareplus}(x,b) = \frac{1}{2}\left(x + \sqrt{x^2 + b}\right)$, where $b \geq 0$ is a learnable or fixed hyperparameter.
  • The function is composed solely of algebraic operations: addition, multiplication, and square root, avoiding exp and log.
  • The first derivative of Squareplus is $\frac{1}{2}\left(1 + \frac{x}{\sqrt{x^2 + b}}\right)$, an algebraic sigmoid-like function.
  • The second derivative is $\frac{1}{2}\left(\frac{b}{(x^2 + b)^{3/2}}\right)$, which corresponds to the PDF of a Student’s t-distribution with $\nu = 2$ when $b = 2$.
  • The hyperparameter $b$ acts as a scale parameter: $\frac{\operatorname{squareplus}(ax, b)}{a} = \operatorname{squareplus}\left(x, \frac{b}{a^2}\right)$.
  • For $b = 0$, Squareplus reduces exactly to ReLU; for $b = 4\ln^2 2$, it matches softplus at $x = 0$ and bounds it from above.

Experimental results

Research questions

  • RQ1Can a softplus-like activation be constructed using only algebraic operations to improve computational efficiency?
  • RQ2Does an algebraic activation function maintain the smoothness and non-negativity of softplus while avoiding numerical instability at large inputs?
  • RQ3How does the performance of Squareplus compare to softplus and ReLU in terms of speed and gradient dynamics?
  • RQ4Can the hyperparameter $b$ be used to tune curvature near zero, enabling shape control similar to softplus?
  • RQ5Does Squareplus maintain a continuous gradient at $x = 0$ and approach ReLU asymptotically, like softplus?

Key findings

  • Squareplus is approximately 6× faster than softplus on CPU for 1 million inputs, with a runtime of 0.631 ms vs. 3.777 ms.
  • On GPU, Squareplus is only ~10% faster than softplus, as performance is limited by memory bandwidth rather than computation.
  • Squareplus is numerically stable for large inputs, unlike naive softplus implementations that fail around $x \approx 15$ due to overflow.
  • When $b = 4$, Squareplus’s second derivative at $x = 0$ matches that of softplus: $\frac{1}{4}$.
  • At $x = 0$, Squareplus with $b = 4$ outputs 1.0, which is a natural and intuitive value for activation functions.
  • For all $b \geq 4\ln^2 2$, Squareplus is guaranteed to be pointwise greater than or equal to softplus, ensuring it is a valid upper bound on ReLU.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.