Introduction
Structured prediction is a fundamental challenge in machine learning, involving the prediction of outputs with complex internal dependencies, such as molecular graphs, protein sequences, or natural language structures. Traditionally, Output Kernel Regression (OKR) has been a preferred method due to its ability to leverage the "kernel trick" to handle non-Euclidean geometries in the output space. However, OKR faces significant scalability issues: it typically relies on non-parametric models that struggle with high-dimensional inputs and infinite-dimensional feature spaces, making them incompatible with modern deep neural networks (DNNs).
To address these limitations, we present Deep Sketched Output Kernel Regression (DSOKR). This framework bridges the gap between kernel methods and deep learning by using "sketching" to project infinite-dimensional kernel spaces into a manageable, data-dependent finite basis. This allows standard DNN architectures, like Transformers or CNNs, to perform structured prediction using standard gradient-based optimization.
The DSOKR Architecture
The core innovation of DSOKR is the transformation of the neural network's final layer into a functional unit that operates within a sketched kernel space. Instead of predicting the structured output directly, the network is trained to predict the coefficients of a learned basis in the output Reproducing Kernel Hilbert Space (RKHS).
As illustrated in the diagram above, the mapping $h_{\hat{\theta}}(x)$ decomposes into a trainable feature extractor $g_{\widehat{W}}$ and a fixed, data-dependent basis $g_{\widetilde{E}}$. The sketching process identifies a finite-dimensional subspace that captures the most significant variations in the output data, effectively acting as a mathematical bridge between infinite-dimensional theory and finite neural architectures.
Methods and Training
The DSOKR training pipeline consists of three primary stages:
- Sketching the Basis: Using dimensionality reduction techniques (random linear projections), the authors compute the eigenfunctions of a sketched empirical covariance operator to create a finite basis of size $m$.
- End-to-End Learning: The network is trained to minimize a kernel-induced squared loss. Because the basis is finite, this loss can be expressed in terms of the predicted coefficients, allowing for standard backpropagation and stochastic gradient descent (SGD).
- Inference (The Pre-image Problem): To convert the predicted feature vector back into a structured object (e.g., a molecule), the model solves a "pre-image" problem. This is typically achieved by searching a candidate set for the object whose kernel representation best matches the network's prediction.
Experimental Results and Analysis
DSOKR was evaluated across several benchmarks, including synthetic datasets, molecular graph prediction (SMI2Mol), and text-to-molecule tasks (ChEBI-20). A key finding is the relationship between the sketching size $m$ and model performance.
As shown in the figure above, the Mean Squared Error (MSE) drops sharply as $m$ increases, eventually plateauing. This demonstrates that a relatively small, sketched basis can effectively capture the necessary structure for high-accuracy prediction. In synthetic tests, DSOKR achieved superior results compared to standard multi-output NNs while using 13 times fewer parameters, suggesting that the kernel structure provides a powerful inductive bias and regularization effect.
On real-world tasks, DSOKR significantly outperformed existing state-of-the-art methods. In the SMI2Mol task, it achieved a Graph Edit Distance (GED) of 1.951, nearly doubling the performance of previous kernel-based methods (GED 3.330). On the ChEBI-20 text-to-molecule dataset, a DSOKR ensemble reached a Hits@1 of 51.0%, surpassing specialized cross-modal attention models.
Conclusion
Deep Sketched Output Kernel Regression provides a scalable and flexible framework for structured prediction. By integrating sketching techniques with deep learning, it enables the use of powerful kernel-induced losses within standard DNN pipelines. While the current reliance on candidate sets for the pre-image problem remains a bottleneck, the method's parameter efficiency and robust performance across diverse kernels mark a significant step forward in bridging non-parametric kernel theory with parametric deep learning.
Summary updated