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

Rishabh Ranjan, Valter Hudovernik, Mark Znidar, Charilaos Kanatsoulis, Roshan Upendra +5 more
10/7/2025
cs.LGcs.AIcs.DB

No official code found. Best implementation: snap-stanford/relational-transformer (91 stars, Rust, last commit 2026-02-05).

Abstract

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) tokenizes cells with table/column metadata, (ii) is pretrained via masked token prediction, and (iii) 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 experiments show that RT's zero-shot transfer harnesses task-table context, relational attention patterns and schema semantics. Overall, RT provides a practical path toward foundation models for relational data.

View on arXivView PDF

Code Implementations(1)

Rust

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

9122Rust, PythonJul 10, 20258 months ago

Similar Papers

Cite this paper

@article{ranjan2025relational,
  title  = {Relational Transformer: Toward Zero-Shot Foundation Models for Relational Data},
  author = {Rishabh Ranjan and Valter Hudovernik and Mark Znidar and Charilaos Kanatsoulis and Roshan Upendra and Mahmoud Mohammadi and Joe Meyer and Tom Palczewski and Carlos Guestrin and Jure Leskovec},
  year   = {2025},
  eprint = {2510.06377},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.06377v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.06377.svg)](https://codeofpaper.com/paper/2510.06377)

Discussion