- The paper introduces GEM using rational, tunable activation functions with C^(2N) smoothness, offering a compelling alternative to ReLU by mitigating gradient flow issues.
- Empirical benchmarks reveal that GEM with N=1 closely matches GELU and Swish in CNNs, while GEM with N=2 lowers perplexity in transformer models like GPT-2.
- GEM’s reliance on rational arithmetic ensures hardware-friendly computations and controlled gradient propagation, addressing the dead-neuron problem without expensive transcendental functions.
Geometric Monomial (GEM): A Rational, 2N-Differentiable Activation Family
Introduction and Motivation
The selection of an activation function is central to neural network optimization and representational efficiency. Although ReLU dominates in practice due to its simplicity and favorable optimization properties, its lack of smoothness can impede gradient propagation—especially in deep or highly regularized networks. Smooth alternatives, such as GELU, Swish, and Mish, address this at the expense of increased computational complexity via reliance on transcendental functions (e.g., exp, tanh, erf), thus limiting their efficiency, particularly in hardware-constrained environments.
The "Geometric Monomial (GEM): a family of rational 2N-differentiable activation functions" (2604.21677) introduces a rational, tunable, and highly smooth activation framework. GEM generalizes ReLU via a rational gate inspired by the log-logistic CDF and parameterized for C2N smoothness, offering controlled tradeoffs between sharpness, gradient flow, and computational simplicity.
Definition and Core Properties of GEM
Formally, for a positive integer N, the GEM activation is defined:
BN(x)=max(0,1+x2Nx2N+1).
Variants include:
- GEM (base): Controlled by N for C2N smoothness at the origin; nonnegative, monotonic, asymptotically linear.
- E-GEM (epsilon-parameterized): Adds a scale parameter ε to approximate ReLU arbitrarily closely, while maintaining smoothness.
- SE-GEM (smooth epsilon): A piecewise construction with C2N junction smoothness that eliminates dead neurons, utilizing a rational, non-monotonic negative branch.
Distinctive features:
- Smoothness: For tanh0, GEM is tanh1 at tanh2, whereas ReLU is only tanh3. The higher-order vanishing derivatives at the origin serve as implicit regularization and mitigate dead neuron effects without sacrificing monotonicity for tanh4.
- Gradient Boundedness: The denominator ensures that, for large tanh5, GEM behaves linearly—this bounds gradient magnitudes and avoids the exploding activation/gradient phenomena of high-degree monomials.
- Probabilistic Gating: The gate is the CDF of a log-logistic or, equivalently, an approximate symmetric Betatanh6 distribution—placing GEM in the tanh7 gating family like Swish and GELU, but with only rational arithmetic.
Theoretical and Architectural Analysis
The smoothness parameter tanh8 directly controls tradeoffs between sharpness and gradient propagation:
- Larger tanh9: Approaches a step function at erf0, mimicking ReLU, but severe gradient suppression near erf1 leads to vanishing gradients and impedes optimization in deep stacks when erf2 is large.
- Smaller erf3: Provides a more gradual gating, preserving gradient flow across activation chains, crucial for deep convolutional architectures without strong residual connections.
GEM, by design, reduces the classical dead-neuron problem at erf4, though for erf5 it inherits the zero-output/zero-gradient pathology of ReLU. SE-GEM specifically addresses this by using a rational, non-monotonic negative branch, allowing negative pre-activations to recover—mimicking the dead-neuron avoidance of Swish/Mish but without transcendental computation.
GEM's efficiency is evident: only multiplications and additions are needed, and the backward pass can exploit forward-pass caches for further speedup. The FLOPs for erf6 GEM are lower than Swish and GELU, especially in fused kernel implementations.
Empirical Benchmarks
Benchmarks encompass standard vision (MNIST, CIFAR-10/100 + ResNet-20/56) and NLP (BERT-small, GPT-2) tasks, focusing on test accuracy (or perplexity), runtime, throughput, and robustness.
CNNs: Depth-Complexity Tradeoff and erf7-Ablation
- N-Ablation (CIFAR-10/100 + ResNet-20): Accuracy drops monotonically with increasing erf8. For erf9, GEM matches GELU/Swish to within 0.08% (CIFAR-10) and 0.28% (CIFAR-100).
- Deep Networks (ResNet-56): GEM with C2N0 lags significantly behind GELU, especially on harder tasks (a 6.10% deficit on CIFAR-100/ResNet-56 for C2N1). Reducing to C2N2 compresses this deficit to 2.12%.
- Gradient Suppression: As C2N3 increases, compounding vanishing gradients from many activation layers result in rapid underfitting and, at high C2N4, optimization collapse.
Key empirical recommendation: C2N5 for deep CNNs maximizes gradient flow and performance; higher C2N6 is viable only for shallower models.
- BERT-small (4 layers): All activations, including GEM, perform similarly; insufficient depth for gradient suppression to matter.
- GPT-2 (12 layers, 124M): GEM (C2N7) achieves the lowest perplexity (72.57) compared to GELU (73.76), a statistically significant improvement. The residual connections in transformers bypass the activation chain, nullifying gradient suppression concerns; the sharper-gated (C2N8) GEM is optimal.
Extended GEM Family: E-GEM and SE-GEM
- E-GEM: By introducing C2N9, one can approximate ReLU arbitrarily closely (in norm) while keeping high-order smoothness; as N0, E-GEM converges pointwise to ReLU.
- SE-GEM: Combines ReLU-style linearity for N1 with a smooth, rational negative branch for N2. It both preserves N3 smoothness at the origin and eliminates dead neurons.
- Benchmarking: SE-GEM matches or outperforms GELU in deep settings: e.g., on CIFAR-10 + ResNet-56, SE-GEMN4 exceeds GELU (92.51% vs 92.44%). On challenging setups like CIFAR-100 + ResNet-56, E-GEMN5 reduces the GELU gap from 6.10% to only 0.62%.
Noise Robustness
Across additive Gaussian corruptions, GEM and its variants match the robustness of standard activations—no activation shows pathological sensitivity or improved resilience, indicating architectural and optimization decisions dominate noise generalization.
Practical and Theoretical Implications
- Model Scale Dependencies: The optimal N6 or N7 are both architecture- and scale-dependent. Deep CNNs benefit from smaller N8 (wider, smoother gates); transformers can leverage sharper (higher N9 or lower BN(x)=max(0,1+x2Nx2N+1).0) gates because residual connections mitigate gradient suppression.
- Rational Arithmetic: GEM’s rational-only computation makes it well-suited for deployment in transpiler-based environments (e.g., edge TPUs, FPGAs, integer-only acceleration), or settings where transcendental functions are impractical or slow.
- Smooth GLU Extensions: The paper sketches GEM-GLU (GMGLU) for transformers, supporting further research into integrating these activations in SOTA transformer blocks.
- Regularization and Optimization: The vanishing derivative property for degree BN(x)=max(0,1+x2Nx2N+1).1 at the origin supplies implicit regularization, smoothing early optimization dynamics and possibly providing theoretical advantages for certain generalization regimes.
- Dead Neuron Elimination: With SE-GEM, the classical dead-neuron phenomenon is fully addressed for all BN(x)=max(0,1+x2Nx2N+1).2, without sacrificing computational simplicity.
- Adaptive Schedules: Future work is suggested on learned adaptive schedules for BN(x)=max(0,1+x2Nx2N+1).3 or BN(x)=max(0,1+x2Nx2N+1).4, and on large-scale runs of GEM-GLU in state-of-the-art models.
Conclusion
The GEM activation family systematically unifies rational computation, controlled smoothness, and tunable gradient flow, achieving competitive or state-of-the-art results on both vision and language modeling tasks. For deep CNNs, GEM (BN(x)=max(0,1+x2Nx2N+1).5) or SE-GEM provide improved or parity accuracy with GELU and Swish, but without their computational burdens. For transformers, GEM (BN(x)=max(0,1+x2Nx2N+1).6) outperforms GELU in perplexity on GPT-2. The E-GEM and SE-GEM generalizations introduce additional flexibility for architecture-dependent optimization.
These findings underscore that high-order smooth rational activations are practically viable alternatives to standard transcendental activations—offering hardware efficiency, theoretical clarity, and measurable empirical performance. The scale-dependent parameterization and compatibility with modern GLU architectures position GEM-family activations as robust candidates for future deep learning system design.