Scalable Pairwise Kernel Learning with Stochastic Vec Trick

Napsu Karmitsa, Tapio Pahikkala, Antti AirolaarXiv 2026

TL;DR

The paper introduces SPaiK, a highly scalable kernel learning method designed for pairwise prediction tasks like drug-target affinity mapping. By introducing the Stochastic Generalized Vec Trick (sGVT), the authors enable efficient mini-batch training for Kronecker product kernels, drastically reducing memory and computational costs while maintaining the high accuracy required for challenging zero-shot learning scenarios.

What Problem Does This Paper Address?

Pairwise learning focuses on predicting outcomes for pairs of objects—such as determining whether a specific drug will bind to a particular target protein. While deep neural networks and matrix factorization dominate this space, they often struggle with "cold-start" or zero-shot learning (ODOT) settings, where predictions must be made for entirely new drugs and targets unseen during training.

Kernel methods (specifically Kronecker product kernels) excel in these challenging regimes because they naturally exploit the structural properties of the data. However, they suffer from a massive scalability bottleneck: explicitly constructing the kernel matrix scales quadratically ($O(n^2)$) with the number of pairs. While the existing Generalized Vec Trick (GVT) avoids explicit matrix construction and reduces the cost to linear scaling, it still depends directly on the total number of training samples ($n$), making it too slow for truly massive datasets.

Figure 1: Pairwise learning framework for DTA prediction.

Methods

To break this scalability barrier, the authors developed SPaiK, which introduces two core components:

  1. Stochastic Generalized Vec Trick (sGVT): A stochastic extension of the GVT that allows the algorithm to compute kernel matrix-vector multiplications using mini-batches rather than the full dataset. It processes data block-wise (either target-wise or drug-wise), reducing the computational complexity per iteration to $O(n_B m + n_B q)$, where $n_B$ is the user-defined batch size, and $m, q$ are the unique counts of drugs and targets.
  2. StoILMBM Optimizer: Because the authors utilize an $\epsilon$-insensitive squared loss and $\ell_1$ regularization (which promotes sparsity and robustness), the resulting optimization problem is nonsmooth. They introduced the Stochastic Inexact Limited-Memory Bundle Method (StoILMBM) to reliably solve this batch subproblem iteratively.

The baseline algorithm that sGVT builds upon is outlined below:

GVT for Training

Datasets

The authors evaluated SPaiK on seven real-world drug-target affinity (DTA) benchmark datasets:

  • Continuous Label Datasets: Davis, Metz, KIBA, and Merget.
  • Binary Label Datasets: G protein-coupled receptor (GPCR), Ion Channels, and Enzymes.

These datasets span varying sizes, label types, and sparsity levels (e.g., KIBA and Merget are highly sparse, with only 24-25% of affinities observed).

Key Insights and Ideas

  • Target-Wise Batching Wins: When constructing mini-batches, selecting a subset of targets and including all interacting drugs (target-wise) consistently yielded more accurate predictions than drug-wise batching for DTA tasks.
  • The Importance of Memory ($M$ Matrix): In sGVT, an auxiliary dual-drug matrix $M$ is maintained to capture dependencies between the current mini-batch and dual variables outside the current batch. Eliminating this information-preserving mechanism caused a severe drop in predictive accuracy.
  • Epoch-Wise Beats Purely Random Sampling: Processing target indices systematically in an epoch-wise random order (ensuring every target is sampled at least once per epoch) preserves pairwise interaction information much better than choosing targets completely at random for each batch.

An illustration of how target-wise batches are selected from the training data matrix can be seen here:

Figure 2: Training data for Examples 1 and 2.

Key Results

  • Massive Speedups with Zero Accuracy Loss: SPaiK20 (using a 20% batch size) achieved virtually identical Concordance Index (C-index) and Interaction Concordance Index (IC-index) scores compared to the full-batch version (SPaiK100), while running up to an order of magnitude faster.
  • Competitive with State-of-the-Art: SPaiK proved highly competitive against CGKronRLS (a leading conjugate gradient baseline). Crucially, in the most difficult zero-shot learning (ODOT) setups, SPaiK often outperformed the baseline due to the added robustness of its $\ell_1$ regularization and nonsmooth optimization framework.
  • Hinge-Loss Efficiency: On binary datasets, SPaiK was significantly faster than KronSVM, which failed to complete training on the Enzymes dataset within a 5-hour limit, whereas SPaiK finished in minutes.

Limitations and Future Work

  • Dataset-Specific Anomalies: SPaiK showed lower interaction tracking (IC-index) on the Merget dataset, though the authors note this appears to be an inherent property of the dataset rather than a flaw in the stochastic batching method.
  • Validation/Testing Bottleneck: Currently, sGVT is only implemented for the training phase. The validation and testing phases still rely on the original full-batch GVT, which the authors note could be extended to sGVT in future iterations to save more memory.
  • Algorithmic Portability: The sGVT technique is not exclusive to SPaiK; a promising future direction is integrating it into other Kronecker product-based algorithms, such as standard RLS methods.

Summary updated

BibTeX
@misc{karmitsa2026scalable,
  author = {Napsu Karmitsa and Tapio Pahikkala and Antti Airola},
  title = {{Scalable Pairwise Kernel Learning with Stochastic Vec Trick}},
  year = {2026},
  eprint = {2606.16979},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2606.16979},
}
Figure