Abstract
Black-box query attacks, which rely only on the output of the victim model, have proven to be effective in attacking deep learning models. However, existing black-box query attacks show low performance in a novel scenario where only a few queries are allowed. To address this issue, we propose gradient aligned attacks (GAA), which use the gradient aligned losses (GAL) we designed on the surrogate model to estimate the accurate gradient to improve the attack performance on the victim model. Specifically, we propose a gradient aligned mechanism to ensure that the derivatives of the loss function with respect to the logit vector have the same weight coefficients between the surrogate and victim models. Using this mechanism, we transform the cross-entropy (CE) loss and margin loss into gradient aligned forms, i.e. the gradient aligned CE or margin losses. These losses not only improve the attack performance of our gradient aligned attacks in the novel scenario but also increase the query efficiency of existing black-box query attacks. Through theoretical and empirical analysis on the ImageNet database, we demonstrate that our gradient aligned mechanism is effective, and that our gradient aligned attacks can improve the attack performance in the novel scenario by 16.1% and 31.3% on the $l_2$ and $l_{\infty}$ norms of the box constraint, respectively, compared to four latest transferable prior-based query attacks. Additionally, the gradient aligned losses also significantly reduce the number of queries required in these transferable prior-based query attacks by a maximum factor of 2.9 times. Overall, our proposed gradient aligned attacks and losses show significant improvements in the attack performance and query efficiency of black-box query attacks, particularly in scenarios where only a few queries are allowed.
Introduction
Adversarial attacks on deep learning models generally fall into two categories: transfer attacks and query attacks. Transfer attacks require zero queries but often suffer from lower success rates due to the mismatch between surrogate and victim models. Query attacks are highly effective but typically demand hundreds or thousands of interactions with the victim model, making them expensive and easy to detect.
This research addresses the "ultra-low query" regime—specifically scenarios where fewer than 10 queries are permitted. Existing query-efficient attacks struggle in this budget setting because their initial gradient estimates from surrogate models are insufficiently accurate. We introduce Gradient Aligned Attacks (GAA) to bridge this gap by synchronizing the gradients of a surrogate model with those of a black-box victim model.
Methodology
The Preference Property
A key observation driving our approach is the "preference property": adversarial examples tend to be misclassified into the victim model's top-ranked incorrect categories. As shown in the performance curves below, the Attack Success Rate (ASR) increases significantly when considering the top-$n$ predicted classes, suggesting that the victim model has a predictable "preference" for certain incorrect labels.
Gradient Aligned Losses (GAL)
Standard attacks use Cross-Entropy (CE) or Margin loss on a surrogate model. However, these gradients do not naturally align across different architectures. We propose the Gradient Aligned Mechanism, which weights the surrogate's logit derivatives using the probability distribution obtained from the victim model. This leads to two new loss functions:
- GACE (Gradient Aligned Cross-Entropy)
- GAM (Gradient Aligned Margin)
By ensuring the surrogate's gradient points in a direction mathematically aligned with the victim's decision boundaries, GAA can iteratively refine perturbations with minimal queries.
Experimental Results
Performance in Low-Query Settings
Evaluated on a subset of 1,000 ImageNet images across architectures like VGG16, ResNet50, and Inception-v3, GAA demonstrates state-of-the-art performance. In the <10 query scenario, GAA improved ASR by 16.1% for $l_2$ norms and 31.3% for $l_\infty$ norms compared to previous transferable query attacks.
Query Efficiency Gains
Beyond its own performance, the GAL framework acts as a "plug-and-play" enhancement for existing attacks. Integrating GACE loss into state-of-the-art attacks like LeBA or PRGF reduced the number of queries required to reach success by a factor of up to 2.9x.
Conclusion
Gradient Aligned Attacks effectively exploit the internal preferences of deep learning models to achieve high success rates in extremely restricted query environments. By prioritizing gradient direction alignment over raw magnitude, GAA provides a robust and efficient framework for black-box adversarial testing. Future work will explore extending this alignment logic to non-image domains such as NLP and audio recognition.
Summary updated