Adversarial Random Forests for Density Estimation and Generative Modeling

David S. Watson, Kristin Blesch, Jan Kapar, Marvin N. Wright

Abstract

We propose methods for density estimation and data synthesis using a novel form of unsupervised random forests. Inspired by generative adversarial networks, we implement a recursive procedure in which trees gradually learn structural properties of the data through alternating rounds of generation and discrimination. The method is provably consistent under minimal assumptions. Unlike classic tree-based alternatives, our approach provides smooth (un)conditional densities and allows for fully synthetic data generation. We achieve comparable or superior performance to state-of-the-art probabilistic circuits and deep learning models on various tabular data benchmarks while executing about two orders of magnitude faster on average. An accompanying R package, arf, is available on CRAN.

Introduction

Generative modeling has seen massive breakthroughs recently, but most advancements center around deep learning models like GANs, VAEs, and Diffusion models for unstructured data like images and text. However, these models often struggle with tabular data—the standard rows-and-columns datasets characterized by a mix of continuous and categorical variables. Deep learning models for tabular data are often data-hungry, require extensive hyperparameter tuning, and act as "black boxes" where calculating exact probabilities is computationally intractable.

While tree-based models like Random Forests are the gold standard for tabular prediction, they have rarely been used to generate fully synthetic joint distributions. This paper introduces Adversarial Random Forests (ARFs), a variant that synthesizes high-fidelity tabular data without the massive computational overhead of neural networks.

Methodology

The proposed framework consists of three interconnected algorithms designed to achieve stable and fast density estimation:

  1. ARF (Adversarial Random Forest): Inspired by the generator-discriminator dynamic of GANs. The generator creates a naive synthetic dataset by sampling independently from marginal distributions. A Random Forest discriminator then attempts to classify real vs. synthetic data. If successful, the generator updates by sampling within the specific leaf nodes learned by the discriminator, forcing it to respect complex feature interactions. This loop continues until the discriminator can no longer distinguish between real and synthetic data.
  2. FORDE (FORests for Density Estimation): Once the ARF converges, the data within each leaf satisfies a "local independence criterion." FORDE estimates density by calculating 1D densities (using Kernel Density Estimation or Maximum Likelihood) for each feature independently within each leaf.
  3. FORGE (FORests for GEnerative modeling): To generate new data, FORGE selects a random tree, picks a leaf based on data coverage, and samples from the 1D distributions learned by FORDE.

By slicing the data space into hyperrectangles (leaves) where features are mutually independent, the algorithm reduces a complex $d$-dimensional density estimation problem into $d$ simple 1-dimensional problems.

Experimental Results

Visual Verification and Simulations

To verify that the generated data matches true distributions, the authors tested ARFs on low-dimensional visual datasets such as cassini, shapes, and twomoons. As shown in the visual comparison, the synthetic data generated by the model captures the complex geometric structures of the original distributions with high fidelity.

Visual comparison of original and synthetic data across four low-dimensional datasets.

Tabular Benchmarks and Computational Efficiency

On the Tabular GAN benchmark, FORGE was compared against state-of-the-art deep learning models including CTGAN, TVAE, and CTAB-GAN+. The results demonstrate that FORGE not only achieves top-tier accuracy and F1-scores but does so with a massive reduction in training and generation time.

Performance comparison on real-world tabular datasets, highlighting FORGE's superior speed and competitive accuracy.

In benchmark tests, FORGE executed 60 to 100 times faster than its deep learning competitors. While neural network models often required hours on GPUs, FORGE completed tasks in seconds on a standard CPU. Furthermore, on the Twenty Datasets benchmark for density estimation, FORDE achieved an average rank of 3.3, placing it second overall against specialized Probabilistic Circuits.

Discussion and Conclusion

Adversarial Random Forests provide a powerful, mathematically tractable alternative to deep generative models for tabular data. By exploiting the partitioning rules of trees rather than learning complex neural parameters, the method remains incredibly stable and fast.

However, ARFs are not intended for highly structured data like images or text, where convolutional or transformer-based architectures remain superior. The quality of the output also depends on the 1D estimators used within the leaves. Future work includes extending this framework to anomaly detection, clustering, and privacy-preserving synthetic data generation.

Summary updated

BibTeX
@inproceedings{watson2023adversarial,
  author = {David S. Watson and Kristin Blesch and Jan Kapar and Marvin N. Wright},
  title = {{Adversarial Random Forests for Density Estimation and Generative Modeling}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2023},
  url = {https://openreview.net/forum?id=yOeB8H7QbH},
}
Figure