Abstract
Kernels derived from deep neural networks (DNNs) in the infinite-width regime provide not only high performance in a range of machine learning tasks but also new theoretical insights into DNN training dynamics and generalization. In this paper, we extend the family of kernels associated with recurrent neural networks (RNNs), which were previously derived only for simple RNNs, to more complex architectures including bidirectional RNNs and RNNs with average pooling. We also develop a fast GPU implementation to exploit the full practical potential of the kernels. Though RNNs are typically only applied to time-series data, we demonstrate that classifiers using RNN-based kernels outperform a range of baseline methods on 90 non-time-series datasets from the UCI data repository.
Introduction
In the "infinite-width limit," deep neural networks behave like kernel machines. This theoretical bridge, known as the Neural Tangent Kernel (NTK), allows researchers to study the training dynamics of deep nets using the well-understood tools of kernel methods. However, most NTK research has focused on simple Multi-Layer Perceptrons (MLPs) or Convolutional Neural Networks (CNNs). While "Recurrent" NTKs (RNTKs) existed for basic RNNs, they lacked support for the more sophisticated architectures used in practice, such as bidirectional processing or pooling. Furthermore, RNTKs are notoriously slow to compute. Finally, there was a prevailing assumption that RNNs are only useful for time-series data; this paper challenges that by applying RNTKs to general tabular data.
Methodology
The authors provide three main contributions to the field:
- Theoretical Extensions: They derive the closed-form Conjugate Kernel (CK) and NTK for complex RNN variants: Bidirectional RNNs (BI-RNN), RNNs with average pooling (RNN-AVG), and a combination of both. These extensions allow the kernel to capture more nuanced dependencies within the input data.
- RNN-P (Permuted RNN): Since non-time-series data (like a list of medical symptoms) has no inherent "time" order, the authors propose a configuration that uses both the default feature ordering and its reverse (flip) to ensure the kernel captures information regardless of sequence direction. This approach effectively treats tabular data as a sequence where the order is arbitrary but consistent.
- Computational Optimization: They developed a fast GPU implementation using the SymJAX library and XLA compilation. Crucially, they found a way to calculate the NTK and the Gaussian Process (GP) kernels simultaneously. This reduces the memory requirement from $O(T \times N^2)$ to $O(N^2)$, where $T$ is the sequence length and $N$ is the number of samples—a massive win for scalability.
Key Results
The proposed RNN-P kernel achieved the highest mean accuracy (82.34%) across the 90 UCI datasets, outperforming Random Forests (81.56%), RBF Kernels (81.03%), and the standard MLP-NTK (81.95%). In statistical ranking across all datasets (where lower is better), RNN-P scored 4.22, the best among all tested methods.
Beyond accuracy, the computational efficiency gains were significant. The GPU implementation reduced computation time from roughly 20 seconds (on CPU) to under 2 seconds for a 10-layer RNTK on a dataset of 1,000 points. As shown in the benchmarking figures, while CPU computation time scales poorly with the number of samples and layers, the GPU implementation remains nearly linear for a wide range of $N$, making these complex kernels practical for real-world use.
Discussion and Limitations
The most striking insight is that the sequential processing of an RNN acts as a powerful "feature aggregator" even when the features aren't temporal. By treating a row of tabular data as a sequence, the RNTK captures complex dependencies that standard MLP kernels might miss. Bidirectionality and pooling are essential to this success, mirroring the evolution of finite RNNs in deep learning.
However, limitations remain. While the authors used a "default + flip" approach (RNN-P), they acknowledge that for non-time-series data, any permutation of the features is technically valid. Finding the optimal ordering of features to maximize RNN kernel performance remains an open, computationally difficult ($O(T!)$) problem. Additionally, the current implementation assumes all data points have the same number of features ($T$). Adapting these kernels to handle datasets with varying input lengths efficiently is a suggested next step for future research.
Summary updated