A Zest of LIME: Towards Architecture-Independent Model Distances

Hengrui Jia, Hongyu Chen, Jonas Guan, Ali Shahin Shamsabadi, Nicolas PapernotICLR 2022

Quantifying how "similar" two machine learning models are is a surprisingly difficult task, yet it is crucial for detecting stolen intellectual property, verifying machine unlearning, and understanding model distillation. Traditionally, researchers have relied on two main approaches, both of which carry significant limitations:

  1. Weight-based distances: These compare the actual internal parameters (weights) of the models. While mathematically precise, they require "white-box" access to the model and only work if both models share the exact same architecture. You cannot compare a ResNet to a MobileNet using their weights.
  2. Prediction-based distances: These compare the outputs of models on a given set of inputs. While this approach is flexible and works with "black-box" models, it is notoriously noisy. Two completely unrelated models might happen to give similar predictions on a specific dataset, or two highly related models might diverge significantly on edge cases, leading to high variance and unreliable distance metrics.

To address these flaws, researchers have introduced Zest, a novel framework for measuring the distance between machine learning models. Zest is architecture-independent, requires only black-box access, and is significantly more robust than raw prediction comparisons.

The Zest Framework: A Proxy for Weight Comparison

Zest bridges the gap between weight-based and prediction-based methods by leveraging LIME (Local Interpretable Model-Agnostic Explanations). Instead of comparing the complex models directly, Zest compares simple, local approximations of those models.

The process follows four main phases:

  1. Reference Selection: A small set of reference data points (e.g., 128 images) is sampled from the task distribution.
  2. Local Approximation: For each reference point, the algorithm uses LIME to train a simple linear regressor. This regressor approximates how the complex, black-box model behaves in that specific local neighborhood.
  3. Global Signature: The weights of these local linear models are concatenated into a single "global signature." This signature captures how the model "thinks" about features across various parts of the input space.
  4. Distance Calculation: The similarity between two models is determined by calculating the Cosine distance between their respective global signatures.
The four phases of the Zest framework: reference selection, local approximation, global signature creation, and distance calculation.

A key technical contribution of Zest is Class Alignment. This technique allows the framework to compare models even if they have different numbers of output classes (for example, comparing a general ImageNet model to a specialized dog-breed classifier) by matching the most similar explanation vectors.

The "Tangent" Intuition

To understand why Zest works, consider a geometry analogy. Comparing model predictions is like comparing individual points on a complex curve. Comparing model weights is like comparing the underlying algebraic formulas of those curves.

Zest, by using LIME, is akin to comparing the tangent lines to the curve at various points. It captures the direction and logic of the decision boundary without needing access to the underlying formula. Because the local linear models are simple, their weights are directly comparable, allowing Zest to perform a weight-space comparison by proxy, even if the "parent" models have wildly different architectures.

Key Results and Applications

The authors validated Zest across multiple domains, including vision (CIFAR, ImageNet), text (AG News), and audio (Speech Commands), proving that the "explanation-as-signature" approach is truly model-agnostic.

  • Solving Model Extraction: On the ModelReuse benchmark—which contains 144 pairs of models involving transfer learning, pruning, quantization, and distillation—Zest achieved 100% accuracy in detecting all forms of model reuse. Most notably, it succeeded in detecting "model extraction" (where an adversary trains a clone by querying a victim model), a scenario where the previous state-of-the-art method (ModelDiff) completely failed with 0% accuracy. Zest succeeds because it captures the logic of the decision boundary that the stolen model is forced to mimic.
  • Verifying Machine Unlearning: Zest can effectively distinguish between "exact unlearning" (retraining a model from scratch without the restricted data) and "approximate unlearning" (applying a quick algorithmic patch). The framework revealed that approximate unlearning often leaves the model's decision boundaries nearly identical to the original, which could potentially fail strict privacy requirements.

Limitations and Future Directions

While highly effective, Zest does come with computational overhead. Generating LIME explanations for 128+ points per model comparison is computationally more expensive than simply checking predictions. Additionally, while more robust than previous methods, the distance metric still depends on the chosen reference dataset; if the reference set fails to cover the specific areas where two models differ, their distance might be underestimated.

Future work may move beyond simple distance scores to provide finer-grained insights, potentially allowing researchers to pinpoint exactly where in the feature space two models begin to disagree.

Summary updated

BibTeX
@inproceedings{jia2022zest,
  author = {Hengrui Jia and Hongyu Chen and Jonas Guan and Ali Shahin Shamsabadi and Nicolas Papernot},
  title = {{A Zest of LIME: Towards Architecture-Independent Model Distances}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=OUz_9TiTv9j},
}
Figure