Papers
Topics
Authors
Recent
Search
2000 character limit reached

Gradient-based Attacks in ML

Updated 15 January 2026
  • Gradient-based attacks are adversarial techniques that use input gradients of loss functions to craft minimal perturbations which mislead machine learning models.
  • They employ optimization methods like FGSM, PGD, and non-sign approaches to precisely manipulate inputs under norm constraints.
  • These attacks are vital for benchmarking model robustness and have fostered innovations in defense strategies across image, text, graph, and generative domains.

Gradient-based attacks are a fundamental class of adversarial attacks on machine learning models, characterized by the use of input gradients of a loss function to construct imperceptible or small-magnitude perturbations that induce misclassification or targeted errors. They are integral for evaluating model robustness, understanding adversarial transferability, and formulating or benchmarking both attacks and defenses in high-stakes domains ranging from image recognition and point cloud processing to text models, graph neural networks, and large-scale generative systems.

1. Core Principles and Taxonomy

Gradient-based attacks seek adversarial examples by perturbing input data xx in the direction that most increases (or decreases, for targeted attacks) the model loss L(θ,x,y)L(\theta, x, y). The canonical workflow comprises several modular components (Cinà et al., 2024):

  • Objective function: Defines the loss surface over which the attack is performed. Common choices include Negative Cross-Entropy (NCE), logit difference (Carlini–Wagner), and DLR.
  • Perturbation norm: Constrains the allowable perturbation. Typical norms are ℓ∞\ell_\infty, â„“2\ell_2, â„“1\ell_1, and â„“0\ell_0; minimum-norm attacks seek the smallest effective perturbation, while fixed-budget attacks operate within a fixed size ball.
  • Optimization method: Includes gradient descent (GD), momentum variants (PGD, MI-FGSM), Adam, and quasi-Newton solvers. The update direction and step-size schedule profoundly influence attack performance.
  • Projection and step-size: Enforce norm constraints using projection or proximal operators and adaptively modulate step size via cosine annealing, exponential decay, or reduce-on-plateau tactics.
  • Directionality: The raw gradient may be used directly, normalized, sign-quantized, or rescaled.

This modularity allows an expansive taxonomy encompassing FGSM [Goodfellow et al.], PGD [Madry et al.], DeepFool [Moosavi-Dezfooli et al.], CW [Carlini & Wagner], DDN, FMN, and a host of modern strategies (Cinà et al., 2024).

2. Methodologies and Innovations

Sign-based and Non-sign Methods

The Fast Gradient Sign Method (FGSM) and its iterative extensions such as I-FGSM and PGD are among the most widely used ℓ∞\ell_\infty attacks, updating xx along the sign of the input gradient [Goodfellow et al.]. This produces xadv=x+ϵ⋅sign(∇xL(θ,x,y))x_{\text{adv}} = x + \epsilon \cdot \text{sign}(\nabla_x L(\theta, x, y)). However, the sign operator quantizes each dimension, discarding gradient magnitude information and causing a substantial angular bias between the step direction and true gradient (Han et al., 2023, Cheng et al., 2021). Fast Gradient Non-sign Methods (FGNM) remedy this by rescaling the update to match the ℓ2\ell_2 length of the sign vector while aligning precisely with the true gradient direction, increasing attack efficiency without losing norm control (Cheng et al., 2021). Sampling-based Fast Gradient Rescaling (S-FGRM) leverages monotonic transforms of the log-magnitudes of gradients and depth-first stochastic averaging to further reduce update deviation and boost transferability (Han et al., 2023).

Objective and Projection Choices

Attack success rates, precision, and imperceptibility are further controlled by the choice of objective function (cross-entropy vs. logit margin), norm, and projection procedure. For instance, ℓ1\ell_1- or ℓ0\ell_0-constrained attacks leverage proximal operators or masked updates for sparse perturbations (Wang et al., 2021), while minimum-norm attacks (e.g., DDN, FMN, PDPGD) binary search the effective radius to find the smallest successful perturbation (Cinà et al., 2024).

Interval attacks augment local gradients with "interval gradients" derived from symbolic interval propagation over input boxes, allowing the attack to exploit worst-case loss trends in a neighborhood and to escape the local optima that defeat point-wise PGD, boosting violation rates substantially on adversarially trained networks (Wang et al., 2019).

Domain Adaptations

  • Points Clouds: Incorporate per-point gradient weighting and adaptive step-size procedures that reflect structural inhomogeneity. Sub-cloud attacks focus perturbations on subsets most influential for classification, markedly lowering overall perceptibility for fixed success rate (Chen et al., 28 May 2025).
  • Text Transformers: Employ gradient-based optimization in the space of categorical distributions over tokens, enforced by continuous relaxation (Gumbel-softmax) and blending adversarial magnitude, fluency, and semantic similarity constraints (Guo et al., 2021).
  • Graphs: For both node features and graph topology, gradient-based attacks leverage surrogate labeling and hypergradient approximations to enable black-box attacks, iterative edge perturbation, and homophily-regularized loss interpolation for imperceptibility (Zhan et al., 2021, Liu et al., 2022).

3. Attack Performance, Efficiency, and Benchmarks

The comparative effectiveness of gradient-based attacks depends on the alignment between the optimization pipeline and the defended model structure. The AttackBench suite provides a standardized protocol and local optimality metric (LO) for benchmarking attacks under fixed query budgets across datasets and architectures (Cinà et al., 2024). Notably:

  • No single attack uniformly dominates; the empirical optimum often requires pooling across assorted losses, directions, and projection techniques.
  • Adaptive gradient shaping (e.g., using non-sign steps or rescaling) and ensemble/ensemble-augmented attacks (e.g., MUTEN mutant ensembles) mitigate masking, leading to pronounced gains under defensive regimes (Guo et al., 2021, Han et al., 2023, Cheng et al., 2021).
  • In quantized or proxy-masked models, temperature scaling restores informative input gradients and exposes previously masked vulnerabilities (Gupta et al., 2020).

4. Transferability, Robustness, and Defenses

Transferability—the propensity for adversarial examples to fool multiple models—is a function of update precision, step-size, and loss-type (Han et al., 2023). Rescaling and depth-first averaging as in S-FGRM or FGNM reduce the angular deviation and overfit, boosting transfer. Ensemble and mutant-based attacks (e.g., via CKA-PageRank diversity maximization) generalize the attack directionality, overcoming gradient obfuscation (Guo et al., 2021). Bayesian neural networks in the overparameterized, large-data limit provide robustness to gradient-based attacks by averaging gradients over the posterior, canceling normal components and rendering the expected input gradient near zero (Carbone et al., 2020). Defenses based on denoising, dimensionality reduction, or GAN-based minimax training reshape the loss landscape or the attainable data manifold to frustrate adversarial directions (Mahfuz et al., 2021, Lindqvist et al., 2020).

5. Specialized and Advanced Scenarios

  • Data Poisoning and Byzantine Settings: Recent work establishes, even for non-convex neural networks, that the effect of any malicious gradient attack can be mimicked by data poisoning via gradient inversion—i.e., reconstructing inputs whose empirical gradients replicate arbitrary adversarial updates. As little as 1% poisoned data suffices for full model degradation (Bouaziz et al., 2024).
  • Retrieval-Augmented Generation Systems: Unified gradient-based poisoning attacks have been devised for dual-stage RAG systems, necessitating cross-vocabulary and tokenization alignment, adaptive fusion of conflicting gradient signals, and coordinated optimization across retriever and generator models (Wang et al., 6 Jun 2025).
  • Backdoor and Trigger Robustness: Gradient-shaping (GRASP) can harden backdoors against gradient-based inversion detection by increasing the model's local Lipschitz constant around trigger regions, sharply narrowing the "basins" that admit successful gradient search reconstructions without compromising attack success (Zhu et al., 2023).

6. Efficiency Considerations and Practical Recommendations

Gradient-based attack efficiency is governed by the interplay of optimizer, scheduler, projection, restart scheme, and query budget. Adaptive schedulers (cosine or reduce-on-plateau), projection-based updates, non-sign gradients, and careful hyperparameter tuning can yield near-optimal attacks within 500–1000 queries per sample (Cinà et al., 2024). Implementation details are critical: mishandled restarts, misaligned penalty searches, or library bugs can drastically degrade attack performance, underscoring the importance of standardized pipelines and public leaderboards (Cinà et al., 2024).

7. Open Challenges and Future Directions

Despite advances, key challenges persist:

  • Defenses that break the assumption of smooth, informative gradients (e.g., quantization, strong regularization) can hinder attack efficiency, though methods such as temperature scaling close this gap (Gupta et al., 2020).
  • Black-box and decision-based variants, as well as adaptive gradient-free attacks, remain outside the scope of classical gradient-based methods.
  • The extension of attack efficacy, optimality guarantees, and defense strategies to settings with complex data modalities (point clouds, sequences, graphs), and adversarial data distributions, is ongoing.
  • Certification of robustness to gradient-based and hybrid attacks, in both deterministic and randomized Bayesian models, is an active frontier (Carbone et al., 2020, Bouaziz et al., 2024).

Gradient-based attacks thus represent both a mature and rapidly evolving area of adversarial research, driving advances in robust model design, theoretically informed defense strategies, and the systematic benchmarking of machine learning safety.

Topic to Video (Beta)

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Gradient-based Attacks.