NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Space-Efficient Feature Maps for String Alignment Kernels

Yasuo Tabei, Yoshihiro Yamanishi, Rasmus Pagh

TL;DR

Researchers have developed SFMEDM, a novel method that allows high-accuracy string alignment kernels to scale to millions of sequences. By combining "Edit-Sensitive Parsing" with a new, memory-efficient hashing trick for Random Fourier Features, they reduced memory requirements from Terabytes to Megabytes without sacrificing predictive power.

What Problem Does This Paper Address?

In fields like bioinformatics and natural language processing, comparing strings (sequences of characters) is a fundamental task. String alignment kernels are the gold standard for this; they calculate the similarity between sequences by finding the best way to "align" them. When paired with Support Vector Machines (SVMs), they offer incredible accuracy for tasks like protein homology detection.

However, they have a massive "scalability wall." Standard methods require $O(N^2)$ computations—meaning if you double your data, your work quadruples. For massive datasets with millions of strings, this is computationally impossible. While "Feature Maps" (like Random Fourier Features or RFFs) are often used to speed up kernel methods, they usually require a projection matrix proportional to the input dimension ($d$) and output dimension ($D$). For strings, $d$ can be in the millions, leading to a memory explosion that crashes even the most powerful servers.

Methods

The authors introduce SFMEDM (Space-efficient Feature maps for Edit Distance with Moves), which relies on two key innovations:

  1. Edit-Sensitive Parsing (ESP): Instead of comparing strings character-by-character, ESP builds a hierarchical parse tree of the string. This maps the string into a high-dimensional "characteristic vector" in a way that approximates Edit Distance with Moves (EDM). Unlike standard edit distance, EDM accounts for substrings being moved or swapped, which is common in biological sequences.
  2. Space-Efficient Feature Maps (SFMs): This is the paper's core theoretical contribution. To avoid storing a massive $O(dD)$ projection matrix for RFFs, the authors use $t$-wise independent hash functions. This allows them to generate the necessary random values on the fly. This mathematical "sleight of hand" reduces the memory footprint from $O(dD)$ down to just $O(d)$, making the memory usage independent of the target projection size.

Datasets

The researchers evaluated their method on five diverse, large-scale datasets:

  • Protein & DNA: 3,238 human enzymes from the KEGG database.
  • Music & Sports: Amazon user reviews (10,261 and 296,337 strings, respectively).
  • Compound: A massive collection of 1,367,074 bioactive compounds (SMILES strings) from the PubChem database. This served as the primary stress test for scalability.

Key Insights and Ideas

  • The Memory Breakthrough: The most striking "aha moment" is the realization that we don't need to store the random projection matrix; we only need to be able to reproduce it consistently. By using specific hash functions, they achieved the same theoretical concentration bounds as standard RFFs but with a fraction of the RAM.
  • Preserving the Laplacian: String similarity is often best captured by Laplacian kernels. The authors' SFM approach is general enough to approximate any shift-invariant kernel, including the Laplacian, which is essential for the ESP embedding to work.
  • Move-Awareness Matters: By approximating "edit distance with moves" rather than just simple insertions/deletions, the model captures more meaningful structural similarities in complex data like DNA or long product reviews.

Key Results

  • Extreme Memory Savings: On the "Sports" dataset, the standard RFF approach (FMEDM) required a staggering 1.1 Terabytes of memory. The proposed SFMEDM required only 280 Megabytes—a reduction of over 4,000x.
  • Superior Scalability: SFMEDM successfully processed the 1.3 million strings in the "Compound" dataset in about 9 hours. Most competing methods (like GAK or LAK) either timed out after 48 hours or crashed due to memory limits.
  • High Accuracy: Despite the approximations, SFMEDM achieved higher AUC (Area Under the Curve) scores than state-of-the-art string kernels like STK17 and D2KE across almost all benchmarks.

Limitations and Future Work

While SFMEDM is a leap forward, the authors note a few areas for growth:

  • Parameter Sensitivity: The performance depends on choosing the right projection dimension ($D$) and the kernel parameter ($\beta$). While SFMEDM makes large $D$ values feasible, finding the optimal settings still requires some trial and error.
  • Beyond Strings: The authors suggest that the logic behind SFMs is general. Future work could apply this space-efficient hashing trick to other complex data structures, such as tree kernels or graph kernels, which suffer from similar dimensionality explosions.
  • Hardware Optimization: The current implementation is CPU-based; the independent nature of the hash-based projections makes this an ideal candidate for massive parallelization on GPUs.

Summary updated

BibTeX
@inproceedings{tabei2019space,
  author = {Yasuo Tabei and Yoshihiro Yamanishi and Rasmus Pagh},
  title = {{Space-Efficient Feature Maps for String Alignment Kernels}},
  booktitle = {ICDM},
  year = {2019},
  doi = {10.1109/icdm.2019.00166},
}
Figure