Efficient Search for Customized Activation Functions with Gradient Descent
Lukas Strack, Mahmoud Safari, Frank Hutter
TL;DR
This work addresses the challenge of selecting or designing activation functions tailored to a given model and dataset. It introduces GRAFS, a gradient-based activation function search that treats activations as a differentiable space defined by a graph-like activation cell of unary and binary operations, optimized via bi-level gradient methods with a Dirichlet sampling scheme $Dir( ho)$. Key contributions include warmstarting, bounded-output regularization, progressive shrinking, and variance-reduced sampling, enabling search overhead orders of magnitude lower than prior approaches. Empirically, the method discovers specialized activations that improve performance for ResNet, ViT, and GPT families and transfer well to larger models and new datasets, demonstrating practical potential for automatic activation design in real pipelines.
Abstract
Different activation functions work best for different deep learning models. To exploit this, we leverage recent advancements in gradient-based search techniques for neural architectures to efficiently identify high-performing activation functions for a given application. We propose a fine-grained search cell that combines basic mathematical operations to model activation functions, allowing for the exploration of novel activations. Our approach enables the identification of specialized activations, leading to improved performance in every model we tried, from image classification to language models. Moreover, the identified activations exhibit strong transferability to larger models of the same type, as well as new datasets. Importantly, our automated process for creating customized activation functions is orders of magnitude more efficient than previous approaches. It can easily be applied on top of arbitrary deep learning pipelines and thus offers a promising practical avenue for enhancing deep learning architectures.
