SHiFT: An Efficient, Flexible Search Engine for Transfer Learning

Cédric Renggli, Xiaozhe Yao, Luka Kolar, Luka Rimanic, Ana Klimovic, Ce Zhang

Abstract

Transfer learning has become the standard paradigm for developing high-quality machine learning applications. However, the proliferation of pre-trained models in public repositories has created a "model selection" bottleneck, where practitioners must choose from thousands of candidates. This paper introduces SHiFT, a dedicated search engine designed to efficiently identify optimal pre-trained models for specific downstream tasks. By treating model selection as a data management problem, SHiFT utilizes a declarative query language (SHiFT-QL) and database-inspired optimizations, including successive halving and incremental execution. Our evaluation demonstrates that SHiFT can identify high-performing models up to 45x faster than brute-force fine-tuning while maintaining near-optimal accuracy.

Introduction

In the current machine learning landscape, training from scratch is rarely the first step. Instead, practitioners leverage transfer learning, fine-tuning models pre-trained on massive datasets like ImageNet or Wikipedia for specialized tasks. While this approach is effective, the scale of available models has outpaced our ability to evaluate them. Model hubs such as HuggingFace and TensorFlow Hub host tens of thousands of checkpoints, leaving developers to rely on "gut feeling" or computationally expensive brute-force searches.

SHiFT addresses this challenge by providing a unified, efficient framework to programmatically search across diverse model repositories. By abstracting the selection process into a queryable system, SHiFT allows for complex, multi-objective search strategies that balance accuracy, model size, and computational cost.

System Architecture and Methods

SHiFT is built on the premise that model selection is fundamentally a data management task. Its architecture consists of several novel components designed to minimize redundant computation and maximize search efficiency.

SHiFT-QL: A Declarative Query Language

At the core of the system is SHiFT-QL, a SQL-like language that allows users to define search strategies declaratively. Rather than writing custom scripts for every search, users can specify constraints and objectives—for example, selecting the top five models based on linear classifier accuracy that also meet a specific parameter count threshold. This abstraction decouples the what of the search from the how of the execution.

Optimization Strategies

To accelerate the search process, SHiFT implements several key optimizations:

  • Successive Halving (SH): Borrowed from hyperparameter optimization, this technique prunes the search space early. SHiFT begins with a large pool of candidate models, evaluates them on a small subset of data, and iteratively discards the bottom-performing half while increasing the resources allocated to the remaining candidates.
  • Cost-Based Decision Maker: Because optimizations like Successive Halving can introduce overhead (e.g., model loading times), SHiFT employs a cost model to decide the most efficient execution path based on the dataset size and model complexity.
  • Incremental Execution: Recognizing that ML development is iterative, SHiFT caches intermediate results such as feature vectors. When a user updates their dataset, SHiFT only processes the new data, avoiding the need to re-run the entire search from scratch.

Experimental Evaluation

The researchers evaluated SHiFT across both Computer Vision (CV) and Natural Language Processing (NLP) domains. The CV evaluation utilized 100 models across datasets including Oxford Flowers 102, CIFAR-100, and the VTAB-1K benchmark. The NLP evaluation focused on 60 models tested against the GLUE benchmark (specifically the cola and sst2 tasks).

Key Results

  • Search Speed: SHiFT achieved speedups of 22.6x to 45.0x compared to exhaustive fine-tuning on vision tasks.
  • Optimization Gains: The inclusion of Successive Halving provided a 1.57x speedup over a baseline search implementation without pruning.
  • Incremental Efficiency: For iterative updates where 10% of the dataset was modified, SHiFT’s incremental execution was up to 4.0x faster than a full re-run.
  • Search Quality: In nearly all scenarios, the models identified by SHiFT queries achieved accuracy within a fraction of a percentage point of the absolute best model in the candidate pool, demonstrating extremely low "regret."

Discussion and Future Work

SHiFT demonstrates that treating model selection as a database query problem can yield massive efficiency gains. However, some limitations remain. The current cost model is less effective when dealing with highly heterogeneous model pools where inference times vary wildly. Furthermore, while SHiFT-QL is robust, future iterations could benefit from advanced database techniques like predicate push-down to optimize query trees before execution.

While the current framework focuses on classification, the underlying principles of SHiFT—declarative search, early pruning, and incremental execution—provide a blueprint for scaling model selection across other domains, including generative AI and object detection.

Summary updated

BibTeX
@article{renggli2022shift,
  author = {Cédric Renggli and Xiaozhe Yao and Luka Kolar and Luka Rimanic and Ana Klimovic and Ce Zhang},
  title = {{SHiFT: An Efficient, Flexible Search Engine for Transfer Learning}},
  journal = {Proc. VLDB Endow.},
  year = {2022},
  url = {https://openreview.net/forum?id=h9yHch3W7h},
}
Figure