Abstract
RetroLive is an interactive system designed to bridge the gap between relational databases and word embeddings. By "retrofitting" general-purpose word vectors using schema information and table relationships, RetroLive enhances the semantic representation of database entities for downstream machine learning tasks. This paper explores the methodology behind relational retrofitting and demonstrates its effectiveness across several real-world datasets.
Introduction
Word embeddings like GloVe and word2vec have transformed natural language processing by providing dense numerical representations of text. However, these embeddings are often "context-blind" when applied to structured relational databases. For instance, a model trained on general news might identify "Brazil" as a country, whereas in a movie database, it is a specific film directed by Terry Gilliam. Standard embeddings fail to leverage the rich structural information inherent in Database Management Systems (DBMS), such as column categories and foreign key relationships.
Relational Retrofitting with Retro
To address this, the authors propose the Retro algorithm. This approach takes initial word vectors and adjusts them in a high-dimensional space based on three primary constraints:
- Original Semantics: Maintaining proximity to the pre-trained vector to preserve general linguistic knowledge.
- Columnar Connections: Encouraging values within the same column (e.g., all entries in a "Director" column) to cluster together, reflecting their shared semantic category.
- Relational Connections: Utilizing row-level associations. If a database record links "Terry Gilliam" to "Brazil," their respective vectors are pulled closer together.
The optimization problem is formulated as a convex objective, allowing for efficient computation of the "best" adjusted vectors.
The RetroLive System
RetroLive is a web-based demonstration platform that operationalizes the Retro algorithm. It allows users to upload their own databases and interactively tune hyperparameters ($\alpha, \beta, \gamma, \delta$) that weight the different connection types. A key feature of the system is the real-time visualization of vector shifts using Principal Component Analysis (PCA). This visualization often reveals "geometric alignment," where relationship pairs (like movie-director) develop similar orientations and lengths in the vector space after retrofitting.
Evaluation and Key Results
The system was evaluated using three datasets: The Movie Database (TMDB), Google Play Store Apps, and Open Food Facts, using Google News (word2vec) and fastText as base models.
Key findings include:
- Improved Downstream Performance: Retrofitted vectors significantly outperformed standard baselines like DeepWalk in tasks such as binary classification (e.g., identifying US vs. non-US directors), null value imputation, and link prediction for foreign keys.
- Handling Out-of-Vocabulary (OOV) Terms: Retro effectively generates vectors for rare terms or database-specific IDs by leveraging their relational neighbors, filling gaps in the original pre-trained models.
- Schema as a Semantic Map: The results demonstrate that treating database columns as semantic categories (hypernyms) provides crucial context that general-purpose models lack.
Conclusion and Future Work
RetroLive demonstrates a powerful method for injecting structured relational knowledge into unstructured numerical vectors. While effective, the authors identify several areas for future research, including the automation of hyperparameter tuning, scaling the optimization for massive enterprise databases, and developing methods for incremental embedding updates as database content changes.
Summary updated