Towards Fundamentally Scalable Model Selection: Asymptotically Fast Update and Selection

Wenxiao Wang, Weiming Zhuang, Lingjuan LyuarXiv 2024 · DOI

Abstract

As the number of pre-trained models on platforms like Hugging Face exceeds hundreds of thousands, selecting the optimal model for a specific downstream task has become a significant computational challenge. This paper presents Isolated Model Embedding (IME), a framework that achieves fundamental scalability by ensuring both model updates and selection are computationally efficient. By decoupling model embeddings from the rest of the pool, IME allows for $O(1)$ update complexity while maintaining high selection accuracy.

Introduction: The Scalability Bottleneck

The current landscape of AI is characterized by an explosion of pre-trained models. However, finding the "needle in the haystack"—the best model for a specific task—remains difficult. Traditional approaches generally fall into two categories:

  1. Brute Force: Evaluating every model on the target data. While accurate, its $O(m)$ complexity (where $m$ is the number of models) makes it unusable for large-scale hubs.
  2. Joint Model Embedding: Mapping models into a shared vector space. While selection is fast, adding a new model requires re-optimizing the entire space, leading to an $O(m)$ update cost.
Comparison of model selection paradigms: (a) Brute-force, (b) Joint Model Embedding, and (c) the proposed Isolated Model Embedding.

The authors propose a third paradigm: Isolated Model Embedding, where models are embedded independently of one another, ensuring that the cost of adding a model does not grow with the size of the library.

Methodology: The Standardized Embedder

The core of the IME framework is the Standardized Embedder, which acts as a universal translator. The process involves several key steps:

  • Baseline Selection: A well-known model (e.g., ResNet-18 or Swin Transformer) is chosen to provide a fixed set of baseline features.
  • Isolated Model Embedding: Each candidate model is analyzed to determine how well it can approximate specific subsets of the baseline's features. This is done using affine transformations and cosine similarity to identify "functionality equivalence" without needing access to other models in the pool.
  • Task Embedding (Feature Sifting): For a new downstream task, the system identifies which baseline features are most critical using sparsity regularization ($ℓ_1$ norm).
  • Selection via Fuzzy Intersection: The system compares the task's requirements with the models' capabilities. A model is selected if its "owned" features align with the task's "needed" features.
The full pipeline of Isolated Model Embedding, showing model embedding via a baseline model and task-specific selection.

Experimental Evaluation

The researchers evaluated IME using a pool of 100 pre-trained vision models from torchvision and timm, including various architectures like ResNets and Vision Transformers. Testing was conducted on standard benchmarks: CIFAR-10, CIFAR-100, and STL-10.

Key Results

  • High Accuracy: The selection quality was near-optimal. For CIFAR-10, the gap between the selected model and the ground-truth best was only 0.03%.
  • Constant-Time Updates: The update complexity remained $O(1)$, confirming that the system scales perfectly as the model pool grows.
  • Baseline Expressivity: Using more advanced architectures like the Swin Transformer as a baseline improved selection performance, as they offer a more expressive feature set.

Discussion and Key Insights

The IME framework offers several advantages beyond pure speed:

  • Decentralization: Model owners can compute and publish their own embeddings privately.
  • Efficiency: The system distinguishes between expensive "model operations" (GPU passes) and cheap "vector operations" (mathematical comparisons), making the selection process feel instantaneous.
  • Privacy: Users can select models without exposing their sensitive downstream data to model providers.

Limitations

Despite its success, the framework faces challenges. A major "paradigm shift" in AI architectures might necessitate a new baseline model, requiring a one-time re-embedding of the pool. Additionally, while highly effective for vision tasks, its application to Large Language Models (LLMs) and multi-modal tasks remains a subject for future research.

Conclusion

Isolated Model Embedding provides a robust solution to the model selection problem in the era of massive model hubs. By prioritizing independent, standardized embeddings, it achieves the elusive goal of $O(1)$ update complexity without sacrificing selection quality, paving the way for truly scalable AI model management.

Summary updated

Abstract

The advancement of deep learning technologies is bringing new models every day, motivating the study of scalable model selection. An ideal model selection scheme should minimally support two operations efficiently over a large pool of candidate models: update, which involves either adding a new candidate model or removing an existing candidate model, and selection, which involves locating highly performing models for a given task. However, previous solutions to model selection require high computational complexity for at least one of these two operations. In this work, we target fundamentally (more) scalable model selection that supports asymptotically fast update and asymptotically fast selection at the same time. Firstly, we define isolated model embedding, a family of model selection schemes supporting asymptotically fast update and selection: With respect to the number of candidate models $m$, the update complexity is O(1) and the selection consists of a single sweep over $m$ vectors in addition to O(1) model operations. Isolated model embedding also implies several desirable properties for applications. Secondly, we present Standardized Embedder, an empirical realization of isolated model embedding. We assess its effectiveness by using it to select representations from a pool of 100 pre-trained vision models for classification tasks and measuring the performance gaps between the selected models and the best candidates with a linear probing protocol. Experiments suggest our realization is effective in selecting models with competitive performances and highlight isolated model embedding as a promising direction towards model selection that is fundamentally (more) scalable.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
CIFAR-100Best candidate (ground truth)downstream accuracy82.58%linear-probe
Source quote
L234: \multirow{7}{*}{82.58%}
CIFAR-100Standardized Embedder (ResNet-18 baseline features; 10k embedding steps per candidate; top-1 selection)downstream accuracy80.13%linear-probe · backbone=ResNet-18
Source quote
L244: \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}80.13% (2.45%)}
CIFAR-100Standardized Embedder (Swin-T (tiny) baseline features; 10k embedding steps per candidate; top-1 selection)downstream accuracy81.48%linear-probe · backbone=Swin-T
Source quote
L258: \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}81.48% (1.10%)}
STL-10Best candidate (ground truth)downstream accuracy99.24%linear-probe
Source quote
L262: \multirow{7}{*}{99.24%}
STL-10Standardized Embedder (ResNet-18 baseline features; 10k embedding steps per candidate; top-1 selection)downstream accuracy97.51%linear-probe · backbone=ResNet-18
Source quote
L272: \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}97.51% (1.72%)}
STL-10Standardized Embedder (Swin-T (tiny) baseline features; 10k embedding steps per candidate; top-1 selection)downstream accuracy98.60%linear-probe · backbone=Swin-T
Source quote
L286: \multicolumn{1}{c|}{\begin{tabular}[c]{@{}c@{}}98.60% (0.64%)}
BibTeX
@misc{wang2024towards,
  author = {Wenxiao Wang and Weiming Zhuang and Lingjuan Lyu},
  title = {{Towards Fundamentally Scalable Model Selection: Asymptotically Fast Update and Selection}},
  year = {2024},
  eprint = {2406.07536},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.07536},
}
Figure