Biological Sequence Kernels with Guaranteed Flexibility

Alan Nawzad Amin, Eli Nathan Weinstein, Debora Susan MarksarXiv 2023 · DOI

Abstract

Machine learning models for biological sequences frequently utilize kernels to measure similarity. However, many standard kernels lack universality and characteristic properties, preventing them from learning complex patterns even with infinite data. We introduce the discrete mass property, a theoretical framework that ensures a kernel is universal and characteristic. We provide methods to "fix" existing kernels, such as the Inverse Multiquadric Hamming (IMQ-H) kernel, which employs heavy-tailed decay to avoid diagonal dominance. Our results on synthetic and real-world biological datasets show that these modifications allow models to overcome performance plateaus and reliably converge as data volume increases.

Introduction

In bioinformatics, predicting phenotypes—such as protein fitness or viral evolution—from sequences is a core challenge. Kernels are the standard tool for defining similarity in these discrete, infinite, and variable-length spaces. However, many common choices, including Hamming and k-mer spectrum kernels, are mathematically "inflexible." They may fail to be universal (unable to represent certain relationships) or characteristic (unable to distinguish between different sequence distributions), which is critical for generative modeling and hypothesis testing.

The Discrete Mass Property

The authors propose a theoretical "shortcut" to guarantee kernel flexibility: the discrete mass property. A kernel possesses this property if its associated Reproducing Kernel Hilbert Space (RKHS) contains "delta functions" (discrete masses) for every possible sequence. If this condition is met, the kernel is guaranteed to be universal, characteristic, and capable of metrizing the space of distributions.

To achieve this, the authors developed a toolkit of transformations:

  • Summing, Tilting, and Tensorizing: Operations that preserve the discrete mass property.
  • Heavy-tailed Kernels: Replacing exponential decay with power-law decay (e.g., the IMQ-H kernel) to prevent "diagonal dominance," where the model treats every training sequence as entirely unique and fails to generalize.
  • Scaled Embeddings: A method to ensure neural network-based representations (from Transformers or VAEs) maintain flexibility by scaling them based on sequence length.

Experimental Results

The proposed kernels were evaluated against standard benchmarks, including transcription factor binding regression and immune repertoire distribution testing.

Overcoming the "Big Data" Plateau

A key finding is that inflexible kernels cause models to plateau at high error rates regardless of the amount of training data. As shown in Figure 1, the standard Hamming kernel reaches a performance floor, while the heavy-tailed IMQ-H kernel continues to improve as the dataset size ($N$) increases.

Comparison of convergence between the standard Hamming kernel and the heavy-tailed IMQ-H kernel.

Distribution Testing and Optimization

In two-sample testing of T cell receptor (TCR) sequences, kernels with discrete masses required significantly less data to distinguish between patient distributions. Furthermore, when optimizing for representative sequences, standard embedding kernels often produced unrealistic results (e.g., unnaturally long sequences), whereas the authors' scaled embedding kernels correctly matched the target distribution's length and composition.

Conclusion

This work highlights that theoretical guarantees are not just mathematical niceties but are essential for the reliability of machine learning in biology. By ensuring the discrete mass property, researchers can avoid the pitfalls of "inflexible" kernels and build models that truly scale with the growing volume of biological data. Future work will extend these principles to more complex structures like circular RNA and protein complexes.

Summary updated

BibTeX
@misc{amin2023biological,
  author = {Alan Nawzad Amin and Eli Nathan Weinstein and Debora Susan Marks},
  title = {{Biological Sequence Kernels with Guaranteed Flexibility}},
  year = {2023},
  eprint = {2304.03775},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.03775},
}
Figure