Random Features for Compositional Kernels

Amit Daniely, Roy Frostig, Vineet Gupta, Yoram SingerarXiv 2017

Abstract

We describe and analyze a simple random feature scheme (RFS) from prescribed compositional kernels. The compositional kernels we use are inspired by the structure of convolutional neural networks and kernels. The resulting scheme yields sparse and efficiently computable features. Each random feature can be represented as an algebraic expression over a small number of (random) paths in a composition tree. Thus, compositional random features can be stored compactly. The discrete nature of the generation process enables de-duplication of repeated features, further compacting the representation and increasing the diversity of the embeddings. Our approach complements and can be combined with previous random feature schemes.

Introduction

Machine learning has long navigated a tension between the theoretical elegance of kernel methods and the empirical success of deep learning. While kernel methods offer convex optimization and strong theoretical guarantees, they typically scale poorly, with storage and computation costs often reaching $O(N^2)$ for $N$ examples. Furthermore, standard kernel methods often struggle to capture the hierarchical, spatial structures that make convolutional neural networks (CNNs) so effective for image data.

To address scaling, researchers often employ "random features" (such as the Rahimi-Recht scheme) to approximate kernels, transforming them into linear problems. However, these standard features are often "oblivious" to structure. This paper introduces a novel random feature scheme (RFS) designed specifically for compositional kernels—hierarchical kernels that mimic the architecture and connectivity of CNNs.

The Compositional Random Feature Scheme

The core of the proposed method is a recursive generation process based on a computation skeleton, represented as a directed acyclic graph (DAG). This skeleton defines how kernels are composed to form a deeper hierarchy.

Recursive Sampling and Generation

The generation of a single random feature involves a top-down traversal of the skeleton:

  1. The Skeleton: The graph's leaves represent "base kernels" (such as simple pixel-wise identities), while internal nodes represent compositions (multiplications or averages) governed by "conjugate activation functions" like ReLU or Exponential.
  2. Sampling Algorithm: Starting at the output node, the algorithm recursively samples child nodes. For an internal node, it determines a degree $l$ and selects $l$ children.
  3. Feature Construction: The final feature is the product of the features returned by the sampled children.

Because the generation process is discrete—relying on picking specific paths within the tree—it allows for de-duplication. Repeated features can be merged, which not only saves memory but also increases the diversity of the resulting embedding by ensuring unique feature representation.

Computational Efficiency

A standout finding of this RFS is its computational efficiency. For specific activations, such as those corresponding to ReLU, the expected number of recursive calls is constant. This implies that the time required to generate a feature can be independent of the input dimension ($O(1)$ complexity in expectation). This represents a significant improvement over previous methods where costs scale linearly with the number of input features, making the scheme highly scalable for high-resolution data.

Empirical Insights and Results

The authors evaluated the scheme using the CIFAR-10 dataset, a standard benchmark for visual object recognition. By calculating the correlation between pixels in the generated features, the authors demonstrated that deeper kernels successfully capture hierarchical tiers of locality—ranging from intense correlation within small patches to milder correlation across larger regions.

Key results include:

  • Superior Approximation: The proposed RFS approximated the "ground truth" compositional kernel more accurately than hybrid baselines using standard random feature techniques.
  • Architecture Ranking: The RFS kernel learning accurately ranked the performance of various convolutional architectures (e.g., different filter sizes). These rankings matched those of fully-trained neural networks, suggesting that compositional kernels are effective proxies for understanding network architecture performance.
  • The Kernel-Network Connection: The research reinforces the idea that a compositional kernel represents the "infinite-width" limit of a neural network, providing a theoretical bridge between fixed-feature methods and deep learning.

Conclusion and Future Work

While compositional kernels significantly outperform simple flat kernels, a performance gap remains between these kernel methods and fully-trained neural networks. This suggests that "learning the features" via backpropagation still provides a critical edge in complex spatial tasks.

However, the RFS presented here offers a powerful, efficient, and architecturally informed tool for structured kernel approximation. The authors suggest that this approach is complementary to existing ones; future work could involve using non-elementary base kernels (like Gaussian kernels) within the compositional skeleton to combine the benefits of both frameworks.

Summary updated

BibTeX
@misc{daniely2017random,
  author = {Amit Daniely and Roy Frostig and Vineet Gupta and Yoram Singer},
  title = {{Random Features for Compositional Kernels}},
  year = {2017},
  eprint = {1703.07872},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1703.07872},
}
Figure