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

AReLU: Attention-based Rectified Linear Unit

Dengsheng Chen, Kai Xu

Introduction

In the domain of deep learning, the activation function serves as a critical gatekeeper, determining which information is propagated through a neuron and how it is transformed. While the Rectified Linear Unit (ReLU) has long been the industry standard due to its simplicity and efficiency, its fixed nature limits its adaptability to specific tasks. AReLU (Attention-based Rectified Linear Unit) introduces a novel, learnable activation function that treats the activation process as a form of task-aware attention.

Problem Statement

Traditional activation functions are typically "fixed," applying the same mathematical transformation to all features regardless of the data context or the specific problem being solved. This approach presents two significant challenges:

  1. Gradient Vanishing: In deep neural networks, gradients can become excessively small during backpropagation, effectively halting the learning process. Static activations like ReLU provide no mechanism to mitigate this.
  2. Lack of Adaptability: Standard functions lack "task-awareness," meaning they cannot learn to prioritize specific regions or features within a map that are most relevant to the objective (e.g., distinguishing a digit from a background).

Methodology: ELSA

The core innovation of AReLU is the ELSA (Element-wise Sign-based Attention) module. Instead of a simple threshold, AReLU combines the standard ReLU operation with a learnable attention mechanism.

AReLU introduces two learnable parameters per layer, $\alpha$ and $\beta$:

  • Sign-based Scaling: Negative inputs are scaled by a clamped version of $\alpha$. Positive inputs are scaled by $(1 + \sigma(\beta))$, where $\sigma$ represents the sigmoid function.
  • Gradient Amplification: Because the positive scaling factor $(1 + \sigma(\beta))$ is always greater than 1, AReLU amplifies the gradients of activated neurons. This is a significant departure from ReLU or PReLU, which at best act as an identity transform (scaling by 1).
  • Efficiency: By adding only two parameters per layer ($2L$ for an $L$-layer network), AReLU maintains a negligible computational overhead.

Key Insights: Activation as Attention

The fundamental conceptual shift in AReLU is viewing the activation function as a "task-oriented attention mechanism." It learns which elements in a feature map are most relevant to the end goal and "attends" to them by amplifying their signal. Visualizations using Grad-CAM demonstrate that AReLU-powered networks produce cleaner, more focused activation maps on objects of interest compared to standard ReLU.

Comparison of pre-activation and post-activation feature maps for ReLU and AReLU, demonstrating AReLU's ability to amplify relevant features.

Experimental Evaluation

The authors benchmarked AReLU against standard activation functions using several datasets:

  • MNIST: Evaluated for basic classification performance and convergence speed.
  • CIFAR100: Tested robustness across mainstream architectures, including VGG-11, ResNet-18, and MobileNet-v2.
  • SVHN (Street View House Numbers): Specifically used to demonstrate performance in transfer learning scenarios (pre-training on MNIST and fine-tuning on SVHN).
  • Kaggle Brain MRI Segmentation: Validated effectiveness in dense prediction tasks like image segmentation.

Key Results

AReLU consistently outperformed standard and learnable activation functions across various metrics:

  • Faster Convergence: On MNIST, AReLU reached high accuracy significantly faster than 18 other activation functions, particularly when utilizing small learning rates ($10^{-4}$ or $10^{-5}$).
  • Accuracy Improvements: On CIFAR100, AReLU consistently surpassed ReLU and PReLU across five different network architectures.
  • Transfer Learning Performance: In the MNIST-to-SVHN transfer task, AReLU achieved 78.48% accuracy after 20 epochs, compared to 72.06% for ReLU.
  • Segmentation Accuracy: In Brain MRI segmentation, AReLU improved the Dice Similarity Coefficient (DSC) to 91.14%, up from ReLU's 90.77%.
Accuracy over epochs and the learning procedure for parameters alpha and beta, showing stable parameter evolution and superior convergence.

Limitations and Future Work

While AReLU shows significant promise, the authors identify several areas for future exploration. Current research focuses primarily on classification and segmentation; future work will extend AReLU to more complex tasks such as object detection and natural language processing (NLP). Additionally, the element-wise nature of AReLU may be particularly well-suited for structural feature learning in Graph Neural Networks. Finally, exploring finer-grained attention (channel-wise or spatial-wise) within the activation function remains a potential direction for further optimization.

Summary updated

BibTeX
@misc{chen2020arelu,
  author = {Dengsheng Chen and Kai Xu},
  title = {{AReLU: Attention-based Rectified Linear Unit}},
  year = {2020},
  eprint = {2006.13858},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.13858},
}
Figure