Manuscript Offprint
arXiv:2608.29674Creation begins with understanding: LLMs as strategy designers for privacy-preserving tabular data synthesis
Abstract
Sharing tabular data in high-stakes domains is constrained by privacy regulations. Synthetic data offer a promising alternative, but deep generative models are costly to train and difficult to audit, while LLM-based methods often serialize records as text, obscuring tabular structure and exposing sensitive data. We introduce Tabular Synthesis Strategy Designer (TabSSD), which uses an LLM to design synthesis procedures rather than directly generate records. TabSSD provides the LLM with tree-derived summaries of variable dependence rather than raw records, which produces Python programs for local execution and evaluation. Across twelve datasets, TabSSD strikes a favourable balance among statistical fidelity, predictive utility, and empirical privacy risk, achieving the best average rank across six metrics among ten methods. Moreover, it substantially reduces local computation and token consumption relative to the compared methods. By enabling human-guided refinement and eliminating user-side model tuning, TabSSD lowers the expertise and infrastructure barriers to transparent tabular data synthesis.
Introduction
Tabular data, which combine heterogeneous (e.g., numerical and categorical) variables, underpin applications in various domains such as healthcare and physical systems [1, 2]. Collaboration and data sharing in these settings are increasingly constrained by stringent data-protection regulations, including the European Union's General Data Protection Regulation [3]. Tabular data synthesis offers a promising solution for data use without releasing sensitive records. High-quality synthetic data must balance statistical fidelity, downstream utility, and privacy: they should preserve the distributions and variable relationships of the original data so that models trained on them remain effective and generalizable, while minimizing memorization and re-identification risks [4, 5]. In safety-critical applications, the synthesis process should also be transparent and auditable, enabling domain experts to identify potential failure modes and determine whether the resulting data are suitable for downstream use.
Existing synthesis approaches, however, face limitations arising from their underlying modelling paradigms. Classical statistical methods [6–8] provide interpretable and principled mechanisms for tabular synthesis, but the reliance on distributional assumptions can limit their effectiveness for high-dimensional data with strong variable dependence [9, 10]. Deep generative models, including generative adversarial networks [11–13] and diffusion models [14–16], offer greater modelling flexibility but encode data distributions implicitly within neural network parameters (Fig. 1a). Their generation mechanisms are therefore difficult to inspect or audit. In high-stakes domains, this opacity limits experts' ability to understand the generation logic, diagnose failure modes, and correct undesirable behaviours [17, 18]. Moreover, adapting these models to new data typically requires computationally intensive retraining.
Large language models (LLMs) have recently been adapted for tabular tasks [19, 20], but using them directly as record-level generators for tabular synthesis creates a modality mismatch: LLMs are optimized for sequential text, whereas tabular records are heterogeneous, non-sequential, and order-invariant [21, 22]. Existing approaches commonly address this mismatch by serializing rows into text sequences (Fig. 1b). Such representations obscure variable dependence and impose an artificial order that does not reflect the intrinsic structure of tabular data [21]. Methods based on serialized records generally rely on either task-specific fine-tuning [23, 24] or in-context learning [25, 26]. Fine-tuning is data-intensive and computationally expensive, and in-context learning must infer the joint distribution from a limited set of examples and incurs increasing context-window and token costs as more examples are provided. Record serialization can also expose raw data during LLM adaptation or prompting, introducing additional privacy risks [27, 28]. These limitations motivate a different paradigm in which the LLM reasons over summarized data structure rather than generating records directly from raw examples.
We propose the Tabular Synthesis Strategy Designer (TabSSD), which shifts the role of the LLM from a record-level generator to a high-level strategy designer. TabSSD draws on conditional modelling in statistical practice (Fig. 1c), where a complex joint distribution is decomposed into a sequence of conditional models. To represent tabular structure without exposing raw records, TabSSD uses chained classification and regression trees (chained trees, hereafter) as a language-compatible bridge. These trees capture variable dependence through decision rules [29, 30], compressing variable-dependence structure into compact prompts. Guided by these prompts, the LLM identifies redundant predictive dependence, determines sampling orders, selects appropriate conditional samplers, and expresses the resulting synthesis strategy as executable Python code (Fig. 1d). Because the synthesis logic is represented as inspectable, executable code, domain experts can audit its rules, diagnose empirical anomalies, and make targeted revisions without computationally expensive retraining. By automating dependence extraction, strategy generation, local validation, and candidate selection, TabSSD lowers the expertise and computational requirements of tabular synthesis. Through a standardized interface, it produces locally executable and inspectable programs without requiring users to design deep generative models, fine-tune LLMs, perform extensive hyperparameter tuning, or rely on local GPU acceleration.
We evaluate TabSSD on twelve heterogeneous datasets spanning a range of dimensionalities and sample sizes. Compared with representative deep generative models and LLM-based methods, TabSSD achieves a favourable balance among statistical fidelity, downstream utility, and privacy while substantially reducing computational and token costs. A case study on a severely imbalanced clinical dataset further demonstrates its practical use for minority-outcome augmentation and assesses whether the generated data preserve clinically meaningful phenotype distributions beyond conventional statistical metrics. Overall, these results show that strategy-level LLM reasoning provides a transparent and efficient approach to privacy-preserving tabular data synthesis and may extend to other heterogeneous data modalities.
Overview of TabSSD
As shown in Fig. 1d, TabSSD is an end-to-end framework that converts tabular data into executable synthesis strategies. It first extracts predictive dependence among variables using chained trees and encodes this information in a compact prompt. The LLM then analyses the dependence structure and designs multiple candidate strategies, each implemented as a Python program. These programs run locally and undergo evaluation for statistical fidelity, empirical privacy risk, and computational efficiency. The selected program synthesizes the data and provides an inspectable generation procedure. This design shifts the role of the LLM from record-level generation to strategy design. Because the LLM receives summaries of the variable-dependence structure rather than training records, the original data remain in the local environment throughout synthesis and evaluation. TabSSD runs on CPU only and is summarized as Algorithm 1.
Datasets, baselines, evaluation, and settings
We assess TabSSD on 12 real-world datasets and in a clinical data-augmentation experiment. Supplementary Table 1 provides the data descriptions. We compare TabSSD with methods that span several synthesis paradigms: tabular deep generative models (CTGAN [31] and TVAE [31]), diffusion-based models (TabD-DPM [32], TabDiff [33], and TABSYN [34]), a fine-tuned LLM using record serialization (GReaT [23]), tree-and energy-based models (ARF [35] and NRGBoost [36]), and the interpolation method SMOTE [7]. Each method uses the same train-test splits and generates as many synthetic samples as the corresponding training set contains. When required, validation uses only the training data. In the main experiments, TabSSD queries Gemini-2.5-Pro 10 times per dataset to generate candidate strategies. All local stages of TabSSD, including tree fitting, candidate execution, strategy evaluation, and final synthesis, run on CPU. Among the baselines, the tree-based methods ARF and NRGBoost run on CPU, and others use GPU acceleration because their running on CPU is prohibitively slow. We follow the scheme of TABSYN [34] to report results

Fig. 1 Comparison of tabular data synthesis paradigms and overview of the proposed TabSSD framework. a, Conventional deep generative models encode data distributions implicitly within trained parameters, resulting in opaque generation mechanisms that are difficult to inspect or audit. b, Existing LLM-based methods serialize tabular records into one-dimensional text sequences, obscuring variable dependence, increasing computational overhead, and exposing raw records in prompts. c, Human experts instead analyse variable dependence and domain constraints to design tailored synthesis strategies. d, TabSSD similarly positions the LLM as a strategy designer. Chained trees extract the variable-dependence structure from the original data. This information is distilled and combined with the task definition, evaluation criteria, reasoning instructions, and output specification, forming a prompt. Without accessing raw records, the LLM analyses the variable-dependence structure and produces multiple executable Python strategies. These candidates are executed and evaluated locally for statistical fidelity, empirical privacy risk, and runtime. Finally, the selected strategy is used to generate synthetic data.
averaged over 20 randomly sampled synthetic data. Supplement A.2 provides the implementation details. Across all datasets, we use the same prompt template, validation procedure, and selection criteria. No dataset-specific synthesis has been designed, tuned, or selected manually.
We evaluate the synthetic data from four perspectives: statistical fidelity, downstream predictive utility, empirical privacy risk, and computational efficiency. We additionally examine inspectability and editability through code-level case studies. Statistical fidelity is measured by marginal distribution error, pairwise correlation error, and α-precision, quantifying how well the synthetic data preserve the empirical properties of the real training data. Under the train-on-synthetic, test-on-real protocol, AdaBoost [37], Random Forest [38], and XGBoost [39] are used as downstream models to measure predictive utility, and we report their mean performance. Distance to closest record (DCR) measures empirical memorization risk, and δ-presence measures empirical re-identification risk. Computational efficiency is reflected by the time required for the entire data synthesis process. The code-level case studies examine whether the resulting procedures are inspectable and editable. Supplement A.3 defines the evaluation metrics.
Synthetic data fidelity, utility, and privacy risks
We compare TabSSD with the baseline synthesis methods on 12 real-world datasets and examine statistical fidelity, downstream predictive utility, and empirical privacy risk. Fig. 2 summarizes the trade-offs: TabSSD combines low statistical errors and competitive predictive utility with a favourable empirical privacy profile. Supplementary Tables 2–7 report the complete numerical results.
Statistical fidelity and variable dependence. SMOTE attains high statistical fidelity and predictive utility through linear interpolation between two data records. This mechanism preserves local geometry but produces the least favourable DCR result, indicating higher memorization risk and limiting its applicability for privacy-preserving data sharing [40]. We therefore focus the performance analysis and comparison on the deep generative and LLM-based methods. Among these methods, TabSSD has the second-lowest mean marginal distribution error (3.80%), close to TabDiff (3.74%; Fig. 2a). TabSSD also has the lowest mean pairwise correlation error (3.89%), a relative reduction of 19.79% from ARF (4.85%), the second-best method a Statistical fidelity


b Pairwise correlation preservation (Blood dataset)

c Trade-off between memorization risk and utility

d Trade-off between re-identification risk and fidelity
e Overall benchmark ranking
Fig. 2 Statistical fidelity, predictive utility, and empirical privacy risk of representative tabular data synthesis methods. a, Statistical fidelity on 12 datasets, measured by marginal distribution error and pairwise correlation error. Lower values indicate higher fidelity. Boxes span the interquartile range, centre lines show the median, whiskers extend to 1.5 times this range, diamonds show the arithmetic mean, and dots denote performance on individual datasets. Because GReaT serializes tabular records as a text sequence, inputs from four high-dimensional datasets (SpeedDating, Jasmine, DNA, and DARWIN) exceed the LLM's context window; the GReaT results cover the remaining eight datasets. TabSSD is comparable to the best-performing SMOTE and better than the generative baselines. b, Pairwise correlation preservation on the Blood dataset. Each cell reports the preservation score for a variable pair, and the value in the centre reports the mean across all pairs. Higher values indicate better performance. c, Trade-off between downstream utility and DCR. A lower adjusted DCR indicates less proximity to training records and lower potential memorization risk. d, Trade-off between -presence and -precision. Lower -presence indicates lower empirical re-identification risk, and higher -precision indicates higher sample-level fidelity. Panels c and d report the performance averaged across datasets with available results. Methods on the top left are preferred, and TabSSD is on the Pareto front in both comparisons. e, Ranking profiles of TabSSD, TabDiff, SMOTE, and GReaT across marginal fidelity, pairwise fidelity, utility, adjusted DCR, -precision, and -presence. For each metric, all ten evaluated methods are ranked in the preferred direction, with rank 1 denoting the best performance. The ranks are mapped such that better performance appears closer to the outer ring. Across the six metrics, TabSSD ranks third, second, second, third, first, and second, respectively, yielding an average rank of 2.17. Among all methods compared, TabSSD exhibits the strongest and most balanced overall ranking profile.
compared, and 43.95% from TabDiff (6.94%). On the Blood dataset, TabSSD achieves a mean pairwise correlation preservation score of 0.971, better recovering variable correlations than the other generative methods (Fig. 2b).
Fidelity-utility-privacy trade-offs. High statistical fidelity and predictive utility can be achieved by sacrificing privacy protection. Fig. 2c and Fig. 2d show that TabSSD is on the Pareto front of the utility-memorization and fidelity-re-identification comparisons, respectively. TabSSD combines competitive predictive utility and leading -precision with memorization and re-identification risks that are comparable to or lower than those of the strongest baselines. Among other well-performing methods, GReaT and CTGAN have a favourable adjusted DCR but lower predictive utility and -precision, whereas ARF and TabDiff have favourable -presence but a lower utility and/or a less favourable adjusted DCR than TabSSD. Fig. 2e summarizes the six metrics in a rank-based radar plot. Each metric is ranked across the evaluated methods, with better ranks plotted closer to the outer boundary. TabSSD achieves the best average rank of 2.17 across the six metrics and is near the outer boundary, indicating its balanced performance.
More importantly, TabSSD mitigates a source of exposure not captured by these empirical metrics: raw records are not transmitted to the LLM during strategy generation. The LLM receives abstract partition rules rather than raw records, while tree extraction and synthesis execution remain within the data holder's environment. Ablation studies support the contributions of tree-based dependence extraction, compact dependence encoding, and explicit prompt guidance (see Supplementary Tables 8–10). In addition, the framework remains applicable across the evaluated LLM backbones, although synthesis performance varies across models and datasets (see Supplementary Table 11).
Scalability and token efficiency
Computing efficiency and scalability. We assess computational scalability across 12 datasets that vary in training data size and variable dimension ( features and 1 label) and report method efficiency in Fig. 3. TabSSD requires a 199.6-second end-to-end runtime averaged across datasets. ARF, the fastest generative baseline compared, requires 332.6 seconds, or 1.7 times the TabSSD runtime (Fig. 3a). The other baselines require 3.4 to 38.4 times the TabSSD runtime. Notably, the reported runtimes of the deep generative baselines are obtained with GPU acceleration; on CPUs, these methods are prohibitively slow. By contrast, TabSSD's local execution uses CPU only. The runtime decomposition in Fig. 3b attributes 77.1% of TabSSD runtime to LLM querying and 22.9% to tree fitting and synthesis execution. Fig. 3c presents dataset-level runtime ratios, calculated as baseline method runtime divided by TabSSD runtime. Values above 1 indicate that TabSSD is faster. Overall, TabSSD is competitive in terms of computing speed, and its largest runtime advantages occur on high-dimensional data. Following established empirical computational-complexity analyses [41], we fit a log-linear model, , to TabSSD runtime and the geometric mean runtime of the baselines. The baseline runtime has a significant positive association with training data size (), whereas TabSSD exhibits an insignificant, near-zero association (; Fig. 3d). Within the evaluated datasets, TabSSD runtime shows no detectable association with training-data size (, ). This finding is consistent with the use of compact tree summaries instead of serializing records. Variable dimensionality has similar associations with TabSSD and baseline runtime ( and 0.37, respectively), but TabSSD retains a lower absolute runtime (Fig. 3e). Supplementary Table 12 reports the results for each dataset.
Token efficiency and context management. We compare TabSSD with record serialization, a common approach used by LLM-based tabular synthesis methods. On low-dimensional datasets, TabSSD and serialization have comparable token consumption. As the variable dimension increases, however, serialization becomes increasingly costly and requires up to 130.3 times as many tokens as TabSSD (Fig. 3f). TabSSD's token efficiency stems from its use of compact chained-tree rules rather than raw record and variable values. For high-dimensional data, a greedy set-cover algorithm selects a subset of trees that covers all the variables (Algorithm 1). Thus, increasing the data dimension adds only the rules needed to include previously uncovered variables, rather than replicating the entire dataset in the prompt. For example, a coverage of DARWIN's 451 variables requires rules from only 54 trees. By separating dependence extraction from prompt construction, TabSSD limits token growth and avoids the context-window failures that are often observed with record serialization.
Transparent data synthesis and human-in-the-loop auditing
From variable dependence to transparent code synthesis. TabSSD produces inspectable and executable Python programs. We illustrate this procedure using Adult, a census dataset commonly used to predict whether annual income exceeds 50,000 U.S. dollars from demographic, educational, employment, and financial variables [42]. To reduce redundancy across the chained trees (Supplementary Fig. 1), the LLM distils the extracted variable dependence into a directed graph. As shown in Fig. 4a, the graph designates education.num, relationship, and age as root variables, maps education deterministically from education.num, and assigns an appropriate estimator to each remaining variable—for example, a regression tree for capital.gain. TabSSD renders the resulting strategy as executable Python code, which is shown in Fig. 4b with details provided in Supplement D. This enables domain experts to inspect, audit, and modify the synthesis logic. Notably, the LLM does not receive the original variable names; the variable names restored in the figure are solely for illustration.
Human-in-the-loop interventions. Generative models can inherit biases in their training data, like sex-related disparities in Adult. TabSSD's generated scripts support direct code-level interventions without tree retraining or prompt editing. For example, if a user wants to reduce gender bias in their synthetic data to be shared, they can remove sex from the predictors for occupation and add group-wise probability calibration for income (Fig. 4c) without regenerating the data synthesis strategy. We assess the original and edited strategies using Cramér's for the association between sex and occupation, the absolute demographic-parity difference () between female and male high-income rates, and the counterfactual



Fig. 3 Scalability and efficiency. Deep generative baselines and the serialization-based method GReaT use GPU acceleration. The runtime of TabSSD reported in a to e is calculated as the sum of the tree-fitting time and the parallel execution time of ten LLM queries and local syntheses. a, End-to-end runtime of data synthesis averaged across datasets. Parenthetical values indicate runtime relative to TabSSD. b, Decomposition of TabSSD's mean end-to-end runtime into tree fitting, LLM querying, and synthesis execution. c, Ratios of baseline runtime to TabSSD runtime on the 12 datasets. Values greater than 1 indicate that TabSSD is faster; dashes indicate unavailable results of GReaT due to the LLM's context window constraint. Datasets are ordered by training-set size in ascending order. Parenthetical values below dataset names indicate the number of variables . d, End-to-end runtime as a function of training-data size . Each point represents one dataset, with TabSSD compared against the geometric mean of the compared baselines. e, End-to-end runtime as a function of the number of variables . In d and e, lines show trends estimated using a log-linear model, . The coefficients and quantify the associations of runtime with training-set size and variable dimension, respectively. f, Token consumption on a logarithmic scale. Stacked blue bars show the ten-query token consumption of TabSSD prompts and answers. Orange bars show the tokens required for one-time training data serialization and new data generation. Values above the TabSSD bars report total prompt-and-answer token consumption, and values above the serialization bars report token consumption relative to TabSSD. Parenthetical values below dataset names in c and f indicate the number of variables . In a and c, asterisks indicate that GReaT results are based on the eight datasets that fit within the LLM context window.
a Dependence-guided synthesis graph

b Executable strategy snippet
01 def generate_synthesis_data(...):
02 df['subspace'] = route_by_label_tree(df)
03 for sub_id in range(4):
04 sub_df = df[df.subspace == sub_id]
05 # root sampling
06 roots = sample(sub_df, root_features)
07 # deterministic mapping
08 education = map_mode(roots['education.num'])
09 # categorical classifiers
10 sex = fit_sample_cat([['relationship', 'age']])
11 occupation = fit_sample_cat(
['workclass', 'education.num', 'sex']
)
12 # regression + residual sampling
14 hours = fit_sample_cont(
['age', 'education.num', 'occupation']
)
15 capital_gain = fit_sample_cont(
['education.num', 'age', 'hours']
)
16 income = fit_sample_cat(label_predictors)
17 append(sub_gen)
c Strategy editing for improved fairness
Original strategy
01 occupation_predictors = [
"workclass", "education.num",
"sex",
]
05 occupation = fit_sample_cat(
"occupation", occupation_predictors
)
09 income_p = label_model.predict_proba(
income_predictors
)[:, positive_col]
12 income = sample(income_p)
Revised strategy
01 occupation_predictors = [
"workclass", "education.num",
]
04 occupation = fit_sample_cat(
"occupation", occupation_predictors
)
07 income_p = label_model.predict_proba(
income_predictors
)[:, positive_col]
11 income_p = calibrate_by_group(
income_p, sex, strength=0.50
)
14 income = sample(income_p)
d Improved parity with slight fidelity change




Fig. 4 Distilling variable dependence into executable synthesis strategies with human-in-the-loop fairness editing. a, Variable-dependence graph distilled by TabSSD for the Adult dataset. Nodes denote variables, directed edges encode the predictive conditional dependence used by the synthesis program, and node colours indicate the models assigned to variables. b, An excerpt from the executable synthesis strategy generated by TabSSD. Each record is routed to a tree-induced subspace, within which variables are synthesized with the models and predictors specified by the distilled dependence graph. c, Human-in-the-loop editing of the executable strategy. Sex is removed from the predictors of Occupation and sex-aware calibration is used in the generated probability of high income. The edited strategy executes locally and requires no additional LLM query. d, Fairness and fidelity comparison between the original and edited strategies. Fairness is quantified using Cramér's V for the association between Sex and Occupation, the absolute demographic-parity difference in the generated high-income outcome, and the directional counterfactual sex gap estimated by a random-forest income auditor. Fidelity is quantified using marginal-distribution and pairwise-correlation errors. Lower values indicate better parity or higher fidelity. Bars and error bars show the mean and s.d., respectively. P values are reported for two-sided paired t-tests.
sex gap obtained by changing sex while holding all other attributes fixed (Fig. 4d). Lower values indicate better parity. The edit reduces the mean sex-occupation association from 0.420 to 0.193, the mean absolute DPD from 16.3 to 8.1 percentage points, and the mean counterfactual sex gap from 1.91 to 1.08 percentage points, while largely preserving overall statistical fidelity. This experiment illustrates code-level editability rather than prescribing a general fairness intervention.
Code diagnosis and domain-knowledge injection. The executable representation further enables targeted diagnosis and the direct incorporation of domain knowledge. Users can correct empirically identified errors at

Fig. 5 Dataset-adaptive synthesis strategies guided by variable types and dependence from chained trees. a, For Car, weak inter-feature dependence coupled with strong label predictability leads to categorical sampling conditioned on both the label-tree leaf and class label. b, For Blood, strong dependence among continuous variables motivates a leaf-wise Gaussian copula followed by a bounded inverse transformation. c, For DARWIN, sparse dependence combined with near-deterministic relationships motivates cycle-resolved sequential regression with empirical residual resampling.
specific lines of Python code (Supplementary Table 13), impose logical constraints such as mutually exclusive medical diagnoses, and insert custom if-else statements to construct targeted stress-test scenarios. By combining variable dependence learned from the data with explicit expert rules, TabSSD makes the synthesis process transparent, auditable, and readily editable.
Tailored data synthesis strategies
We examine three datasets with different structures: Car, which contains only categorical features; Blood, which contains only continuous features; and DARWIN, a high-dimensional, small-sample dataset. The same prompting and validation pipeline is used to produce synthesis strategies. Fig. 5 shows that TabSSD adapts its synthesis procedure to each dataset rather than applying a fixed template. Specifically, TabSSD combines empirical sampling, node-conditional categorical sampling, Gaussian copulas, and cycle-resolved sequential regression.
For Car, the chained trees show weak feature dependence but high label predictability. TabSSD first samples a label within a selected leaf according to its empirical distribution and then samples each feature conditional on the leaf and label. For Blood, the variables exhibit near-deterministic functional dependence. TabSSD fits a Gaussian copula within each label-tree leaf, transforms the samples back to the original scale, and constrains them to the corresponding variable ranges. For DARWIN, variable dependence is sparse. TabSSD uses predictive variable dependence and the associated values to establish a sequential generation order, breaking a dependence cycle at the feature with the smallest . Within each label-tree leaf, ordinary least squares regression with empirical residual resampling generates predictable features. Leaf-level or global empirical distributions supply root and unmodelled features, and the leaf-level empirical distribution supplies labels. Supplement I provides the corresponding Python implementations.
Clinically robust augmentation under class imbalance
We examine TabSSD for data augmentation to address imbalanced classification in a clinically motivated setting. Specifically, we investigate whether TabSSD-generated data can improve minority identification a Mean balanced accuracy on testing data

b Tumour category distribution for real and synthetic minority

c One-year mortality risk distribution

Fig. 6 Clinical phenotype preservation and mortality-prediction utility under 2× augmentation in the Thoracic Surgery case study. a, Mean balanced accuracy on test data. AdaBoost, random forest, and XGBoost are trained on augmented training data, and the results are averaged across the three classifiers. b, Tumour category distributions among 41 real deaths in training data and 458 synthetic deaths for each synthesis method. Lower total-variation (TV) distance indicates better recovery of the real tumour phenotype distribution among the minority. c, Cross-fitted one-year mortality-risk distributions for the real and synthetic data. Five class-weighted logistic-regression models are cross-fitted on the real training data; real records receive out-of-fold scores, and synthetic records receive scores averaged across the five models. Higher density overlap indicates better recovery of the minority risk profile.
under class imbalance while preserving the clinical phenotype distribution. We conduct this evaluation using the Thoracic Surgery dataset [43] that comprises 470 patients, including 70 deaths within one year, and 16 predictors. Death within one year serves as the binary outcome, with deceased patients forming the minority class. We use 270 samples, including 41 deaths, for training, and the other 200, including 29 deaths, for testing. Each data synthesis method generates 458 synthetic samples per class, corresponding to twice the number of the majority in the training data, and data synthesis augments the training data. We show representative results in Fig. 6.
Fig. 6a shows that TabSSD achieves the highest mean balanced accuracy (0.578) among the evaluated methods, using AdaBoost, random forest, and XGBoost as classifiers. This result indicates that TabSSD is effective for data augmentation under class imbalance, improving minority-class detection. We defer detailed results to Supplementary Table 14. We next assess synthetic data's preservation of the tumour category distribution. A tumour category (T1, T2, T3, or T4) represents the local extent of invasion and relates directly to disease severity. As shown in Fig. 6b, TabSSD most closely reproduces the observed tumour-category distribution with a total-variation distance of 0.033, achieving the best distribution recovery among the compared methods. It retains the predominance of T2 while preserving the less frequent T3 and T4.
Finally, we evaluate whether the synthetic data generated by TabSSD and the baseline methods preserve the predictive characteristics of the minority class. Specifically, we examine how closely the synthetic records corresponding to patients who die within one year recover the distribution of one-year mortality risk observed in real data. We estimate these risks using class-weighted logistic regression trained on the real data. To obtain out-of-sample predictions for the real records, we perform five-fold cross-fitting; four folds are used for model training and one fold for prediction. A synthetic record's prediction is averaged over the five models. We then compare the risk-score distributions of the real and synthetic minority-class records using the overlap coefficient, which measures the shared area between their density curves; values closer to 1 indicate better recovery of the real data. Fig. 6c shows that TabSSD achieves an overlap coefficient of 0.893, very close to the best-performing CTGAN (0.894), demonstrating that TabSSD well preserves the data distribution and delivers strong predictive utility.
Discussion
In this work, we introduce TabSSD, which repositions LLMs from record-level data generators to synthesis strategy designers. TabSSD separates the local extraction of variable-dependence structure from strategy design and synthesis execution: chained trees summarize variable dependence in the training data, the LLM translates the summary into executable synthesis programs, and candidate programs are executed and validated within the data holder's environment. Across 12 benchmark datasets, this strategy-level formulation strikes a favourable balance among statistical fidelity, downstream predictive utility, empirical privacy risk, and computational efficiency. The case studies of fairness editing and clinical data augmentation further illustrate how exposing the synthesis logic as executable code enables targeted intervention and application-specific validation. Unlike extant methods that encode the generator in learned parameters or read and generate records token by token, TabSSD produces an inspectable computational procedure while avoiding the transmission of raw data to the LLM during strategy generation.
Our findings have practical and broader implications. TabSSD lowers the expertise and infrastructure barriers to tabular synthesis by automating dependence extraction, strategy design, local validation, and candidate selection. Through a standardized interface, it produces executable programs without requiring users to design deep generative models, fine-tune LLMs, perform extensive hyperparameter tuning, or undertake local GPU-accelerated neural network training. More broadly, TabSSD suggests that, for structured data, LLMs may be more valuable as designers of synthesis procedures than as direct record generators. Tree-derived summaries bridge private, order-invariant tables and general-purpose LLMs, while local statistical tools handle data access, model fitting, sampling, and evaluation. Representing the synthesis mechanism as executable code also enables failures to be traced, domain constraints to be incorporated, and strategies to be revised without retraining. This modular separation of data structure, LLM reasoning, and local verification provides a basis for human-governed generative AI.
Several limitations delineate the scope of the conclusions, although some reflect broader challenges common to current LLM-based systems rather than TabSSD alone. TabSSD depends on both the adequacy of tree-derived summaries and the reliability of the backbone LLM. Chained trees may miss weak or higher-order variable dependence, and stochastic LLM outputs may yield invalid, inefficient, or low-fidelity synthesis routines. We mitigate these risks through multi-candidate generation, local execution, and code inspection (Supplementary Table 13). Future work could further incorporate execution feedback, iterative program repair, and verifier-guided search over alternative strategies [44–48]. Scalability to ultra-high-dimensional tables can be limited by LLM context windows. Step-specific retrieval-augmented context construction [49] and graph-based decomposition [50] could restrict reasoning to the dependence relevant to each synthesis decision. Moreover, future work can further reduce information leakage by integrating formal privacy mechanisms into dependence extraction and strategy validation. Human-centred studies are also needed to assess whether practitioners can reliably understand, audit, and modify generated strategies in realistic settings. Taken together, our findings suggest that LLMs may be particularly valuable as designers of transparent, locally executable procedures rather than as unconstrained generators of sensitive structured data.
Methods
Problem setup
Let denote an original tabular dataset with samples, where and denote the feature vector and target value of the -th sample, respectively. The dataset comprises variables: feature variables and one target variable, or label, . Here, denotes the value of feature variable for the -th sample. The goal of tabular data synthesis is to construct a generator that synthesizes table from the original data , . The synthetic data should preserve statistical properties of the original dataset, such as marginal distributions and variable dependence, without compromising privacy. For supervised tasks, we distinguish between the features and the target , such as a continuous target for regression tasks or a categorical target for classification tasks. If the data holder does not specify a task for the tabular data, is omitted, and the workflow of TabSSD remains unchanged.
TabSSD separates the learning of variable-dependence structure from synthesis execution. The framework first extracts variable-dependence structure from using chained trees. It then encodes this information into a compact prompt , which is provided to an LLM to generate candidate synthesis strategies . Each candidate strategy is executed locally to produce a candidate synthetic table . The final strategy is selected based on fidelity, empirical privacy risk, runtime criteria, and potentially other criteria. This design changes the role of the LLM from a record-level generator to a synthesis strategy designer. The LLM receives summaries of the variable-dependence structure rather than raw records, and the original data are used only within the local environment for chained tree training, strategy execution, and candidate evaluation. The workflow is summarized in Algorithm 1.
Variable dependence extraction, encoding, and prompt design
Tabular synthesis requires preserving variables' marginal distributions and dependence to maintain statistical fidelity and downstream utility. Because it is inherently difficult for an LLM to reason about variable dependence given tabular data, we use chained trees to capture variable relationships without imposing parametric assumptions. Concretely, we construct chained trees and train a feature tree to predict each feature from all other features, denoted by , and the label tree to predict Y from :
For each Tree , we denote by the set of split variables. The variables in are ordered according to the minimum tree depth where they are first split, as variables splitting closer to the root define broader partitions of the data and are more influential in predicting . We denote the goodness of fit of Tree by , which contains the coefficient of determination ( ) and root-mean-square error (RMSE) for continuous variables and prediction accuracy for categorical variables:
Directly incorporating all decision rules into the LLM prompt would introduce substantial overhead and rapidly inflate the prompt length, particularly for high-dimensional datasets. We encode each Tree 's decision rule into compact dependence signals, including variable types and ranges, split variables , and goodness-of-fit scores . For Tree , we retain its split rules and the distribution of Y in leaf nodes. For high-dimensional datasets, even the compact dependence encoding can exceed the LLM's context-window limit. To enhance scalability, we apply a greedy set-cover procedure. At each iteration, we select the Tree _X_j whose variable set covers the largest number of previously uncovered features, and repeat this process until all features are covered. We always retain Tree when Y is defined.
Given the variable-dependence structure extracted by the chained trees, we construct a structured prompt that guides the LLM to reason about variable relationships and generate an executable synthesis strategy. The prompt p is composed of five components:
where denotes textual concatenation. is the task definition that informs the LLM that the goal is to generate an executable tabular data synthesis strategy rather than directly populating data records. is the guidance on evaluation metrics. It tells the LLM that the generated synthetic data will be evaluated according to statistical fidelity, downstream machine-learning utility, and empirical privacy-related risk. This component does not directly optimize these metrics but encourages the LLM to reason about trade-offs among the metrics when designing the synthesis strategy. instructs the LLM to analyse to infer variable dependence and distributional characteristics. It also encourages dividing heterogeneous data into more homogeneous subspaces when appropriate, thereby simplifying the modelling of each subspace. contains information about the variable-dependence structure extracted by the chained trees. provides both an output template and a worked in-context example. The template requires each candidate synthesis strategy to be expressed as an executable Python program with the following standardized interface:
During local execution, X_train and y_train provide the training data, n_sample specifies the number of records, and save_path specifies the output location. The function saves n_sample records matching the training schema. An example prompt is provided in Supplement D.1.
Synthesis strategy validation and selection
Given the prompt , we query the LLM multiple times to generate a set of candidate synthesis strategies. Because LLM outputs are stochastic and the extracted dependence information can support multiple valid synthesis approaches, these candidates often vary in their variable-generation order, subspace partitioning, and choice of statistical or machine learning models. Consequently, the candidates exhibit disparate statistical fidelity, empirical utility, privacy risk, and execution time. Generating multiple candidates increases strategy diversity, allowing subsequent validation and selection to filter out suboptimal or non-executable pipelines. The impact of the number of LLM queries on overall synthesis performance is detailed in Supplementary Fig. 2.
Each candidate strategy is executed locally to generate a synthetic table; any strategy that fails to execute is discarded. We then select a synthesis strategy through a filtering step prioritizing privacy and computational efficiency, followed by an evaluation step based on statistical fidelity. During filtering, we discard strategies whose execution time exceeds a predefined limit or whose resulting synthetic table exhibits a -presence privacy risk above an acceptable threshold. The remaining strategies constitute the feasible candidate set . We then compute the marginal distribution error and pairwise correlation error for the remaining synthetic tables, ultimately selecting the strategy that minimizes the combined errors:
where E is the average of the marginal distribution error and pairwise correlation error. Finally, or its synthetic table can be published or used for downstream tasks.
Algorithm 1 LLM-guided strategy-level tabular data synthesis
Notation: , where . predicts from , whereas predicts from .
denotes the split-variable set of ; denotes its goodness-of-fit statistics; executes strategy on to generate samples; and denotes the statistical error. If no target is specified, and are omitted.
Require: Training data ; number of synthetic samples ; number of LLM queries ; -presence risk threshold ; execution-time threshold s
1: Define the synthesis task, evaluation objectives, and output requirements
2: Construct from
3: Extract and, when present, the split structure and leaf-level target distributions of
4:
5: if is high-dimensional then
6:
7: while do
8: Select the tree covering the most previously uncovered variables:
9:
10:
11: end while
12:
13: end if
14: Encode the information retained in as
15: Construct the structured prompt
16: initialize the feasible strategy set
17: repeat
18: for do
19: Query the LLM with to generate a candidate strategy
20: Attempt ; skip non-executable or invalid candidates
21: Evaluate the statistical-fidelity error , -presence risk , and execution time
22: if and then
23:
24: end if
25: end for
26: until Raw records are not transmitted
27: Select
28:
29: return and
Author contributions
J.L., H.Y., and D.G. conceived the study. J.L., H.Y., D.G., and Q.Z. contributed substantially to the design of various aspects of the study. J.L. developed the code and performed the experiments. J.L., H.Y., D.G., and Q.Z. analysed and interpreted the experimental results. All authors contributed to the critical revision of the manuscript and reviewed and approved the final version.
Competing interests
The authors declare no competing interests.
References
[1] D'Sa, K., Evans, J.R., Virdi, G.S., Vecchi, G., Adam, A., Bertolli, O., Fleming, J., Chang, H., Leighton, C., Horrocks, M.H., Athauda, D., Choi, M.L., Gandhi, S.: Prediction of mechanistic subtypes of Parkinson's using patient-derived stem cell models. Nature Machine Intelligence 5(8), 933–946 (2023) https://doi.org/10.1038/s42256-023-00702-9
[2] Gamella, J.L., Peters, J., Bühlmann, P.: Causal chambers as a real-world physical testbed for AI methodology. Nature Machine Intelligence 7(1), 107–118 (2025) https://doi.org/10.1038/s42256-024-00964-x
[3] European Parliament, Council: General data protection regulation. Off. J. Eur. Union L 119, 1–88 (2016)
[4] Yan, C., Yan, Y., Wan, Z., Zhang, Z., Omberg, L., Guinney, J., Mooney, S.D., Malin, B.A.: A multifaceted benchmarking of synthetic electronic health record generation models. Nature Communications 13(1), 7609 (2022) https://doi.org/10.1038/s41467-022-35295-1
[5] van Breugel, B., Liu, T., Oglic, D., van der Schaar, M.: Synthetic data in biomedicine via generative artificial intelligence. Nature Reviews Bioengineering 2(12), 991–1004 (2024) https://doi.org/10.1038/s44222-024-00245-7
[6] Reynolds, D.: Gaussian mixture models. In: Li, S.Z., Jain, A. (eds.) Encyclopedia of Biometrics, pp. 659–663. Springer, Boston, MA (2009). https://doi.org/10.1007/978-0-387-73003-5_196
[7] Chawla, N.V., Bowyer, K.W., Hall, L.O., Kegelmeyer, W.P.: SMOTE: synthetic minority over-sampling technique. Journal of Artificial Intelligence Research 16, 321–357 (2002)
[8] Nowok, B., Raab, G.M., Dibben, C.: synthpop: Bespoke creation of synthetic data in R. Journal of Statistical Software 74, 1–26 (2016)
[9] O'Hagan, A., Murphy, T.B., Gormley, I.C., McNicholas, P.D., Karlis, D.: Clustering with the multivariate normal inverse gaussian distribution. Computational Statistics & Data Analysis 93, 18–30 (2016) https://doi.org/10.1016/j.csda.2014.09.006
[10] Blagus, R., Lusa, L.: SMOTE for high-dimensional class-imbalanced data. BMC Bioinformatics 14(1), 106 (2013) https://doi.org/10.1186/1471-2105-14-106
[11] Schmidhuber, J.: Making the world differentiable: On using fully recurrent self-supervised neural networks for dynamic reinforcement learning and planning in non-stationary environments. Technical Report FKI-126-90, Institut für Informatik, Technische Universität München (1990)
[12] Schmidhuber, J.: A possibility for implementing curiosity and boredom in model-building neural controllers. In: Proc. of the International Conference on Simulation of Adaptive Behavior: From Animals to Animats, pp. 222–227 (1991)
[13] Goodfellow, I.J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., Bengio, Y.: Generative adversarial nets. In: Advances in Neural Information Processing Systems, vol. 27, pp. 2672–2680 (2014)
[14] Jarzynski, C.: Equilibrium free-energy differences from nonequilibrium measurements: A master-equation approach. Phys. Rev. E 56, 5018–5035 (1997) https://doi.org/10.1103/PhysRevE.56.5018
[15] Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., Ganguli, S.: Deep unsupervised learning using nonequilibrium thermodynamics. In: Proceedings of the 32nd International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 37, pp. 2256–2265 (2015)
[16] Ho, J., Jain, A., Abbeel, P.: Denoising diffusion probabilistic models. In: Advances in Neural Information Processing Systems, vol. 33, pp. 6840–6851 (2020)
[17] Rudin, C.: Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nature Machine Intelligence 1(5), 206–215 (2019)
[18] Fang, Z., Jiang, Z., Chen, H., Li, X., Li, J.: Understanding and mitigating memorization in diffusion models for tabular data. In: Proceedings of the 42nd International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 267, pp. 15976–16005 (2025). https://proceedings.mlr.press/v267/fang25f.html
[19] Hegselmann, S., Buendia, A., Lang, H., Agrawal, M., Jiang, X., Sontag, D.: TabLLM: Few-shot classification of tabular data with large language models. In: International Conference on Artificial Intelligence and Statistics, pp. 5549–5581 (2023). PMLR
[20] Ye, H., Li, J., Zhao, H., Guo, D., Chang, Y.: LLM meeting decision trees on tabular data. In: Advances in Neural Information Processing Systems, vol. 38, pp. 118095–118131 (2025). https://doi.org/10.52202/085713-3938
[21] Wu, X., Ritter, A., Xu, W.: Tabular data understanding with LLM: A survey of recent advances and challenges. arXiv preprint arXiv:2508.00217 (2025)
[22] Fang, X., Xu, W., Tan, F.A., Hu, Z., Zhang, J., Qi, Y., Sengamedu, S.H., Faloutsos, C.: Large language models (LLMs) on tabular data: Prediction, generation, and understanding - a survey. Transactions on Machine Learning Research (2024)
[23] Borisov, V., Sessler, K., Leemann, T., Pawelczyk, M., Kasneci, G.: Language models are realistic tabular data generators. In: The Eleventh International Conference on Learning Representations (2023)
[24] Yang, S., Yuan, C., Rong, Y., Steinbauer, F., Kasneci, G.: P-ta: Using proximal policy optimization to enhance tabular data augmentation via large language models. In: Findings of the Association for Computational Linguistics: ACL 2024, pp. 248–264 (2024)
[25] Seedat, N., Huynh, N., Breugel, B., Schaar, M.: Curated LLM: Synergy of LLMs and data curation for tabular augmentation in low-data regimes. In: Proceedings of the 41st International Conference on Machine Learning. Proceedings of Machine Learning Research, vol. 235, pp. 44060–44092 (2024). https://proceedings.mlr.press/v235/seedat24a.html
[26] Kim, J., Kim, T., Choo, J.: Epic: Effective prompting for imbalanced-class data synthesis in tabular data classification via large language models. In: Advances in Neural Information Processing Systems, vol. 37, pp. 31504–31542 (2024)
[27] Ward, J., Gu, B., Wang, C.-H., Cheng, G.: When tables leak: Attacking string memorization in llm-based tabular data generation. arXiv preprint arXiv:2512.08875 (2025)
[28] Carlini, N., Tramer, F., Wallace, E., Jagielski, M., Herbert-Voss, A., Lee, K., Roberts, A., Brown, T., Song, D., Erlingsson, U., et al.: Extracting training data from large language models. In: 30th USENIX Security Symposium (USENIX Security 21), pp. 2633–2650 (2021)
[29] Breiman, L., Friedman, J.H., Olshen, R.A., Stone, C.J.: Classification and Regression Trees. Wadsworth International Group, Belmont, CA (1984)
[30] Grinsztajn, L., Oyallon, E., Varoquaux, G.: Why do tree-based models still outperform deep learning on typical tabular data? In: Advances in Neural Information Processing Systems, vol. 35, pp. 507–520 (2022)
[31] Xu, L., Skoularidou, M., Cuesta-Infante, A., Veeramachaneni, K.: Modeling tabular data using Conditional GAN. In: Advances in Neural Information Processing Systems, vol. 32 (2019)
[32] Kotelnikov, A., Baranchuk, D., Rubachev, I., Babenko, A.: TabDDPM: Modelling tabular data with diffusion models. In: International Conference on Machine Learning, pp. 17564–17579 (2023). PMLR
[33] Shi, J., Xu, M., Hua, H., Zhang, H., Ermon, S., Leskovec, J.: TabDiff: a mixed-type diffusion model for tabular data generation. In: The Thirteenth International Conference on Learning Representations (2025). https://openreview.net/forum?id=swvURjrt8z
[34] Zhang, H., Zhang, J., Srinivasan, B., Shen, Z., Qin, X., Faloutsos, C., Rangwala, H., Karypis, G.: Mixed-type tabular data synthesis with score-based diffusion in latent space. In: The Twelfth International Conference on Learning Representations (2024)
[35] Watson, D.S., Blesch, K., Kapar, J., Wright, M.N.: Adversarial random forests for density estimation and generative modeling. In: International Conference on Artificial Intelligence and Statistics, pp. 5357–5375 (2023). PMLR
[36] Bravo, J.: NRGBoost: Energy-based generative boosted trees. In: The Thirteenth International Conference on Learning Representations (2025). https://openreview.net/forum?id=wQHyjlZ1SH
[37] Freund, Y., Schapire, R.E.: A decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences 55(1), 119–139 (1997)
[38] Breiman, L.: Random forests. Machine Learning 45(1), 5–32 (2001)
[39] Chen, T., Guestrin, C.: XGBoost: A scalable tree boosting system. In: Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 785–794 (2016)
[40] Ganev, G., Nazari, M., Davison, R., Dizche, A.F., Wu, X., Abbey, R., Silva, J.G., Cristofaro, E.D.: SMOTE and mirrors: Exposing privacy leakage from synthetic minority oversampling. In: The Fourteenth International Conference on Learning Representations (2026). https://openreview.net/forum?id=ZQSZMpsQKj
[41] Goldsmith, S.F., Aiken, A.S., Wilkerson, D.S.: Measuring empirical computational complexity. In: Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on The Foundations of Software Engineering, pp. 395–404 (2007)
[42] Becker, B., Kohavi, R.: Adult. UCI Machine Learning Repository (1996). https://doi.org/10.24432/C5XW20
[43] Lubicz, M., Pawelczyk, K., Rzechonek, A., Kolodziej, J.: Thoracic Surgery Data. UCI Machine Learning Repository (2014). https://doi.org/10.24432/C5Z60N
[44] Madaan, A., Tandon, N., Gupta, P., Hallinan, S., Gao, L., Wiegreffe, S., Alon, U., Dziri, N., Prabhumoye, S., Yang, Y., Gupta, S., Majumder, B.P., Hermann, K., Welleck, S., Yazdanbakhsh, A., Clark, P.: Self-refine: Iterative refinement with self-feedback. In: Advances in Neural Information Processing Systems, vol. 36, pp. 46534–46594 (2023)
[45] Shinn, N., Cassano, F., Gopinath, A., Narasimhan, K., Yao, S.: Reflexion: Language agents with verbal reinforcement learning. In: Advances in Neural Information Processing Systems, vol. 36, pp. 8634–8652 (2023)
[46] Yao, S., Yu, D., Zhao, J., Shafran, I., Griffiths, T., Cao, Y., Narasimhan, K.: Tree of thoughts: Deliberate problem solving with large language models. In: Advances in Neural Information Processing Systems, vol. 36, pp. 11809–11822 (2023)
[47] Yao, S., Zhao, J., Yu, D., Du, N., Shafran, I., Narasimhan, K.R., Cao, Y.: ReAct: Synergizing reasoning and acting in language models. In: The Eleventh International Conference on Learning Representations (2023)
[48] Lightman, H., Kosaraju, V., Burda, Y., Edwards, H., Baker, B., Lee, T., Leike, J., Schulman, J., Sutskever, I., Cobbe, K.: Let's verify step by step. In: The Twelfth International Conference on Learning Representations (2024). https://openreview.net/forum?id=v8L0pN6EOi
[49] Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W.-t., Rocktäschel, T., Riedel, S., Kiela, D.: Retrieval-augmented generation for knowledge-intensive NLP tasks. In: Advances in Neural Information Processing Systems, vol. 33, pp. 9459–9474 (2020)
[50] Veličković, P., Cucurull, G., Casanova, A., Romero, A., Liò, P., Bengio, Y.: Graph attention networks. In: International Conference on Learning Representations (2018). https://openreview.net/forum?id=rJXMpiKCZ
[51] Comanici, G., Bieber, E., Schaekermann, M., Pasupat, I., Sachdeva, N., Dhillon, I., Blistein, M., Ram, O., Zhang, D., Rosen, E., et al.: Gemini 2.5: Pushing the frontier with advanced reasoning, multimodality, long context, and next generation agentic capabilities. arXiv preprint arXiv:2507.06261 (2025)
[52] Patki, N., Wedge, R., Veeramachaneni, K.: The synthetic data vault. In: IEEE International Conference on Data Science and Advanced Analytics (DSAA), pp. 399–410 (2016). https://doi.org/10.1109/DSAA.2016.49
[53] Qian, Z., Davis, R., van der Schaar, M.: Synthcity: A benchmark framework for diverse use cases of tabular synthetic data. In: Advances in Neural Information Processing Systems, vol. 36, pp. 3173–3188 (2023). https://doi.org/10.52202/075280-0140
[54] DataCebo, Inc.: Synthetic Data Metrics. (2023). Version 0.9.3. https://docs.sdv.dev/sdmetrics/
[55] Zeng, A., Lv, X., Hou, Z., Du, Z., Zheng, Q., Chen, B., Yin, D., Ge, C., Huang, C., Xie, C., et al.: Glm-5: from vibe coding to agentic engineering. arXiv preprint arXiv:2602.15763 (2026)
[56] Qwen Team: Qwen3-Max: Just Scale it (2025)
Supplement
Supplement Content
A Details of experimental setups 19 A.1 Statistics of the evaluated datasets 19 A.2 Implementation details 19 A.3 Evaluation metrics 20
B Detailed results 22 B.1 Statistical fidelity results 22 B.2 Downstream predictive results 22 B.3 DCR results 22 B.4 δ-presence results 22
C Visualization of tree-derived variable dependence 29
D Prompt and generated strategy for the Adult dataset 29 D.1 Original prompt provided to the LLM 29 D.2 LLM-generated analysis and synthesis strategy 33
E Ablation results 36 E.1 Contribution of feature-dependence extraction 36 E.2 Effect of dependence information encoding 36 E.3 Contribution of prompt guidance 36 E.4 Sensitivity to different LLM backbones 37 E.5 Sensitivity to LLM query budget 37
F Detailed runtime of different algorithms on various datasets 39
G Case study of failure modes 39
H Detailed predictive results for clinical data augmentation 40
I Tailored data synthesis strategies 40
A Details of experimental setups
A.1 Statistics of the evaluated datasets
We evaluate our method on 13 real-world tabular datasets spanning classification and regression tasks, small-sample settings, and high-dimensional feature spaces. These datasets contain between 4 and 450 features and between 174 and 53,940 samples. Each dataset is divided into training and test sets for downstream machine-learning evaluation. For the Adult dataset, we adopt the official train-test split. For the Thoracic dataset, we use a fixed split of 270 training samples and 200 test samples for the augmentation experiments. The remaining datasets are partitioned using either a 9:1 or 7:3 train-test ratio with a fixed random seed. To evaluate the applicability of our method to high-dimensional data, we additionally apply the greedy set-cover procedure in Algorithm 1 to the two highest-dimensional datasets, DNA and DARWIN, selecting a compact subset of trees that maximizes variable coverage while controlling prompt length. This procedure retains 19 and 54 trees in total, respectively, including the label tree. Dataset statistics are summarized in Supplementary Table 1.
Supplementary Table 1 Statistics of the evaluated datasets. Dataset names are hyperlinked to their public sources. Num and Cat denote the numbers of numerical and categorical predictor features, respectively. Imb. denotes the majority-to-minority class ratio in the training set.
| Dataset | Domain | Source | Samples | Num | Cat | Train | Test | Task | Imb. |
|---|---|---|---|---|---|---|---|---|---|
| Adult | Social Sci. | UCI | 48842 | 6 | 8 | 32561 | 16281 | Classification | 3.153 |
| Default | Finance | UCI | 30000 | 14 | 9 | 27000 | 3000 | Classification | 3.523 |
| Magic | Physics | UCI | 19019 | 10 | 0 | 17117 | 1902 | Classification | 1.847 |
| Diamonds | Commerce | OpenML | 53940 | 8 | 3 | 48546 | 5394 | Regression | – |
| Blood | Medicine | UCI | 748 | 4 | 0 | 523 | 225 | Classification | 3.023 |
| Car | Decision | UCI | 1728 | 0 | 6 | 1209 | 519 | Classification | 19.409 |
| Heart | Medicine | UCI | 270 | 5 | 8 | 189 | 81 | Classification | 1.305 |
| Liver | Medicine | OpenML | 345 | 5 | 0 | 241 | 104 | Regression | – |
| SpeedDating | Social Sci. | OpenML | 8378 | 53 | 61 | 7540 | 838 | Classification | 5.081 |
| Jasmine | Life Sci. | OpenML | 2984 | 8 | 136 | 2685 | 299 | Classification | 1.008 |
| DNA | Biology | OpenML | 3186 | 0 | 180 | 2230 | 956 | Classification | 2.222 |
| DARWIN | Medicine | UCI | 174 | 450 | 0 | 121 | 53 | Classification | 1.051 |
| Thoracic | Medical | UCI | 470 | 3 | 13 | 270 | 200 | Classification | 5.585 |
A.2 Implementation details
For each dataset, we fit all synthesis methods exclusively on the real training split and use each method to generate a synthetic table with the same number of rows as the training split. All methods are evaluated under the same train-test partition and downstream evaluation protocol. Downstream utility is evaluated using the train-on-synthetic, test-on-real protocol with AdaBoost [37], Random Forest [38], and XGBoost [39] as downstream predictors; the reported utility score is the average normalized performance across these models. The reported results are averaged over 20 randomly sampled synthetic data following TABSYN [34]. No information from the held-out test set is used for synthetic-data synthesis, candidate-strategy selection, or hyperparameter selection.
In the main experiments, we use Gemini-2.5-Pro [51] as the LLM backbone. For each dataset, the LLM is queried ten times to generate candidate Python-based synthesis strategies. Sensitivity to the number of LLM queries is analysed in Supplementary Fig. 2. Each candidate strategy is required to follow a unified executable interface, taking the local training table and the target sample size as inputs and saving the generated synthetic table to disk. Candidates that fail to execute, violate the required interface, or produce invalid output tables are discarded before strategy selection. The final strategy is selected using statistics computed only from the real training split, including statistical fidelity, empirical privacy-related risk, and computational efficiency. The held-out test set is used only for final evaluation.
Our framework first extracts dependence information from the original training data using chained trees and then provides only the encoded dependence summaries to the LLM. The original records are used locally for dependence extraction, candidate-strategy execution, and evaluation, but are not transmitted to the LLM during strategy generation. This design separates strategy-level reasoning from record-level data exposure while allowing the generated executable strategy to operate locally on the training data.
The baseline methods include (1) Conditional Tabular Generative Adversarial Network (CTGAN) [31], which uses conditional generation and mode-specific normalization to model multimodal variables, (2) TVAE [31], which learns a probabilistic latent representation of mixed-type tabular data using a variational autoencoder, (3) Generation of Realistic Tabular Data (GReaT) [23], which serializes table rows as text and generates synthetic records autoregressively using a fine-tuned LLM, (4) diffusion-based methods, which generate mixed-type tabular data by progressively corrupting real samples and learning to reverse the resulting diffusion process, including Tabular Denoising Diffusion Probabilistic Model (TabDDPM) [32], TabDiff [33], and TABSYN [34], (5) Adversarial Random Forests (ARF) [35], a tree-based model that iteratively trains random forests to distinguish real from synthetic records and samples from the resulting leaf-wise distributions, and (6) NRGBoost [36], an energy-based generative model that learns a generative energy function through boosted regression trees and samples from the resulting distribution. In addition to the tabular generative models, we include the Synthetic Minority Oversampling Technique (SMOTE) [7] as a baseline due to its strong performance on synthetic data fidelity. However, SMOTE relies on interpolation between neighbouring records and duplicates specific local geometries. Real records may be reconstructed from synthetic samples [40], incurring severe privacy vulnerabilities that hinder SMOTE's applicability to secure data-sharing contexts. By benchmarking against SMOTE, we demonstrate that TabSSD achieves competitive synthetic data fidelity and predictive utility but provides a more viable solution for privacy-preserving data synthesis. ARF, TabDiff, and NRGBoost are implemented using their official codebases with the recommended experimental configurations. TABSYN, TabDDPM, and GReaT are implemented using the code and configurations released by the TABSYN authors, whereas CTGAN and TVAE are implemented using the SDV library with its default configurations [52]. Unless otherwise specified, we follow the default or recommended configurations of the corresponding implementations and use the same train-test splits and evaluation protocol for all methods. All experiments are conducted on a workstation equipped with two NVIDIA RTX 4090 GPUs and two Intel Xeon Gold 6430 CPUs. While TABSYN, TabDDPM, GReaT, TabDiff, CTGAN, and TVAE relied on GPU acceleration, our method, TabSSD, required no GPU, demonstrating substantially lower hardware requirements and greater accessibility.
A.3 Evaluation metrics
A.3.1 Distance to closest record (DCR)
Following the DCR evaluation protocol adopted by TABSYN [34], we assess whether synthetic records exhibit excessive proximity to real training records. For each synthetic record, we compare its nearest-neighbour distances to the training and test sets and compute the proportion for which the nearest real neighbour belongs to the training set:
Because this proportion is affected by unequal train-test split sizes, we centre it relative to the split-induced null expectation. Under the null hypothesis of no preferential proximity to the training data, exchangeability implies that the nearest real neighbour belongs to the training set with probability . We therefore define
The positive-part operation ensures that only proximity exceeding the split-induced expectation contributes to the risk score; values at or below this expectation are assigned a score of zero. Throughout this paper, adjusted DCR refers to this split-ratio-adjusted score. Lower values indicate less excessive proximity to training records and therefore lower potential memorization risk.
A.3.2 -presence
We further use -presence to evaluate the re-identification risk of the generated synthetic data. Unlike DCR, which measures whether synthetic records are excessively close to real training records, -presence characterizes the worst-case imbalance between real and synthetic records across cluster-based partitions. In our experiments, -presence is computed following the implementation in SynthCity version 0.2.12 [53]. Specifically, -means clustering models are fitted to the real training data using the full encoded feature space, and synthetic records are then assigned to the learned clusters using the same clustering models.
Let denote the clustering function learned from using clusters. For the -th cluster, the numbers of real and synthetic records assigned to the same partition are defined as
(7) and
For each cluster represented in both the real and synthetic datasets, the cluster-wise -presence score is computed as
where is a small constant used for numerical stability. Following the SynthCity implementation, we evaluate multiple partition granularities with and skip a clustering setting when the average number of real records per cluster is smaller than 10, i.e., .
The final -presence score is defined as the maximum cluster-wise ratio over all retained clustering granularities and clusters represented in both datasets:
A larger -presence value indicates a larger worst-case real-to-synthetic cluster-count ratio, meaning that at least one partition contains relatively many real records compared with synthetic records. Accordingly, in our privacy evaluation, a lower -presence value is regarded as preferable.
A.3.3 Downstream utility
For downstream utility, we adopt the train-on-synthetic, test-on-real protocol. Predictive models are trained on synthetic data and evaluated on the real test set, and their results are compared with those of the same models trained on real data. We use AdaBoost [37], Random Forest [38], and XGBoost [39] as downstream predictors and average their results. Specifically, the utility score is computed as
where and denote the averaged results obtained by training on synthetic data, while and denote the corresponding averaged results obtained by training on real data. Because higher AUROC and lower RMSE indicate better predictive performance, a utility value closer to 1 indicates that training on synthetic data achieves performance closer to training on real data.
A.3.4 Marginal distribution error and pairwise correlation error
Following TABSYN [34], we evaluate the statistical fidelity of the generated synthetic data using marginal distribution error and pairwise correlation error.
Marginal distribution error assesses whether the marginal distribution of each individual variable is preserved in the synthetic data. For numerical variables, distributional similarity is evaluated using the Kolmogorov–Smirnov statistic, whereas for categorical variables, total variation distance is used to compare category-frequency distributions.
Pairwise correlation error assesses whether relationships between variable pairs are preserved. For numerical variable pairs, similarity is evaluated by comparing the Pearson correlation coefficients computed from the real and synthetic data. For categorical variable pairs, contingency similarity is used to compare their joint-frequency distributions. For mixed-type variable pairs, the numerical variable is first discretized into bins, after which contingency similarity is computed.
In our experiments, these metrics are computed using the single-table Quality Report in SDMetrics version 0.9.3 [54]. The marginal distribution error is defined as one minus the Column Shapes score, and the pairwise correlation error is defined as one minus the Column Pair Trends score. The Column Shapes score averages KSComplement scores for numerical variables and TVComplement scores for categorical variables, whereas the Column Pair Trends score averages CorrelationSimilarity scores for numerical–numerical pairs and ContingencySimilarity scores for categorical–categorical and mixed-type pairs.
A.3.5 -precision
We use -precision to evaluate the sample-level fidelity of the generated synthetic data. Unlike the marginal distribution estimation and pairwise correlation estimation metrics, which focus on marginal distributions and inter-feature relationships, -precision evaluates whether synthetic samples lie within real-data regions defined by quantile radii around the real-data centre. Following the implementation in SynthCity version 0.2.12 [53], we compute the naive -precision score, where real and synthetic data are first normalized using a scaler fitted on the real data, and the centre of the normalized real data is used as the reference point. The metric compares the empirical -precision curve with the ideal curve across different quantile radii. A higher -precision value indicates closer agreement between the empirical and ideal curves and therefore better sample-level fidelity to the real data distribution.
B Detailed results
B.1 Statistical fidelity results
Dataset-level statistical fidelity results are reported for marginal distribution error (Supplementary Table 2), pairwise correlation error (Supplementary Table 3), and -precision (Supplementary Table 4), capturing complementary aspects of marginal, inter-variable, and distributional fidelity.
B.2 Downstream predictive results
Dataset-level downstream predictive performance is reported in Supplementary Table 5, comparing models trained on synthetic data with the corresponding real-data reference performance. Classification datasets report mean AUROC, whereas the regression datasets (Diamonds and Liver) report mean RMSE. Results are averaged across AdaBoost, Random Forest, and XGBoost.
B.3 DCR results
Dataset-level DCR results are reported in Supplementary Table 6, together with the corresponding train-set proportions used as references for assessing empirical memorization risk.
B.4 -presence results
Dataset-level -presence results are reported in Supplementary Table 7, providing an empirical assessment of re-identification risk across datasets and synthesis methods.
Supplementary Table 2 Dataset-level marginal distribution errors (%). Results are reported as mean ± s.d. across 20 runs. Lower values are better; dashes indicate unavailable results. The average row reports the mean of the dataset-level mean errors.
| Dataset | SMOTE | ARF | NRGBoost | TVAE | CTCAN | TABSYN | TabDDPM | TabDiff | GReaT | TabSSD |
|---|---|---|---|---|---|---|---|---|---|---|
| Adult | 1.57±0.030 | 4.99±0.000 | 1.80±0.001 | 8.05±0.000 | 8.87±0.040 | 2.17±0.056 | 1.18±0.044 | 0.64±0.047 | 12.74±0.079 | 5.44±0.001 |
| Blood | 5.57±0.929 | 6.37±0.006 | 8.04±0.008 | 12.28±0.000 | 19.27±0.251 | 5.52±0.554 | 5.34±0.747 | 5.83±0.701 | 10.67±1.246 | 3.32±0.005 |
| Car | 1.57±0.267 | 1.58±0.003 | 2.00±0.005 | 3.85±0.000 | 15.84±0.224 | 1.99±0.402 | 1.70±0.379 | 1.73±0.312 | 3.15±0.428 | 1.68±0.004 |
| Default | 1.56±0.089 | 4.80±0.000 | 3.92±0.001 | 9.29±0.000 | 7.48±0.025 | 1.08±0.057 | 1.50±0.089 | 1.23±0.101 | 20.17±0.124 | 1.00±0.001 |
| Diamonds | 1.57±0.058 | 1.82±0.001 | 5.61±0.001 | 8.61±0.000 | 5.18±0.033 | 3.19±0.097 | 0.93±0.086 | 0.72±0.096 | 4.88±0.082 | 3.79±0.000 |
| Heart | 5.40±0.448 | 5.78±0.006 | 5.87±0.009 | 11.90±0.000 | 20.23±0.355 | 6.65±0.565 | 5.03±0.530 | 5.70±0.836 | 11.42±0.599 | 6.08±0.007 |
| Jasmine | 1.38±0.065 | 0.97±0.001 | 3.09±0.002 | 6.77±0.000 | 11.15±0.027 | 3.57±0.052 | 28.16±0.270 | 0.82±0.079 | — | 0.48±0.000 |
| Liver | 7.56±0.764 | 10.55±0.009 | 7.44±0.013 | 12.17±0.000 | 19.43±0.293 | 9.14±0.715 | 7.60±0.727 | 8.61±0.655 | 13.60±0.910 | 9.20±0.000 |
| Magic | 0.93±0.070 | 2.67±0.001 | 2.37±0.002 | 8.71±0.000 | 8.14±0.055 | 0.90±0.102 | 0.99±0.109 | 0.83±0.095 | 15.07±0.097 | 3.09±0.000 |
| SpeedDating | 1.82±0.075 | 6.09±0.001 | 12.59±0.000 | 12.84±0.000 | 10.04±0.036 | 12.73±0.047 | 53.09±0.118 | 5.86±0.101 | — | 1.11±0.000 |
| DNA | 1.41±0.001 | 0.73±0.000 | 0.86±0.000 | 13.15±0.000 | 11.58±0.000 | 8.09±0.001 | 0.87±0.001 | 2.12±0.069 | — | 0.76±0.000 |
| DARWIN | 11.43±0.004 | 14.75±0.002 | 14.60±0.003 | 21.06±0.000 | 46.19±0.001 | 19.42±0.003 | 52.53±0.001 | 10.85±0.204 | — | 9.67±0.002 |
| Average | 3.48 | 5.09 | 5.68 | 10.72 | 15.28 | 6.20 | 13.24 | 3.74 | 11.46 | 3.80 |
Supplementary Table 3 Dataset-level pairwise correlation errors (%). Results are reported as mean ± s.d. across 20 runs. Lower values are better; dashes indicate unavailable results. The average row reports the mean of the dataset-level mean errors.
| Dataset | SMOTE | ARF | NRGBoost | TVAE | CTGAN | TABSYN | TabDDPM | TabDiff | GReaT | TabSSD |
|---|---|---|---|---|---|---|---|---|---|---|
| Adult | 2.78±0.041 | 7.79±0.000 | 2.92±0.001 | 10.01±0.000 | 13.88±0.044 | 3.83±0.065 | 2.35±0.055 | 1.47±0.056 | 18.00±0.097 | 3.53±0.000 |
| Blood | 2.83±0.546 | 4.65±0.006 | 8.25±0.006 | 10.35±0.000 | 13.35±0.272 | 3.65±0.368 | 3.46±0.541 | 40.86±0.322 | 6.58±0.624 | 2.68±0.004 |
| Car | 3.70±0.313 | 3.68±0.003 | 3.95±0.005 | 6.94±0.000 | 26.25±0.242 | 4.12±0.401 | 3.75±0.427 | 4.15±0.315 | 6.10±0.503 | 3.99±0.004 |
| Default | 1.68±0.079 | 4.58±0.001 | 5.00±0.001 | 9.68±0.000 | 5.34±0.031 | 1.17±0.046 | 5.92±0.184 | 1.38±0.101 | 14.40±0.244 | 5.09±0.001 |
| Diamonds | 0.77±0.050 | 1.09±0.000 | 5.09±0.001 | 9.25±0.000 | 7.70±0.030 | 2.89±0.063 | 2.93±0.174 | 1.04±0.053 | 6.15±0.067 | 2.11±0.000 |
| Heart | 10.53±0.660 | 12.21±0.006 | 10.81±0.010 | 15.87±0.000 | 26.55±0.375 | 12.65±0.710 | 8.91±0.638 | 11.88±0.845 | 19.20±0.626 | 11.11±0.006 |
| Jasmine | 2.05±0.102 | 1.99±0.001 | 5.06±0.003 | 11.44±0.000 | 16.89±0.041 | 5.83±0.089 | 44.64±0.406 | 1.49±0.123 | - | 0.96±0.000 |
| Liver | 3.25±0.809 | 3.98±0.008 | 4.21±0.013 | 5.77±0.000 | 8.27±0.579 | 3.57±0.774 | 2.76±0.701 | 2.98±0.631 | 7.54±0.940 | 3.49±0.000 |
| Magic | 0.90±0.095 | 1.36±0.001 | 1.10±0.001 | 4.45±0.000 | 6.82±0.059 | 0.61±0.088 | 0.75±0.082 | 0.63±0.085 | 7.20±0.116 | 0.98±0.000 |
| SpeedDating | 2.92±0.084 | 9.02±0.000 | 10.42±0.000 | 15.45±0.000 | 11.02±0.030 | 19.08±0.057 | 64.17±0.053 | 8.22±0.119 | - | 5.07±0.000 |
| DNA | 2.37±0.001 | 1.61±0.000 | 1.59±0.001 | 25.67±0.000 | 18.50±0.000 | 12.60±0.001 | 13.77±0.001 | 3.43±0.099 | - | 1.75±0.000 |
| DARWIN | 4.16±0.003 | 6.20±0.001 | 7.13±0.000 | 5.91±0.000 | 16.09±0.001 | 6.57±0.001 | 7.84±0.000 | 5.70±0.115 | - | 5.91±0.001 |
| Average | 3.16 | 4.85 | 5.46 | 10.89 | 14.22 | 6.38 | 13.44 | 6.94 | 10.65 | 3.89 |
Supplementary Table 4 Dataset-level o-precision scores. Results are reported as mean ± s.d. across 20 runs. Higher values indicate better statistical fidelity; dashes indicate unavailable results. The average row reports the mean of the dataset-level mean scores.
| Dataset | SMOTE | ARF | NRGBoost | TVAE | CTGAN | TABSYN | TabDDPM | TabDiff | GReaT | TabSSID |
|---|---|---|---|---|---|---|---|---|---|---|
| Adult | 0.9307±0.002 | 0.9917±0.002 | 0.9514±0.003 | 0.9777±0.000 | 0.7666±0.002 | 0.9791±0.002 | 0.9529±0.003 | 0.9914±0.002 | 0.5443±0.001 | 0.9944±0.002 |
| Blood | 0.9706±0.009 | 0.9683±0.010 | 0.9105±0.020 | 0.8857±0.000 | 0.7663±0.005 | 0.9638±0.010 | 0.9642±0.012 | 0.1718±0.008 | 0.9413±0.015 | 0.9627±0.011 |
| Car | 0.9860±0.006 | 0.9808±0.006 | 0.9688±0.019 | 0.9751±0.000 | 0.9319±0.005 | 0.9825±0.008 | 0.9826±0.006 | 0.9825±0.007 | 0.9603±0.014 | 0.9848±0.005 |
| Default | 0.9790±0.003 | 0.9427±0.002 | 0.9406±0.003 | 0.8576±0.000 | 0.9179±0.001 | 0.9885±0.002 | 0.9893±0.002 | 0.9872±0.003 | 0.8611±0.002 | 0.9790±0.001 |
| Diamonds | 0.9954±0.002 | 0.9962±0.002 | 0.9553±0.001 | 0.9442±0.000 | 0.8667±0.002 | 0.9743±0.003 | 0.9956±0.002 | 0.9964±0.001 | 0.8522±0.003 | 0.9957±0.001 |
| Heart | 0.9042±0.036 | 0.9527±0.016 | 0.9462±0.020 | 0.7023±0.000 | 0.8516±0.018 | 0.8934±0.033 | 0.9340±0.029 | 0.9504±0.021 | 0.6085±0.032 | 0.9442±0.021 |
| Jasmine | 0.8616±0.009 | 0.9403±0.007 | 0.7595±0.012 | 0.4716±0.000 | 0.7703±0.003 | 0.7499±0.010 | 0.2855±0.012 | 0.9792±0.007 | — | 0.9391±0.007 |
| Liver | 0.8878±0.032 | 0.8791±0.036 | 0.9071±0.031 | 0.7834±0.000 | 0.7473±0.012 | 0.9404±0.019 | 0.9646±0.011 | 0.9386±0.017 | 0.6761±0.028 | 0.9659±0.000 |
| Magic | 0.9814±0.003 | 0.9865±0.002 | 0.9916±0.002 | 0.8365±0.000 | 0.8547±0.001 | 0.9918±0.003 | 0.9827±0.004 | 0.9941±0.002 | 0.8610±0.005 | 0.9925±0.000 |
| SpeedDating | 0.9391±0.006 | 0.9323±0.003 | 0.8807±0.004 | 0.7526±0.000 | 0.9683±0.003 | 0.6902±0.006 | 0.0832±0.001 | 0.7229±0.007 | — | 0.8948±0.002 |
| DNA | 0.8145±0.014 | 0.9669±0.009 | 0.8654±0.007 | 0.0771±0.000 | 0.6164±0.004 | 0.3043±0.007 | 0.9491±0.011 | 0.6674±0.012 | — | 0.9550±0.009 |
| DARWIN | 0.5071±0.050 | 0.6772±0.018 | 0.1892±0.004 | 0.0000±0.000 | 0.0000±0.000 | 0.0002±0.000 | 0.0000±0.000 | 0.2002±0.016 | — | 0.6623±0.019 |
| Average | 0.8964 | 0.9346 | 0.8555 | 0.6887 | 0.7548 | 0.7882 | 0.7570 | 0.7985 | 0.7881 | 0.9392 |
Supplementary Table 5 Dataset-level downstream predictive performance. Real denotes the reference performance obtained by training on real data. Classification datasets report mean AUROC, whereas the regression datasets (Diamonds and Liver) report mean RMSE. Results are averaged across AdaBoost, Random Forest, and XGBoost. Synthetic-data results are reported as mean ± s.d. across 20 runs. Higher AUROC and lower RMSE indicate better performance; dashes indicate unavailable results.
| Dataset | Real | SMOTE | ARF | NRGBoost | TVAE | CTGAN | TABSYN | TabDDPM | TabDiff | GReaT | TabSSD |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Adult | 0.9209 | 0.9003±0.001 | 0.9065±0.001 | 0.9112±0.001 | 0.8889±0.000 | 0.8767±0.004 | 0.9063±0.001 | 0.9100±0.001 | 0.9107±0.001 | 0.9062±0.002 | 0.9001±0.001 |
| Blood | 0.7353 | 0.7026±0.023 | 0.7169±0.045 | 0.5786±0.089 | 0.7935±0.000 | 0.7959±0.017 | 0.7229±0.046 | 0.6860±0.059 | 0.7235±0.032 | 0.6127±0.072 | 0.7036±0.026 |
| Car | 0.9789 | 0.9772±0.006 | 0.9084±0.010 | 0.9790±0.006 | 0.9305±0.000 | 0.7924±0.040 | 0.9637±0.004 | 0.9780±0.007 | 0.8994±0.016 | 0.9521±0.006 | 0.9577±0.004 |
| Default | 0.7717 | 0.7492±0.004 | 0.7514±0.002 | 0.7566±0.002 | 0.7319±0.000 | 0.7278±0.003 | 0.7619±0.002 | 0.7607±0.002 | 0.7617±0.004 | 0.7494±0.004 | 0.7520±0.002 |
| Diamonds | 836.93 | 860.13±0.52 | 1027.78±2.78 | 956.81±7.24 | 1544.25±0.00 | 1521.09±0.47 | 927.47±21.21 | 949.41±0.25 | 891.76±30.39 | 984.00±26.59 | 934.09±5.11 |
| Heart | 0.8498 | 0.8417±0.024 | 0.8022±0.031 | 0.8030±0.031 | 0.8467±0.000 | 0.7910±0.021 | 0.8348±0.025 | 0.8416±0.020 | 0.8409±0.023 | 0.7698±0.038 | 0.8233±0.028 |
| Jasmine | 0.8860 | 0.8704±0.010 | 0.8518±0.009 | 0.8668±0.008 | 0.8556±0.000 | 0.6231±0.047 | 0.8456±0.013 | 0.5185±0.077 | 0.8549±0.009 | — | 0.8622±0.009 |
| Liver | 3.4243 | 3.4096±0.090 | 3.5508±0.102 | 3.5743±0.184 | 3.4199±0.000 | 3.8220±0.009 | 3.3874±0.147 | 3.5228±0.153 | 3.5010±0.186 | 4.1169±0.209 | 3.1812±0.000 |
| Magic | 0.9362 | 0.9320±0.001 | 0.9137±0.002 | 0.9252±0.002 | 0.8934±0.000 | 0.8832±0.002 | 0.9293±0.002 | 0.9256±0.002 | 0.9281±0.002 | 0.9012±0.003 | 0.9206±0.000 |
| SpeedDating | 0.8515 | 0.8357±0.006 | 0.7995±0.012 | 0.5051±0.025 | 0.7640±0.000 | 0.7755±0.011 | 0.8137±0.007 | 0.4952±0.044 | 0.8251±0.006 | — | 0.8010±0.005 |
| DNA | 0.9848 | 0.9847±0.002 | 0.9437±0.008 | 0.9833±0.002 | 0.9655±0.000 | 0.4791±0.020 | 0.9292±0.010 | 0.4965±0.031 | 0.9758±0.003 | — | 0.9623±0.006 |
| DARWIN | 0.9667 | 0.9081±0.035 | 0.8007±0.055 | 0.6241±0.111 | 0.8758±0.000 | 0.4977±0.081 | 0.8470±0.052 | 0.4580±0.071 | 0.8633±0.026 | — | 0.8805±0.022 |
Supplementary Table 6 Dataset-level DCR values. DCR is the proportion of synthetic records closer to the training set than to the held-out test set. Results are reported as mean ± s.d. across 20 runs where available. Values closer to the train-set proportion indicate lower empirical memorization risk; dashes indicate unavailable results.
| Dataset | Train prop. | SMOTE | ARF | NRGBoost | TVAE | CTGAN | TABSYN | TabDDPM | TabDiff | GReaT | TabSSID |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Adult | 0.67 | 0.9438±0.001 | 0.7231±0.003 | 0.7046±0.003 | 0.6685±0.000 | 0.6748±0.002 | 0.6687±0.003 | 0.6798±0.002 | 0.7057±0.003 | 0.6785±0.004 | 0.6715±0.002 |
| Blood | 0.70 | 0.8732±0.011 | 0.7528±0.021 | 0.9444±0.005 | 0.7354±0.000 | 0.7258±0.007 | 0.7342±0.022 | 0.7676±0.014 | 0.7326±0.016 | 0.7569±0.012 | 0.7543±0.017 |
| Car | 0.70 | 0.9972±0.001 | 0.8099±0.012 | 0.9973±0.001 | 0.7438±0.000 | 0.7419±0.009 | 0.7574±0.012 | 0.7644±0.010 | 0.7156±0.015 | 0.7186±0.013 | 0.7090±0.009 |
| Default | 0.90 | 0.9856±0.001 | 0.9073±0.002 | 0.9022±0.002 | 0.8950±0.000 | 0.9009±0.002 | 0.9031±0.002 | 0.9039±0.002 | 0.9158±0.002 | 0.9004±0.002 | 0.9027±0.002 |
| Diamonds | 0.90 | 0.9813±0.001 | 0.9176±0.001 | 0.9047±0.002 | 0.8984±0.000 | 0.9040±0.001 | 0.9013±0.002 | 0.9009±0.001 | 0.9119±0.001 | 0.9040±0.001 | 0.9020±0.001 |
| Heart | 0.70 | 0.9958±0.004 | 0.7616±0.031 | 0.9995±0.002 | 0.8254±0.000 | 0.7561±0.027 | 0.9328±0.017 | 0.9873±0.007 | 0.8651±0.020 | 0.7543±0.021 | 0.7616±0.035 |
| Jasmine | 0.90 | 1.0000±0.000 | 0.9291±0.004 | 0.9200±0.005 | 0.9363±0.000 | 0.9142±0.003 | 0.9125±0.006 | 0.9421±0.004 | 0.9129±0.005 | — | 0.9199±0.006 |
| Liver | 0.70 | 0.9749±0.011 | 0.7562±0.025 | 1.0000±0.000 | 0.7427±0.000 | 0.7114±0.016 | 0.7618±0.028 | 1.0000±0.000 | 0.7205±0.026 | 0.7326±0.036 | 0.7178±0.000 |
| Magic | 0.90 | 0.9945±0.001 | 0.9105±0.002 | 0.9116±0.002 | 0.8964±0.000 | 0.8999±0.002 | 0.9044±0.002 | 0.9052±0.002 | 0.9054±0.002 | 0.9051±0.003 | 0.8993±0.000 |
| SpeedDating | 0.90 | 1.0000±0.000 | 0.9419±0.003 | 0.9056±0.002 | 0.9188±0.000 | 0.9111±0.003 | 0.9082±0.004 | 0.7022±0.004 | 0.9716±0.002 | — | 0.9090±0.003 |
| DNA | 0.70 | 0.9830±0.001 | 0.8537±0.006 | 0.7999±0.010 | 0.9350±0.000 | 0.7985±0.006 | 0.8773±0.007 | 0.7541±0.007 | 0.9533±0.004 | — | 0.7687±0.006 |
| DARWIN | 0.70 | 1.0000±0.000 | 0.6583±0.044 | 0.6215±0.046 | 0.5455±0.000 | 0.6810±0.024 | 0.9256±0.024 | 0.9146±0.024 | 0.5983±0.045 | — | 0.7287±0.050 |
Supplementary Table 7 Dataset-level -presence scores. Results are reported as mean s.d. across 20 runs. Lower values indicate lower empirical re-identification risk; dashes indicate unavailable results. The average row reports the mean of the dataset-level mean scores.
| Dataset | SMOTE | ARF | NRGBoost | TVAE | CTGAN | TABSYN | TabDDPM | TabDiff | GReaT | TabSSD |
|---|---|---|---|---|---|---|---|---|---|---|
| Adult | ||||||||||
| Blood | ||||||||||
| Car | ||||||||||
| Default | ||||||||||
| Diamonds | ||||||||||
| Heart | ||||||||||
| Jasmine | - | |||||||||
| Liver | ||||||||||
| Magic | ||||||||||
| SpeedDating | - | |||||||||
| DNA | - | |||||||||
| DARWIN | - | |||||||||
| Average | 2.7547 | 1.8493 | 2.3679 | 10.0862 | 63.5033 | 4.1047 | 86.1523 | 2.4608 | 19.1134 | 2.3501 |
C Visualization of tree-derived variable dependence
Supplementary Fig. 1 visualizes the raw variable-dependence signals extracted by the chained trees for the Adult dataset. The graph contains overlapping, reciprocal, and cyclic associations and should not be interpreted as a coherent causal structure.

Supplementary Fig. 1 Raw variable-dependence signals extracted by the chained trees for the Adult dataset. Nodes represent the input variables and task label. A directed edge indicates that was selected as a splitting variable by the CART fitted to predict . Because variables can appear in one another's prediction trees, the resulting graph may contain reciprocal, redundant, or cyclic dependence signals. Grey dashed edges denote signals extracted from trees with weak predictive performance, defined as regression trees with or classification trees with accuracy . These edges represent predictive associations rather than causal relationships.
D Prompt and generated strategy for the Adult dataset
This section presents the original prompt and the corresponding LLM-generated synthesis strategy for the Adult dataset. Both are reproduced verbatim to preserve the actual strategy-generation process and may differ from the terminology used in the manuscript.
D.1 Original prompt provided to the LLM
According to the prompt construction described in our framework, the prompt is conceptually composed of:
Here, contains both the feature-wise structural summaries and the complete label tree structure. The component symbols are provided only for explanation and are not inserted into the original prompt text.
Prompt Part I: Task Specification and Evaluation Criteria ()
1 Your task is to generate a tabular data synthesis strategy by inferring the original data's intrinsic characteristics from the provided pre-trained decision trees and feature information. The synthesized data will replace the original data for model training, with the core goal of making the performance of models trained on synthetic data as close as possible to those trained on the original data.
7
Metrics
9 When evaluating synthetic data, typically considering the following metrics:
10
11 1. ML Efficiency:
12 A core metric reflecting synthetic data's support for downstream ML tasks, evaluated via the TSTR (Train on Synthetic, Test on Real) protocol.
13
14
15 2. Fidelity:
16 Measures preservation of raw data statistical properties from two aspects:
17 - Pairwise: Uses DPCM (numerical features), DCSM (categorical features), and contingency similarity matrices (mixed features) to assess feature-pair dependencies.
19
20 - Column-wise: Compares individual features; KST is commonly used for numerical features.
22
23 3. Privacy:
24 Privacy is evaluated using split-ratio-adjusted DCR risk, which measures whether synthetic records exhibit excessive proximity to training records beyond the expected preference induced by the train--test split ratio.
27 A lower adjusted DCR value indicates lower potential memorization risk.
28
29 The synthetic data you generate should perform well on these metrics.
Prompt Part II: Core Requirements for Strategy Generation ()
1 # Core Requirements for Your Strategy
2
3 Multiple decision tree models are provided. The final decision tree takes the original label of the raw data as the prediction target. All preceding decision trees are trained with a single data feature as the target and all other features, excluding the original label, as inputs. Their outputs are restricted to structured summaries, for example:
8
9 {feature_0}: {type:continuous,min:0.0,max:1.0, associated_features: [feature_1,feature_3,feature_89], performance: {R2:0.992,RMSE:0.0379}}
10
11
12
13 The features listed in the associated_features field participate in node splitting in the decision tree trained to predict the corresponding target feature. Their order follows the top-down splitting order of the original tree.
16
17 You need to analyse the underlying feature dependency patterns and distribution characteristics based on the provided decision tree information. You should then construct a routing function to assign each sample to an appropriate subspace. The routing function should reflect your interpretation of the data structure rather than merely reproducing tree rules.
22
23 Within each routed subspace, use suitable model fitting procedures to learn the distribution characteristics of real data and support the generation of high-quality synthetic samples.
26
27 Attention:
28 Decision tree rules are not intended for direct record sampling. They should be analysed to infer feature dependencies and data distribution characteristics.
30 Your output must incorporate this analysis when designing the synthesis procedure.
Prompt Part III: Feature inter-dependency for Adult ()
1
2 {feature_0}: {type:continuous,min:17.0,max:90.0, associated_features: [feature_5, feature_12, feature_7, feature_1, feature_6, feature_4, feature_10], performance: {R2:0.4227, RMSE:10.3665}
{feature_1}: {type: categorical, ordinal_encoding_range: [0,8], class_num:9, associated_features: [feature_6, feature_0, feature_4, feature_12], performance: {accuracy:0.7553}}
{feature_2}: {type: continuous, min:12285.0, max:1484705.0, associated_features: [feature_13, feature_8, feature_0, feature_9, feature_1, feature_6, feature_12], performance: {R2:0.0549, RMSE:102680.6073}}
{feature_3}: {type: categorical, ordinal_encoding_range: [0,15], class_num:16, associated_features: [feature_4], performance: {accuracy:1.0}}
{feature_4}: {type: continuous, min:1.0, max:16.0, associated_features: [feature_3], performance: {R2:1.0, RMSE:0.0}}
{feature_5}: {type: categorical, ordinal_encoding_range: [0,6], class_num:7, associated_features: [feature_7, feature_0, feature_9, feature_4, feature_8, feature_13], performance: {accuracy:0.8419}}
{feature_6}: {type: categorical, ordinal_encoding_range: [0,14], class_num:15, associated_features: [feature_1, feature_4, feature_9, feature_0, feature_12], performance: {accuracy:0.3717}}
{feature_7}: {type: categorical, ordinal_encoding_range: [0,5], class_num:6, associated_features: [feature_5, feature_9, feature_0, feature_12, feature_4, feature_1, feature_13, feature_8], performance: {accuracy:0.7891}}
{feature_8}: {type: categorical, ordinal_encoding_range: [0,4], class_num:5, associated_features: [feature_13, feature_7, feature_12, feature_2, feature_5], performance: {accuracy:0.8752}}
{feature_9}: {type: categorical, ordinal_encoding_range: [0,1], class_num:2, associated_features: [feature_7, feature_6, feature_1, feature_5, feature_12], performance: {accuracy:0.8336}}
{feature_10}: {type: continuous, min:0.0, max:99999.0, associated_features: [feature_4, feature_0, feature_12, feature_11, feature_2, feature_3, feature_8, feature_7, feature_5], performance: {R2:0.1142, RMSE:6927.3273}}
{feature_11}: {type: continuous, min:0.0, max:4356.0, associated_features: [feature_4, feature_7, feature_10, feature_5, feature_2, feature_0, feature_12, feature_3, feature_6], performance: {R2:0.0354, RMSE:394.4608}}
{feature_12}: {type: continuous, min:1.0, max:99.0, associated_features: [feature_0, feature_3, feature_4, feature_9, feature_10, feature_1, feature_7, feature_6], performance: {R2:0.2214, RMSE:10.9254}}
{feature_13}: {type: categorical, ordinal_encoding_range: [0,41], class_num:42, associated_features: [feature_8, feature_2, feature_4, feature_0, feature_1], performance: {accuracy:0.9031}}
Prompt Part IV: Complete Label-Tree Structure ( )
feature_14 (label) (categorical) ordinal encoding range is integers in [0, 1]: accuracy: 0.8545
--- feature_7 <= 0.5 --- feature_4 <= 12.5 --- feature_10 <= 5095.5 --- feature_11 <= 1782.5 --- feature_4 <= 8.5 --- class: 0 [leaf_id:1] Sample Count 1247, Label Ratio {'0': 0.901, '1': 0.099} --- feature_4 > 8.5 --- feature_0 <= 35.5 --- class: 0 [leaf_id:2] Sample Count 2042, Label Ratio {'0': 0.800, '1': 0.200}
--- feature_0 > 35.5 --- feature_12 <= 34.5 --- class: 0 [leaf_id:3] Sample Count 376, Label Ratio {'0': 0.899, '1': 0.101} --- feature_12 > 34.5 --- feature_4 <= 9.5 --- class: 0 [leaf_id:4] Sample Count 2136, Label Ratio {'0': 0.659, '1': 0.341} --- feature_4 > 9.5 --- class: 0 [leaf_id:5] Sample Count 1716, Label Ratio {'0': 0.538, '1': 0.462} --- feature_11 > 1782.5 --- feature_11 <= 1989.5 --- class: 1 [leaf_id:6] Sample Count 209, Label Ratio {'0': 0.053, '1': 0.947} --- feature_11 > 1989.5 --- class: 0 [leaf_id:7] Sample Count 82, Label Ratio {'0': 0.829, '1': 0.171} --- feature_10 > 5095.5 --- class: 1 [leaf_id:8] Sample Count 403, Label Ratio {'0': 0.020, '1': 0.980} --- feature_4 > 12.5 --- feature_10 <= 5095.5 --- feature_11 <= 1782.5 --- feature_12 <= 31.0 --- class: 0 [leaf_id:9] Sample Count 207, Label Ratio {'0': 0.691, '1': 0.309} --- feature_12 > 31.0 --- feature_0 <= 28.5 --- class: 0 [leaf_id:10] Sample Count 149, Label Ratio {'0': 0.624, '1': 0.376} --- feature_0 > 28.5 --- class: 1 [leaf_id:11] Sample Count 2321, Label Ratio {'0': 0.318, '1': 0.682} --- feature_11 > 1782.5 --- class: 1 [leaf_id:12] Sample Count 309, Label Ratio {'0': 0.036, '1': 0.964} --- feature_10 > 5095.5 --- class: 1 [leaf_id:13] Sample Count 533, Label Ratio {'0': 0.004, '1': 0.996} --- feature_7 > 0.5 --- feature_10 <= 7073.5 --- feature_7 <= 4.5 --- feature_4 <= 13.5 --- feature_12 <= 42.5 --- class: 0 [leaf_id:14] Sample Count 11927, Label Ratio {'0': 0.979, '1': 0.021} --- feature_12 > 42.5 --- class: 0 [leaf_id:15] Sample Count 2793, Label Ratio {'0': 0.890, '1': 0.110} --- feature_4 > 13.5 --- feature_12 <= 43.5 --- class: 0 [leaf_id:16] Sample Count 494, Label Ratio {'0': 0.836, '1': 0.164} --- feature_12 > 43.5 --- class: 0 [leaf_id:17] Sample Count 318, Label Ratio {'0': 0.594, '1': 0.406} --- feature_7 > 4.5 --- feature_4 <= 10.5 --- class: 0 [leaf_id:18] Sample Count 784, Label Ratio {'0': 0.684, '1': 0.316} --- feature_4 > 10.5 --- class: 1 [leaf_id:19] Sample Count 503, Label Ratio {'0': 0.364, '1': 0.636} --- feature_10 > 7073.5 --- class: 1 [leaf_id:20] Sample Count 395, Label Ratio {'0': 0.033, '1': 0.967}
Prompt Part V: Output and Implementation Constraints
Output Requirements
Please carefully examine the decision tree rules and adhere to the core requirements.
You must write a complete and executable function to generate samples covering all features. The resulting synthetic data will replace the original dataset.
8 Additional requirements: 9 1. The generated synthetic data must be saved in CSV format. 11 2. Only output the function generate_synthesis_data. 12 3. All library imports and auxiliary functions must be contained within generate_synthesis_data. 14 4. Categorical features must use ordinal encoding and be represented directly as integers rather than strings. 16 5. If probabilities are used, they must sum to 1. 17 6. Generated values must not exceed the predefined feature ranges. 18 7. You may select different distribution-fitting models for different feature types or subspaces, provided that feature dependencies are appropriately considered. 21 22 # Output Format 23 def generate_synthesis_data(save_path: str, n_sample: int, X_train: np.ndarray, y_train: np.ndarray) -> None: import pandas as pd import csv ...
fieldnames = [f"feature_{i}" for i in range(14)] + ["label"] with open(save_path, "w", newline="") as csv_file: writer = csv.DictWriter(csv_file, fieldnames=fieldnames) writer.writeheader() writer.writerows(synthesis_samples)
Prompt Part VI: Reference Analysis Provided to the LLM (poutput)
Reference Analysis
2 An analysis of the provided decision tree rules reveals a complex web of inter-feature dependencies. The goal is to construct a generative process that honors these relationships to produce high-fidelity synthetic data. The strategy is founded on the principle of divide and conquer: partitioning the data space into smaller, more homogeneous subspaces and then modelling the distribution within each subspace.
9
- Feature Dependency Analysis 11 - Hub Features: feature_4, feature_7, and feature_0 appear frequently as splitting variables, indicating that they are central to the data structure. 13 - Strong Co-dependency: feature_3 and feature_4 exhibit a near-deterministic relationship. Once feature_4 is generated, feature_3 can be generated through an explicit mapping. 16 - Cyclic Dependencies: dependencies such as feature_5 relying on feature_7 and feature_7 relying on feature_5 imply that the generation strategy must adopt a practical ordering to break cycles. 19
- Subspace-based Synthesis Strategy 21 - Partition the data using major task-relevant attributes identified from the label tree, especially feature_7 and feature_4. 23 - Fit conditional generative models within each subspace rather than learning one global distribution. 25 - Use probabilistic classification models for categorical attributes. 26 - Use regression models with residual sampling for continuous attributes. 27 - Explicitly preserve the deterministic mapping from feature_4 to feature_3. 28
- Data Generation and Validation 30 - Allocate generated samples according to the empirical sizes of routed subspaces. 31 - Aggregate all generated records into a complete synthetic dataset. 33 - Enforce feature type, range, and encoding constraints before saving the CSV.
D.2 LLM-generated analysis and synthesis strategy
Listing 1 Original LLM output containing the analysis and generated synthesis strategy for the Adult dataset.
To synthesize the data effectively, I will follow a "Divide and Conquer" approach based on the provided decision tree rules.
Analysis of Decision Tree Rules and Feature Dependencies
- Hub Features and Partitioning:**
- Feature 7:** This is the root of the label decision tree. It also appears as a primary split for features 5 and 9. This is the most natural candidate for the primary routing split.
- Feature 4 and Feature 3:** These features have a perfect deterministic relationship (, Accuracy=1). They are essentially two representations of the same information. In the label tree, feature 4 is a critical secondary splitter.
- Feature 10 and Feature 11:** These features show high sparsity (min=0) and appear as important split features in the label tree.
- Dependency Chain:**
- Root Features:** feature 0, feature 9, and feature 13 tend to be independent or act as root nodes.
- Related Features:** feature 4 influences feature 1, feature 6, and feature 12.
- Target:** Label is heavily conditioned on feature 7, feature 4, features 10 and feature 11.
Synthesis Strategy
-
Routing Function:** I will partition the data into 4 major subspaces based on the primary splits of the label tree: feature 7 (<= 0.5 vs > 0.5) and feature 4 (<= 12.5 vs > 12.5). This ensures that the most important decision boundaries for ML Efficiency are preserved.
-
Generative Chain within Subspaces:**
- Step 1:** Fit and sample "Root Features" (feature 7, feature 4, feature 0) using their empirical joint distribution in the subspace.
- Step 2:** Generate feature 3 via a direct mapping from feature 4.
- Step 3:** Generate remaining categorical features (feature 1, feature 5, feature 6, feature 8, feature 9, feature 13) using DecisionTreeClassifier models conditioned on the root features. To maintain fidelity, I will sample from the predicted probability distributions rather than taking the argmax.
- Step 4:** Generate continuous features (feature 2, feature 10, feature 11, feature 12) using DecisionTreeRegressor models. To preserve variance and privacy, I will add sampled residuals from the training data to the model predictions.
- Step 5:** Generate the label using a DecisionTreeClassifier conditioned on all significant predictors identified in the rules.
- Refining Constraints:** I will strictly enforce the min and max values provided in the rules for continuous features and use ordinal_encoding_range for categorical features.
''python
import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor
import csv
def generate_synthesis_data(save_path: str, n_sample: int, X_train: np.ndarray, y_train: np.ndarray) -> None:
# Combine X and y for training modeling
full_data = np.column_stack((X_train, y_train))
feat_cols = [f"feature_{i}" for i in range(14)]
all_cols = feat_cols + ["label"]
df = pd.DataFrame(full_data, columns=all_cols)
# Feature metadata derived from rules
continuous_features = {
'feature_0': (17.0, 90.0),
'feature_2': (12285.0, 1484705.0),
'feature_4': (1.0, 16.0),
'feature_10': (0.0, 99999.0),
'feature_11': (0.0, 4356.0),
'feature_12': (1.0, 99.0)
}
categorical_features = {
'feature_1': 9, 'feature_3': 16, 'feature_5': 7, 'feature_6': 15,
'feature_7': 6, 'feature_8': 5, 'feature_9': 2, 'feature_13': 42,
'label': 2
}
# Define subspaces based on the label decision tree splits
df['subspace'] = 0
df.loc[(df['feature_7'] <= 0.5) & (df['feature_4'] <= 12.5), 'subspace'] = 0
df.loc[(df['feature_7'] <= 0.5) & (df['feature_4'] > 12.5), 'subspace'] = 1
df.loc[(df['feature_7'] > 0.5) & (df['feature_4'] <= 12.5), 'subspace'] = 2
df.loc[(df['feature_7'] > 0.5) & (df['feature_4'] > 12.5), 'subspace'] = 3
subspace_counts = df['subspace'].value_counts(normalize=True)
synthetic_data = []
for sub_id in range(4):
sub_df = df[df['subspace'] == sub_id]
``` if len(sub_df) < 5: continue # Safety for empty subspaces
n_sub_samples = int(n_sample * subspace_counts.get(sub_id, 0))
if n_sub_samples <= 0: continue
# Local Models for this subspace
# Order: 7, 4, 0 -> 3 -> 9, 5 -> 1, 6, 12 -> 10, 11 -> 2, 8, 13 -> label
# 1. Roots: 7, 4, 0 (Sampled directly to maintain core structure)
indices = np.random.choice(sub_df.index, size=n_sub_samples, replace=True)
roots = sub_df.loc[indices, ['feature_7', 'feature_4', 'feature_0']].values
sub_gen = pd.DataFrame(roots, columns=['feature_7', 'feature_4', 'feature_0'])
# 2. Map 3 from 4 (Deterministic rule)
# We learn the most frequent mapping in this subspace
map_3_4 = sub_df.groupby('feature_4')['feature_3'].agg(lambda x: x.value_counts().index[0]).to_dict()
sub_gen['feature_3'] = sub_gen['feature_4'].map(map_3_4).fillna(sub_df['feature_3'].mode() [0])
# 3. Conditional Generators
def fit_sample_cat(target, predictors, current_gen_df):
clf = DecisionTreeClassifier(max_depth=5)
clf.fit(sub_df[predictors], sub_df[target])
probs = clf.predict_proba(current_gen_df[predictors])
# Sample from probabilities
return [np.random.choice(clf.classes_, p=p) for p in probs]
def fit_sample_cont(target, predictors, current_gen_df):
reg = DecisionTreeRegressor(max_depth=5)
reg.fit(sub_df[predictors], sub_df[target])
preds = reg.predict(current_gen_df[predictors])
# Add residuals
residuals = sub_df[target] - reg.predict(sub_df[predictors])
sampled_res = np.random.choice(residuals, size=len(preds), replace=True)
res = preds + sampled_res
# Clip to range
low, high = continuous_features[target]
return np.clip(res, low, high)
# Sequence of generation
sub_gen['feature_9'] = fit_sample_cat('feature_9', ['feature_7', 'feature_0'], sub_gen)
sub_gen['feature_5'] = fit_sample_cat('feature_5', ['feature_7', 'feature_0', 'feature_9'], sub_gen)
sub_gen['feature_1'] = fit_sample_cat('feature_1', ['feature_4', 'feature_0', 'feature_5'], sub_gen)
sub_gen['feature_6'] = fit_sample_cat('feature_6', ['feature_1', 'feature_4', 'feature_9'], sub_gen)
sub_gen['feature_12'] = fit_sample_cont('feature_12', ['feature_0', 'feature_4', 'feature_6'], sub_gen)
sub_gen['feature_10'] = fit_sample_cont('feature_10', ['feature_4', 'feature_0', 'feature_12'], sub_gen)
sub_gen['feature_11'] = fit_sample_cont('feature_11', ['feature_4', 'feature_7', 'feature_10'], sub_gen)
sub_gen['feature_2'] = fit_sample_cont('feature_2', ['feature_0', 'feature_7', 'feature_12'], sub_gen)
sub_gen['feature_8'] = fit_sample_cat('feature_8', ['feature_7', 'feature_9', 'feature_2'], sub_gen)
sub_gen['feature_13'] = fit_sample_cat('feature_13', ['feature_8', 'feature_2', 'feature_0'], sub_gen)
sub_gen['label'] = fit_sample_cat('label', ['feature_7', 'feature_4', 'feature_10', 'feature_11', 'feature_0', 'feature_12'], sub_gen)
synthetic_data.append(sub_gen)
# Combine and shuffle
final_df = pd.concat(synthetic_data).sample(frac=1).reset_index(drop=True)
# Final data type correction
for col in categorical_features:
final_df[col] = final_df[col].astype(int)
# Reorder columns to match fieldnames
final_df = final_df[feat_cols + ["label"]]
# Save to CSV
final_df.to_csv(save_path, index=False)
# E Ablation results
The ablation experiments are conducted on eight datasets for which all evaluated variants can be accommodated within the LLM context window. In particular, the Full Feature Trees variant retains the complete feature-tree structures and therefore produces substantially longer prompts; for the remaining high-dimensional datasets, these prompts exceed the context-window limit. We therefore restrict the ablation analysis to datasets on which all variants can be evaluated under the same experimental protocol, ensuring a consistent and fair comparison. Across the following ablations, we focus on overall performance trends across datasets rather than requiring each design choice to improve every individual metric on every dataset.
## E.1 Contribution of feature-dependence extraction
This section reports detailed ablation results on feature-dependence extraction. We compare the proposed tree-based extraction mechanism with two alternative mechanisms based on linear models and mutual information. To isolate the effect of feature-wise dependence extraction, the complete label tree and all other prompt components are kept unchanged across all variants. Across the evaluated datasets, the chained-tree mechanism provides a stronger overall balance of marginal fidelity, pairwise-dependence preservation, and downstream task performance than the alternative extraction mechanisms, although the relative advantage varies across individual datasets and metrics. Detailed per-dataset results are reported in Supplementary Table 8.
Supplementary Table 8 Ablation results for feature-dependence extraction mechanisms. Values are reported as mean ± s.d. Bold values indicate the best result for each dataset.
<table><tr><td rowspan="2">Dataset</td><td colspan="3">Linear Models</td><td colspan="3">Mutual Information</td><td colspan="3">Chained Trees (Ours)</td></tr><tr><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td></tr><tr><td>Adult</td><td>12.31%±0.000</td><td>9.78%±0.000</td><td>0.903±0.001</td><td>9.93%±0.031</td><td>11.90%±0.000</td><td>0.892±0.002</td><td>5.44%±0.001</td><td>3.53%±0.000</td><td>0.900±0.001</td></tr><tr><td>Blood</td><td>8.64%±0.000</td><td>2.91%±0.000</td><td>0.712±0.000</td><td>8.38%±0.004</td><td>3.21%±0.004</td><td>0.699±0.055</td><td>3.32%±0.005</td><td>2.68%±0.004</td><td>0.704±0.026</td></tr><tr><td>Car</td><td>8.67%±0.003</td><td>17.70%±0.003</td><td>0.969±0.004</td><td>1.64%±0.003</td><td>3.84%±0.003</td><td>0.961±0.006</td><td>1.68%±0.004</td><td>3.99%±0.004</td><td>0.958±0.006</td></tr><tr><td>Default</td><td>10.57%±0.001</td><td>4.74%±0.001</td><td>0.751±0.004</td><td>8.48%±0.000</td><td>5.72%±0.000</td><td>0.735±0.005</td><td>1.00%±0.001</td><td>5.09%±0.001</td><td>0.752±0.002</td></tr><tr><td>Diamonds</td><td>3.50%±0.001</td><td>3.18%±0.000</td><td>1287.506±125.968</td><td>4.29%±0.000</td><td>3.58%±0.000</td><td>1262.624±13.715</td><td>3.79%±0.000</td><td>2.11%±0.000</td><td>934.090±15.111</td></tr><tr><td>Heart</td><td>5.94%±0.004</td><td>11.17%±0.004</td><td>0.783±0.029</td><td>8.42%±0.007</td><td>13.96%±0.008</td><td>0.852±0.019</td><td>6.08%±0.007</td><td>11.11%±0.006</td><td>0.823±0.028</td></tr><tr><td>Liver</td><td>14.94%±0.000</td><td>5.21%±0.000</td><td>3.291±0.000</td><td>11.62%±0.007</td><td>3.15%±0.000</td><td>3.421±0.088</td><td>9.20%±0.000</td><td>3.49%±0.000</td><td>3.181±0.000</td></tr><tr><td>Magic</td><td>3.02%±0.000</td><td>0.98%±0.000</td><td>0.920±0.000</td><td>3.57%±0.000</td><td>1.08%±0.000</td><td>0.918±0.001</td><td>3.09%±0.000</td><td>0.98%±0.000</td><td>0.920±0.000</td></tr></table>
Task<sup>a</sup> is AUROC (↑) for classification and RMSE (↓) for regression. The complete label tree and all other prompt components are retained across all variants.
## E.2 Effect of dependence information encoding
This section examines how the representation and ordering of dependence information affect synthesis performance. We compare the proposed encoding with three variants: retaining the full feature-tree structures, replacing the complete label tree with a compact summary, and randomly shuffling the order of associated features. Overall, the proposed representation provides a favourable balance across the evaluated metrics and datasets, while individual variants can perform better on particular datasets or metrics. These results indicate that compact representation and structured ordering are useful at the aggregate level rather than uniformly improving every individual evaluation measure. The corresponding results are reported in Supplementary Table 9.
Supplementary Table 9 Ablation results for dependence-information representation and ordering. Values are reported as mean ± s.d. Bold values indicate the best result for each dataset.
<table><tr><td rowspan="2">Dataset</td><td colspan="3">Full Feature Trees</td><td colspan="3">Condensed Label Tree</td><td colspan="3">Shuffled Dependence Order</td><td colspan="3">Proposed Representation (Ours)</td></tr><tr><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td></tr><tr><td>Adult</td><td>6.21%±0.000</td><td>4.65%±0.000</td><td>0.897±0.002</td><td>3.14%±0.000</td><td>5.99%±0.000</td><td>0.887±0.003</td><td>9.09%±0.000</td><td>5.53%±0.000</td><td>0.907±0.001</td><td>5.44%±0.001</td><td>3.53%±0.000</td><td>0.900±0.001</td></tr><tr><td>Blood</td><td>3.77%±0.006</td><td>4.02%±0.007</td><td>0.696±0.035</td><td>5.92%±0.006</td><td>3.53%±0.005</td><td>0.636±0.050</td><td>7.99%±0.007</td><td>3.39%±0.003</td><td>0.713±0.033</td><td>3.32%±0.005</td><td>2.68%±0.004</td><td>0.704±0.026</td></tr><tr><td>Car</td><td>4.21%±0.000</td><td>7.37%±0.000</td><td>0.952±0.000</td><td>1.68%±0.000</td><td>4.47%±0.000</td><td>0.943±0.013</td><td>1.29%±0.002</td><td>3.44%±0.002</td><td>0.904±0.000</td><td>1.68%±0.004</td><td>3.99%±0.004</td><td>0.958±0.006</td></tr><tr><td>Default</td><td>9.25%±0.001</td><td>5.48%±0.001</td><td>0.756±0.003</td><td>11.78%±0.000</td><td>9.54%±0.000</td><td>0.730±0.000</td><td>9.95%±0.000</td><td>7.37%±0.000</td><td>0.750±0.000</td><td>1.00%±0.001</td><td>5.09%±0.001</td><td>0.752±0.002</td></tr><tr><td>Diamonds</td><td>1.40%±0.000</td><td>2.18%±0.000</td><td>1419.174±5.703</td><td>3.92%±0.000</td><td>2.31%±0.000</td><td>1477.964±13.969</td><td>2.36%±0.000</td><td>2.46%±0.000</td><td>1408.246±5.114</td><td>3.79%±0.000</td><td>2.11%±0.000</td><td>934.090±15.111</td></tr><tr><td>Heart</td><td>5.46%±0.004</td><td>10.76%±0.004</td><td>0.845±0.016</td><td>5.67%±0.005</td><td>10.77%±0.004</td><td>0.853±0.013</td><td>5.42%±0.004</td><td>10.08%±0.004</td><td>0.837±0.033</td><td>6.08%±0.007</td><td>11.11%±0.006</td><td>0.823±0.028</td></tr><tr><td>Liver</td><td>9.26%±0.010</td><td>3.52%±0.008</td><td>3.550±0.119</td><td>8.83%±0.006</td><td>0.77%±0.007</td><td>3.448±0.185</td><td>10.30%±0.000</td><td>2.16%±0.000</td><td>3.375±0.000</td><td>9.20%±0.000</td><td>3.49%±0.000</td><td>3.181±0.000</td></tr><tr><td>Magic</td><td>2.98%±0.000</td><td>0.96%±0.000</td><td>0.915±0.000</td><td>3.41%±0.000</td><td>0.96%±0.000</td><td>0.917±0.001</td><td>2.85%±0.001</td><td>2.12%±0.001</td><td>0.914±0.002</td><td>3.09%±0.000</td><td>0.98%±0.000</td><td>0.920±0.000</td></tr></table>
Task<sup>a</sup> is AUROC (↑) for classification and RMSE (↓) for regression. The complete label tree is retained in all variants except the Condensed Label Tree variant.
## E.3 Contribution of prompt guidance
We further examine whether the prompt components used to guide LLM reasoning contribute to synthesis quality. In this experiment, the task definition and the feature-dependence information extracted from the chained trees are retained in all variants, while metric guidance, routing guidance, or the reference analysis is removed individually. Across datasets, the full prompt provides a more balanced overall synthesis performance than the ablated variants, although removing an individual component can occasionally improve a particular metric on a particular dataset. The ablation therefore supports the overall contribution of the prompt-guidance components without implying that each component improves every metric individually. Detailed results are reported in Supplementary Table 10.
Supplementary Table 10 Ablation results for prompt-guidance components. Values are reported as mean ± s.d. Bold values indicate the best result for each dataset.
<table><tr><td rowspan="2">Dataset</td><td colspan="3">w/o Routing</td><td colspan="3">w/o Metric</td><td colspan="3">w/o Reference</td><td colspan="3">Full Prompt (Ours)</td></tr><tr><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td></tr><tr><td>Adult</td><td>5.85%±0.064</td><td>5.07%±0.038</td><td>0.904±0.001</td><td>8.29%±0.064</td><td>4.70%±0.064</td><td>0.905±0.001</td><td>11.92%±0.059</td><td>10.82%±0.052</td><td>0.888±0.002</td><td>5.44%±0.001</td><td>3.53%±0.000</td><td>0.900±0.001</td></tr><tr><td>Blood</td><td>6.97%±1.180</td><td>3.94%±0.493</td><td>0.702±0.034</td><td>8.14%±0.146</td><td>3.50%±0.232</td><td>0.713±0.054</td><td>8.83%±0.404</td><td>3.78%±0.597</td><td>0.700±0.075</td><td>3.32%±0.005</td><td>2.68%±0.004</td><td>0.704±0.026</td></tr><tr><td>Car</td><td>1.70%±0.380</td><td>3.92%±0.403</td><td>0.915±0.017</td><td>1.37%±0.234</td><td>3.40%±0.392</td><td>0.974±0.005</td><td>1.68%±0.382</td><td>3.92%±0.328</td><td>0.963±0.004</td><td>1.68%±0.004</td><td>3.99%±0.004</td><td>0.958±0.006</td></tr><tr><td>Default</td><td>9.58%±0.001</td><td>3.54%±0.046</td><td>0.756±0.003</td><td>11.67%±0.078</td><td>5.89%±0.079</td><td>0.751±0.003</td><td>13.89%±0.041</td><td>10.42%±0.028</td><td>0.723±0.004</td><td>1.00%±0.001</td><td>5.09%±0.001</td><td>0.752±0.002</td></tr><tr><td>Diamonds</td><td>4.91%±0.000</td><td>2.97%±0.000</td><td>889.092±0.476</td><td>4.04%±0.000</td><td>2.51%±0.000</td><td>1195.031±0.000</td><td>0.17%±0.000</td><td>5.06%±0.000</td><td>1011.838±0.000</td><td>3.79%±0.000</td><td>2.11%±0.000</td><td>934.093±15.111</td></tr><tr><td>Heart</td><td>7.25%±1.046</td><td>12.57%±0.864</td><td>0.817±0.031</td><td>6.23%±0.873</td><td>11.21%±0.008</td><td>0.817±0.029</td><td>5.70%±0.462</td><td>11.08%±0.009</td><td>0.849±0.022</td><td>6.08%±0.007</td><td>11.11%±0.000</td><td>0.823±0.028</td></tr><tr><td>Liver</td><td>14.19%±0.729</td><td>4.84%±1.205</td><td>3.413±0.065</td><td>9.67%±1.019</td><td>2.59%±0.357</td><td>3.484±0.080</td><td>13.34%±0.946</td><td>2.55%±0.482</td><td>3.546±0.103</td><td>9.20%±0.000</td><td>3.49%±0.000</td><td>3.181±0.000</td></tr><tr><td>Magic</td><td>3.29%±0.026</td><td>1.19%±0.033</td><td>0.915±0.002</td><td>3.39%±0.000</td><td>0.98%±0.000</td><td>0.921±0.000</td><td>2.75%±0.011</td><td>0.84%±0.007</td><td>0.898±0.002</td><td>3.09%±0.000</td><td>0.98%±0.000</td><td>0.920±0.000</td></tr></table>
Task<sup>a</sup> is AUROC (↑) for classification and RMSE (↓) for regression. The task definition and tree-derived dependence information are retained in all variants.
## E.4 Sensitivity to different LLM backbones
We evaluate the sensitivity of the proposed framework to the choice of LLM backbone. We replace Gemini-2.5-Pro [51] with GLM-5 [55] and Qwen3-Max [56], while retaining the same prompt, number of candidate queries, and strategy-selection protocol. The results show that the overall TabSSD pipeline remains applicable across all three evaluated LLM backbones, indicating that the framework is not restricted to a single specific model. However, synthesis performance varies across backbones and datasets, suggesting that the choice of backbone can still affect the quality of the generated strategies. Detailed results are reported in Supplementary Table 11.
Supplementary Table 11 Sensitivity of TabSSD to different LLM backbones. Values are reported as mean ± s.d. Bold values indicate the best result for each dataset.
<table><tr><td rowspan="2">Dataset</td><td colspan="3">GLM-5</td><td colspan="3">Qwen3-Max</td><td colspan="3">Gemini-2.5-Pro</td></tr><tr><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td><td>Marginal distribution error (↓)</td><td>Pairwise correlation error (↓)</td><td>Task<sup>a</sup></td></tr><tr><td>Adult</td><td>11.66%±0.000</td><td>11.89%±0.000</td><td>0.898±0.000</td><td>6.33%±0.000</td><td>4.35%±0.000</td><td>0.894±0.000</td><td>5.44%±0.001</td><td>3.53%±0.000</td><td>0.900±0.001</td></tr><tr><td>Blood</td><td>9.84%±0.008</td><td>5.01%±0.005</td><td>0.722±0.033</td><td>5.54%±0.000</td><td>3.11%±0.000</td><td>0.703±0.000</td><td>3.32%±0.005</td><td>2.68%±0.004</td><td>0.704±0.026</td></tr><tr><td>Car</td><td>1.48%±0.002</td><td>3.70%±0.003</td><td>0.963±0.005</td><td>1.30%±0.003</td><td>3.49%±0.003</td><td>0.961±0.006</td><td>1.68%±0.004</td><td>3.99%±0.004</td><td>0.958±0.006</td></tr><tr><td>Default</td><td>12.42%±0.000</td><td>7.03%±0.000</td><td>0.752±0.000</td><td>12.54%±0.000</td><td>6.64%±0.000</td><td>0.724±0.000</td><td>1.00%±0.001</td><td>5.09%±0.001</td><td>0.752±0.002</td></tr><tr><td>Diamonds</td><td>4.62%±0.000</td><td>2.54%±0.000</td><td>881.093±18.327</td><td>2.97%±0.000</td><td>2.54%±0.000</td><td>903.082±0.000</td><td>3.79%±0.000</td><td>2.11%±0.000</td><td>934.090±15.111</td></tr><tr><td>Heart</td><td>5.23%±0.005</td><td>10.83%±0.005</td><td>0.852±0.017</td><td>5.93%±0.000</td><td>11.36%±0.000</td><td>0.873±0.000</td><td>6.08%±0.007</td><td>11.11%±0.006</td><td>0.823±0.028</td></tr><tr><td>Liver</td><td>10.79%±0.000</td><td>2.51%±0.000</td><td>3.537±0.000</td><td>15.01%±0.000</td><td>4.41%±0.000</td><td>3.362±0.000</td><td>9.20%±0.000</td><td>3.49%±0.000</td><td>3.181±0.000</td></tr><tr><td>Magic</td><td>3.94%±0.000</td><td>1.23%±0.000</td><td>0.902±0.000</td><td>2.60%±0.000</td><td>1.69%±0.000</td><td>0.910±0.000</td><td>3.09%±0.000</td><td>0.98%±0.000</td><td>0.920±0.000</td></tr></table>
Task<sup>a</sup> is AUROC (↑) for classification and RMSE (↓) for regression. All three LLM backbones use the same prompt, number of candidate queries, and strategy-selection protocol.
## E.5 Sensitivity to LLM query budget
Because LLM-generated strategies are stochastic, we further examine whether the final performance depends strongly on a single LLM output. We conduct this query-budget analysis on three datasets, Adult, Default, and Blood. For each query budget k, we select the best-performing strategy among the first k candidate strategies according to the average statistical error, defined as the mean of marginal distribution error and pairwise correlation error. As shown in Supplementary Fig. 2, the best-so-far error generally decreases and then stabilizes as the number of candidate strategies increases. This suggests that querying the LLM multiple times improves strategy-selection robustness and reduces reliance on a single stochastic LLM output, while avoiding the need for extensive search.

Supplementary Fig. 2 Effect of LLM query budget on strategy selection. Best-so-far average statistical error, defined as the mean of marginal distribution error and pairwise correlation error, is shown as a function of the number of LLM-generated candidate strategies. For each query budget $k$, the selected strategy is the one with the lowest average statistical error among the first $k$ candidates. Thin curves show results for Adult, Default, and Blood, and the bold curve shows their mean.
F Detailed runtime of different algorithms on various datasets
Dataset-level runtime results are reported in Supplementary Table 12, including the total runtime of each baseline and the decomposition of TabSSD runtime into feature-CART extraction, LLM-based synthesis-strategy design, and execution of the generated strategy.
Supplementary Table 12 Runtime of different algorithms across datasets, including single-run and 10-run parallel TabSSD runtimes, in seconds.
<table border="1"><tr><td rowspan="2">Dataset</td><td rowspan="2">ARF</td><td rowspan="2">NRGB</td><td rowspan="2">CTGAN</td><td rowspan="2">TVAE</td><td rowspan="2">GReaT</td><td rowspan="2">TDDPM</td><td rowspan="2">TabDiff</td><td rowspan="2">TSYN</td><td colspan="3">Tree Query</td><td colspan="3">Parallel query</td><td colspan="3">Parallel synth.</td></tr><tr><td>Total</td><td>Synth.</td><td>Total</td><td>query</td><td>synth.</td><td>total</td></tr><tr><td>Adult</td><td>586.29</td><td>1145.87</td><td>3950.74</td><td>1361.28</td><td>12492.07</td><td>2794.10</td><td>4449.82</td><td>2306</td><td>11.47</td><td>30.06</td><td>2.50</td><td>44.03</td><td>77.83</td><td>35.90</td><td>125.20</td></tr><tr><td>Default</td><td>881.77</td><td>1191.42</td><td>4172.98</td><td>1954.85</td><td>23840.83</td><td>2414.62</td><td>4849.87</td><td>3110</td><td>29.39</td><td>82.38</td><td>73.65</td><td>185.42</td><td>168.70</td><td>93.16</td><td>291.25</td></tr><tr><td>Magic</td><td>342.90</td><td>587.95</td><td>1846.34</td><td>883.19</td><td>9752.93</td><td>1504.44</td><td>3276.78</td><td>5518</td><td>7.91</td><td>48.62</td><td>2.57</td><td>59.10</td><td>85.09</td><td>13.79</td><td>106.79</td></tr><tr><td>Diamonds</td><td>911.43</td><td>764.76</td><td>4823.80</td><td>1952.56</td><td>14456.91</td><td>1697.19</td><td>5217.43</td><td>2997</td><td>5.48</td><td>34.71</td><td>12.12</td><td>52.31</td><td>90.55</td><td>43.04</td><td>139.07</td></tr><tr><td>Jasmine</td><td>233.54</td><td>1987.75</td><td>954.65</td><td>365.96</td><td>—</td><td>7830.38</td><td>4488.51</td><td>2651</td><td>13.92</td><td>97.88</td><td>28.19</td><td>139.99</td><td>169.99</td><td>1.29</td><td>185.20</td></tr><tr><td>SpeedDating</td><td>668.07</td><td>12392.89</td><td>2241.91</td><td>962.28</td><td>—</td><td>5865.19</td><td>4415.97</td><td>2309</td><td>36.65</td><td>73.06</td><td>5.91</td><td>115.62</td><td>378.45</td><td>2.45</td><td>417.55</td></tr><tr><td>DNA</td><td>322.20</td><td>1251.77</td><td>551.40</td><td>210.51</td><td>—</td><td>7833.71</td><td>4728.01</td><td>3872</td><td>88.61</td><td>78.93</td><td>5.12</td><td>172.66</td><td>120.66</td><td>4.95</td><td>214.22</td></tr><tr><td>DARWIN</td><td>14.54</td><td>8530.16</td><td>437.17</td><td>380.86</td><td>—</td><td>1177.65</td><td>2941.14</td><td>1226</td><td>129.78</td><td>289.65</td><td>10.02</td><td>429.45</td><td>289.65</td><td>3.56</td><td>422.99</td></tr><tr><td>Blood</td><td>7.05</td><td>327.37</td><td>58.93</td><td>44.44</td><td>190.21</td><td>1622.75</td><td>2980.23</td><td>1304</td><td>0.14</td><td>74.08</td><td>0.29</td><td>74.51</td><td>53.81</td><td>5.93</td><td>59.88</td></tr><tr><td>Car</td><td>9.25</td><td>415.17</td><td>88.48</td><td>42.11</td><td>384.97</td><td>1733.42</td><td>1663.72</td><td>1619</td><td>0.20</td><td>86.41</td><td>0.12</td><td>86.73</td><td>197.71</td><td>13.14</td><td>211.05</td></tr><tr><td>Heart</td><td>6.54</td><td>334.39</td><td>73.97</td><td>30.23</td><td>116.48</td><td>2018.31</td><td>2621.01</td><td>1257</td><td>0.37</td><td>96.54</td><td>5.10</td><td>102.01</td><td>100.06</td><td>5.37</td><td>105.80</td></tr><tr><td>Liver</td><td>7.54</td><td>388.90</td><td>50.88</td><td>27.09</td><td>94.72</td><td>1390.71</td><td>1662.97</td><td>1489</td><td>0.08</td><td>56.62</td><td>0.04</td><td>56.74</td><td>112.35</td><td>3.68</td><td>116.11</td></tr></table>
“_” indicates that the corresponding method could not be successfully executed on the dataset. NRGB, TDDPM, and TSYN denote NRGBBoost, TabDDPM, and TABSYN, respectively.
For TabSSD, Tree, Query, and Synth. denote the runtimes required for feature-CART extraction, generation of the selected synthesis strategy, and execution of the selected strategy, respectively. Total is the sum of Tree, Query, and Synth.
The parallel columns correspond to 10 independent candidate runs. Parallel query and Parallel synth. denote the maximum single-query time and single-synthesis time, respectively, across these runs. Parallel total is the sum of Tree, Parallel query, and Parallel synth. The runtime analyses in Fig. 3 use Parallel total as the TabSSD end-to-end runtime.
G Case study of failure modes
Not all LLM-generated synthesis strategies are reliable. Supplementary Table 13 presents representative failure cases in terms of fidelity, privacy, and efficiency. Unlike black-box generators, our framework produces inspectable executable strategies, allowing failure sources to be traced to specific code-level design choices and unreliable strategies to be excluded through multi-objective evaluation before final selection and deployment.
Supplementary Table 13 Representative failure modes in LLM-generated synthesis strategies. The displayed code fragments highlight the operations directly responsible for each failure.
<table border="1"><tr><td>Dataset</td><td>Observed failure</td><td>Failure-inducing design and key code fragment</td></tr><tr><td>Blood</td><td>Low fidelity<br>Marginal distribution error: 28.80%<br>Pairwise correlation error: 23.82%</td><td>Subspace-specific Gaussian mixture models are used to generate the strongly dependent continuous variables feature_1 and feature_2. Repeated single-sample generation with a fixed random state concentrates the outputs on only a few recurring value pairs, causing distribution collapse. The regenerated routing attributes are also not constrained to remain in their assigned subspaces.<br><br>gmm = GaussianMixture(..., random_state=42)<br>gmm.fit(subspace_data[['feature_1', 'feature_2']])<br>f1_f2_sample, _ = subspace_model['gmm'].sample(1)<br>f0 = f0_pred + f0_residual</td></tr><tr><td>Car</td><td>Privacy leakage<br>DCR: 0.994<br>Train-set proportion: 0.700</td><td>The strategy stores complete feature-label records within each subspace and directly resamples an observed row with probability 0.98. Consequently, most synthetic records are copied from the training support rather than newly generated. Laplace smoothing changes only sampling probabilities and cannot prevent exact matches.<br><br>self.unique_vectors = unique_rows<br>if np.random.rand() > diversity_rate: # diversity_rate = 0.02<br>idx = np.random.choice(len(self.unique_vectors), ...) return self.unique_vectors[idx]</td></tr><tr><td>Jasmine</td><td>Excessive cost<br>Runtime: 1,888.74 s</td><td>The strategy partitions a 144-feature dataset into multiple subspaces and trains a separate conditional boosting model for nearly every feature in each subspace. During synthesis, it further generates each record feature by feature, producing substantial nested training and sampling overhead.<br><br>for space_id in sorted(df['subspace_id'].unique()):<br> for target_feature in GENERATION_ORDER:<br> model.fit(X_fit, y_fit)<br> for _ in range(num_samples_for_subspace):<br> for target_feature in GENERATION_ORDER:</td></tr></table>
# H Detailed predictive results for clinical data augmentation
Detailed predictive results under the 2× augmentation setting are reported in Supplementary Table 14. Balanced accuracy and minority-class accuracy are evaluated on the real test set.
Supplementary Table 14 Predictive utility under the 2× augmentation setting.
<table border="1"><tr><td>Method</td><td>Balanced accuracy</td><td>Minority-class accuracy</td></tr><tr><td>TabSSD</td><td>$0.5785 \pm 0.0162$</td><td>$0.5874 \pm 0.0331$</td></tr><tr><td>SMOTE</td><td>$0.5638 \pm 0.0158$</td><td>$0.2557 \pm 0.0303$</td></tr><tr><td>ARF</td><td>$0.5499 \pm 0.0251$</td><td>$0.3259 \pm 0.0495$</td></tr><tr><td>CTGAN</td><td>$0.5106 \pm 0.0130$</td><td>$0.1052 \pm 0.0254$</td></tr><tr><td>TVAE</td><td>$0.5197 \pm 0.0051$</td><td>$0.2586 \pm 0.0102$</td></tr><tr><td>GReaT</td><td>$0.5229 \pm 0.0199$</td><td>$0.2236 \pm 0.0460$</td></tr><tr><td>TabDDPM</td><td>$0.5550 \pm 0.0141$</td><td>$0.2224 \pm 0.0290$</td></tr><tr><td>TabDiff</td><td>$0.5634 \pm 0.0203$</td><td>$0.3236 \pm 0.0459$</td></tr><tr><td>TABSYN</td><td>$0.5360 \pm 0.0168$</td><td>$0.2460 \pm 0.0306$</td></tr><tr><td>NRGBoost</td><td>$0.5525 \pm 0.0108$</td><td>$0.1707 \pm 0.0202$</td></tr></table>
## I Tailored data synthesis strategies
This section presents the concrete Python synthesis strategies generated by TabSSD for the selected datasets. For clarity, only the executable strategy code is shown, without reproducing the corresponding LLM analyses. Owing to its substantially greater length, the strategy for the DARWIN dataset is presented in an abridged form, with part of the embedded feature-dependence information omitted for brevity.
Listing 2 Generated synthesis strategy for the Blood dataset.
def generate_synthesis_data(save_path: str, n_sample: int, X_train: np.ndarray, y_train: np.ndarray) -> None:
""
Generates synthetic tabular data by inferring characteristics from pre-trained decision trees.
The strategy involves:
1. Analyzing feature dependencies from provided tree performance metrics.
2. Using the main label-prediction decision tree to define subspaces (leaves).
3. Fitting a Gaussian Copula model to the continuous features within each subspace to capture local correlations.
4. Modeling the categorical label based on its empirical distribution in each subspace.
5. Generating new data by sampling from these fitted models, ensuring generated values respect subspace boundaries.
""
# All necessary imports are contained within the function.
import numpy as np
import pandas as pd
from sklearn.preprocessing import QuantileTransformer
import csv
import warnings
# Suppress warnings from QuantileTransformer for small n_quantiles
warnings.filterwarnings("ignore", category=UserWarning)
feature_names = [f"feature_{i}" for i in range(4)]
all_feature_names = feature_names + ["label"]
# Define global feature ranges for final clamping
feature_ranges = {
0: (0.0, 74.0),
1: (1.0, 50.0),
2: (250.0, 12500.0),
3: (2.0, 98.0)
}
# Helper function to get leaf boundaries for clamping. This is critical for fidelity.
def get_leaf_bounds():
bounds = {
1: {0: (-np.inf, 6.5), 2: (-np.inf, 1125.0), 3: (-np.inf, 3.0)},
2: {0: (-np.inf, 5.0), 2: (-np.inf, 1125.0), 3: (3.0, 12.0)},
3: {0: (5.0, 6.5), 2: (-np.inf, 1125.0), 3: (3.0, 12.0)},
4: {0: (-np.inf, 6.5), 2: (-np.inf, 625.0), 3: (12.0, np.inf)},
5: {0: (-np.inf, 6.5), 2: (625.0, 1125.0), 3: (12.0, 24.5)},
6: {0: (-np.inf, 6.5), 2: (625.0, 1125.0), 3: (24.5, np.inf)},
7: {0: (-np.inf, 6.5), 2: (1125.0, np.inf), 3: (-np.inf, 22.5)},
8: {0: (-np.inf, 6.5), 2: (1125.0, np.inf), 3: (22.5, 31.0)},
9: {0: (-np.inf, 6.5), 2: (1125.0, np.inf), 3: (31.0, 33.5)},
10: {0: (-np.inf, 6.5), 1: (-np.inf, 5.5), 2: (1125.0, np.inf), 3: (33.5, 50.0)},
11: {0: (-np.inf, 6.5), 1: (5.5, np.inf), 2: (1125.0, np.inf), 3: (33.5, 50.0)},
12: {0: (-np.inf, 6.5), 1: (-np.inf, 11.5), 2: (1125.0, np.inf), 3: (50.0, np.inf)},
13: {0: (-np.inf, 6.5), 1: (-np.inf, 15.0), 2: (1125.0, 4500.0), 3: (50.0, 78.5)},
14: {0: (-np.inf, 3.5), 1: (15.0, np.inf), 2: (1125.0, 4500.0), 3: (50.0, 78.5)},
15: {0: (3.5, 5.0), 1: (15.0, np.inf), 2: (1125.0, 4500.0), 3: (50.0, 78.5)},
16: {0: (5.0, 6.5), 1: (15.0, np.inf), 2: (1125.0, 4500.0), 3: (50.0, 78.5)},
17: {0: (-np.inf, 6.5), 2: (1125.0, 4500.0), 3: (78.5, np.inf)},
18: {0: (-np.inf, 6.5), 2: (4500.0, np.inf), 3: (50.0, np.inf)},
19: {0: (6.5, np.inf), 3: (-np.inf, 58.5)},
20: {0: (6.5, np.inf), 3: (58.5, np.inf)}
}
return bounds
LEAF_BOUND = get_leaf_bounds()
# Step 1: Define the Routing Function based on the decision tree for the label.
def get_leaf_id(sample):
f0, f1, f2, f3 = sample['feature_0'], sample['feature_1'], sample['feature_2'], sample['feature_3']
if f0 <= 6.5:
if f2 <= 1125.0:
if f3 <= 3.0: return 1
else:
if f3 <= 12.0:
if f0 <= 5.0: return 2
else: return 3
else:
if f2 <= 625.0: return 4
else:
if f3 <= 24.5: return 5
else: return 6
else:
if f3 <= 50.0:
if f3 <= 22.5: return 7
else:
if f3 <= 31.0: return 8
else:
if f3 <= 33.5: return 9
else:
if f1 <= 5.5: return 10
else: return 11
else:
if f1 <= 11.5: return 12
else:
if f2 <= 4500.0:
if f3 <= 78.5:
if f1 <= 15.0: return 13
else:
if f0 <= 3.5: return 14
else:
if f0 <= 5.0: return 15
else: return 16
else: return 17
else: return 18
else:
if f3 <= 58.5: return 19
else: return 20
return -1 # Should not be reached with valid data
# Step 2: Partition the original data into subspaces using the routing function.
X_df = pd.DataFrame(X_train, columns=feature_names)
data_df = X_df.copy()
data_df['label'] = y_train
subspaces = {i: [] for i in range(1, 21)}
for _, row in data_df.iterrows():
leaf_id = get_leaf_id(row)
if leaf_id != -1:
subspaces[leaf_id].append(row.values) for leaf_id in subspaces:
subspaces[leaf_id] = pd.DataFrame(subspaces[leaf_id], columns=all_feature_names)
# Step 3: Learn a generative model for each subspace.
models = {}
for leaf_id, subspace_df in subspaces.items():
n_points = len(subspace_df)
if n_points < 4: # Need a few points to fit a model reliably.
models[leaf_id] = None
continue
continuous_data = subspace_df[feature_names]
labels = subspace_df['label']
qt = QuantileTransformer(output_distribution='normal', n_quantiles=max(2, min(n_points // 2, 100)), subsample=min(n_points, int(1e5)))
transformed_data = qt.fit_transform(continuous_data)
transformed_data = np.nan_to_num(transformed_data) # Handle constant columns
copula_corr = np.corroef(transformed_data, rowvar=False)
copula_corr = np.nan_to_num(copula_corr, nan=0.0) # Handle NaN in correlation matrix
np.fill_diagonal(copula_corr, 1.0)
label_dist = labels.value_counts(normalize=True).to_dict()
if 0 not in label_dist: label_dist[0] = 0.0
if 1 not in label_dist: label_dist[1] = 0.0
models[leaf_id] = {
"qt": qt,
"copula_corr": copula_corr,
"label_dist": label_dist,
"n_points": n_points
}
# Step 4: Generate new data by sampling from the fitted models.
total_original_points = len(data_df) if len(data_df) > 0 else 1
synthesis_samples_list = []
for leaf_id, model in models.items():
if model is None:
continue
n_samples_leaf = int(np.round(n_sample * model['n_points'] / total_original_points))
if n_samples_leaf == 0:
continue
mean = np.zeros(len(feature_names))
try:
# Add a small ridge to ensure matrix is positive semi-definite
cov_matrix = model['copula_corr'] + np.eye(len(feature_names)) * 1e-6
mvn_samples = np.random.multivariate_normal(mean, cov_matrix, n_samples_leaf)
except np.linalg.LinAlgError:
continue # Skip subspace if generation fails
synthetic_continuous = model['qt'].inverse_transform(mvn_samples)
leaf_bounds = LEAF_BOUNDDS.get(leaf_id, {})
for i in range(len(feature_names)):
global_min, global_max = feature_ranges[i]
leaf_min, leaf_max = leaf_bounds.get(i, (-np.inf, np.inf))
final_min = max(global_min, leaf_min)
final_max = min(global_max, leaf_max)
synthetic_continuous[:, i] = np.clip(synthetic_continuous[:, i], final_min, final_max)
labels_to_gen = list(model['label_dist'].keys())
label_probs = list(model['label_dist'].values())
synthetic_labels = np.random.choice(labels_to_gen, size=n_samples_leaf, p=label_probs)
for j in range(n_samples_leaf):
record = {fname: val for fname, val in zip(feature_names, synthetic_continuous[j])}
record['label'] = int(synthetic_labels[j])
synthesis_samples_list.append(record)
# Adjust sample count to exactly match n_sample
if len(synthesis_samples_list) > n_sample:
synthesis_samples_list = synthesis_samples_list[:n_sample]
elif len(synthesis_samples_list) < n_sample and synthesis_samples_list:
diff = n_sample - len(synthesis_samples_list)
extras = np.random.choice(synthesis_samples_list, size=diff)
synthesis_samples_list.extend(extras)
# Step 5: Save the generated data to a CSV file.
with open(save_path, "w", newline="") as csv_file:
writer = csv DictWriter(csv_file, fieldnames=all_feature_names)
writer.writeheader()
if synthesis_samples_list:
writer.writerows(synthesis_samples_list)
Listing 3 Generated synthesis strategy for the Car dataset.
def generate_synthesis_data(save_path: str, n_sample: int, X_train: np.ndarray, y_train: np.ndarray) -> None:
import pandas as pd
import numpy as np
import csv
# 1. Data Preparation
# Map X_train to features 0-5 and y_train to label
feat_cols = ['feature_i'] for i in range(6)]
df = pd.DataFrame(X_train, columns=feat_cols)
df['label'] = y_train
# 2. Routing Function: Partitioning into Subspaces based on Decision Tree logic
def get_subspace(data):
f3 = data['feature_3']
f5 = data['feature_5']
# Condition 1: feature_3 <= 0.5 (Significant split for Class 2)
# Condition 2: feature_3 > 0.5 and feature_5 <= 0.5
# Condition 3: feature_3 > 0.5 and 0.5 < feature_5 <= 1.5
# Condition 4: feature_3 > 0.5 and feature_5 > 1.5
conditions = [
(f3 <= 0.5),
(f3 > 0.5) & (f5 <= 0.5),
(f3 > 0.5) & (f5 > 0.5) & (f5 <= 1.5),
(f3 > 0.5) & (f5 > 1.5)
]
choices = [1, 2, 3, 4]
# Use select to assign each row to a subspace ID
return np.select(conditions, choices, default=4)
df['subspace'] = get_subspace(df)
# 3. Fit: Learning distribution characteristics within each subspace
subspace_stats = {}
subspace_weights_series = df['subspace'].value_counts(normalize=True)
for s_id in df['subspace'].unique():
s_df = df[df['subspace'] == s_id]
# Model P(Label | Subspace)
l_counts = s_df['label'].value_counts(normalize=True).to_dict()
l_vals = list(l_counts.keys())
l_weights = np.array(list(l_counts.values)), dtype='float64')
l_weights / = l_weights.sum() # Normalize for safety
# Model P(Feature_i | Label, Subspace)
f_probs_given_l = {}
for l_val in s_df['label'].unique():
sl_df = s_df[s_df['label'] == l_val]
f_probs_given_l[l_val] = {}
for col in feat_cols:
counts = sl_df[col].value_counts(normalize=True).to_dict()
f_v = list(counts.keys())
f_w = np.array(list(counts.values)), dtype='float64')
f_w / = f_w.sum()
f_probs_given_l[l_val][col] = (f_v, f_w)
subspace_stats[s_id] = {
'label_dist': (l_vals, l_weights),
'feature_dists': f_probs_given_l
}
# 4. Synthesize Data
synthesis_samples = []
s_ids = list(subspace_stats.keys())
s_probs = [subspace_weights_series.get(sid, 0) for sid in s_ids]
s_probs = np.array(s_probs) / sum(s_probs)
for _ in range(n_sample):
# Sample Subspace
sid = np.random.choice(s_ids, p=s_probs)
stats = subspace_stats[sid]
# Sample Label within Subspace
l_vals, l_weights = stats['label_dist']
l_choice = np.random.choice(l_vals, p=l_weights)
# Sample Features conditioned on Label and Subspace
row = {'label': int(l_choice)}
for col in feat_cols:
f_vals, f_weights = stats['feature_dists'] [l_choice][col]
f_choice = np.random.choice(f_vals, p=f_weights)
row[col] = int(f_choice)
synthesis_samples.append(row)
# 5. Output to CSV
fieldnames = feat_cols + ["label"]
with open(save_path, "w", newline="") as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(synthesis_samples)
Listing 4 Abridged excerpt from the synthesis strategy generated for the DARWIN dataset.
def generate_synthesis_data(save_path: str, n_sample: int, X_train: np.ndarray, y_train: np.ndarray) -> None:
""
Generates synthetic tabular data based on inferred characteristics from pre-trained decision trees.
The strategy involves:
1. Parsing decision tree summaries to build a feature dependency graph.
2. Performing a topological sort to establish a valid, sequential generation order.
3. Using the final label-prediction tree to define a "routing function" that partitions the data space into subspaces with homogeneous labels.
4. Fitting models within each subspace to capture local data distributions:
- Linear Regression + Residual Sampling for features with strong predictors.
- Empirical Distribution Sampling for root/un-modeled features.
5. Sequentially generating new samples according to the determined order and fitted models, ensuring values are within known bounds.
6. Saving the generated data to a CSV file.
""
import pandas as pd
import numpy as np
import csv
import re
from collections import defaultdict, Counter
from sklearn.linear_model import LinearRegression
import warnings
warnings.filterwarnings("ignore", category=UserWarning)
# 1. Parse feature information and define constants
# The decision tree rule strings are embedded for self-containment.
feature_info_str = ""
{feature_49}: {type:continuous,min:0.0,max:14.0,associated_features: [feature_36,feature_38,feature_334,feature_105],performance: {R2:0.9911,RMSE:0.2114}}
{feature_94}: {type:continuous,min:736.0,max:9830.0,associated_features: [feature_251,feature_95,feature_201,feature_100],performance: {R2:0.9752,RMSE:199.1262}}
... additional feature summaries omitted for brevity ...
{feature_41}: {type:continuous,min:0.0,max:4456.0,associated_features: [feature_53,feature_49,feature_48,feature_227],performance: {R2:0.9838,RMSE:87.5136}}
{feature_88}: {type:continuous,min:0.0,max:340361.9688,associated_features: [feature_87,feature_122,feature_248,feature_222],performance: {R2:0.9922,RMSE:4425.3103}}
""
def parse_feature_info(info_str):
feature_models = {}
feature_metadata = {}
pattern = re.compile(
r"(\{feature_\d+}\):\{type: ($$-,]+),min: ($$-,]+),max: ($$-,]+),associated_features:$$($$-$$]*)],performance:\{R2: ($$-,]+),RMSE: ($$-$$+)\}\}"
)
for line in info_str.strip().split('n'):
44
$$ match = pattern.match(line.strip())
if match:
target_id = int(match.group(1))
assoc_str = match.group(5)
predictors = []
if assoc_str:
predictors = [int(f.replace('feature_', '')) for f in assoc_str.split(',')]
feature_models[target_id] = predictors
feature_metas[target_id] = {
'type': match.group(2),
'min': float(match.group(3)),
'max': float(match.group(4)),
'r2': float(match.group(6)),
'rmse': float(match.group(7))
}
return feature_models, feature_metas
feature_models, feature_metas = parse_feature_info(feature_info_str)
NUM_FEATURES = 450
all_feature_indices = list(range(NUM_FEATURES))
feature_names = [f"feature_{i}" for i in all_feature_indices]
CONSTANT_FEATURES = {k for k, v in feature_metas.items() if v['min'] == v['max']}]
# 2. Define the Subspace Routing Logic from the label decision tree
def get_subspace_id(row):
if row['feature_413'] <= 8690.0:
if row['feature_446'] <= 54097.5:
if row['feature_204'] <= 1.61:
return 0 # Leaf 1 -> Label 0
else:
return 1 # Leaf 2 -> Label 1
else: # feature_446 > 54097.5
return 2 # Leaf 3 -> Label 1
else: # feature_413 > 8690.0
if row['feature_305'] <= 28607.5:
if row['feature_202'] <= 763.0:
return 3 # Leaf 4 -> Label 0
else: # feature_202 > 763.0
if row['feature_171'] <= 0.03:
return 4 # Leaf 5 -> Label 0
else: # feature_171 > 0.03
return 5 # Leaf 6 -> Label 1
else: # feature_305 > 28607.5
if row['feature_329'] <= 11045.5:
return 6 # Leaf 7 -> Label 1
else: # feature_329 > 11045.5
return 7 # Leaf 8 -> Label 0
subspace_labels = {0: 0, 1: 1, 2: 1, 3: 0, 4: 0, 5: 1, 6: 1, 7: 0}
# 3. Determine Generation Order via Topological Sort
dependencies = {k: v for k, v in feature_models.items()}
all_features_set = set(all_feature_indices)
generation_order = []
generated_features = set()
# Start with features that are not targets of any model (root nodes)
unmodeled_targets = all_features_set - set(dependencies.keys())
generation_order.extend(list(unmodeled_targets))
generated_features.update(unmodeled_targets)
# Iteratively add features whose dependencies are met
while len(generated_features) < len(all_features_set):
features_to_add = set()
for f in (all_features_set - generated_features):
if f in dependencies:
preds = dependencies.get(f, [])
if all(p in generated_features for p in preds):
features_to_add.add(f)
if not features_to_add:
# Cycle detected. Break it by finding the feature with the lowest R2 in the cycle.
cyclic_features = all_features_set - generated_features
feature_to_break = min(cyclic_features, key=lambda f: feature_metas.get(f, {'r2': 999})['r2'])
features_to_add.add(feature_to_break)
# Sort to make order deterministic, then add
for f in sorted(list(features_to_add)):
generation_order.append(f)
generated_features.add(f)
# 4. Synthesizer Class
class SubspaceSynthesizer:
def __init__(self, order, metas, models, constants, num_features):
self.order = order
self.metas = metas
self.models = models
selfconstants = constants
self.num_features = num_features
self.subspace_models = defaultdict(dict)
self.subspace_residuals = defaultdict(dict)
self.subspace_margins = defaultdict(dict)
self.subspace_proportions = {}
self.global_margins = {} # Fallback
def fit(self, df):
df['subspace_id'] = df.apply(get_subspace_id, axis=1)
self.subspace_proportions = df['subspace_id'].value_counts(normalize=True).to_dict()
# Store global marginals as a fallback
for feature_id in self.order:
self.global_margins[feature_id] = df[f'feature_{feature_id}'].values
grouped = df.groupby('subspace_id')
for subspace_id, subspace_df in grouped:
if subspace_df.empty: continue
for feature_id in self.order:
fname = f'feature_{feature_id}'
if feature_id in selfconstants: continue
# Decide if this feature is modeled conditionally or marginally
is_conditionally_modeled = feature_id in self.models and all(
p in self.order[:self.order.index(feature_id)] for p in self.models[
)
if is_conditionally_modeled:
predictors = self.models[feature_id]
pred_names = [f'feature_{p}'] for p in predictors]
# Ensure all predictor columns exist in the subspace df
if not all(p in subspace_df.columns for p in pred_names):
is_conditionally_modeled = False
else:
X_sub = subspace_df[pred_names]
y_sub = subspace_df[fname]
if X_sub.empty or y_sub.empty:
is_conditionally_modeled = False
else:
try:
model = LinearRegression()
model.fit(X_sub, y_sub)
predictions = model.predict(X_sub)
residuals = y_sub - predictions
self.subspace_models[subspace_id][feature_id] = model
self.subspace_residuals[subspace_id][feature_id] = residuals.
values
except ValueError: # E.g., if X_sub has no variation
is_conditionally_modeled = False
if not is_conditionally_modeled:
self.subspace_margins[subspace_id][feature_id] = subspace_df[fname].
values
def sample(self, n_samples):
all_samples = []
subspace_ids = list(self.subspace_proportions.keys())
subspace_probs = list(self.subspace_proportions.values()) if not subspace_ids: # Handle case where training data is empty
return []
# Assign samples to subspaces based on proportions
assignments = np.random.choice(subspace_ids, size=n_samples, p=subpace_probs)
for i in range(n_samples):
subspace_id = assignments[i]
new_sample = {}
for feature_id in self.order:
fname = f'feature_{feature_id}'
fmeta = self.metas.get(feature_id, {})
fmin = fmeta.get('min', -np.inf)
fmax = fmeta.get('max', np.inf)
val = 0.0 # Default value
if feature_id in selfconstants:
val = 0.0
elif feature_id in self.subspace_models.get(subspace_id, {}):
model = self.subspace_models[subspace_id][feature_id]
residuals = self.subspace_residuals[subspace_id][feature_id]
predictors = self.models[feature_id]
pred_names = [f'feature_{p}' for p in predictors]
pred_vals_list = [new_sample[p_name] for p_name in pred_names]
pred_df = pd.DataFrame([pred_vals_list], columns=pred_names)
base_val = model.predict(pred_df)[0]
residual = np.random.choice(residuals) if len(residuals) > 0 else 0
val = base_val + residual
else:
# Use subspace marginal if available, else global marginal as fallback
marginal_vals = self.subspace_marginals.get(subspace_id, {}).get(
if marginal_vals is None or len(marginal_vals) == 0:
marginal_vals = self.global_marginals.get(feature_id)
if marginal_vals is not None and len(marginal_vals) > 0:
val = np.random.choice(marginal_vals)
else: # Ultimate fallback for features with no data
val = np.random.uniform(fmin if np.isfinite(fmin) else 0, fmax if np.isfinite(fmax) else 1)
# Clip to ensure validity
new_sample[ffname] = np.clip(val, fmin, fmax)
new_sample['label'] = subspace_labels[subspace_id]
all_samples.append(new_sample)
return all_samples
# 5. Main execution logic
df_train = pd.DataFrame(X_train, columns=feature_names)
df_train['label'] = y_train
# Instantiate, fit, and sample
synthesizer = SubspaceSynthesizer(generation_order, feature_metas, feature_models, CONSTANT_FEATURES, NUM_FEATURES)
synthesizer.fit(df_train)
synthetic_samples = synthesizer.sample(n_sample)
# 6. Save to CSV
if not synthetic_samples:
print("Warning: No synthetic samples were generated.")
return
output_fieldnames = [f"feature_{i}" for i in all_feature_indices] + ["label"]
with open(save_path, "w", newline="") as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=output_fieldnames)
writer.writerow()
writer.writerows(synthetic_samples)
print(f"Successfully generated {len(synthetic_samples)} synthetic samples and saved to {save_path}")