acceptodds
Under review as a conference paper at ICLR 2027

Fast Adversarial Attacks with Gradient Prediction

Abstract

Generating adversarial examples at scale is a core primitive for robustness evaluation, adversarial training, and red-teaming, yet even 'fast' attacks such as FGSM remain throughput-limited by the cost of a backward pass. We introduce a family of attacks that eliminates the backward pass by predicting the input gradient from forward-pass hidden states via a lightweight linear regression. Theoretically, we derive exact affine conditional gradient means, showing optimality in the (idealized) NTK regime. Empirically, our methods work when applied to practical finite-width models; we recover much of FGSM's attack performance while using only a small fraction of the time, corresponding to a 532% increase in throughput. These results suggest gradient prediction as a simple and general route to significantly faster adversarial generation under realistic wall-clock constraints.

Primary area:
alignment, fairness, safety, privacy, and societal considerations
Keywords:
Adversarial attacks, gradient prediction, neural tangent kernel, neural networks

Reviews

Among:
Shape:
1234this paper, Bottom 2%
Figure 1. Mean review rating of the reviewed papers at ICLR 2027. This paper averages 1.33 over 3 reviews, above 2% of the others.
Reviewer_JF2POpenReview ↗
Rating
1
Confidence
3
Informativeness
1
Presentation
2
Soundness
2
Read review
Paper summary

This study proposes a fast adversarial attack that predicts input gradients with a linear regressor instead of computing them through backpropagation. The approach is particularly fast when many perturbations must be generated. The experiments show that applying the proposed method to attacks such as FGSM and PGD increases the number of successful attacks per second. Under assumptions about the stochastic properties of the model’s hidden states and input gradients, the authors also show that the mean of the input gradient can be represented by an affine predictor.

Critical strengths

The proposed method offers an interesting approach to accelerating perturbation generation. As noted below, training the additional linear regressor takes time, but this cost may be amortized when generating a large number of perturbations.

Critical weaknesses
  1. The attack success rate drops substantially. Methods using predicted gradients are much less successful than those using exact gradients. For example, in the Qwen 2.5 PGD-10 setting, the attack success rate falls from 72.1% with exact gradient computation to 18.7% with gradient prediction. This is a major weakness even when the increase in throughput is taken into account.

  2. Tables 1 and 2 should include the time required to train the linear regressors. The authors should clarify how many perturbations must be generated in each setting to amortize the training cost. Table 4 reports results related to this question, but it covers only FGM, which is insufficient. This is an important consideration for the proposed method and requires more detailed reporting.

  3. FGSM and PGD are no longer sufficient for robust evaluations. Such evaluations typically use stronger, more recent adaptive attacks, such as AutoAttack [1]. At least, the authors should include a stronger modern gradient-based attack, such as APGD [1], in their evaluation.
    [1] F. Croce et al. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. ICML20.

  4. The assumptions in Proposition 1 limit its applicability. The proposition assumes that the means and variances of the final hidden state H(x) and input gradient G(x) do not depend on x, which generally does not hold. Although the authors provide a lemma to justify these assumptions, that justification places strong restrictions on the inputs and their embeddings. The proposition’s scope therefore remains limited.

Questions for authors

Weakness 1 is my primary concern. I would appreciate a clearer explanation of how the reported gains in throughput might justify the substantial reduction in attack success rate.

Reviewer_MX3jOpenReview ↗
Rating
2
Confidence
2
Informativeness
2
Presentation
2
Soundness
2
Read review
Paper summary

This paper proposes accelerating adversarial attack generation by replacing attack-time input-gradient computation with a learned affine predictor based on intermediate hidden representations. The predictor is trained using gradients collected from a fixed model and a specified prompt-target distribution, and its outputs are used in FGSM-style embedding perturbations and multi-step attacks. The authors also extend the approach to token-level Greedy Coordinate Gradient (GCG) attacks, where predicted gradients replace exact gradients for candidate-token generation while final candidate selection continues to use the model's true loss. The theoretical analysis derives an affine conditional-mean gradient predictor under idealized Gaussian and stationarity assumptions, motivated by the neural tangent kernel framework. Experiments on three language models using HarmBench and JailbreakBench evaluate attack success rate, perturbation throughput, and successful-attack throughput. The results demonstrate substantial speed improvements in several settings, often accompanied by reduced or variable attack success rates, and examine prediction quality, transfer, and selected computational costs.

Critical strengths
  1. I find the central idea appealing because of its simplicity. Using a relatively inexpensive linear predictor based on intermediate hidden representations to replace repeated backward passes is a practical direction worth investigating. The reported throughput improvements show that even an approximate gradient can be useful when attack-generation cost is an important constraint.

  2. A positive aspect is that the paper considers both embedding-level perturbations and token-level GCG attacks. The latter provides a more practically relevant evaluation, since it operates in the discrete token space. Importantly, GCG-GPR preserves the original candidate evaluation and acceptance procedure, replacing only the gradient used to propose candidates. This makes the comparison with exact-gradient GCG informative. For example, on HarmBench with Qwen2.5-3B, successful-attack throughput increases from approximately 0.08 to 0.18 attacks/s while ASR remains similar in the reported estimates. These results provide useful evidence that gradient prediction can reduce computational cost without necessarily sacrificing much attack effectiveness in some settings.

Critical weaknesses
  1. The idea of replacing computed gradients with learned predictions is not new, as shown by earlier synthetic-gradient methods. The Gaussian conditional-mean formula and optimal affine least-squares predictor are also standard results. I therefore see the main novelty in applying gradient prediction to adversarial attacks and demonstrating the efficiency–effectiveness trade-off, rather than in the theoretical characterization itself. Although the paper acknowledges synthetic gradients, its relationship to other learned or amortized adversarial generation methods could be clearer. A more precise distinction from existing approaches would help establish the contribution.

  2. Proposition 1 gives an exact affine conditional mean under idealized assumptions. Observation 1 provides a separate population least-squares justification that does apply to a fixed trained model without Gaussianity or stationarity. However, best-in-class affine optimality does not establish that the residual prediction error is small, that finite-sample ridge regression generalizes sufficiently, or that the predicted gradients preserve useful signs and candidate rankings. The remaining theoretical gap is therefore not the absence of any justification for regression, but the lack of a quantitative connection between prediction quality and the attack effectiveness achieved in practice.

  3. The reported speedups are encouraging, but embedding-level successful-attack throughput measures only perturbation-generation time, excluding predictor training, response generation, and success evaluation. The authors report fitting times of approximately 159–260 seconds and break-even points of 1,280–2,113 examples for one FGM setting, but no comparable amortized analysis is provided for other configurations, particularly GCG. The preparation time and memory requirements of the full-rank GCG predictor over flattened token representations are not sufficiently quantified. An end-to-end comparison, including predictor preparation and wall-clock time per successful attack, would better establish the practical efficiency gains.

  4. The comparison between exact-gradient GCG and GCG-GPR is useful because both retain the same objective and exact-loss candidate selection. However, the random-suffix baseline does not include GCG's iterative search or loss-based selection, making it insufficient to isolate the predictor's contribution. A stronger control would preserve GCG's iteration budget, candidate evaluations, and exact-loss selection while using random candidate proposals. A constant or mean-gradient predictor would also help determine whether conditioning on hidden representations provides an additional benefit.

  5. The results show substantial variation across models, benchmarks, and attack configurations. A lower ASR alone does not contradict the paper's throughput objective: for example, Qwen2.5-3B FGSM on JailbreakBench drops from 22% to 4% ASR while its reported successful-attack throughput increases. However, some GPR configurations produce no observed successes despite nonzero success for their exact-gradient counterparts. The sensitivity and transfer studies are useful, but the conclusions should more clearly distinguish settings with a favorable efficiency–effectiveness trade-off from those in which gradient prediction fails to provide a useful attack.

Questions for authors

Q1. Observation 1 justifies the best affine predictor at the population level. What additional evidence explains why its approximation error is small enough for the evaluated attacks? In particular, how do the empirical diagnostics connect prediction error to gradient-sign accuracy or GCG candidate-ranking quality, beyond the least-squares optimality statement?

Q2. Could the authors provide a more complete accounting of predictor training, inference, and memory costs, particularly for the full-rank GCG predictor, and clarify which operations are included in token-level timings? How do the amortized break-even points change when considering total wall-clock time per successful attack rather than the number of attempted examples?

Q3. Could the authors compare GCG-GPR with a random-candidate GCG variant using the same iteration budget, candidate evaluations, and exact-loss selection? How does the method compare with a constant or mean-gradient predictor? These controls would help isolate the benefit of conditioning gradient predictions on hidden representations.

Q4. Appendix B.3 shows that cosine similarity and sign agreement do not consistently track ASR, and its transfer experiment covers one model and one FGM configuration. Which conclusions about the reliability of GPR are supported beyond that setting, particularly for token-level GCG? Please distinguish the demonstrated operating regimes from broader claims that remain untested.

Reviewer_xvv3OpenReview ↗
Rating
1
Confidence
3
Informativeness
1
Presentation
1
Soundness
2
Read review
Paper summary

The paper proposes to accelerate the adversarial attack via training a gradient predictor, which removes the need for repeated backpropagation for attack generation. Specifically, the authors use a simple affine predictor that is trained on intermediate hidden states of the model, and outputs the corresponding gradient of the logits with respect to the input embedding. The method is compared against using exact gradient during attack generation, where it shows enhanced throughput.

Critical strengths
  • The authors provide formal mathematical support for their proposed method's design.
  • The paper addresses an important problem in AI safety and recognizes the practical value of accelerating adversarial attack generation for more efficient and scalable safety evaluation.
Critical weaknesses
  • The current organization and presentation make the paper difficult to follow.
    • Both the abstract and the introduction are relatively brief and, in their current form, do not provide sufficient details to convey the necessity and the severity of the problem. to make the paper more self-contained, more detailed discussion of the limitations of existing methods, prior efforts to replace or approximate gradient computation, and the challenges associated with accurately predicting gradients.
    • The method section is difficult to follow. It currently devotes substantial attention to justifying the use of an affine predictor and the model’s hidden states as its input, but provides limited intuition for why these particular design choices are appropriate for gradient prediction. A clearer high-level description of the proposed approach and the motivations behind its main design choices would substantially improve readability.
    • The method seems to be referred to as "GPR", but this acronym is used without introduction or definition (line 47), and does not appear to be formally introduced in the method section. It takes a lot of guesswork to understand that GPR is the authors' proposed method.
  • It's difficult to understand where the boundary between the prior methods and the proposed method exists. This largely comes from not introducing the existing approaches properly. There are relevant works in estimating or replacing the backpropagated gradients without actually performing the computations, and their application to adversarial attacks generation ([1-3]). Also, there are gradient-free methods that generate attacks without any gradient-related computation at all ([4]). However, the authors do not compare against them in the evaluation. Currently, the only baseline provided in the paper is using exact gradient. This makes it hard to evaluate the contribution of the proposed method fairly.
  • The current evaluation shows a substantial trade-off between attack success rate and throughput. In Table 1, replacing the exact gradient with the predicted gradient reduces ASR by approximately 32%p for PGD-10 (Qwen3-4B). A performance gap of 5.8%p is also observed for FGSM, despite it being a relatively simple single-step attack. The current results do not yet establish that the computational savings sufficiently compensate for the reduction in attack success rate.

[1] Jaderberg et al. "Decoupled Neural Interfaces using Synthetic Gradients." ICML, 2017.

[2] Tu et al. "AutoZOOM: Autoencoder-Based Zeroth Order Optimization Method for Attacking Black-Box Neural Networks." AAAI, 2019.

[3] Ilyas et al. “Prior Convictions: Black-Box Adversarial Attacks with Bandits and Priors.” ICLR, 2019.

[4] Li et al. “NATTACK: Learning the Distributions of Adversarial Examples for an Improved Black-Box Attack on Deep Neural Networks.” ICML, 2019.

Questions for authors

Please address the points made in the weaknesses section.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Related papers

Loading the map…

Discussion (0)

Sign in to comment.