Lay summary for non-technical audience
Much of the world's important data, from bank transactions to hospital records to online shopping, is stored in databases made of many linked tables. Organizations often want to make predictions from this data, such as which customers will leave or how a clinical trial will turn out. Today this usually requires specialist effort and tens of thousands of labeled past examples. We built RT-J, an AI model that learns a new prediction task from just a hundred or so examples shown on the spot, like a person picking up a task from a few worked examples. To teach it, we used AI agents to gather hundreds of real public databases and pose thousands of practice prediction questions about them. RT-J needs about ten times fewer examples than strong existing methods to match their accuracy, putting fast, low-cost forecasting within reach of small businesses, scientists and analysts.
Pretrained models for language and vision solve new tasks from a handful of examples in their prompt. Models for relational databases, where much of the world's enterprise and scientific data lives, still need task-specific training or tens of thousands of labels. RT-J is an 86M-parameter relational foundation model that makes accurate predictions on an unseen database from hundreds of in-context examples or fewer, in a single forward pass.
Same architecture, new recipe
RT-J keeps the Relational Transformer architecture, which reads cells of a database directly as tokens instead of flattening it into a feature table. What changes is everything around the model.
Real pretraining data
THE JOIN is the largest open corpus of real relational data to date: 639 databases across e-commerce, sports, finance, healthcare, and more, with forecasting tasks proposed by an LLM and filtered by deterministic checks. RT-J is pretrained first on synthetic PluRel databases, then on THE JOIN.
Long-context training
Training samples context sizes from 512 to 8,192 cells, so the context holds hundreds of labeled examples and one model works at every size.
Random-walk retrieval
Instead of expanding blindly from the target row, random walks rank the rows that are close to it and carry useful labels. Retrieval is cheap, needs no precomputation, and beats uniform sampling by 4.1 nMAE and 6.1 AUROC points.
Results
On RelBench's 21 forecasting tasks across 7 held-out databases, RT-J is compared with the strongest in-context pipelines: RDBLearn or an LLM agent writing SQL to engineer features, followed by TabICLv2 or LightGBM. Every pipeline sees exactly the labeled rows in RT-J's context, plus the rest of the database.
- Regression. RT-J beats every pipeline at every context size, by 2.3–5.0 nMAE points.
- Classification. RT-J leads by 3.1 AUROC points when examples are scarcest, and the strongest pipeline catches up at the largest context.
- Test-time compute helps. Tuning the context per task and averaging over several sampled contexts improve RT-J further.
Each pretraining phase helps
Synthetic pretraining on PluRel improves a randomly initialized RT, and continuing on THE JOIN improves it again. Real data matters most in context, where RT-J beats RT-PluRel by 0.6 nMAE and 1.5 AUROC points.
Pretraining on real databases also teaches RT-J what table and column names mean. Shuffling those names costs up to 2.1 AUROC points, and the gap grows with more examples, so the schema carries knowledge that examples alone do not replace.
Takeaways
- Context-efficient predictions emerge from large-scale pretraining. Real data, long contexts, and smarter retrieval turn RT into a strong in-context learner.
- Modeling the database natively beats feature engineering. Given the same labels, RT-J needs about 10× fewer of them.
- Real data teaches semantics. Table and column names carry knowledge that examples alone do not replace.
Release
We release:
- the RT-J and RT-PluRel models,
- THE JOIN data (alongside the PluRel synthetic data used for the first pretraining phase),
- the THE JOIN agentic curation pipeline, and
- our pretraining, fine-tuning and inference code.
Cite
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}
}