Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Relational Transformer: Toward Zero-Shot Foundation Models for Relational Data

About

Pretrained transformers readily adapt to new sequence modeling tasks via zero-shot prompting, but relational domains still lack architectures that transfer across datasets and tasks. The core challenge is the diversity of relational data, with varying heterogeneous schemas, graph structures and functional dependencies. In this paper, we present the Relational Transformer (RT) architecture, which can be pretrained on diverse relational databases and directly applied to unseen datasets and tasks without task- or dataset-specific fine-tuning, or retrieval of in-context examples. RT (i) incorporates task specification via task table prompting, (ii) tokenizes cells with table/column metadata, (iii) is pretrained via masked token prediction, and (iv) utilizes a novel Relational Attention mechanism over columns, rows, and primary-foreign key links. Pretrained on RelBench datasets spanning tasks such as churn and sales forecasting, RT attains strong zero-shot performance, averaging 93% of fully supervised AUROC on binary classification tasks with a single forward pass of a 22M parameter model, as opposed to 84% for a 27B LLM. Fine-tuning yields state-of-the-art results with high sample efficiency. Our experimental analyses show that RT's zero-shot transfer leverages task context, relational attention patterns and schema semantics. Overall, RT provides a practical path toward foundation models for relational data. Code, models, data: https://github.com/snap-stanford/relational-transformer.

Rishabh Ranjan, Valter Hudovernik, Mark Znidar, Charilaos Kanatsoulis, Roshan Upendra, Mahmoud Mohammadi, Joe Meyer, Tom Palczewski, Carlos Guestrin, Jure Leskovec• 2025

Related benchmarks

TaskDatasetResultRank
Entity ClassificationRelBench rel-avito user-visits
AUC62.6
32
Entity RegressionRelBench v1.0 (test)
LTV (Amazon Item)57.996
27
Binary ClassificationRelBench 1.0 (test)
Relational Amazon User Churn70.8
26
Entity ClassificationRelBench rel-stack user-badge
AUC83.6
23
Entity ClassificationRELBENCH rel-amazon item-churn (test)
AUROC74.3
23
Entity ClassificationRELBENCH rel-f1 driver-dnf (test)
AUROC0.812
15
Entity ClassificationRELBENCH rel-f1 driver-top3 (test)
AUROC89.3
15
Entity ClassificationRELBENCH rel-avito user-visits (test)
AUROC0.626
15
Entity ClassificationRELBENCH rel-stack user-badge (test)
AUROC0.811
15
Entity ClassificationRELBENCH rel-avito user-clicks (test)
AUROC60.9
15
Showing 10 of 36 rows

Other info

Follow for update