TL;DR
This paper introduces a "learn–freeze–transfer" protocol for activation functions, demonstrating that a nonlinearity learned in one neural network can be frozen and successfully reused in entirely different architectures trained from scratch. By using a globally shared, five-parameter Fourier-based activation (FAct), the authors show that learned nonlinearities can capture generalizable architectural knowledge that is independent of the specific weights with which they were originally optimized.
What Problem Does This Paper Address?
In the world of deep learning, transfer learning is almost synonymous with reusing weights. We take a model pre-trained on a massive dataset like ImageNet and fine-tune its weights for a new task. However, other components of the architecture—specifically activation functions like ReLU or GELU—are typically treated as fixed "hyperparameters" or are learned locally within a single model and discarded afterward.
The authors ask a provocative question: Can a learned activation function be a transferable asset in its own right?
Existing learnable activations are often tied to specific layers or neurons, making them difficult to move between models of different widths or depths. This paper tackles the challenge of creating a parameterized activation that is independent of layer dimensions, allowing it to be "harvested" from one model and "planted" into another.
Methods
The researchers propose the learn–freeze–transfer protocol, which consists of three stages:
- Learn: A parameterized activation function is optimized jointly with a source network's weights during a standard training run.
- Freeze: After training, the activation parameters are fixed, and the source weights are discarded.
- Transfer: This "Frozen FAct" is plugged into a new target network, which is then trained from scratch.
To make this work, they introduce FAct (Fourier Activation). It represents the activation function as a truncated Fourier series with only five learnable coefficients. Crucially, these coefficients are globally shared across all activation sites in the network. Because the number of parameters is constant (just 5) regardless of the network's size, FAct can be easily moved between different architectures.
Datasets
- Source Training: The activation was originally learned using a Vision Transformer (ViT-d6) on the ImageNet-1K dataset.
- Target Evaluation: The frozen activation was tested on four image-classification datasets: Fashion-MNIST, CIFAR-10, CIFAR-100, and Food-101.
Key Insights and Ideas
- Non-monotonicity is Key: When initialized as a Fourier approximation of GELU, the activation function evolves during training into a complex, non-monotonic shape. This suggests that the "optimal" nonlinearity for these architectures is more intricate than the standard functions we typically use.
- Independence from Weights: The most surprising finding is that the benefit of the learned activation persists even when the weights it was learned with are completely discarded. The activation seems to capture something fundamental about the data flow or architectural inductive bias rather than just being a co-adaptation to specific weight values.
- Cross-Paradigm Utility: A nonlinearity learned in a standard Vision Transformer (global self-attention) proved highly effective in models with vastly different mechanisms, such as the Swin Transformer (shifted-window attention) and even the MLP-Mixer, which uses no attention at all.
Key Results
- Same-Task Boost: When reused in a ViT of the same architecture on ImageNet-1K, Frozen FAct improved top-1 accuracy by 1.46 percentage points over the standard GELU baseline.
- Broad Superiority: In cross-architecture tests (transferring from ViT-d6 to smaller models like Swin-d2 or MLP-Mixer), Frozen FAct achieved the highest mean accuracy in 15 out of 16 experimental settings compared to ten other common activation functions (including ReLU, Swish, and Mish).
- Robustness to Tuning: Even when learning rates and weight decay were specifically tuned for every individual activation function, Frozen FAct remained the top performer in 11 of the 16 settings.
Limitations and Future Work
- Scale of Target Networks: The target networks used for the cross-architecture study were relatively small (~100K parameters). It remains to be seen if these gains hold for massive, billion-parameter models.
- Domain Specificity: The study focused exclusively on vision architectures and image classification. The transferability of activations in Natural Language Processing (NLP) or reinforcement learning is an open question.
- The "Why" remains elusive: While the paper provides strong empirical evidence that it works, the underlying mathematical reason why a specific Fourier-based shape generalizes so well across different token-mixing mechanisms is not yet fully understood.
The authors suggest that future work should explore transferring activations across even more diverse families, such as from Transformers to Convolutional Neural Networks (CNNs).
Summary updated