Abstract
Deep kernel learning provides an elegant and principled framework for combining the structural properties of deep learning algorithms with the flexibility of kernel methods. By means of a deep neural network, we learn a parametrized kernel operator that can be combined with a differentiable kernel algorithm during inference. While previous work within this framework has focused on learning a single kernel for large datasets, we learn a kernel family for a variety of few-shot regression tasks. Compared to single deep kernel learning, our algorithm enables the identification of the appropriate kernel for each task during inference. As such, it is well adapted for complex task distributions in a few-shot learning setting, which we demonstrate by comparing against existing state-of-the-art algorithms using real-world, few-shot regression tasks related to the field of drug discovery.
Introduction
In the world of few-shot learning (FSL), most research focuses on classification—identifying a new object from just a few images. However, few-shot regression (FSR)—predicting continuous values from minimal data—is equally critical but often overlooked in complex domains like drug discovery.
Existing approaches to FSR generally fall into two camps: metric learning and optimization-based methods (like MAML). Metric learning methods use deep networks to learn a fixed covariance function, but they often struggle to adapt to tasks that differ significantly from the training distribution. Optimization-based methods are flexible but computationally expensive. Standard Deep Kernel Learning (DKL) typically learns a single kernel for all tasks, which is insufficient for complex distributions where the rules of similarity might change depending on the specific context, such as different protein targets in drug-protein interactions.
Methods: Adaptive Deep Kernel Learning (ADKL)
To address these limitations, we propose Adaptive Deep Kernel Learning (ADKL). The core innovation is moving from a single kernel to a task-dependent kernel family.
As shown in the architecture diagram above, the model consists of several key components:
- Task Encoding: The model uses a modified "DeepSets" architecture to process the small training set (support set) of a new task and generate a task embedding ($z_t$). This embedding captures the specific context of the task.
- Conditional Embedding: Instead of a standard fixed feature extractor, ADKL uses a network $\phi_\theta$ that takes both the input data $x_i$ and the task embedding $z_t$. This allows the model to "re-interpret" features for every new problem.
- Base Learners: This flexible feature space is plugged into a differentiable kernel algorithm—either Kernel Ridge Regression (KRR) for speed or Gaussian Processes (GP) for probabilistic uncertainty.
- Meta-Regularization: To ensure the task encoder learns distinct task identities, a contrastive loss (InfoNCE) is used to group similar tasks together in the embedding space while separating different ones.
Datasets and Benchmarks
We evaluated ADKL on three benchmarks, including two new real-world datasets from the field of drug discovery:
- Sinusoids: A standard synthetic benchmark predicting sine waves with varying amplitudes and phases.
- Binding (BindingDB): Predicting the binding affinity between small molecules and proteins, where each task corresponds to a different protein.
- Antibacterial (PubChem): Predicting the antimicrobial activity of molecules across different bacterial strains.
These molecular datasets are particularly challenging because molecular structures (represented as SMILES strings) have complex, non-linear relationships with their biological effects.
Key Results
ADKL (both GP and KRR versions) consistently outperformed state-of-the-art baselines like R2-D2, CNP, and MAML across all three datasets.
Our experiments yielded several key insights:
- Adaptation via Covariance: Unlike MAML, which adapts by changing weights, ADKL adapts by changing the kernel. This provides a more principled, non-parametric way to handle new tasks.
- Active Learning Edge: In scenarios where the model can "choose" which data points to learn from (Active Learning), ADKL-GP significantly outperformed Conditional Neural Processes (CNP). The GP's better-calibrated uncertainty allows it to pick more informative samples.
- Simplicity in Kernels: Interestingly, linear kernels in the deep feature space often outperformed RBF kernels. This suggests the deep network handles the necessary non-linearity, and a simpler kernel on top prevents overfitting.
Limitations and Future Work
While effective, ADKL faces some challenges. The $O(m^3)$ complexity of kernel methods could become a bottleneck if the number of "shots" increases significantly. Additionally, while the feature extractor is task-aware, some kernel hyperparameters are currently shared across tasks. Future work could involve learning these hyperparameters dynamically via the task encoder. Finally, exploring more advanced graph neural networks (GNNs) for molecular encoding could further enhance performance in drug discovery applications.
Summary updated