Model Immunization from a Condition Number Perspective
Amber Yijia Zheng, Cedar Site Bai, Brian Bullins, Raymond A. Yeh
TL;DR
This work addresses the risk of harmful fine-tuning of open-source models by introducing a Hessian condition-number perspective on model immunization. It develops a principled framework with two differentiable regularizers, $\mathcal{R}_{\text{ill}}$ and $\mathcal{R}_{\text{well}}$, and a gradient-based algorithm that increases the harmful-task Hessian conditioning while stabilizing the pre-training-task conditioning, analyzed for linear probes and extended to deep nets. Empirically, the method achieves strong immunization on linear models (high $\text{RIR}$) and shows robust performance on non-linear models like ResNet18 and ViT, indicating practical safety benefits for releasing pre-trained models. The approach provides a clear, theory-grounded pathway to preemptively curb relearning of harmful concepts while preserving utility, with broad implications for the safe deployment of open-source AI systems.
Abstract
Model immunization aims to pre-train models that are difficult to fine-tune on harmful tasks while retaining their utility on other non-harmful tasks. Though prior work has shown empirical evidence for immunizing text-to-image models, the key understanding of when immunization is possible and a precise definition of an immunized model remain unclear. In this work, we propose a framework, based on the condition number of a Hessian matrix, to analyze model immunization for linear models. Building on this framework, we design an algorithm with regularization terms to control the resulting condition numbers after pre-training. Empirical results on linear models and non-linear deep-nets demonstrate the effectiveness of the proposed algorithm on model immunization. The code is available at https://github.com/amberyzheng/model-immunization-cond-num.
