The "learnware" paradigm allows developers and users to reuse pre-trained machine learning models by matching their tasks against tiny, privacy-preserving model "specifications." Previous specification methods only captured the feature distribution of the model's training data, ignoring how well the model actually makes decisions. This paper introduces DALI (Learnware Specification via Dual ALIgnment), a novel approach that aligns both the data distribution and the model's discriminative performance, resulting in significantly more accurate model retrieval and reuse.
The Challenge of Model Reusability
Training high-performance machine learning models from scratch is expensive, data-hungry, and requires deep expertise. The learnware paradigm proposes a "dock system"—akin to an app store for models—where developers submit well-trained models alongside a specification. This specification is a small, synthetic representation of the model's capabilities that acts as its unique identifier. When a user has a new task, they submit their data's specification to the dock, which then recommends the best pre-trained models to reuse.
The core challenge is determining how to generate a high-quality specification. Existing methods, such as Reduced Kernel Mean Embedding (RKME), rely purely on distribution alignment. They generate a small set of synthetic data points that mimic the feature distribution of the original training data. However, this ignores the model's actual discriminative performance. Two models trained on the same data might have vastly different capabilities depending on their architecture or training process. By ignoring the model's output space, current specifications fail to adequately characterize what the model is actually good at, leading to suboptimal model recommendations.
Introducing DALI: Dual Alignment
To solve this limitation, the authors propose DALI, which generates specifications using a Dual Alignment mechanism:
- Discriminative Alignment: Instead of just looking at the true labels of the training data, DALI uses the well-trained model to generate pseudo-labels for the training set. It then uses $\mathcal{H}$-discrepancy to ensure the specification mimics this pseudo-label distribution. This forces the specification to capture the model's inherent decision boundaries and confidence.
- Distribution Alignment: Simultaneously, DALI uses Maximum Mean Discrepancy (MMD) to ensure the specification's feature distribution matches the true-label training data.
- Random Neural Network Embeddings: Instead of relying on predefined kernel functions (which can be brittle and hard to tune), DALI projects the data into numerous randomly initialized neural network embedding spaces. Because random neural networks are surprisingly good at preserving both intra-class and inter-class topological information, they provide a rich space to compute the alignment losses.
The final specification is generated by initializing a small set of random data points and optimizing them via gradient descent to minimize both the discriminative and distribution alignment losses simultaneously.
Key Insights and Results
The authors evaluated DALI using two image datasets commonly used for domain adaptation and model reuse tasks due to their hierarchical and overlapping class structures: DomainNet (5 domains) and NICO (6 domains). They extracted 4 distinct label spaces from overlapping classes across 11 domains to simulate a realistic learnware dock system containing 22 developer tasks and various unseen user requirements.
- Pseudo-labels as a Model Fingerprint: True labels dictate what the data is, but pseudo-labels reveal what the model actually learned. By forcing the specification to align with the model's pseudo-labels, DALI successfully encodes the model's unique strengths and weaknesses.
- Superior Retrieval Performance: DALI was tested on its ability to identify the most useful learnware for a given user task (measured by
Pre@k). In homogeneous label spaces, DALI achieved a perfect 100% Pre@1, vastly outperforming the standard RKME baseline (~40-50%). In harder, heterogeneous scenarios where the user's label space doesn't perfectly match the dock's models, DALI achieved 68.18% Pre@1, beating the state-of-the-art LANE method (63.64%). - Handling Mixed Tasks: When a user requirement needed a combination of models to be solved, DALI achieved 100% superclass accuracy and the highest specification quality score (94.05% vs LANE's 90.23%).
- Privacy Preservation: Because the specification is a highly compressed, optimized synthetic dataset (e.g., just 5-10 samples per class) rather than raw data, it naturally resists data leakage. Under White-Box Membership Inference Attacks (MIA), DALI kept attacker accuracy low (64.57%), comparable to other safe baselines and far below a random-sampling baseline (90.55%).
Limitations and Future Work
While highly effective, optimizing synthetic data points across numerous random neural networks introduces a computational overhead during the specification generation phase compared to simpler kernel-based methods. Additionally, the theoretical upper bounds and proofs provided in the paper rely heavily on assumptions about two-layer networks with ReLU activations; translating these guarantees to highly complex, modern architectures may require further theoretical groundwork. Future work will likely focus on scaling this dual-alignment approach to multi-modal learnwares and further optimizing the computational efficiency of the generation process.
Summary updated