Realistic relational database synthesis with language model guidance

Mixed-Type Relational Database Synthesis with Graph-Prompted Language Model

Databases

Summary

Datasets with multiple linked tables are hard to copy realistically because the data types and the relationships between tables are complex. The paper presents REMIX, a method that uses two types of language models working together to create realistic fake databases. One model generates data by understanding the tables as a graph of attributes, while the other model checks and repairs inconsistencies. This approach helps produce data that looks real and maintains important relationships across tables. Tests on seven real databases show that REMIX creates high-quality synthetic data that can be useful for analysis.

What this means in practice

  • For database administrators: Generate realistic synthetic database versions for testing without risking sensitive data exposure.
  • For data engineering teams: Create high-fidelity multi-table datasets that preserve attribute dependencies for development and validation workflows.

Authors

Yuxiang Sun, Mengshi Chen, Jianwei Wang, Wenjie Zhang, Kai Wang

Abstract

Data access is often limited by privacy or proprietary restrictions, motivating relational database synthesis, which synthesizes realistic contents across related tables. Relational databases couple multi-table structure with mixed-type attributes and intricate semantic dependencies among values, making realistic synthesis challenging. In this paper, we propose REMIX, a unified framework for realistic relational database synthesis with mixed-type attributes. REMIX integrates a small language model (SLM) and a large language model (LLM) through two key phases: Graph-to-Prompt Tuning and Collaborative SLM-LLM Decoding. To capture attribute dependencies within and across tables, Graph-to-Prompt Tuning represents the database as an attributed heterogeneous graph. We project mixed-type record embeddings and aggregated relational context into soft prompts that serve as continuous vectors for an SLM. We jointly optimize the graph-to-prompt mapping and SLM through autoregressive attribute reconstruction. Furthermore, to reduce semantic inconsistencies, Collaborative SLM-LLM Decoding combines SLM-based record generation with repair programs induced by an LLM. The LLM discovers semantic dependencies, iteratively refines them through independent validation with a statistical bound on the overall probability of false acceptance, and translates validated dependencies into tested programs that repair generated values. Extensive experiments on seven real-world relational databases demonstrate the effectiveness of REMIX in generating high-fidelity data with improved semantic consistency and downstream utility.