NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

D2R2: Diffusion-based Representation with Random Distance Matching for Tabular Few-shot Learning

Ruoxue Liu, Linjiajie Fang, Wenjia Wang, Bingyi JingNeurIPS 2024

Introduction

While few-shot learning—the ability to learn from just a handful of examples—has seen massive success in computer vision and natural language processing, tabular data remains a challenging frontier. Tabular data is notoriously messy: it lacks the spatial structure of images or the sequential structure of text, and it often mixes numerical values with categorical labels.

Existing methods struggle with three main issues:

  1. Semantic Scarcity: With only one or five labeled examples, it is difficult for a model to understand the defining characteristics of a class.
  2. Feature Heterogeneity: Standard deep learning models often fail to process numerical and categorical features with the specific logic each requires.
  3. Prototype Imprecision: Many few-shot methods use the "average" of labeled samples (a prototype) to represent a class. However, in tabular data, a single class might be "multimodal"—meaning its members belong to several distinct clusters—making a single average point a poor representation.

To address these challenges, researchers have introduced D2R2 (Diffusion-based Representation with Random Distance Matching), a novel framework that brings the power of diffusion models to tabular few-shot learning. By repurposing diffusion as a feature extractor and combining it with distance-preserving projections and an iterative prototyping scheme, D2R2 sets a new state-of-the-art across diverse tabular datasets.

The D2R2 Methodology

D2R2 tackles the inherent difficulties of tabular few-shot learning through three key components: Diffusion-based Representation, Random Distance Matching, and an Instance-wise Iterative Prototype scheme.

D2R2 Framework Architecture
  • Diffusion-based Representation (DR): Instead of using diffusion to generate new data, D2R2 uses it to learn better features. It trains a conditional diffusion model to denoise noisy tabular samples. To do this successfully, the model is forced to extract "semantic knowledge" into a low-dimensional embedding that acts as an information bottleneck. The core insight is that the process of denoising requires a deep understanding of the underlying data structure. By forcing a model to denoise a sample based on a compressed embedding, that embedding naturally becomes a high-quality summary of the sample's essence.
  • Random Distance Matching (RDM): Standard embeddings do not always preserve the geometry of the original data. To ensure the learned embeddings are useful for classification, D2R2 introduces a loss function that forces the distances between points in the embedding space to match distances in various random projection spaces. Crucially, different random projection strategies are used for numerical and categorical features to respect their distinct mathematical properties.
  • Instance-wise Iterative Prototype (IP): During the classification phase, instead of calculating one static average for each class, D2R2 uses an iterative scheme inspired by soft k-means. It starts with the few labeled samples and refines the class representation by looking at the unlabeled query samples.
Comparison of Prototyping Schemes

This move from static prototypes to iterative ones is a game-changer for tabular data. It acknowledges that an initial guess at what a class looks like (based on one or two samples) is likely incomplete, and uses the test data itself to help sharpen the class boundaries, accounting for multimodality within a single class.

Datasets and Evaluation

The model was evaluated on nine datasets from the OpenML-CC18 benchmark, covering a wide variety of real-world scenarios:

  • Numerical-only: optdigits, karkunen, diabetes, breast.
  • Categorical-only: dna, mfeat-pixel.
  • Mixed (Numerical & Categorical): income, cmc, nomao.

The researchers tested these in standard N-way K-shot settings (specifically 1-shot and 5-shot), comparing D2R2 against 15 different baselines including CatBoost, TabPFN, and STUNT.

Key Results

D2R2 consistently outperformed all 15 baselines, often by significant margins:

  • Superior Accuracy: On the optdigits dataset (1-shot), D2R2 achieved 81.13% accuracy, compared to the previous state-of-the-art (STUNT) at 76.94% and traditional CatBoost at 58.30%.
  • Mixed Data Mastery: On the income dataset, which contains both numbers and categories, D2R2 outperformed the leading baseline by a relative 19%.
  • Ablation Success: The authors demonstrated that all three components (DR, RDM, and IP) are necessary. Removing the Diffusion Representation caused the most significant performance drop, proving it is the primary engine of the framework's success.

Limitations and Future Work

While highly effective, the framework has a few limitations. First, D2R2 is explicitly tailored for the unique characteristics of tabular data; it is unlikely to perform as well on computer vision or natural language processing tasks without major modifications. Second, while the few-shot setting involves small datasets, the iterative prototype scheme adds a computational layer during inference. Although linear, it is more intensive than a simple distance calculation. Finally, the complex architecture of diffusion models means that analyzing theoretical behaviors, such as exact convergence rates, remains an open challenge for future research.

Summary updated

BibTeX
@inproceedings{liu2024d,
  author = {Ruoxue Liu and Linjiajie Fang and Wenjia Wang and Bingyi Jing},
  title = {{D2R2: Diffusion-based Representation with Random Distance Matching for Tabular Few-shot Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=lS9e36lkxG},
}
Figure