Introduction
Relational databases (RDBs) serve as the primary storage for structured data in nearly every industry. Despite their prevalence, they have remained a challenging domain for the "foundation model" paradigm that has revolutionized natural language processing and computer vision. The structural complexity of RDBs—characterized by diverse schemas, heterogeneous feature types (textual, numerical, categorical), and intricate inter-table relationships defined by Primary and Foreign Keys—has historically necessitated task-specific architectures or traditional machine learning methods like XGBoost that fail to capture relational context.
Griffin introduces a novel approach by treating interconnected tables as a large-scale heterogeneous graph. By unifying data encoders and task decoders across diverse schemas, Griffin establishes itself as a foundation model capable of generalizing across different databases and predictive tasks.
Methodology: A Graph-Centric Architecture
Griffin’s core innovation lies in its conceptualization of an RDB as a graph where rows are nodes and relational links are edges. This perspective allows the model to leverage Graph Neural Network (GNN) principles to propagate information across table boundaries.
Unified Data Encoding
To accommodate any schema, Griffin maps all inputs into a shared embedding space. It utilizes a pretrained text encoder for categorical data and metadata (such as table and column names), enabling the model to understand the semantic context of the data (e.g., recognizing that "Price" in one table is semantically related to "Cost" in another). For numerical values, a specialized "float encoder" is employed to preserve the precision and magnitude of continuous data.
Message Passing and Aggregation
The model employs a multi-layered GNN architecture with two key components:
- Cross-Attention Module: Instead of uniform feature aggregation, Griffin uses attention mechanisms to selectively weigh the importance of different columns relative to the specific target task.
- Hierarchical Aggregation: Within the GNN layers, information is first aggregated within specific relation types before being merged across the broader graph, ensuring that the relational logic of the database is preserved during the learning process.
Multi-Stage Training Strategy
Griffin is trained in three distinct phases:
- Stage 1: Self-Supervised Pretraining: The model performs masked cell completion on approximately 200 single-table datasets, learning the fundamental "language" of tabular data.
- Stage 2: Joint Supervised Fine-Tuning (SFT): The model is trained on a mixture of single-table and multi-table RDB tasks to align its representations with real-world predictive objectives.
- Stage 3: Downstream Adaptation: Finally, the model is fine-tuned on specific target RDBs for final task execution.
Datasets and Benchmarking
The development of Griffin involved a massive training suite encompassing over 150 million nodes. The training data included ~200 curated single-table datasets from sources like TPBerta and CARTE. Evaluation was conducted on 4DBInfer and RelBench, the current state-of-the-art benchmarks for graph-centric RDB modeling. These benchmarks cover diverse domains, including e-commerce (churn prediction, purchase rates), sports, social networks, and clinical data.
Key Insights
- Semantic Metadata: By encoding schema metadata as text, Griffin learns to transfer knowledge between databases with different structures but similar semantics.
- Universal Decoding: A shared float decoder for regression and a unified classification head allow a single model instance to handle varied tasks, such as binary churn prediction and multi-class product categorization, using the same weight set.
- The Pretraining Advantage: A significant finding is that pretraining on isolated single tables provides a "free lunch," substantially improving performance on complex multi-table tasks. This suggests that mastering basic tabular structures is a prerequisite for understanding complex relational systems.
Experimental Results
Griffin demonstrates superior performance across a wide range of metrics. Even without pretraining, the Griffin architecture outperforms standard GNN baselines like GraphSAGE and HGT.
As shown in the experimental results, "Griffin-pretrained" consistently achieves the best results, validating the foundation model approach. Notably, Griffin excels in low-data scenarios, providing a robust solution for industrial applications where labeled data is often scarce. Furthermore, cross-domain tests confirmed that pretraining on diverse data (e.g., sports, medicine, finance) creates a more resilient model that generalizes better to entirely new domains compared to models trained from scratch.
Conclusion and Future Directions
Griffin represents a major milestone in extending foundation models to relational databases. By unifying schema-agnostic encoding with graph-based relational reasoning, it overcomes the limitations of previous task-specific models. Future work will focus on optimizing the computational cost of sampling large-scale temporal subgraphs and exploring the integration of more powerful LLM-based reasoning directly into the graph iterations to better handle text-heavy databases.
Summary updated