NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

$λ$-GELU: Learning Gating Hardness for Controlled ReLU-ization in Deep Networks

Cristian Pérez-Corral, Alberto Fernández-Hernández, Jose I. Mestre, Manuel F. Dolz, Enrique S. Quintana-OrtíarXiv 2026

TL;DR

While smooth activation functions like GELU boost deep network training, downstream deployment toolchains (like quantization and formal verification) heavily favor the piecewise-linear structure of ReLU. This paper introduces $\lambda$-GELU, a parameterized variant of GELU that allows networks to benefit from smooth training before gradually and deterministically hardening into a ReLU-compatible model with minimal loss in performance.

What Problem Does This Paper Address?

Modern deep learning is caught in a tug-of-war between training optimization and deployment efficiency. Smooth, self-gated activation functions like the Gaussian Error Linear Unit (GELU) have become the default choice for architectures like Transformers because their continuous curvature prevents issues like "dead neurons" and aids gradient flow.

However, when it comes to edge deployment, hardware acceleration, integer-only quantization, network pruning, and formal verification, piecewise-linear activations like the Rectified Linear Unit (ReLU) reign supreme. Trying to naively swap GELU for ReLU after training usually tanks a model's accuracy due to the sudden shift in internal feature distributions. The authors address this gap by creating a mathematically principled bridge: an activation function that can smoothly interpolate from GELU to ReLU during the training process itself.

Methods

The authors propose $\lambda$-GELU, defined mathematically as:

$$\lambda\text{-GELU}(x) = x \Phi(\lambda x)$$

where $\Phi(x)$ is the Cumulative Distribution Function (CDF) of the standard normal distribution, and $\lambda \in [1, \infty)$ is a parameter controlling the sharpness of the gate. When $\lambda = 1$, the function is exactly standard GELU; as $\lambda \to \infty$, it converges perfectly to ReLU.

Optimizing $\lambda$ directly via gradient descent is notoriously unstable because naive updates can push $\lambda$ below 1 or cause gradient attenuation. To solve this, the authors introduce two key innovations:

  1. Softplus Reparameterization: They map an unconstrained learnable parameter $s$ to $\lambda$ using a temperature-controlled softplus function: $\lambda(s) = 1 + \log(1 + e^{s/t})$.
  2. Optimizer-Aware Scaling: They introduce a dedicated learning-rate multiplier ($c$) to decouple the adaptation speed of the gating hardness from the rest of the network's weights.

The ReLU-ization Protocol

To deliver a deployable ReLU network, the authors design a two-phase training schedule:

  • Phase 1 (First 25% of epochs): $\lambda$ is learned jointly with the network weights to act as a smooth probe of layerwise hardness.
  • Phase 2 (Remaining 75% of epochs): The learnable parameter is frozen, and $\lambda$ is deterministically annealed linearly toward a principled target ($\lambda_{\text{target}} \approx 160$, derived from a closed-form $\ell_1$ approximation bound).
  • Post-Training: At the best validation checkpoint, the annealed $\lambda$-GELU activations are directly substituted with standard ReLUs without any further weight updates.

Datasets

The approach was evaluated across a diverse set of model-dataset combinations:

  • Tabular: MLP on the Adult dataset.
  • Vision (CNNs & Transformers): MLP on FashionMNIST; ResNet-18 on CIFAR-10 and CIFAR-100; DeiT (Tiny) on TinyImageNet.
  • Language: GPT-2 (small) on WikiText-2.

Key Insights and Ideas

  • Structured Hardness Hierarchies: When allowed to learn freely, different layers naturally prefer different levels of gating sharpness. More importantly, these layerwise hardness profiles converge to a highly consistent hierarchy regardless of how $\lambda$ is initialized (e.g., uniform vs. increasing/decreasing across depth), particularly in vision architectures.
  • Mitigating Distributional Shock: Gradually sharpening the activation function allows the surrounding network weights to co-adapt to the emerging piecewise-linear boundaries. This progressive transition is what prevents the catastrophic performance drops typically seen in post-hoc activation swaps.

Key Results

Through hyperparameter grid searches, the authors demonstrated that a low temperature ($t=0.1$) and a higher learning rate multiplier ($c=9$) consistently yield the best balance of stable training and substantial hardness adaptation.

Hyperparameter grid search showing that lower temperatures and larger multipliers induce stronger hardness adaptation without degrading validation scores.

The core validation of the hardening protocol is shown in the post-training substitution results:

  • Standard GELU $\to$ ReLU Swap: Directly replacing GELU with ReLU at the end of training caused noticeable drops in accuracy (e.g., falling from 0.74 to 0.67 on CIFAR-100).
  • $\lambda$-GELU $\to$ ReLU Swap: Models trained with the progressive annealing protocol experienced minimal to no degradation when swapped to ReLU. On CIFAR-100, the accuracy only shifted from 0.74 to 0.72. Remarkably, on TinyImageNet, the annealed $\lambda$-GELU model achieved 0.71 validation accuracy and actually improved to 0.72 after being completely replaced by ReLU.

Limitations and Future Work

While $\lambda$-GELU proved highly effective for MLPs and CNNs in tabular and vision tasks, Language Modeling remains a challenge. When testing GPT-2 on WikiText-2, substituting the activation function led to severe performance degradation (increased perplexity) even with annealing. The authors note that autoregressive language models are exceptionally sensitive to activation shifts, suggesting that future work must explore architecture-specific hardening strategies that account for heavy normalization layers and residual connections.

Additionally, the authors plan to expand this framework to other self-gated activations (like Swish/SiLU) and explore finer granularities, such as learning unique hardness parameters per channel or per neuron rather than just per layer.

Summary updated

BibTeX
@misc{perezcorral2026gelu,
  author = {Cristian Pérez-Corral and Alberto Fernández-Hernández and Jose I. Mestre and Manuel F. Dolz and Enrique S. Quintana-Ortí},
  title = {{$λ$-GELU: Learning Gating Hardness for Controlled ReLU-ization in Deep Networks}},
  year = {2026},
  eprint = {2603.21991},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.21991},
}
Figure