Abstract
Access to pre-trained models has recently emerged as a standard across numerous machine learning domains. Unfortunately, access to the original data the models were trained on may not equally be granted. This makes it tremendously challenging to fine-tune, compress models, adapt continually, or to do any other type of data-driven update. We posit that original data access may however not be required. Specifically, we propose Contrastive Abductive Knowledge Extraction (CAKE), a model-agnostic knowledge distillation procedure that mimics deep classifiers without access to the original data. To this end, CAKE generates pairs of noisy synthetic samples and diffuses them contrastively toward a model’s decision boundary. We empirically corroborate CAKE’s effectiveness using several benchmark datasets and various architectural choices, paving the way for broad application.
Introduction
Knowledge Distillation (KD) is a cornerstone technique for model compression, where a large "teacher" model transfers its knowledge to a smaller, more efficient "student" model. Traditionally, this process relies on the availability of the original training data. However, in many real-world scenarios, data is restricted due to privacy concerns, proprietary rights, or simple loss over time.
Existing data-free distillation methods often impose significant constraints. Generative approaches typically require training a separate GAN, while inversion methods like DeepInversion rely on specific architectural features, such as Batch Normalization layers, to reconstruct data. This leaves a gap for truly model-agnostic distillation that can handle "black-box" models or architectures like Vision Transformers (ViTs) that lack standard normalization layers. Contrastive Abductive Knowledge Extraction (CAKE) addresses this by focusing on the teacher's decision boundaries rather than data reconstruction.
Methodology: The CAKE Framework
CAKE is built on the philosophy of Abductive Knowledge Extraction, asserting that a student model primarily needs to understand the teacher's decision boundaries to mimic its behavior effectively. The process involves three key stages:
- Contrastive Diffusion: The method generates pairs of noisy synthetic samples. Using a contrastive loss, these samples are "pulled" toward each other across the teacher's decision boundary, identifying the regions where the teacher is most uncertain or where class labels transition.
- Noise Injection: To prevent synthetic samples from collapsing into redundant points, CAKE injects noise (or uses Langevin dynamics in a variant called LAKE). This sweeps the samples along the decision boundary, ensuring the student learns the boundary's global geometry.
- Domain Priors: While data-free, CAKE utilizes basic meta-knowledge. For image tasks, a Total Variation (TV) prior is applied to encourage local pixel consistency, preventing the synthetic samples from becoming pure high-frequency noise.
Experimental Results
The effectiveness of CAKE was validated across standard benchmarks including MNIST, Fashion-MNIST, SVHN, and CIFAR-10.
Performance Benchmarks
On the CIFAR-10 dataset, CAKE achieved a remarkable 78.9% accuracy when distilling a ResNet-34 teacher into a ResNet-18 student. This significantly outperforms model-agnostic baselines like DeepDream, which reached only 30.0%. Furthermore, CAKE remains competitive with methods that utilize original data; on MNIST, it achieved 98.4% accuracy, trailing the data-access baseline by less than 1%.
Model Agnosticism and Flexibility
A core strength of CAKE is its architectural flexibility. The authors demonstrated successful knowledge transfer between disparate architectures, including MLPs, CNNs, and Vision Transformers. A key finding, dubbed the "ResNet Rule," suggests that when the teacher's architecture is unknown, a ResNet student provides the most stable and reliable performance.
Key Insights
- Boundary > Fidelity: CAKE proves that synthetic samples do not need to be visually recognizable to be effective. While the generated samples often look like adversarial noise, they contain the critical boundary information necessary for high-fidelity mimicry.
- Privacy Implications: Because the synthetic samples bear no resemblance to the original training data, CAKE provides a potential framework for privacy-preserving model transfers where the underlying data remains hidden.
Limitations and Future Work
Despite its success, CAKE requires gradient access (a callable backward function), which may not be available in restricted API-based black-box scenarios. Additionally, the optimization process for generating synthetic samples is more computationally intensive than standard training. Future research may explore gradient-free alternatives or methods to mitigate the transfer of biases from the teacher to the student model.
Summary updated