Introduction
We live in an era of "open-weight" models like Llama and ResNet. However, "open weights" rarely means "open data." Often, the original training sets are proprietary, restricted, or simply too massive to download. This creates a significant hurdle for model modification tasks, such as pruning a model for speed or "unlearning" specific data for privacy.
Traditional methods for these tasks rely on gradients and the original loss function, which are unavailable in "data-free" settings. While some workarounds exist, they are often architecture-specific or require expensive fine-tuning. ModHiFi introduces a new, unified framework for modifying deep learning models without needing access to the original training data, loss functions, or gradients. By introducing a metric called Subset Fidelity, the authors identify a tiny fraction of "High-Fidelity" components that drive model performance, enabling efficient model editing using only synthetic data.
The Core Problem: Data-Free Modification
Modifying pre-trained models typically falls into two major categories:
- Structured Pruning: Reducing a model's size and latency by removing redundant channels or neurons.
- Classwise Unlearning: Forcing a model to "forget" a specific category of data (e.g., for copyright or privacy reasons).
Without access to the original training pipeline, these tasks become computationally and mathematically challenging. ModHiFi aims to bridge this gap with a mathematically grounded, architecture-agnostic approach that works even when only a handful of synthetic samples are available.
Methodology: Subset Fidelity
The "secret sauce" of this paper is the concept of Subset Fidelity.
The authors theoretically demonstrate that for Lipschitz-continuous networks—which include CNNs and, as they prove, well-trained Transformers—the global error of a model is linearly bounded by the local reconstruction errors at each layer. This means if you can find a small subset of neurons or channels that can accurately reconstruct a layer's output, you have found the components that matter most for the entire model's prediction.
The ModHiFi algorithm operates in three steps:
- Fidelity Estimation: It uses synthetic data (distributional access) to compute "singleton fidelity scores" for every component in a layer.
- HiFi Selection: It identifies the "High-Fidelity" (HiFi) components—the top-performing subset.
- Modification:
- ModHiFi-P (Pruning): Keeps the HiFi components and discards the rest. Crucially, it uses a closed-form "compensation term" to adjust the remaining weights, recovering accuracy without needing backpropagation.
- ModHiFi-U (Unlearning): Identifies the HiFi components most responsible for a specific "forget" class and zeroes them out or disrupts them.
Key Insights
- The 20% Rule: Across various models, the authors found that fewer than 20% of components typically achieve "high fidelity" (scores $\ge 0.8$). This confirms that modern models are heavily over-parameterized and that importance is concentrated in a small "HiFi" core.
- Transformers are Lipschitz (Mostly): There has been debate about whether Transformers exhibit Lipschitz continuity. The authors show that well-trained Transformers actually do, which justifies applying their local-to-global error bounds to Large Language Models (LLMs).
- Gradient-Free is Viable: You don't need to calculate complex gradients to find what's important. Simple forward passes on synthetic data are enough to estimate Subset Fidelity.
Experimental Results
The researchers evaluated ModHiFi across a variety of domains, using synthetic images generated by diffusion models for vision tasks, and datasets like WikiText-2 and Alpaca for language tasks.
- State-of-the-Art Pruning: ModHiFi-P achieved an 11% speedup over the previous state-of-the-art (DFPC) on ImageNet models while maintaining similar accuracy.
- Zero-Shot Unlearning: On CIFAR-10, ModHiFi-U achieved complete unlearning (reducing "forget class" accuracy to near zero) without any fine-tuning. This is significantly faster than retraining-based methods.
- LLM Efficiency: On Llama-2-7B and OPT-125M, ModHiFi-P remained competitive with specialized LLM pruning tools like SliceGPT and ShortGPT, despite being a more general-purpose algorithm.
- Scalability: The algorithm's complexity is linear relative to the number of layers, making it much faster than quadratic-complexity competitors.
Limitations and Future Work
While powerful, the authors note a few areas for future exploration:
- Initialization Sensitivity: The theoretical bounds rely on the Lipschitz property, which might not hold for models that haven't been well-trained yet.
- Metric Exploration: Currently, the method uses expected square loss to measure similarity. Future work could explore other metrics like Wasserstein distance or Total Variation (TV) distance.
- Complex Unlearning: While unlearning is "instant" for CNNs, more complex architectures like Swin Transformers still require a small amount of fine-tuning to reach peak performance after the HiFi components are removed.
Summary updated