Abstract
Relational Deep Learning (RDL) bridges the gap between structured SQL databases and Graph Neural Networks (GNNs). By treating relational databases as temporal, heterogeneous graphs, RDL enables end-to-end representation learning, replacing manual feature engineering with differentiable message-passing operations. This paper outlines the RDL framework and introduces RELBENCH, a standardized benchmark for evaluating predictive modeling on complex multi-table data.
Introduction
Most high-value enterprise data resides in relational databases (SQL), structured across multiple tables linked by primary and foreign keys. Traditional machine learning workflows for this data typically require a "flattening" process—manual feature engineering where data scientists join tables and aggregate rows into a single feature vector. This manual process is labor-intensive, often loses fine-grained signal through aggregation, and is prone to "time travel" errors where future information accidentally leaks into training sets.
Relational Deep Learning (RDL) proposes a paradigm shift: moving from handcrafted features to a fully data-driven, end-to-end system that learns directly from the raw relational structure. By representing the database as a graph, RDL leverages the inherent connectivity of the data without requiring manual intervention.
Methods
The RDL framework transforms a relational database into a learnable representation through a multi-stage pipeline:
- Relational Entity Graph Construction: Every row in every table is treated as a node. Edges are automatically generated based on existing primary-foreign key relationships.
- Temporal Consistency: To prevent information leakage, the model employs a time-consistent computation graph. Nodes only receive messages from neighbors that existed prior to the "seed time" of the prediction task.
- The Architecture:
- Column Encoders: Modality-specific networks (e.g., LMs for text, CNNs for images) encode row attributes into initial node embeddings.
- Message Passing GNNs: Information propagates across the graph. GNN message-passing acts as a differentiable version of SQL
JOINandAGGREGATEoperations. - Task-Specific Heads: Final layers produce predictions for specific entities or relationships.
A key innovation is the Training Table, which defines tasks by providing a set of (Entity ID, Timestamp, Label) tuples. The GNN then dynamically retrieves relevant historical context from the database for each specific point in time.
The RELBENCH Benchmark
To standardize research, the authors introduce RELBENCH, a Python package featuring real-world relational datasets:
- rel-amazon: A subset of the Amazon Product Catalog (1.85M customers, 21.9M reviews) for tasks like User Lifetime Value (LTV) and Churn prediction.
- rel-stackex: Data from Stack Exchange (333K users, 415K posts) to predict user engagement and post popularity.
Key Insights
The core insight of RDL is that GNNs function as Differentiable SQL. Message passing and aggregation are functional equivalents to JOIN and GROUP BY. By making these operations differentiable, the model learns optimal data aggregations rather than relying on human heuristics. Furthermore, by treating time as a first-class citizen and supporting multi-modal column encoders, RDL naturally handles the dynamic, heterogeneous nature of real-world databases.
Conclusion and Future Work
RDL eliminates the need for manual feature engineering, potentially increasing both the speed of model development and the accuracy of predictions by preserving data resolution. While scaling to billions of rows remains a challenge, the introduction of RELBENCH provides a foundation for future research into "Relational Foundation Models" and more expressive, SQL-inspired GNN architectures.
Summary updated