TL;DR
IRG (Incremental Relational Generator) introduces a novel modular framework for generating synthetic relational databases that perfectly preserve complex, real-world database schemas. By combining depth-first context learning with exact graph optimization algorithms, IRG guarantees 100% schema validity—successfully handling composite keys, nullable foreign keys, and multi-table correlations where existing models fail.
What Problem Does This Paper Address?
Sharing relational databases (RDBs) for machine learning, data mining, or software testing is heavily restricted by privacy regulations like GDPR. While generating synthetic data offers a safe alternative, relational databases present a unique challenge: they consist of multiple tables interconnected by strict structural rules (primary and foreign key constraints).
Existing synthetic database generators typically only handle simple parent-child relationships. However, real-world databases feature Complex Relational Schemas (CRSs). These include:
- Composite Keys: Primary or foreign keys made up of multiple columns.
- Overlapping Constraints: Multiple foreign keys pointing to the same parent table, often with logical rules like non-self-match constraints (e.g., a user cannot send a message to themselves).
- Multi-fold Connections: Hidden, indirect correlations between tables (like a "step-parent" table affecting a "step-child" table).
Standard generative models either fail to run on these complex schemas or produce corrupted databases with broken links, rendering the synthetic data useless for realistic SQL queries or software testing.
Methods
IRG addresses these challenges by breaking down the database generation process into a modular pipeline. Instead of relying purely on a neural network to guess the correct relational structure, IRG splits the task into context retrieval, machine learning-based generation, and exact algorithmic matching.
1. Context Construction via DFS
Rather than generating tables in a strict top-down topological order, IRG uses a depth-first search (DFS) traversal across the database schema graph. This allows it to gather context bi-directionally from all related tables, capturing complex, indirect multi-fold relationships before a table is even generated.
2. The 5-Module Generation Pipeline
For each table, IRG executes five distinct steps:
- Degree Generation (g): Predicts how many child rows correspond to a parent row using natural number regression, enforcing a sum constraint to control the final table size.
- NULL-indicator Generation (n): Uses binary classification to accurately replicate where missing or optional foreign keys (NULLs) should occur.
- Aggregated Information Generation (a): Summarizes child row characteristics to guide the generation of actual table values.
- Actual Values Generation (d): Generates non-foreign-key attributes sequentially, preserving intra-table correlations over time (e.g., transaction histories).
- FK Attributes Matching (m): Instead of generating foreign key values directly, IRG treats key assignment as a graph optimization problem. It uses Min-Cost Max-Bipartite Matching (MCMBM) or Min-Cost Max-Flow (MCMF) algorithms to map rows to their parent tables, mathematically guaranteeing that all schema constraints are perfectly satisfied.
Datasets
The authors evaluated IRG across 10 real-world relational database datasets spanning various domains and sizes:
- RelBench Benchmarks (5):
stack,trial,F1,event, andavito. - Kaggle Datasets (5):
bike,social,SMM(Super Mario Maker),BEC(Brazilian E-Commerce), and a highly complexfootballdataset.
The football dataset was utilized for deep quantitative evaluation due to its heavy reliance on overlapping composite keys and non-self-match constraints.
Key Insights and Ideas
- Graph Optimization Over Pure Generation: Neural networks are excellent at learning smooth data distributions, but terrible at adhering to hard logical constraints. By offloading foreign key assignments to exact combinatorial graph algorithms (MCMF), IRG ensures structural perfection.
- The Importance of Table Shape Integrity: A synthetic database must maintain realistic row ratios between parent and child tables. IRG’s explicit control over the "sum of degrees" ensures that synthetic table sizes closely mirror reality.
- Sequential Treatment of Rows: Treating rows sharing the same foreign key as a continuous sequence rather than isolated atomic rows allows the model to capture realistic temporal and behavioral patterns.
Key Results
- 100% Schema Validity: Across all 10 datasets, IRG achieved a 0% constraint violation rate. In contrast, baseline models (SDV, RCTGAN, ClavaDDPM) either failed to run entirely due to memory explosion or generated highly corrupted schemas.
- High Data Utility: In a downstream machine learning task (predicting football match outcomes), models trained on IRG-synthetic data achieved performance closest to models trained on real data, outperforming all baselines.
- Query Consistency: IRG maintained remarkable statistical consistency across tables. For instance, calculating the total number of goals in the football dataset yielded matching results regardless of which interconnected table was queried.
Limitations and Future Work
The primary limitation of the current IRG implementation is its computational overhead. Because it relies on an autoregressive transformer (REaLTabFormer) as its default sequential generation backbone, training and generation times can scale poorly on massive datasets.
However, because IRG is completely modular, the authors note that any component can be easily swapped out. Future work will focus on integrating faster, state-of-the-art tabular and time-series generative models into the IRG framework to improve scalability.
Summary updated