RelPrism: A Multi-Faceted Pre-training Framework with Self-Generated Tasks for Relational Databases

Jinyu Yang, Cheng Yang, Junze Chen, Zedi Liu, Muhan Zhang, Hanyang Peng, Chuan ShiarXiv 2026

TL;DR

RelPrism is a novel self-supervised learning framework designed to improve how deep learning models understand relational databases (RDBs). By automatically generating a diverse pool of pseudo-tasks across multiple perspectives and granularities, RelPrism pre-trains highly adaptable graph representations. This approach yields state-of-the-art performance on downstream classification and regression tasks, particularly in data-scarce, few-shot scenarios.

What Problem Does This Paper Address?

Relational Deep Learning (RDL) has emerged as a powerful paradigm that converts relational databases into graphs—where rows become nodes and inter-table relationships become edges—allowing graph neural networks (GNNs) to make end-to-end predictions. However, effective self-supervised pre-training (SSL) for RDBs remains a major challenge.

The core issue is that different downstream database tasks require completely different types of information. For example, predicting user churn might depend heavily on interaction patterns (relational structure), whereas predicting a user's lifetime value requires a fine-grained mix of both behavior patterns and specific user attributes (intrinsic data).

Figure 1: RDB Predictive Tasks Require Multi-Faceted Infor- mation Across Perspectives and Granularities. We illustrate three downstream tasks in a real-world e-commerce RDB. Specifically, (a) relies primarily on node-level intrinsic at- tributes, such as user source; (b) depends more on subgraph- level relational attributes that capture interaction patterns, such as interaction frequency and intensity; and (c) requires hybrid attributes to support fine-grained regression.

Existing SSL methods typically focus on a single facet—either reconstructing missing row values or analyzing graph topology. Because the exact needs of downstream tasks are unknown during pre-training, these single-faceted approaches produce rigid representations that fail to generalize well.

Methods

To bridge this gap, the authors introduce RelPrism, a multi-faceted pre-training framework that builds a comprehensive foundation for downstream adaptation through four main stages:

  1. RDB-to-Graph Conversion: The RDB is modeled as a temporal heterogeneous graph. Crucially, to avoid redundant data aggregation, only dimension table rows are treated as nodes, while fact table interactions are modeled directly as edges.
  2. Multi-Perspective Attribute Construction: For every node, RelPrism constructs three distinct profiles:
  3. Intrinsic Attributes ($X^I$): Features derived directly from raw row data (numerical, text, categoricals).
  4. Relational Attributes ($X^R$): Statistical profiles capturing interaction frequency, intensity, and neighborhood quality.
  5. Hybrid Attributes ($X^H$): A fusion of both intrinsic and relational signals.
  6. Multi-Granularity Task Generation: RelPrism applies K-Means clustering multiple times with varying cluster counts to each attribute perspective. This automatically creates three distinct pseudo-task pools (Intrinsic, Relational, and Hybrid) spanning different levels of granularity.
  7. Meta-Training Pipeline: Using Prototypical Networks and a mixed task sampling strategy, the graph encoder is trained to solve these diverse pseudo-tasks, teaching it to rapidly adapt to various data distributions.
Figure 2: The Overall Framework of RelPrism. (a) We first convert the RDB into a temporal heterogeneous graph. (b) Next, we construct multi-perspective node attributes: intrinsic attributes X𝐼derived from the corresponding row’s raw data, relational attributes X𝑅extracted from interaction information, and hybrid attributes that fuse both to encode composite information. (c) We then apply a multi-granularity clustering strategy independently to each perspective to construct corresponding multi- granularity task pools: the Intrinsic Pool 𝑇𝑎𝑠𝑘𝐼, the Relational Pool 𝑇𝑎𝑠𝑘𝑅, and the Hybrid Pool 𝑇𝑎𝑠𝑘𝐻. (d) Finally, we perform mixed task sampling from these task pools for pre-training and then obtain representations for downstream adaptation.

Datasets

The framework was evaluated on 14 distinct tasks across 5 real-world datasets from the RelBench benchmark:

  • rel-f1 (Sports domain)
  • rel-stack (Social networks domain)
  • rel-amazon (E-commerce domain)
  • rel-hm (E-commerce domain)
  • rel-trial (Medical records domain)

These datasets represent a highly diverse and challenging evaluation suite, with table counts ranging from 3 to 15 and row counts spanning from tens of thousands to tens of millions.

Key Insights and Ideas

  • Task Preferences Diverge: Ablation studies revealed that downstream tasks have clear, distinct informational preferences. Classification tasks benefit most from pre-training on the Hybrid and Relational task pools, whereas regression tasks heavily favor the Intrinsic task pool. RelPrism's mixed sampling strategy successfully balances these competing needs.
  • Balancing Alignment and Uniformity: Many graph SSL methods suffer from representation collapse (where all representations look similar) or divergence (where same-class items fail to aggregate). By enforcing diverse pseudo-task targets, RelPrism achieves an optimal balance, ensuring local compactness for similar items and global diversity across the feature space.
  • Clustering as a High-Quality Proxy: The self-generated clustering tasks act as surprisingly effective proxies for real-world labels. Performance curves show that RelPrism effectively bridges the gap between completely random pseudo-tasks and upper-bound tasks derived from manual, ground-truth annotations.

Key Results

RelPrism demonstrates substantial performance gains across both data-limited and data-sufficient settings:

  • Data-Limited (Few-Shot) Scenarios: On 1-shot, 5-shot, and 50-shot tasks, RelPrism achieved state-of-the-art results on 13 out of 14 tasks. Compared to the strongest baselines, it improved ROC-AUC by an average of 4.15% for classification and reduced Mean Absolute Error (MAE) by 10.75% for regression.
  • Data-Sufficient Scenarios: When abundant training data is available, RelPrism matches or outperforms fully supervised RDL models on classification and delivers massive error reductions on continuous regression tasks (e.g., drastically lowering MAE on the medical rel-trial dataset).
Figure 3: 1-Shot and 5-Shot Classification and Regression Performance on 14 Tasks across 5 Datasets. For regression tasks, inverted MAE is used for visualization, where larger values indicate better performance.

Limitations and Future Work

While the mixed task sampling strategy ensures robust overall adaptability, the authors note that it can occasionally introduce minor interference on tasks that are heavily dominated by a single facet (such as specific user-engagement metrics). A promising direction for future work includes dynamically calibrating or weighting the task pool sampling ratios during pre-training to better align with specific downstream target domains.

Summary updated

BibTeX
@misc{yang2026relprism,
  author = {Jinyu Yang and Cheng Yang and Junze Chen and Zedi Liu and Muhan Zhang and Hanyang Peng and Chuan Shi},
  title = {{RelPrism: A Multi-Faceted Pre-training Framework with Self-Generated Tasks for Relational Databases}},
  year = {2026},
  eprint = {2605.23241},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2605.23241},
}
Figure