Can this Model Also Recognize Dogs? Zero-Shot Model Search from Weights

Jonathan Kahana, Or Nathan, Eliahu Horwitz, Yedid Hoshen

TL;DR

ProbeLog is a novel framework for searching through massive model repositories (like Hugging Face) using only a model's weights, bypassing the need for unreliable or missing documentation. By observing how a model responds to a small set of "probe" images, the researchers create a functional fingerprint that allows users to find specific classifiers—such as a "Dog" detector—using simple text queries.

What Problem Does This Paper Address?

The "Model Zoo" is becoming a jungle. Platforms like Hugging Face host over 1.2 million models, but the authors discover a startling reality: nearly 60% of these models are either undocumented or have empty "README" templates.

Currently, if you want a model that recognizes a specific niche concept, you are stuck with two bad options:

  1. Rely on text-based search (which fails if the metadata is missing).
  2. Give up and train/fine-tune a model from scratch at a high computational and environmental cost.

The authors propose a "functional" search: instead of asking what the documentation says the model does, they ask what the model actually does when given specific inputs.

Methods

The core of the paper is the ProbeLog descriptor. The process works in three main steps:

  1. Probing: A fixed set of "ordered" images (e.g., 1,000 images from the COCO dataset) are fed into every model in a repository.
  2. Descriptor Creation: For every output dimension (logit) of a model, the researchers record its response to those 1,000 images. This vector of responses becomes the "fingerprint" for that specific class.
  3. Zero-Shot Text Alignment: To search via text (e.g., "Find a dog classifier"), they use CLIP. They embed the probe images and the text query into a shared space. The similarity between the text and the images creates a "synthetic" ProbeLog descriptor, which is then compared against the library of real model descriptors.

To make this scalable, the authors introduced Collaborative Probing. Probing millions of models with thousands of images is computationally expensive. Borrowing a trick from recommendation systems (like the Netflix Prize), they probe each model with only a random subset of images and use Matrix Factorization to fill in the missing responses, reducing the encoding cost by 3x.

Datasets

Since no standard benchmark existed for "model searching," the authors curated two new datasets:

  • INet-Hub: A synthetic repository of 1,500 models trained on various subsets of ImageNet, totaling over 85,000 searchable logits.
  • HF-Hub: A "real-world" collection of 71 models (400+ logits) downloaded directly from Hugging Face. Because user-provided labels are messy, the authors manually annotated these to create a ground-truth mapping for evaluation.
  • Probes: They primarily used images from the COCO dataset as probes, demonstrating that the method works even when the probe images are "out-of-distribution" (different from the data the models were trained on).

Key Insights and Ideas

  • Logits over Models: Previous attempts at "weight-space search" tried to represent the entire model as one vector. ProbeLog argues this is wrong because a model might recognize "Dogs," "Cats," and "Cars." Searching at the logit level (individual output classes) is invariant to class order and allows for much more granular retrieval.
  • The "Top-k" Discrepancy: The authors found that standard distance metrics (like Euclidean distance) performed poorly. They developed an asymmetric discrepancy measure that focuses only on the images where the query is most "confident." This ignores the "noise" of low-confidence responses that don't help define the concept.
  • Functional Identity: The paper reinforces the idea that a model's identity isn't in its parameter values (which change with every training run), but in its responses. Two models with completely different weights can have nearly identical ProbeLog descriptors if they perform the same task.

Key Results

  • High Accuracy: On the INet-Hub, ProbeLog achieved over 40% top-1 accuracy for text-to-model search. Considering there are 1,000 possible classes, a random search would yield only 0.1%.
  • Robustness: The method generalized well to "In-the-Wild" models from Hugging Face, significantly outperforming baselines that relied on model-level representations.
  • Efficiency: Collaborative Probing proved that you don't need to see every response to understand a model. Probing with only a fraction of the images and using matrix imputation maintained high retrieval accuracy while saving massive amounts of compute.

Limitations and Future Work

  • Classification Only: Currently, the method is tailored for discriminative classification models. Extending this to generative models (like LLMs or Diffusion models) would require a different way to define "functional descriptors."
  • Niche Concepts: While COCO images work for general objects, searching for highly specialized concepts (e.g., medical imaging or specific industrial parts) might require a more curated set of probe images.
  • Scaling to Billions: While the descriptors are lightweight (the authors note 8,000 probes for 1,500 models take only 1.4GB), searching through a repository with billions of logits would require integrating with high-performance vector databases like FAISS.

Summary updated

BibTeX
@inproceedings{kahana2025can,
  author = {Jonathan Kahana and Or Nathan and Eliahu Horwitz and Yedid Hoshen},
  title = {{Can this Model Also Recognize Dogs? Zero-Shot Model Search from Weights}},
  booktitle = {WSL @ ICLR},
  year = {2025},
  url = {https://openreview.net/forum?id=fJESU1M2qj},
}
Figure