Abstract
Real-world databases are predominantly relational, comprising multiple interlinked tables that contain complex structural and statistical dependencies. Learning generative models on relational data has shown great promise in generating synthetic data and imputing missing values. However, existing methods often struggle to capture this complexity, typically reducing relational data to conditionally generated flat tables and imposing limiting structural assumptions. To address these limitations, we introduce RelDiff, a novel diffusion generative model that synthesizes complete relational databases by explicitly modeling their foreign key graph structure. RelDiff combines a joint graph-conditioned diffusion process across all tables for attribute synthesis, and a $2K+$SBM graph generator based on the Stochastic Block Model for structure generation. The decomposition of graph structure and relational attributes ensures both high fidelity and referential integrity, both of which are crucial aspects of synthetic relational database generation. Experiments on 11 benchmark datasets demonstrate that RelDiff consistently outperforms prior methods in producing realistic and coherent synthetic relational databases.
Introduction
Most research in synthetic data generation focuses on "flat" tabular data—single tables where each row is independent. However, the real world runs on relational databases (like SQL), where multiple tables are linked via foreign keys. Generating synthetic relational data is notoriously difficult due to the need for structural integrity (ensuring foreign keys point to valid primary keys) and capturing statistical dependencies across tables (e.g., how a customer's demographics correlate with their purchase history).
Existing methods often attempt to flatten these databases or generate tables sequentially, which frequently leads to broken links or the loss of subtle, hierarchical correlations. RelDiff addresses these challenges by treating the entire database as a heterogeneous graph.
Methodology
RelDiff decouples the generation process into two distinct phases: structure generation and attribute synthesis.
1. Structure Generation (The Skeleton)
Instead of generating tables, RelDiff generates a Relational Entity Graph using a specialized "2K+SBM" (Stochastic Block Model) generator. This component acts as a blueprint, determining the number of rows in each table and their connections. It is specifically designed to preserve the degree distribution and the hierarchical nature of the database, ensuring 100% referential integrity.
2. Attribute Synthesis (The Meat)
Once the structure is established, RelDiff employs a Joint Graph-Based Diffusion Model to populate the data.
- Forward Process: Gaussian noise is added to numerical data, and categorical data is "masked" across all tables simultaneously.
- Reverse Process (Denoising): A Heterogeneous Graph Neural Network (GNN) learns to predict original values. By utilizing a GNN, the model considers neighboring rows in connected tables to determine specific values, effectively capturing inter-table correlations. The architecture utilizes Tabular Transformers to encode individual columns and a GraphSAGE variant for message-passing between connected entities.
Evaluation and Key Results
The researchers evaluated RelDiff on 11 real-world relational datasets across major benchmarks, including SyntheRela (e.g., Rossmann, Financial, Cora) and ClavaDDPM (e.g., Census, Instacart). These datasets range from simple parent-child pairs to deep hierarchies with many-to-many relationships.
Performance Highlights
- Superior Fidelity: RelDiff consistently outperformed baselines such as SDV, RCTGAN, and ClavaDDPM across eight different metrics. Notably, it showed up to an 80% improvement in preserving column correlations between connected tables.
- Downstream Utility: In machine learning efficiency tests, RelDiff achieved the best performance on 4 out of 5 datasets, proving the synthetic data is realistic enough for actual analytical tasks.
- Privacy: Using the Distance to Closest Record (DCR) metric, the authors demonstrated that RelDiff does not merely memorize training data; its synthetic records are sufficiently distinct to mitigate privacy risks.
Discussion and Future Work
The core insight of RelDiff is that databases are essentially graphs where rows are nodes and foreign keys are edges. By decoupling links from values, the model guarantees referential integrity—a significant hurdle for sequential models.
However, challenges remain. Training on massive, billion-row graphs presents computational scalability issues. Furthermore, while empirical privacy results are promising, the model currently lacks formal Differential Privacy (DP) guarantees. Future work will focus on integrating DP into the diffusion process and developing techniques to mitigate potential bias amplification inherent in relational structures.
Summary updated