Papers
Topics
Authors
Recent
Search
2000 character limit reached

Sampling-Based Fast Gradient Rescaling (S-FGRM)

Updated 5 March 2026
  • The paper introduces S-FGRM, which replaces sign-based gradient updates with a log-magnitude rescaling method to preserve detailed gradient information.
  • It employs depth-first sampling to average gradients, effectively reducing numerical instability and capturing more accurate perturbation directions.
  • Empirical results on benchmarks like ImageNet show that S-FGRM significantly improves transferability and black-box attack success compared to traditional methods.

The Sampling-based Fast Gradient Rescaling Method (S-FGRM) is an algorithmic framework for the generation of highly transferable adversarial examples with improved stability in gradient-based attacks. By directly addressing quantization and instability limitations inherent in the sign-based update rule—ubiquitous in methods such as FGSM and I-FGSM—S-FGRM introduces a log-magnitude rescaling of the gradient vector, augmented with a depth-first sampling technique, to more faithfully preserve gradient structure and enhance adversarial transferability across neural networks. This approach yields significant improvements in black-box attack efficacy, notably on standard benchmarks such as ImageNet, and remains compatible with diverse attack pipelines and auxiliary input transformations (Han et al., 2023).

1. Shortcomings of Sign-Based Gradient Updates

Conventional adversarial attacks like FGSM and its iterative variants (I-FGSM, MI-FGSM, NI-FGSM) employ the signsign function on the gradient of the loss xJ(x,y)\nabla_x J(x, y) to determine the perturbation direction: xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y)) This approach enforces an \ell_\infty constraint and guarantees uniformly maximal updates per-feature. However, sign()sign(\cdot) discards all within-vector magnitude information, collapsing every nonzero coordinate to ±1\pm1. This induces several drawbacks:

  • Loss of directional precision: Gradients differing by orders of magnitude in certain dimensions are quantized identically, e.g., [0.8,108][1,1][0.8, 10^{-8}] \rightarrow [1, 1].
  • Suboptimal update directions: The restriction to 2D2^D possible update directions, where DD is the input dimension, neglects richer gradient information and biases trajectories away from optimal adversarial paths.
  • Empirical transferability gap: While sign-based updates may converge rapidly on the source/white-box model, they produce perturbations with poor cross-model transfer in black-box scenarios (Han et al., 2023).

2. Fast Gradient Rescaling Mechanism (FGRM)

FGRM replaces the sign function with a smooth, log-magnitude-based rescaling operation that retains gradient directionality while recapturing relative per-coordinate strength. For a gradient vector g=xJ(x,y)g = \nabla_x J(x, y), rescaling is performed in four steps:

  1. For each coordinate xJ(x,y)\nabla_x J(x, y)0, compute xJ(x,y)\nabla_x J(x, y)1.
  2. Calculate mean xJ(x,y)\nabla_x J(x, y)2 and standard deviation xJ(x,y)\nabla_x J(x, y)3 of xJ(x,y)\nabla_x J(x, y)4.
  3. Apply a sigmoid normalization: xJ(x,y)\nabla_x J(x, y)5, mapping to xJ(x,y)\nabla_x J(x, y)6.
  4. Rescale:

xJ(x,y)\nabla_x J(x, y)7

where xJ(x,y)\nabla_x J(x, y)8 is a tunable cap (e.g., xJ(x,y)\nabla_x J(x, y)9). In vector notation:

xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))0

Advantages of this transformation include preservation of coordinate ordering and a parametrizable interpolation between full sign quantization (xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))1, xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))2) and finer-grained magnitude differentiation. The rescaled update allows for more accurate modeling of input space traversal, thus improving adversarial transferability (Han et al., 2023).

3. Depth-First Sampling for Gradient Stabilization (DFSM)

To mitigate instability in rescaled gradients induced by numerical fluctuations in log, normalization, and sigmoid computations, S-FGRM introduces a depth-first sampling strategy. At each iteration xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))3:

  • Construct a sequence xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))4 for xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))5, with xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))6.
  • Compute the average gradient across the walk:

xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))7

This "depth-first" walk, as opposed to single-point or independent sampling, smooths out high-frequency gradient noise and yields a more stable gradient estimate for downstream rescaling. Empirically, optimal performance is usually achieved with xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))8 and a range xt+1=xt+αsign(xJ(xt,y))x_{t+1} = x_t + \alpha \cdot sign(\nabla_x J(x_t, y))9 (Han et al., 2023).

4. Algorithmic Structure and Computational Complexity

An example instantiation of S-FGRM atop MI-FGSM (momentum iterative FGSM) comprises the following pipeline: sign()sign(\cdot)4 Standard MI-FGSM costs one evaluation per iteration, while S-FGRM requires \ell_\infty0 forward/backward passes per step, incurring a modest computational overhead. Element-wise log, normalization, and sigmoid operations are \ell_\infty1 in input size \ell_\infty2. Unlike percentile-based (staircase) rescaling, which needs \ell_\infty3 sorts, S-FGRM avoids such costs (Han et al., 2023).

5. Extension to Input Transformations and Ensemble Attacks

S-FGRM is compatible with both input transformation pipelines and ensemble-based attack methodologies:

  • Input transformations: For each sampled \ell_\infty4 in DFSM, apply a randomized transformation \ell_\infty5 prior to gradient computation (e.g., resize+padding as in DIM).
  • Ensembles: When using \ell_\infty6 surrogate models, the average loss \ell_\infty7 is computed, and gradients from each model are averaged at every depth-first sampled input. All other steps—FGRM rescaling and projection—are left unaltered. This extensibility allows S-FGRM to serve as a modular component in state-of-the-art black-box attack pipelines (Han et al., 2023).

6. Empirical Evaluation and Performance

Evaluation on ImageNet (with \ell_\infty8, \ell_\infty9, sign()sign(\cdot)0, sign()sign(\cdot)1) demonstrates substantial gains in adversarial transferability, as outlined below.

Attack Variant Inc-v3* Inc-v4 IncRes-v2 Res-101 Inc-v3_ens3 Inc-v3_ens4
MI-FGSM 100.0 44.3 42.4 36.2 13.8 13.0
SMI-FGRM 100.0 82.0 81.1 73.6 44.8 41.3
NI-FGSM 100.0 51.3 49.9 40.6 12.8 12.9
SNI-FGRM 100.0 85.4 83.5 75.9 44.2 42.5

In combination with composite input transforms (DIM, TIM, SIM), S-FGRM enhances non-targeted transfer rates up to 94% on black-box models. Ablations indicate that both FGRM and DFSM contribute to the gains, with FGRM outperforming staircased approaches and DFSM providing further stabilization, especially in the presence of transformations.

Additional findings:

  • Optimal gradient rescale cap is sign()sign(\cdot)2.
  • S-FGRM yields absolute black-box transfer gains of 30–40% over MI-FGSM, with only a modest increase in gradient computation (Han et al., 2023).

7. Context and Implications

S-FGRM systematically addresses a critical bottleneck in transfer-based adversarial attack research—the quantization loss of the sign()sign(\cdot)3 function and the instability of gradient signals. By preserving magnitude information and introducing robust local averaging, the method advances the reliability and generalization of adversarial perturbations, with relevance for both benchmark evaluation and security analysis of large-scale vision models. Its modular design allows integration with diverse input manipulations and model ensembles, thereby facilitating exploration of new attack and defense spectra in adversarial machine learning (Han et al., 2023).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

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 Sampling-based Fast Gradient Rescaling (S-FGRM).