Initialization Matters for Adversarial Transfer Learning

Andong Hua, Jindong Gu, Zhiyu Xue, Nicholas Carlini, Eric Wong, Yao Qin

Introduction

In the modern AI landscape, the "Pretraining-Finetuning" paradigm is the standard for developing high-performance models. However, this approach faces a significant "robustness gap." While models can be pretrained to be resistant to adversarial attacks—small, intentional perturbations designed to fool them—this robustness often vanishes during the finetuning process on new downstream tasks.

This paper investigates whether a robust pretrained backbone is mandatory for a robust downstream model and, crucially, how the initialization of the classification "head" affects the final model's ability to resist attacks. The authors demonstrate that the adversarial robustness of a finetuned model depends heavily on its linear head initialization, proposing Robust Linear Initialization (RoLI) as a solution.

Methods

The authors evaluate six finetuning techniques: Full Finetuning (Full-FT) and various Parameter-Efficient Finetuning (PEFT) methods including Adapters, LoRA, Bias-only tuning, Visual Prompt Tuning (VPT), and Linear Probing.

Overview of different finetuning and parameter-efficient methods analyzed in the study.

The core contribution, RoLI, replaces the standard practice of random linear initialization (RanLI) with a two-step process:

  1. Adversarial Linear Probing: The robust pretrained backbone is frozen, and only the linear head is trained using adversarial training. This establishes a "robust starting point" aligned with the backbone's existing features.
  2. Adversarial Finetuning: The weights from the first step serve as the starting point for adversarial finetuning of the desired parameters (either the full model or PEFT modules).

Key Insights

  • Backbone Quality is Essential: Starting with a non-robust backbone (e.g., standard CLIP) makes it nearly impossible for PEFT methods to achieve adversarial robustness on downstream tasks. Robustness cannot be easily "injected" into a brittle backbone during efficient finetuning.
  • The "Head" as a Bottleneck: Randomly initializing the linear head forces the model to re-learn feature-to-label connections. During this process, adversarial training often distorts the backbone's robust features to accommodate the random head, degrading final robustness.
  • Linear Probing as a Preserver: Adversarial linear probing effectively preserves inherited robustness because it leaves the backbone untouched. RoLI leverages this to "warm up" the head before allowing backbone modifications.
  • Regularization Effects: RoLI acts as a regularizer. By starting with a better-aligned head, the model is less likely to overfit to adversarial perturbations in the training set, leading to superior generalization.

Key Results

RoLI consistently outperforms random initialization across multiple benchmarks, including CIFAR-10/100, Caltech256, CUB200, and Stanford Dogs using ViT-B/16 and Swin-B architectures.

Comparison of PGD Robustness vs. Clean Accuracy for various methods using Random (RanLI) vs. Robust (RoLI) initialization.
  • Performance Boost: On average, RoLI improves clean accuracy by 3.88% and robust accuracy by 2.44% compared to RanLI.
  • New State-of-the-Art: RoLI combined with Full-FT achieved 84.01% clean accuracy and 46.25% robust accuracy (averaged across five datasets), setting a new benchmark for adversarial transfer learning.
  • PEFT Synergy: RoLI significantly enhances the performance of efficient methods like LoRA and Adapters, making them viable for security-critical applications where full finetuning might be too costly.

Limitations and Future Work

While effective, RoLI introduces an extra computational step (the linear probing phase), increasing total training time. Future research is needed to determine if these initialization benefits extend beyond image classification to domains like object detection or natural language processing. Additionally, the method remains dependent on the availability of a robustly pretrained backbone, which may not exist for all niche architectures.

Summary updated

BibTeX
@inproceedings{hua2023initialization,
  author = {Andong Hua and Jindong Gu and Zhiyu Xue and Nicholas Carlini and Eric Wong and Yao Qin},
  title = {{Initialization Matters for Adversarial Transfer Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure