Kernelized Hashcode Representations for Relation Extraction

Sahil Garg, Aram Galstyan, Greg Ver Steeg, Irina Rish, Guillermo A. Cecchi, Shuyang Gao

Introduction

Extracting relationships from text—such as identifying protein interactions in biomedical literature—is a fundamental task in Natural Language Processing (NLP). While "kernel methods" are highly effective for this task because they can directly compare structured data like parse trees, they suffer from a significant computational bottleneck. Training these models typically requires $O(N^2)$ complexity, making them prohibitively slow for large datasets.

This paper, presented at AAAI-19, introduces KLSH-RF, a framework that bridges the gap between the high accuracy of structured kernels and the efficiency of modern classifiers. By transforming complex NLP structures into high-dimensional binary hashcodes, the authors achieve state-of-the-art performance with orders-of-magnitude speedups.

Methodology: From Trees to Hashcodes

The core innovation lies in converting "implicit" kernel similarities into "explicit" binary feature vectors (hashcodes). This process involves several key steps:

  1. Kernelized Locality-Sensitive Hashing (KLSH): The model uses a "reference set" of NLP structures to define hash functions. For any given sentence, the hash function determines its proximity to neighbors in the reference set, generating a bitstring "fingerprint" of its structural properties.
  2. Supervised Optimization: To ensure these hashcodes are informative, the authors optimize the kernel parameters and reference set by maximizing the Mutual Information (MI) between the hashcodes and class labels. This ensures the fingerprints capture features most relevant to the specific relation being extracted.
  3. Random Forest Ensemble: To prevent overfitting and handle the high-dimensional nature of the hashcodes, the model employs a Random Forest. Each tree in the ensemble is trained on a random subset of the hashcode bits.
The KLSH-RF pipeline: mapping NLP structures to binary hashcodes for ensemble classification.

Key Results and Performance

The KLSH-RF model was evaluated on several biomedical benchmarks, including AIMed, BioInfer, and PubMed45. The results demonstrate significant improvements in both accuracy and computational efficiency.

Accuracy and Robustness

On the complex PubMed45 dataset, KLSH-RF achieved an F1 score of 0.57, outperforming traditional SVMs (0.45) and previous k-Nearest Neighbor approaches (0.46). The optimization of the reference set was particularly impactful, boosting recall by 7–13 points. The ensemble approach also makes the model more robust to the stylistic variations common in scientific literature compared to deep learning models like LSTMs.

Computational Efficiency

The most striking result is the reduction in training time. Traditional kernel SVMs can take upwards of $10^5$ to $10^6$ seconds on large datasets. In contrast, KLSH-RF completes training in approximately $10^3$ to $10^4$ seconds, representing a 100x to 1000x speedup compared to standard SVM and kNN approaches.

Comparison of training times across different classifiers, showing the massive efficiency gains of KLSH-RF.

Conclusion

KLSH-RF provides a scalable solution for relation extraction by treating hashing as an automated feature engineering process. By making structured data compatible with efficient classifiers like Random Forests, it opens the door for applying high-quality kernel methods to massive datasets in biomedicine and beyond. Future work may extend this "kernel-to-hashcode" pipeline to other domains like chemical informatics or social network analysis.

Summary updated

BibTeX
@inproceedings{garg2019kernelized,
  author = {Sahil Garg and Aram Galstyan and Greg Ver Steeg and Irina Rish and Guillermo A. Cecchi and Shuyang Gao},
  title = {{Kernelized Hashcode Representations for Relation Extraction}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2019},
  doi = {10.1609/aaai.v33i01.33016431},
}
Figure