Deriving Neural Architectures from Sequence and Graph Kernels

Tao Lei, Wengong Jin, Regina Barzilay, Tommi Jaakkola

TL;DR

This paper introduces "Kernel Neural Networks," a principled framework that derives deep recurrent neural network architectures directly from classical sequence and graph kernels. By mathematically grounding network operations in kernel spaces, the authors create simpler, end-to-end trainable models that achieve state-of-the-art performance in language modeling, sentiment analysis, and molecular graph regression.

What Problem Does This Paper Address?

Designing neural network architectures for structured data—such as text sequences or molecular graphs—is often an art form guided by empirical trial-and-error rather than formal theory. While popular architectures like LSTMs, GRUs, and Graph Neural Networks work exceptionally well, we lack a principled mathematical process to determine why a specific computational graph or operation is optimal.

This paper addresses this gap by leveraging classical kernel methods. Kernels possess well-defined function spaces and composition rules. By using them as a blueprint, the authors provide a systematic way to derive neural network architectures rather than relying on heuristic design.

Methods

The authors bridge the gap between kernels and deep learning by replacing the exact-match indicators ($\delta$-functions) found in traditional string and graph kernels with the inner products of continuous vector embeddings.

  • Sequence Networks from String Kernels: By factorizing the computation of a bi-gram string kernel, they derive a recurrent neural network structure where the internal states track the kernel evaluation. Stacking multiple layers corresponds mathematically to a recursive kernel construction.

    Figure 1. An unrolled view of the derived recurrent module for K2(). Horizontal lines denote decayed propagation from c[t −1] to c[t], while vertical lines represent a linear mapping Wxt that is propagated to the internal states c[t].
  • Graph Networks from Graph Kernels: They apply a similar derivation to random walk and subtree kernels (such as the Weisfeiler-Lehman kernel), translating graph neighbor aggregations into neural network operations.

  • Gated Adaptive Decay: Traditional kernels use a constant decay factor ($\lambda$) to weight sub-structures based on distance or length. To make these architectures flexible enough for deep learning, the authors introduce neural gates (similar to those in GRUs/LSTMs) that adaptively tune this decay factor based on the local context.

Datasets

The proposed architectures were evaluated on three standard benchmarks:

  1. Penn Tree Bank (PTB): Used for word-level language modeling to evaluate sequence modeling capabilities.
  2. Stanford Sentiment Treebank (SST): Used for sentence-level sentiment classification, tested on both 5-class fine-grained and binary classification tasks.
  3. Harvard Clean Energy Project: A molecular graph dataset containing 2.3 million candidate molecules labeled with their power conversion efficiency (PCE), used to evaluate graph regression.

Key Insights and Ideas

  • Virtual Reference Objects: The weight matrices in these derived networks act as "virtual reference objects" (analogous to convolutional filters in CNNs). The network computes the similarity between the input structure and these learned reference patterns via the kernel.
  • Unifying Framework: Classical architectures emerge naturally as special cases. For instance, setting the decay factor $\lambda = 0$ reduces the sequence network to a standard word-level CNN, while the graph variant directly embeds the Weisfeiler-Lehman graph isomorphism test.

    Figure 2. Node relabeling in Weisfeiler-Lehman isomorphism test. Figure taken from Shervashidze et al. (2011)
  • Gating as Contextual Kernels: Introducing sigmoid gates to control the decay factor transforms rigid, static kernels into dynamic, context-aware similarity measures, explaining why gating mechanisms are so critical to deep learning performance.

Key Results

  • Language Modeling: On the PTB dataset, a 4-layer Kernel NN with variational dropout achieved a state-of-the-art test perplexity of 63.8, matching or outperforming significantly more complex architectures (such as those found via reinforcement learning architecture search) while using fewer parameters.

    Figure 3. Comparison between kernel NN variants on PTB. |θ| = 5m for all models. Hyper-parameter search is performed for each variant.
  • Sentiment Analysis: The gated Kernel NN achieved 53.2% accuracy on fine-grained SST and 89.9% on binary classification, outperforming standard baselines like Bi-LSTMs and CNNs.

  • Molecular Regression: On the Harvard Clean Energy Project benchmark, the Weisfeiler Kernel NN achieved a state-of-the-art Root Mean Square Error (RMSE) of 0.1043, outperforming Neural Fingerprints and Embedded Loopy Belief Propagation.

Limitations and Future Work

  • Hierarchical Structures: Although the authors note that their framework theoretically extends to hierarchical objects like syntax trees, they do not explicitly derive or empirically evaluate tree-based kernel neural networks in this paper.
  • Non-Convex Optimization: While the architecture design is formally grounded in kernel theory, the training process still relies on standard non-convex backpropagation. Consequently, it does not inherit the convex optimization guarantees typical of classical kernel methods.

Summary updated

BibTeX
@inproceedings{lei2017deriving,
  author = {Tao Lei and Wengong Jin and Regina Barzilay and Tommi Jaakkola},
  title = {{Deriving Neural Architectures from Sequence and Graph Kernels}},
  booktitle = {International Conference on Machine Learning},
  year = {2017},
  url = {https://openreview.net/forum?id=BkVxlnbu-r},
}
Figure