Robustness Reprogramming for Representation Learning

Zhichao Hou, MohamadAli Torkamani, Hamid Krim, Xiaorui Liu

Deep neural networks (DNNs) are famously powerful but notoriously fragile. A tiny, imperceptible "adversarial" tweak to an image can send a state-of-the-art classifier into a tailspin. While researchers have developed defenses like adversarial training, these often require massive computational resources and can degrade performance on normal, "clean" data.

In a new paper, researchers propose a different path: Robustness Reprogramming. Instead of retraining a model from scratch, they ask if we can "reprogram" the fundamental way a pre-trained model processes information to make it inherently resistant to noise and attacks.

The Core Vulnerability

The core vulnerability of DNNs lies in their basic building blocks: linear transformations (like dot products in MLPs or convolutions in CNNs). These operations are mathematically equivalent to "Linear Pattern Matching" (LPM).

The authors point out a critical flaw: LPM is essentially a least-squares optimization. In statistics, least-squares is famously sensitive to outliers. In the context of deep learning, an adversarial perturbation acts as a set of "outliers" that disproportionately influence the output of a neuron, leading to incorrect classifications. Existing defenses often try to "train away" this sensitivity, but this is computationally expensive and often results in a "catastrophic pitfall" where the model forgets how to handle clean data well.

Methods: From Least-Squares to Robust Statistics

To address this, the researchers propose replacing the standard linear layer with Nonlinear Robust Pattern Matching (NRPM).

Instead of the least-squares approach (minimizing squared residuals), NRPM is inspired by Least Absolute Deviation (LAD). By minimizing the absolute difference rather than the squared difference, the model becomes much less sensitive to the "outliers" introduced by an attacker.

Comparison of Vanilla Linear Pattern Matching (LPM) and the proposed Nonlinear Robust Pattern Matching (NRPM).

To make this work inside a neural network, they use an algorithm called Newton-IRLS (Iterative Reweighted Least Squares). This algorithm effectively "reweights" the input features on the fly: features that look like noisy outliers are given low weights, while reliable features are emphasized.

Three Paradigms of Reprogramming

The authors provide a framework for how to use NRPM with existing models:

  1. Paradigm 1 (Zero Cost): Freeze the pre-trained model parameters and simply swap the layers. This is highly efficient and requires no training.
  2. Paradigm 2 (Light Fine-tuning): Keep the model parameters frozen but learn a small set of "mixing weights" to balance the standard linear output and the robust NRPM output.
  3. Paradigm 3 (Full Fine-tuning): Fine-tune both the model parameters and the mixing weights for maximum robustness.

Key Insights and Results

  • The "Median" Advantage: NRPM behaves more like a median-based estimator than a mean-based one. Just as the median of a list of numbers is less affected by a single huge outlier than the average is, NRPM "ignores" adversarial pixels.
  • Dynamic Defense: Because NRPM uses an iterative algorithm during the forward pass, it effectively performs a mini-optimization to "purify" the features of every single input it sees.
  • Orthogonality: This method is "orthogonal" to existing defenses. You can take a model that has already undergone adversarial training and then apply robustness reprogramming to make it even stronger.

The results are striking. On CIFAR-10 using a ResNet-18 backbone, their method achieved an average robustness of 58.03% across various attacks, significantly outperforming established baselines like TRADES (44.54%) and MART (46.96%).

Limitations and Future Work

While powerful, the method has a few hurdles. Because NRPM requires several iterations of the Newton-IRLS algorithm for every layer, it is slower than a standard forward pass. Additionally, in Paradigm 1 (no training), there is often a slight drop in accuracy on clean, non-attacked data. Finding the perfect balance remains a key task.

Future work could involve optimizing the NRPM operation for specialized hardware or exploring how this "reprogramming" logic applies to Large Language Models (LLMs), where adversarial "jailbreaking" is a major concern.

Summary updated

BibTeX
@inproceedings{hou2025robustness,
  author = {Zhichao Hou and MohamadAli Torkamani and Hamid Krim and Xiaorui Liu},
  title = {{Robustness Reprogramming for Representation Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=SuH5SdOXpe},
}
Figure