Recurrent Kernel Networks

Dexiong Chen, Laurent Jacob, Julien Mairal

Biological sequences, such as DNA and proteins, present unique modeling challenges. They vary in length and frequently contain "gaps"—insertions or deletions that shift the positions of critical functional motifs. Historically, researchers have relied on two primary approaches to model these sequences: string kernels and deep learning.

String kernels map sequences into high-dimensional spaces based on subsequence counts. While mathematically grounded and effective for small datasets, they are often fixed (not learned from data) and computationally expensive when accounting for gaps. Conversely, Deep Learning models (CNNs/RNNs) are highly flexible and learn representations directly from data. However, standard CNNs struggle with variable-length gaps, and LSTMs or standard RNNs can be difficult to regularize and interpret, especially when labeled data is scarce.

Introduced at NeurIPS 2019, Recurrent Kernel Networks (RKNs) provide a hybrid architecture that bridges the gap between classical string kernels and modern recurrent neural networks. By approximating substring kernels within an RNN framework, RKNs combine the strong regularization and interpretability of kernel methods with the end-to-end learning power of deep learning.

The RKN Architecture and Methodology

The core innovation of the paper is deriving the RKN through a rigorous mathematical path, ensuring the model retains the flexibility of an RNN alongside the mathematical "prior" of a gappy substring kernel.

  • Continuous Relaxation: Instead of looking for exact matches of a substring (the standard approach in string kernels), RKNs use a Gaussian kernel to allow for "fuzzy" matches. This naturally accounts for biological mutations, such as when one amino acid is replaced by a similar one.
  • Nyström Approximation: To make the infinite-dimensional kernel space computationally tractable, the data is projected onto a finite set of "anchor points." In a biological context, these anchor points can be interpreted as the specific sequence motifs the model is searching for.
  • Recurrent Structure: The authors formally prove that the dynamic programming traditionally used to compute gappy substring kernels can be rewritten as a recurrent update rule. Consequently, the kernel approximation can be implemented as a specialized RNN, where the hidden state tracks the "match scores" of various motifs across the sequence.
Illustration of the gappy $k$-mer kernel embedding and pooling.
  • Generalized Max Pooling (GMP): The authors introduce a novel method to perform max-pooling directly in the kernel's Hilbert space. This helps the model focus on the most relevant motifs while maintaining theoretical consistency.
  • Flexible Learning: The model supports both unsupervised training (where motifs are discovered using $k$-means on sequence fragments) and supervised training (where motifs and the classification layer are optimized end-to-end via backpropagation).

Key Insights and Empirical Results

The authors evaluated RKNs on two major benchmarks for protein fold recognition: SCOP 1.67 (a classic benchmark with 85 fold recognition tasks) and SCOP 2.06 (a more challenging dataset testing the detection of "distant homologies," or proteins that are evolutionarily related but share low sequence similarity).

1. Gaps Matter for Distant Homology

The most significant insight emerges when comparing RKN to its non-recurrent predecessor, Convolutional Kernel Networks (CKN). While both perform similarly on easier tasks, RKN vastly outperforms CKN on the hardest "fold" level of SCOP 2.06. RKN with 512 filters achieved 71.35% accuracy, a massive jump over CKN (45.41%) and the specialized DeepSF model (51.35%). This demonstrates that explicitly modeling gaps is essential for identifying proteins that have diverged significantly over evolutionary time.

2. State-of-the-Art Performance

On the SCOP 1.67 benchmark, RKN (using BLOSUM62 amino acid embeddings) achieved an auROC of 0.871, outperforming the traditional Local Alignment (LA) kernel (0.834) and standard LSTMs (0.830).

3. Interpretability via Anchor Points

Unlike the "black box" hidden states of a standard LSTM, the filters in an RKN represent specific physical motifs. Because the recurrence is a mathematical necessity to compute the gappy substring kernel, the resulting model remains highly interpretable, making it easier for biologists to understand exactly what features drive the model's predictions.

Limitations and Future Directions

While highly effective, RKNs do have limitations. The model relies on several hyperparameters—such as the gap penalty $\lambda$ and the kernel bandwidth $\alpha$—that require careful tuning. Additionally, the current architecture is optimized for classification and fold recognition.

The authors suggest that extending RKNs to sequence-to-sequence tasks, like secondary structure prediction, is a promising future direction. Finally, while the Nyström approximation keeps the model scalable for proteins, further optimizations may be necessary to apply these recurrent kernel structures to massive, whole-genome sequences.

Summary updated

BibTeX
@inproceedings{chen2019recurrent,
  author = {Dexiong Chen and Laurent Jacob and Julien Mairal},
  title = {{Recurrent Kernel Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2019},
  url = {https://openreview.net/forum?id=Dw8CsnZgVl},
}
Figure