Manuscript Offprint

arXiv:2609.31310

Revisiting Certified Defense with Differential Privacy on Vision Transformers

Jun Yan, Weiquan Huang, Qixian Zhang, Yan Bai, Shutai Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Jun Yan

SHOU

yanjun@ieee.org

Weiquan Huang

Tongji University

weiquanh@tongji.edu.cn

Qixian Zhang

Tongji University

zhangqx@tongji.edu.cn

Yan Bai

Independent Researcher

baiyan1996@icloud.com

Shutai Zhanng

SHOU

stzhang@shou.edu.cn

Abstract

Certified defenses that incorporate differential privacy have proven effective on Convolutional Neural Networks (CNNs), furnishing rigorous robustness guarantees against norm-bounded adversaries. However, the certified robustness behavior of Pixel Differential Privacy (PixelDP) remains largely unexplored with the self-attention architecture now dominating the deep-learning landscape. Given that the Transformer has a profound impact on our daily applications from the digital world to the physical world, it is crucial to study certified robustness through differential-privacy-style stability. To fill this research gap, we revisit this construction in Vision Transformers and identify a failure mode that is largely hidden in the convolutional setting. When noise is injected after the patch embedding, the Laplace mechanism with the inherited grouped ℓ1\ell_1 sensitivity bound collapses to chance-level accuracy across noise scales, whereas the Gaussian mechanism remains trainable. This contrast isolates the source of failure: not the injected noise itself, but the geometry of the sensitivity constraint. We show that the attenuation induced by the inherited Δ1,1\Delta_{1,1} projection increases with layer width and kernel size according to a random-matrix scale C/(M+N)C/(\sqrt{M} + \sqrt{N}). Replacing the ℓ1\ell_1-type constraint with a spectral-norm constraint eliminates the collapse across datasets and architectures, but creates a fundamental obstacle: the repaired models no longer satisfy the sensitivity condition required by the standard Laplace certificate. We resolve this mismatch by deriving a dimension-free (ε,δ)(\varepsilon, \delta)-privacy guarantee for the Laplace mechanism under ℓ2\ell_2 sensitivity through concentration of the privacy loss. The resulting certificate applies directly to the repaired models without retraining and avoids the d\sqrt{d} privacy degradation incurred by the naive conversion from ℓ2\ell_2 to ℓ1\ell_1 sensitivity. Experiments on CIFAR-10, CIFAR-100, and SVHN reproduce the failure-and-repair pattern, while ImageNet confirms that the inherited grouped-bound failure persists at scale. Finally, matched-budget experiments show that adversarial training improves certified accuracy at the evaluated positive radii.

1. Introduction

While deep neural networks (DNNs) empower social life, they also raise various security and privacy concerns [5]. During inference, a network may be threatened by adversarial examples. An attacker can cause the model to make incorrect predictions by adding imperceptible perturbations [20, 31]. It poses serious risks to safety-critical applications such as autonomous driving [19] and robotics [42].

In addition to empirical defenses [31, 44, 45], the certified defense approaches [11, 29, 46] offer provable robustness guarantees under explicit assumptions. PixelDP [28] is a general framework that leverages differential-privacy-style stability [1, 17] to certify robustness against norm-bounded input perturbations. It constrains the sensitivity of a pre-noise mapping and injects calibrated noise to stabilize the randomized prediction.

However, previous research on the certified robustness of differential privacy mainly focuses on Convolutional Neural Networks (CNNs) [22, 38]. Transformers use self-attention to model global interactions between tokens [16, 40]. The recent scaling law [23] suggests that increasing model and data scale can improve predictive performance [23]. Transformers can be trained on huge amounts of data and are hardware friendly for large-scale parallel processing, making them widely used as the backbone for building general artificial intelligence base models [6]. The large language model serving the public in the cloud [21] and the general-purpose robot operating at the edge [26] are built on this transformer architecture that can predict the next token. Nevertheless, it is still insufficient to explore the robustness of defense with differential privacy in this new architecture.

To bridge this gap, we rethink the certified defense with differential privacy on the vision transformer architectures. Our study aims to resolve such a research problem:

How can PixelDP be ported to self-attention architectures while preserving a valid and useful robustness certificate?

This paper revisits the pipeline in the new setting, as illustrated in Fig. 1. Addressing this problem requires resolving two technical challenges. First, standard dot-product self-attention is not globally Lipschitz on an unbounded domain. We therefore inject noise immediately after the patch embedding, a linear layer whose sensitivity can be explicitly controlled, exactly as PixelDP treats a first convolution. Our experiments confirm the distinction sharply. Noise placed after an attention block is absorbed by training and leaves accuracy at the baseline for every noise level, which certifies nothing, whereas noise after the patch embedding behaves as the theory prescribes. Second, PixelDP's Gaussian arm degrades gracefully under the faithful port, while the Laplace arm may collapse to chance accuracy even at the smallest noise level. The failure is not a matter of noise magnitude, since the Gaussian mechanism injects a larger standard deviation at the same attack bound and trains without difficulty. Nor is it intrinsic to the Laplace distribution; the original PixelDP pipeline trains Laplace models on the same grid without incident, on convolutions. The culprit is the grouped convolution bound inherited by the Laplace route. For a non-overlapping patch embedding, this bound aggregates all spatial kernel locations of an input channel and is substantially more conservative than the exact stride-aware ℓ1→ℓ1\ell_1 \to \ell_1 operator norm. We prove a random-matrix law showing that, relative to the spectral projection used by the Gaussian route, the resulting attenuation scales as C/(M+N)C/(\sqrt{M} + \sqrt{N}) under the Gaussian initialization model. At the measured ViT patch embedding, this large norm ratio predicts a severe drop in the local signal-to-noise ratio, which makes optimization substantially harder and accounts for the failure we observe across all training recipes. This diagnosis suggests its own experiment. We decouple the constraint from the mechanism and train Laplace models under the spectral constraint of the Gaussian route, changing nothing else. The spectral repair also restores trainability across CIFAR-10, CIFAR-100, and SVHN. The grouped-bound failure also persists at ImageNet scale on the autoencoder configuration of the original pipeline. The causal chain is complete, but the repair is not yet a defense. The Laplace mechanism's (ε,0)(\varepsilon, 0) guarantee is proved from an ℓ1\ell_1 sensitivity bound, the spectral constraint provides an ℓ2\ell_2 bound, and the naive conversion between the two costs a factor of d\sqrt{d} in the privacy budget, about 111 at our noise layer, which would demand a hundredfold larger noise.

To close this certification gap in PixelDP, we specialize the existing ℓ2\ell_{2}-sensitivity Laplace guarantee to our setting and give a direct privacy-loss derivation for completeness. The analysis framework needs only a closed form for the shifted first absolute moment of a Laplace variable and Hoefding's inequality applied to the privacy loss, whose coordinates are independent and bounded. The guarantee plugs directly into the PixelDP certification procedure, holds at every attack radius without group privacy, and applies to our trained checkpoints as a re-certification, with no retraining. It also quantifies an honest cost. At matched (ε,δ)(\varepsilon, \delta) the calibrated Laplace noise carries about 1.47×1.47 \times the standard deviation of the Gaussian mechanism, so Gaussian remains the efficient choice for pure ℓ2\ell_{2} defense, and the value of the theorem is that it closes a gap the original framework left open and turns a diagnostic into a certified configuration.

Finally we ask whether the certified accuracy of the faithful port can be improved rather than merely explained. Following the margin perspective of adversarially trained smoothing [37], we combine the noise layer with ℓ2\ell_{2} adversarial training under a matched-budget protocol that isolates the effect of the attack from the training recipe. On all three datasets, adversarial training improves certified accuracy over the nonzero operating region of the matched controls. On SVHN the joint training collapses to the class prior and a two-phase schedule, noisy pretraining followed by adversarial fine-tuning, restores it, which we report as a practical recipe.

Our contributions are the following.

• A faithful port of PixelDP to Vision Transformers with a placement analysis showing that the patch embedding provides a simple and directly enforceable pixel-space sensitivity bound.

• We identify severe over-attenuation under the inherited grouped ℓ1\ell_{1} bound. A random-matrix law predicts its scale, while exact stride-aware and spectral controls isolate the effect of the sensitivity constraint.

• We connect the repaired spectral configuration to an existing approximate-DP guarantee for coordinatewise Laplace noise under ℓ2\ell_{2} sensitivity [3], derive the corresponding closed-form PixelDP calibration, and show that existing repaired checkpoints can be certified without retraining.

• An ImageNet study across Inception and ViT-Base backbones confirming the post-processing property empirically, and a matched-budget adversarial training ablation showing certified gains at every radius on CIFAR-10, CIFAR-100, and SVHN.

References (42)

  • Deep learning with differential privacy
  • Data dependent randomized smoothing
  • Count on your elders: Laplace vs gaussian noise (opens arXiv in a new tab)
  • Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples
  • Science, 384(6698):842–845, 2024
  • Sparks of Artificial General Intelligence: Early experiments with GPT-4
  • Towards evaluating the robustness of neural networks
  • How smooth is attention? In International Conference on Machine Learning, pages 5817–5840, 2024
  • Broadening the scope of differential privacy using metrics
  • The use of confidence or fiducial limits illustrated in the case of the binomial
  • Certified adversarial robustness via randomized smoothing
  • Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks
  • A light recipe to train robust vision transformers
  • Imagenet: A large-scale hierarchical image database
  • Gaussian differential privacy
  • Transformers for image recognition at scale
  • The algorithmic foundations of differential privacy
  • Robust physical-world attacks on deep learning visual classification
  • Explaining and harnessing adversarial examples
  • Nature, 645(8081):633–638, 2025
  • Deep residual learning for image recognition
  • Scaling Laws for Neural Language Models
  • Some fundamental aspects about lipschitz continuity of neural networks
  • The lipschitz constant of self-attention
  • Openvla: An open-source vision-language-action model
  • Certified robustness to adversarial examples with differential privacy
  • Sok: Certified robustness for deep neural networks
  • Adaptive randomized smoothing: Certified adversarial robustness for multi-step defences
  • Towards deep learning models resistant to adversarial attacks
  • When adversarial training meets vision transformers: Recipes from training to architecture
  • Reading digits in natural images with unsupervised feature learning
  • Lipsformer: Introducing lipschitz continuity to vision transformers
  • Certified adversarial robustness via randomized alpha-smoothing for regression models
  • Overfitting in adversarially robust deep learning
  • Provably robust deep learning via adversarially trained smoothed classifiers
  • Rethinking the inception architecture for computer vision
  • Incremental randomized smoothing certification
  • Attention is all you need
  • Exploring the adversarial vulnerabilities of vision-language-action models in robotics
  • Augment then smooth: Reconciling differential privacy with certified robustness
  • Enhance adversarial robustness via geodesic distance
  • Theoretically principled trade-off between robustness and accuracy