Distribution Embedding Networks for Generalization from a Diverse Set of Classification Tasks

Lang Liu, Mahdi Milani Fard, Sen Zhao

Abstract

We propose Distribution Embedding Networks (DEN) for classification with small data. In the same spirit of meta-learning, DEN learns from a diverse set of training tasks with the goal to generalize to unseen target tasks. Unlike existing approaches which require the inputs of training and target tasks to have the same dimension with possibly similar distributions, DEN allows training and target tasks to live in heterogeneous input spaces. This is especially useful for tabular-data tasks where labeled data from related tasks are scarce. DEN uses a three-block architecture: a covariate transformation block followed by a distribution embedding block and then a classification block. We provide theoretical insights to show that this architecture allows the embedding and classification blocks to be fixed after pre-training on a diverse set of tasks; only the covariate transformation block with relatively few parameters needs to be fine-tuned for each new task. To facilitate training, we also propose an approach to synthesize binary classification tasks, and demonstrate that DEN outperforms existing methods in a number of synthetic and real tasks in numerical studies.

Introduction: The Challenge of Tabular Heterogeneity

Few-shot learning (FSL) has revolutionized computer vision and natural language processing, enabling models to adapt to new tasks with minimal data. However, applying these techniques to tabular data remains a significant challenge due to "heterogeneity."

Unlike image classification, where inputs are consistently pixels, tabular datasets vary wildly in feature count and definition. A model trained on medical records (e.g., age, blood pressure) cannot naturally process financial data (e.g., income, credit score). Most existing meta-learning algorithms assume a homogeneous input space and fail when feature dimensions change. Furthermore, if training tasks are too dissimilar from the target task, standard models often suffer from "negative adaptation," performing worse than simple linear baselines.

The DEN Architecture

To address these issues, we introduce Distribution Embedding Networks (DEN). The core innovation is a three-block architecture that decouples task-specific feature adaptation from general classification logic.

Detailed architectural flow of the Distribution Embedding Network, illustrating the interaction between query and support batches through the transformation, embedding, and classification blocks.
  1. Covariate Transformation Block (Task-Dependent): This layer uses Piecewise Linear Functions (PLFs) to transform raw features. PLFs are highly flexible yet have very few parameters, allowing them to be fine-tuned on very small "support sets" (as few as 50 samples) without overfitting. This block aligns the distribution of a new task with the space learned during pre-training.
  2. Distribution Embedding Block (Task-Independent): This component summarizes the entire task's distribution into a single embedding vector. To handle varying feature counts, it decomposes the input into pairs of features and learns a pairwise embedding.
  3. Classification Block (Task-Independent): Utilizing a Deep Sets architecture, this block combines the task embedding with the features of a specific query point to generate final predictions.

Workflow: Pre-training and Fine-tuning

The DEN framework operates in three distinct phases: pre-training, fine-tuning, and evaluation.

The three phases of the DEN framework: pre-training on diverse tasks, fine-tuning the transformation block on a target task, and final evaluation.

During Pre-training, the model is exposed to a diverse set of heterogeneous tasks. All three blocks are trained simultaneously to learn a robust representation of classification logic across different distributions.

When a new Target Task arrives, the Embedding and Classification blocks are locked (fixed). Only the lightweight Transformation block is Fine-tuned using the target task's support set. This ensures that the model's core "knowledge" remains intact while it adapts to the specific feature characteristics of the new data. Finally, in the Evaluation phase, the model predicts labels for query points with all parameters fixed.

Experimental Results

We evaluated DEN across several real-world and synthetic contexts:

  • OpenML Benchmarks: On 20 binary datasets, DEN outperformed established baselines like Prototypical Networks and MAML, achieving top performance in over 30% of cases. In multi-class settings, DEN was the leader in 61.6% of cases.
  • Heterogeneous Success: On the Nomao dataset, DEN achieved an AUC of 95.21%, significantly outperforming the next best meta-learning baseline, TADAM (82.42%).
  • Synthetic Task Generation: To overcome the scarcity of diverse tabular data, we developed a method to synthesize thousands of tasks by using the outputs of various image classifiers as "features." Surprisingly, models pre-trained on these synthetic tasks often outperformed those trained on real tabular data, suggesting a scalable path for meta-learning where real-world training tasks are scarce.

Conclusion and Future Work

DEN provides a robust framework for few-shot classification on heterogeneous tabular data. By isolating task-specific adaptation to a lightweight transformation layer, DEN avoids the pitfalls of negative adaptation and high-parameter overfitting.

A current limitation is the $O(d^2)$ complexity of the embedding block, which calculates interactions for all pairs of features. This makes the model difficult to scale to extremely high-dimensional data (e.g., genomics). Future work will explore using random subsets of feature combinations to reduce computational load, allowing DEN to tackle even larger datasets.

Summary updated

BibTeX
@article{liu2022distribution,
  author = {Lang Liu and Mahdi Milani Fard and Sen Zhao},
  title = {{Distribution Embedding Networks for Generalization from a Diverse Set of Classification Tasks}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=F2rG2CXsgO},
}
Figure