Skip to main content

Relational Transformer (RT)

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

The following results are fully reproducible from here:
🥇 RT-J is the #1 in-context model on the RelBench leaderboard at the time of submission (in-context, fine-tuned).
🥇 RT-PluRel is #1 on the combined system + model leaderboard on RelArena-alpha at the time of submission (in-context, fine-tuned).

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.

Installation

pip install relational-transformer

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

Quickstart

examples/quickstart.ipynb (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. A few minutes on a GPU runtime.

Bring your own database

The BYOD notebook (open in Colab) preprocesses your database and predicts tasks you define in SQL with a released checkpoint. For more than a first look, examples/ runs the full recipes on your own data in RelBench format: in-context prediction with a frozen checkpoint, or per-task fine-tuning.

Development

We use pixi to manage one self-contained environment (Python, PyTorch + CUDA, Rust, and all dependencies), built on first use.

git clone https://github.com/stanford-star/relational-transformer.git
cd relational-transformer
pixi run pytest                              # the test suite
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
quickstart.ipynb RT-J on one RelBench task, in Colab
byod/ RT-J on your own database, in Colab
preprocess/ RelBench-format databases -> RT's tensor format
pretrain/ RT-J from scratch: PluRel, then the Join
eval/ 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

MIT, 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.10.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.10.0
File Size Uploaded
relational_transformer-1.10.0.tar.gz 87.3 kB Details

Built distributions (wheels)

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

Total release size: 47.6 MB

Release files / relational_transformer-1.10.0.tar.gz

Download URL relational_transformer-1.10.0.tar.gz
Size 87.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f83c9129c9ebaf4c16d84f7053ecacc7ad84b85684f0f27e28328e88434e07b8
BLAKE2b-256 checksum
How to use checksums
8d3231c6a61e54a53fc57455f6e7b19a7ee0e26690b12e48bfa58dcc556a7845
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL relational_transformer-1.10.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
8a5c9cf4f91aee9d842ea6b37327b60833a0f08f15ec0b5c89c8dddf4cca3a30
BLAKE2b-256 checksum
How to use checksums
bb74f50cf468fca6048e6908355180b62b27150ed819e58c6741a0a727f6e235
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL relational_transformer-1.10.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
aeb706c59227eb2526f79c0f707d4328bace89f3b2ab958557bd2c6e025405ba
BLAKE2b-256 checksum
How to use checksums
643af48114356dc8626ca669b8d4fde443510ebba12ee1d8c1d7b413ef2e4664
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL relational_transformer-1.10.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
5e481fc2febed2eaebeb1842fbf211ed05e0c8f65f926ec7d2596a1a93ab854d
BLAKE2b-256 checksum
How to use checksums
caf5b99ab45b2eebdfe87eb1822d5d6c275d0759e176a0d6072d5d3b9047bdc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL relational_transformer-1.10.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
e1ec4cbee72dad979a04efc69d9194bd692ed2ef2257626a9170142b279a983c
BLAKE2b-256 checksum
How to use checksums
b8d00aa36488a2cf93610587f29d910f9c53ac359834958f2e23be7febb30dbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

1.10.0 This release

5 release files

1.9.0

3 release files

1.8.0

3 release files

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