Generating high-quality synthetic tabular data is a persistent challenge in machine learning. Unlike images or text, tabular datasets are heterogeneous, containing a mix of continuous and categorical variables with no inherent spatial or temporal ordering. While Generative Adversarial Networks (GANs) and Variational Autoencoders (VAEs) are common choices, they often struggle with complex conditional dependencies and order-dependency.
MaCoDE (Masked Conditional Density Estimation) introduces a novel approach by reinterpreting the Masked Language Modeling (MLM) objective—famously used in BERT—as a framework for non-parametric conditional density estimation on tabular data. This method provides a robust way to generate high-utility synthetic data while naturally handling missing values and allowing for post-training privacy adjustments.
Methodology: The MaCoDE Framework
MaCoDE treats tabular data synthesis as a series of conditional density estimation problems solved via a Transformer architecture. The process involves four primary stages:
- Discretization: Continuous variables are transformed using their Cumulative Distribution Function (CDF) into a $[0, 1]$ range and then partitioned into $L$ discrete bins. This converts the density estimation problem into a multi-class classification task.
- Masked Language Modeling (MLM): The model is trained to predict the values of "masked" (hidden) columns based on the "unmasked" (visible) ones using a BERT-style encoder. This allows the model to learn dependencies between any arbitrary set of features without being restricted by a fixed sequence.
- Theoretical Bridge: A core contribution of this work is the proof that minimizing the orderless classification loss in MLM is mathematically equivalent to minimizing the Total Variation (TV) distance between the true and estimated conditional distributions.
- Flexible Synthesis: During generation, the model randomly permutes column order and generates values one by one through ancestral sampling.
Key Insights
- MLM as Density Estimation: The standard MLM loss function serves as a proxy for distributional learning. By discretizing the space, a classifier effectively becomes a density estimator.
- Orderlessness: Because MaCoDE is trained with random masking, it is uniquely suited for tabular data where column order is arbitrary.
- Missing Data as Masked Tokens: Missing values in a training set are functionally identical to masked tokens. This allows MaCoDE to perform multiple imputation more effectively than many specialized tools.
Results and Privacy Control
MaCoDE was evaluated on 10 real-world datasets, consistently achieving state-of-the-art Machine Learning Utility (MLu) and statistical fidelity. It outperformed popular baselines like CTGAN, TVAE, and diffusion-based models like TabDDPM.
One of the most powerful features of MaCoDE is the introduction of a temperature parameter ($\tau$). This parameter can be adjusted at inference time to trade off data quality for increased privacy without requiring the model to be retrained. By increasing the "temperature" of the output softmax during generation, the model produces more diverse samples, increasing the Distance to Closest Record (DCR) and thus enhancing privacy.
Conclusion
MaCoDE bridges the gap between NLP-style masked modeling and tabular density estimation. By providing a flexible, orderless framework that handles mixed data types and missing values natively, it sets a new standard for synthetic data utility and privacy control. Future work may explore extending the model to accommodate a broader range of continuous distributions beyond the current histogram-based approach.
Summary updated