Abstract
The infinite-width limit of neural networks establishes a profound connection between deep learning and kernel methods through the Neural Network Gaussian Process (NNGP) and the Neural Tangent Kernel (NTK). Historically, efficient computation of these kernels has been restricted to specific activations like ReLU. This paper introduces a general framework using Hermite expansions and randomized sketching to compute neural kernels for a broad class of smooth activations. The approach achieves a 106× speedup for convolutional kernels on CIFAR-10 while surpassing the accuracy of existing ReLU-based approximations.
Introduction
The study of infinite-width neural networks offers elegant theoretical insights but faces significant practical barriers. Most closed-form expressions for neural kernels are derived exclusively for ReLU activations, leaving a "ReLU monopoly" in the field. Furthermore, computing these kernels for large datasets is computationally intensive; for instance, an exact 10-layer CNN kernel on 60,000 images can require over 1,000 GPU hours. This work addresses these challenges by providing a high-speed, general-purpose toolkit for a diverse "zoo" of activation functions, including GeLU, Swish, and Sinusoidal.
Methodology
The framework relies on three core technical pillars to enable fast and general kernel embeddings:
1. Hermite Polynomial Expansion
The authors demonstrate that any smooth activation function can be expanded in a Hermite polynomial basis. This expansion facilitates a general formula for the "dual kernel"—the fundamental component of NNGP and NTK—based on the expansion coefficients. Smooth functions like Sinusoidal or Gaussian activations exhibit exponential decay in approximation error, making them particularly well-suited for this method.
2. Automatic Derivative Kernels
A key theoretical contribution allows for the direct computation of the dual kernel of an activation's derivative ($\sigma'$) from the dual kernel of the activation itself ($\sigma$). This eliminates the need for manual derivation of derivative kernels, which were previously unknown for many functions.
3. Randomized Sketching (PolySketch)
To overcome the super-quadratic scaling of exact kernel matrices, the authors employ randomized sketching. By extending the PolySketch algorithm, they create low-dimensional feature maps that approximate the multi-layer NNGP and NTK matrices. This method scales linearly with the number of pixels, a significant improvement over the quadratic scaling of exact Convolutional NTK (CNTK).
Experimental Results
The proposed method was validated on synthetic datasets and CIFAR-10 using various convolutional architectures (e.g., Myrtle-5 and Myrtle-8).
- Computational Efficiency: For a 5-layer Myrtle network on CIFAR-10, the sketching framework achieved a 106× speedup, reducing computation time from 151 GPU hours to approximately 1.4 hours.
- Performance: The sketched kernels reached 78.13% accuracy on CIFAR-10, notably outperforming state-of-the-art ReLU-based sketching (75.56%) within the same runtime budget.
- Versatility: The framework supports a wide array of activations, many of which lacked documented NTK expressions prior to this work. Notably, the "Normalized Gaussian" kernel was found to consistently outperform the standard ReLU NTK.
Conclusion
This work significantly expands the practical utility of neural kernel methods by breaking the ReLU dependency and drastically reducing computational overhead. While challenges remain regarding error accumulation in extremely deep networks and certain homogeneity constraints, the ability to work with general activations in $\mathbb{R}^d$ without unit-sphere normalization marks a major advancement. The implementation is integrated into the Neural Tangents library, facilitating further research in dataset distillation and uncertainty quantification.
Summary updated