Skip to main content

Relational Transformer (RT)

Website arXiv Hugging Face PyPI Python Quickstart in Colab BYOD in Colab License: Apache-2.0

This repo is the official implementation of the Relational Transformer (RT) architecture and the recipes to pretrain, fine-tune, run inference with and test-time scale Relational Foundation Models (RFMs) based on RT.

The current state of the repo reflects our NeurIPS 2026 work, RT-J, whose pretraining recipe is shown below:

RT-J pretraining recipe

This repo is linked to the following papers in the Stanford Tabular and Relational (STAR) project ecosystem:

Paper Venue Implementation
RT-J: Large-Scale Pretraining of Relational Transformers for Context-Efficient Predictions NeurIPS 2026 RT-J recipes + paper experiments: this repo.
PluRel: Synthetic Data unlocks Scaling Laws for Relational Foundation Models ICML 2026 Synthetic data generation + paper experiments: stanford-star/plurel. RT-PluRel recipes: this repo.
Relational Transformer: Toward Zero-Shot Foundation Models for Relational Data ICLR 2026 Legacy architecture + paper experiments: this repo @ rt-v1

Models and datasets (including preprocessed versions) are available on Hugging Face. See also our repo on agentic task curation for the Join corpus.

Installation

pip install relational-transformer

This installs the rt package, including the Rust sampler rt.rustler, without any dependency on Rust.

Quickstart

The Quickstart notebook (open in Colab) evaluates the released RT-J checkpoint on a RelBench task, rel-f1/driver-dnf, with no training: download one preprocessed database, predict every test row from its sampled context, score the AUROC (0.826 on an A100). A few minutes on an A100 or L4 runtime.

Bring your own data (BYOD)

RT runs on any database in RelBench format: Parquet tables, a manifest.yaml naming their keys and time columns, and labelled splits per task. See RelBench's BYOD guide for the format. The BYOD notebook (open in Colab) builds one from a DuckDB database with RelBench, with tasks defined in SQL, then preprocesses it and predicts with a released checkpoint. For more than a first look, examples/ runs the full recipes on it: in-context prediction with a frozen checkpoint, or per-task fine-tuning.

Preprocessing a large database (text embeddings included) can take a while, so smoke test on a subsample of it first to get to a first prediction quickly.

Development

We use pixi to manage one self-contained environment (Python, PyTorch + CUDA, Rust, and all dependencies), built on first use. The environment is defined for Linux x86_64 only.

git clone https://github.com/stanford-star/relational-transformer.git
cd relational-transformer
pixi run python -m examples.eval.plan        # or examples.pretrain.phases, ...

Examples

examples/ holds the recipes behind the released checkpoints and leaderboard entries, with the notes on how each part works.

what
preprocess/ RelBench-format databases -> RT's tensor format
pretrain/ RT-PluRel pretraining on PluRel, then RT-J continued pretraining on the Join
eval/ evaluate a checkpoint on every RelBench task; context knobs, tuning, ensembling
icl/ leaderboard entries: RT-J and RT-PluRel in-context
finetune/ leaderboard entries: RT, RT-J and RT-PluRel fine-tuned

Citation

If you use this repo, please cite the following papers:

@inproceedings{ranjan2026rtj,
    title={{RT-J}: Large-Scale Pretraining of Relational Transformers for Context-Efficient Predictions},
    author={Rishabh Ranjan and Vignesh Kothapalli and Harshvardhan Agarwal and Charilaos Kanatsoulis and Roshan Upendra and Tom Palczewski and Carlos Guestrin and Jure Leskovec},
    booktitle={The Fortieth Annual Conference on Neural Information Processing Systems},
    year={2026}
}

@inproceedings{ranjan2026relational,
    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},
    booktitle={The Fourteenth International Conference on Learning Representations},
    year={2026}
}

Additionally, if you use RT-PluRel please also cite:

@inproceedings{kothapalli2026plurel,
    title={{PluRel}: Synthetic Data unlocks Scaling Laws for Relational Foundation Models},
    author={Vignesh Kothapalli and Rishabh Ranjan and Valter Hudovernik and Vijay Prakash Dwivedi and Johannes Hoffart and Carlos Guestrin and Jure Leskovec},
    booktitle={Forty-third International Conference on Machine Learning},
    year={2026}
}

License

Apache-2.0, see LICENSE. The released checkpoints and datasets carry their own licences; "the Join" is assembled from third-party databases that keep theirs.

Metadata

Release files for relational-transformer 1.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for relational-transformer 1.11.0
File Size Uploaded Provenance Actions
relational_transformer-1.11.0.tar.gz 91.8 kB Without provenance Details for relational_transformer-1.11.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for relational-transformer 1.11.0
File Actions
relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details for relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_x86_64.whl
relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details for relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_aarch64.whl
relational_transformer-1.11.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for relational_transformer-1.11.0-cp310-abi3-macosx_11_0_arm64.whl
relational_transformer-1.11.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for relational_transformer-1.11.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 47.6 MB

Release files / relational_transformer-1.11.0.tar.gz

Download URL relational_transformer-1.11.0.tar.gz
Size 91.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e8083fd68a69b95706388f9107766d8a2552eed131d15bfc03ab79791d9d232e
BLAKE2b-256 checksum
How to use checksums
a4573121dd00ee0c9da4fd3d5c0ce05ea66367df0343405bb2207205bbbdb388
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_x86_64.whl
Size 12.1 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
5770d39d442d621aa0236383235af9e16dfe6872b704101cd3186f296e21d384
BLAKE2b-256 checksum
How to use checksums
e03e2e07f65c52ab3104bae655e6897c2a693feaca3736609a21601fe26b3db3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL relational_transformer-1.11.0-cp310-abi3-manylinux_2_28_aarch64.whl
Size 13.1 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
9a8002effce8e9a05af0abc7210f716cb4132ed9f5a7710c299c11eda97378cd
BLAKE2b-256 checksum
How to use checksums
da20daaff3c0c6ce388de62711f999f326b8bb30684a64aee1ba3649fa086bcd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / relational_transformer-1.11.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL relational_transformer-1.11.0-cp310-abi3-macosx_11_0_arm64.whl
Size 10.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
fd9f8837ca13f678b2aff62d55478c1fd213bb8e2b73fb078385a8abaac9946c
BLAKE2b-256 checksum
How to use checksums
592eafb9247e7d682aeabf1c8cd67ab7740cf80f58d4404564e096b8884cb4b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / relational_transformer-1.11.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL relational_transformer-1.11.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 11.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
6fb390aa38243e46d193ba37c81d81aa1498e4ab306adfb7128b879e5b39c656
BLAKE2b-256 checksum
How to use checksums
186ebd762e82b3942935cb43663bb89d1bb1950ffb231d67ed9a63cf53412a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for relational-transformer 1.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page