Relatron: Automating Relational Machine Learning over Relational Databases

Zhikai Chen, Han Xie, Jian Zhang, Jiliang Tang, Xiang song, Huzefa Rangwala

TL;DR

Relatron is a meta-learning framework that automatically selects the best machine learning architecture for relational databases, choosing between modern Relational Deep Learning (GNNs) and classical Deep Feature Synthesis. By using "task signals" like data homophily and loss-landscape flatness, it achieves up to an 18.5% performance boost while being 10x more computationally efficient than previous automated methods.

The Challenge of Relational Data

Most of the world's structured data lives in Relational Databases (RDBs)—think SQL tables linked by primary and foreign keys. Traditionally, applying machine learning to this data required "flattening" multiple tables into one, a manual and error-prone process.

Recently, two main schools of thought have emerged to automate this feature engineering:

  1. Deep Feature Synthesis (DFS): A classical approach that uses fixed, non-parametric rules (like SUM, MEAN, or MAX) to aggregate data across tables.
  2. Relational Deep Learning (RDL): A modern approach using Graph Neural Networks (GNNs) to "learn" how to aggregate data through message passing.
Relational Database Structure and DFS vs. RDL Paradigms

The problem? Practitioners often don't know which approach to pick for a specific task. Furthermore, RDB data is usually split by time (training on the past, testing on the future), creating a distribution shift. This often leads to a frustrating phenomenon where more hyperparameter tuning actually results in worse test performance because the model overfits a validation set that doesn't represent the future.

Introducing Relatron

To address these challenges, the authors introduce Relatron, a meta-selector designed to navigate a unified design space of both RDL and DFS models. Its workflow consists of three main pillars:

  • Task Embeddings & Routing: Instead of training every possible model, Relatron extracts "task signals" from the database. These include RDB task homophily (how similar labels are across linked entities) and affinity embeddings (lightweight features capturing table size, path, feature, and temporal structure). A meta-classifier uses these signals to "route" the task to either the RDL or DFS family.
  • Pruned Search: Once a family is chosen, Relatron uses a Hyperparameter Optimization (HPO) routine to find the best specific configuration within that family, significantly reducing the search space.
  • Loss-Landscape Post-Selection: To solve the "more tuning, worse performance" trap, Relatron doesn't just pick the model with the highest validation accuracy. It analyzes the loss landscape around the model's weights. It prefers "flat" optima (where small changes in weights don't spike the error) over "sharp" ones, as flat regions are known to generalize better under distribution shifts.

Datasets and Evaluation

The study utilizes Relbench, a comprehensive benchmark for relational machine learning. The authors evaluated Relatron across 17 diverse tasks from seven different domains, including online retail (churn, sales prediction), Q&A platforms (engagement, badges), event recommendations, marketplace ads, clinical trials, Formula 1 racing results, and citation networks.

Key Insights

  • RDL is not a silver bullet: One of the most surprising findings is that GNN-based RDL does not consistently outperform classical DFS. DFS often wins on smaller datasets or when simple linear aggregations are sufficient.
  • Homophily is the Deciding Factor: The performance gap between RDL and DFS is strongly correlated with homophily. When labels are heterophilous (linked neighbors have different labels), RDL’s non-linear learning excels. When labels are highly similar across links, DFS’s simple averages are often superior.
  • Validation Accuracy is Unreliable: In relational tasks, validation accuracy is often a poor guide for model selection. Incorporating loss-landscape metrics to measure the "smoothness" of the error surface is a much more robust way to pick a winning model.

Results

  • Superior Performance: Relatron achieved up to an 18.5% improvement over strong baselines in joint hyperparameter and architecture optimization.
  • Efficiency: It reached these results with 10x lower computational cost than alternatives based on Fisher Information.
  • Routing Accuracy: The meta-selector predicted the winning model family (RDL vs. DFS) with 87.5% accuracy using only model-free task features.
  • Generalization: By preferring flatter optima, the system successfully mitigated the performance degradation typically seen during heavy tuning on time-split relational data.

Limitations and Future Work

The authors acknowledge that their study did not deeply explore Large Language Model (LLM)-based encoders or predictors, which are currently resource-heavy but show promise. They also focused on selecting from a space of existing architectures rather than generating entirely new ones.

Future work includes expanding the "performance bank" to include more diverse tasks and exploring how these insights can be used to build Relational Foundation Models—pre-trained models capable of zero-shot or few-shot inference across different database schemas.

Code Availability: The implementation is available at github.com/amazon-science/Automating-Relational-Machine-Learning.

Summary updated

BibTeX
@inproceedings{chen2026relatron,
  author = {Zhikai Chen and Han Xie and Jian Zhang and Jiliang Tang and Xiang song and Huzefa Rangwala},
  title = {{Relatron: Automating Relational Machine Learning over Relational Databases}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=59avbH4HnU},
}
Figure