Abstract
Modern deep learning relies heavily on feedforward layers (FFLs), which entangle input data with learnable weights, limiting model compression and efficiency. This paper introduces Scalable Neural Network Kernels (SNNKs), a novel framework that reinterprets standard layers as kernel-based approximations. By disentangling inputs from parameters and utilizing Universal Random Features (URFs), SNNKs enable significant reductions in trainable parameters and allow for layer "bundling" into single efficient operations. Empirical results across vision and language tasks demonstrate up to a 5x parameter reduction and 50% inference speedup while maintaining competitive accuracy.
Introduction
The Feedforward Layer (FFL), defined by the operation $f(Wx + b)$, is the fundamental building block of architectures like Transformers and MLPs. Despite its success, the tight coupling of input $x$ and weights $W$ poses challenges for model efficiency and theoretical analysis. Kernel methods offer an alternative with strong theoretical grounding but typically suffer from poor scalability. SNNKs bridge this gap by linearizing non-linear layers into separate "towers" for inputs and parameters, combining the expressiveness of neural networks with the efficiency of kernel methods.
Methodology: The SNNK Framework
The core of the SNNK module is the disentanglement of the standard neural network layer into a dot-product kernel. This is achieved by mapping inputs and weights into high-dimensional feature spaces.
Input and Parameter Towers
The SNNK module splits the computation into two distinct paths:
- The Input Tower: Maps input $x$ to a feature space $\Phi(x)$.
- The Parameter Tower: Maps weights $W$ and bias $b$ to a feature space $\Psi(W, b)$.
The final output is computed as the dot product $\Phi(x) \cdot \Psi(W, b)$. To support arbitrary activation functions (ReLU, Sine, Tanh), the authors employ Universal Random Features (URFs) derived from Fourier analysis, providing an unbiased estimate of the non-linearity.
Neural Network Bundling
A significant advantage of this linearization is the ability to "bundle" multiple layers. By iteratively collapsing sequential SNNK modules, complex deep stacks can be reduced to a single bundled matrix operation. In certain scenarios, the optimal parameters for these bundled networks can even be solved analytically, hinting at a potential "backprop-free" training paradigm for specific modules.
Implementation and Architecture
SNNKs can be integrated into existing architectures as "adapters" or direct replacements for standard FFLs.
As shown in Figure 6, the SNNK-Adpt module (b) uses a residual-like structure with a Hadamard product. The error plots (g, h) demonstrate that the approximation error decreases rapidly as the number of random projections increases, validating the scalability of the URF approach across different activation types like SIREN and arccos.
Key Results
The authors evaluated SNNKs across NLP (GLUE), Computer Vision (CIFAR, ImageNet), and scientific computing tasks:
- Parameter Efficiency: When used as adapters for fine-tuning Transformers, SNNKs achieved a 5x reduction in trainable parameters while matching or beating standard baselines on 5 out of 8 GLUE tasks.
- Inference and Storage: Through bundling, the authors reduced BERT and ViT inference times by 40-50%. In one text classification setting, weight storage was compressed by nearly 1000x (from 18.92 Megabits to 0.02 Megabits).
- Scientific Computing: SNNKs successfully approximated potential energy in quantum systems using significantly fewer parameters than specialized physics-based networks.
Discussion and Limitations
While SNNKs offer substantial efficiency gains, they rely on activation functions having well-behaved Fourier transforms. Functions like ReLU require smoothing or truncation, which can introduce minor approximation errors. Additionally, as more layers are bundled, error accumulation can lead to slight accuracy degradation, presenting a trade-off between efficiency and precision.
Conclusion
Scalable Neural Network Kernels provide a powerful framework for disentangling and linearizing deep learning models. By combining kernel theory with modern scalability, SNNKs pave the way for more efficient, compressible, and theoretically grounded neural architectures.
Summary updated