Beyond Random Starts: Amortized Initialization for Adversarial Attacks on Vision-Language Models
Authors: Haz Sameen Shahgir, Ali Asif Khan, K. M. Mehemud Azad, Dongwei Lyu, Zhipeng Wei, Rifat Shahriyar, Yufei Li, Xian Chen, Xiaohan Wei, Yunchen Pu, Fei Tian, Chonglin Sun, Frank Shyu, Sandeep Pandey, Luke Simon, Xi Liu, N. Benjamin Erichson, Yue Dong
Organizations: UC Riverside · BUET · UC Berkeley · Meta · International Computer Science Institute · Lawrence Berkeley National Laboratory
Gradient-based transferable adversarial attacks achieve state-of-the-art attack success rates against black-box vision-language models (VLMs). However, they require hundreds of costly optimization steps for each image pair. One possible reason is that these attacks typically start from random perturbations that contain no information about the source or target image. In this work, we study whether amortized adversarial generation can provide better initializations for gradient-based attacks. By learning across many image pairs, amortization allows a generator to produce adversarial perturbations for new inputs without optimizing each perturbation from scratch. We introduce SPARK, a lightweight looped perturbation generator conditioned on both the source and target images. SPARK repeatedly applies the same network to refine a perturbation, producing effective adversarial attacks in a few forward passes without requiring gradients through surrogate vision encoders at inference time. We show that these perturbations provide effective warm starts for existing gradient-based attacks, substantially improving attack success rates while reducing the number of optimization steps required. These improvements generalize across different attack methods, VLMs, and unseen image categories. SPARK also produces effective standalone attacks at a fraction of the computational cost of gradient-based optimization. Code and model weights are available at https://github.com/Patchwork53/SPARK.
Figures & tables
Figure 1: SPARK uses amortized adversarial generation to warm-start gradient-based attacks. Conventional attacks start from random perturbations and iteratively optimize them using gradients from surrogate vision encoders. In contrast, SPARK learns from source-target image pairs to generate adversarial perturbations through a few passes of a network with shared weights. These perturbations can be used as standalone attacks or to warm-start gradient-based optimization, improving attack success at little additional computational cost.
Figure 2: ASR versus TFLOPs per attack (log scale) for attacks initialized randomly or with SPARK. Points along each attack curve use increasing numbers of optimization steps. Standalone SPARK points use increasing numbers of generator calls.
Gemma-4-12B
Qwen3-VL-8B
InternVL3.5-8B
GLM-4.6V-Flash
Kimi-VL-A3B
Phi-4-RV-15B
Avg.
Method
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ID-test
MAttackV2
54.0
0.508
56.9
0.515
55.2
0.497
53.9
0.484
49.9
0.458
33.1
0.357
50.5
0.470
+ SPARK
70.4
0.601
73.7
0.622
67.2
0.582
67.9
0.569
66.7
0.553
49.0
0.450
65.8
0.563
Δ
+16.4
+0.093
+16.8
+0.107
+12.0
+0.085
+14.0
+0.085
+16.8
+0.095
+15.9
+0.093
+15.3
+0.093
MPCAttack
53.5
0.501
55.5
0.512
51.5
0.482
48.5
0.451
48.0
0.453
34.3
0.361
48.5
0.460
Table 1: Per-victim ASR (%) and average GPTScore for random vs. amortized initialization of gradient-based attacks. MAV2 denotes M-Attack-V2 [ 41 ] , MPC denotes MPCAttack [ 24 ] , and PRAF denotes PRAFAttack [ 37 ] . All attacks are run for 300 optimization steps. Gθ+ denotes amortized initialization using a K=4 Generator Gθ .
Figure 3: Left) Average ASR (%) vs. attack steps for random and amortized initialization on ID-test . Right) Qualitative example of amortized initialization of PRAFAttack. We show additional qualitative examples in Appendix 12 .
imageTFLOPs
ID Test
OOD Test
ObjectNet Test
Method
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
Gradient-based Attacks
MAttackV2
1366 †
50.5
0.47
49.7
0.46
30.7
0.37
MPCAttack
56.1
48.5
0.46
44.7
0.44
31.6
0.37
PRAFAttack
57.0
61.6
0.54
58.8
0.52
43.0
0.44
Generative Attacks
Table 2: Generalization across test sets (1,000 image pairs each). MPCAttack and PRAFAttack run 300 optimization steps; K is the number of SPARK’s iterations during training and inference.
Method
Open-Source VLMs
Closed-Source VLMs
Gemm.
Qwen
Intern
GLM
Kimi
Phi
Avg.
GPT
Claude
Gemini
Avg.
ID-Test
P
77.9
79.4
79.2
74.0
70.0
55.1
72.6
31.9
69.1
45.5
48.8
S + P
83.4
84.0
82.2
77.1
73.5
57.3
76.2
36.8
72.1
50.7
53.2
Δ
+5.5
+4.6
+3.0
+3.1
+3.5
+2.2
+3.7
+4.9
+3.0
+5.2
+4.4
OOD-Test
Table 3: Amortized initialization under surrogate ensemble mismatch. Each cell shows ASR (%). P denotes randomly initialized PRAFAttack. S + P denotes PRAFAttack initialized with SPARK.
Figure 4: Final-call PRAF loss during training for SPARK with tied weights at different values of K.
Figure 5: Average ASR (%) vs. attack steps for random and amortized initialization (K=4 SPARK) of gradient-based attacks on (a) OOD-test and (b) Objectnet-test . ASR is averaged over 6 open-source black-box VLMs. All attacks use the default 3-encoder surrogate ensemble.
Figure 6: Average ASR (%) vs. attack steps for amortized initialization (K=4 SPARK) of PRAFAttack using 5 surrogate encoders: OpenAI CLIP ViT-B/16 and ViT-B/32, LAION CLIP ViT-g/14, DINOv2-base, and InternVL3-1B vision encoder. ASR is averaged over 6 open-source black-box VLMs.
Figure 7: Average ASR (%) over 6 open-source VLMs at different GPTScore thresholds for PRAFAttack with the shared 3 surrogate ensemble. ASR is computed as the fraction of samples where GPTScore is greater than the corresponding threshold. Amortized initialization maintains a consistent advantage at almost all thresholds.
Comparison
VLM
PRAFAttack
PRAFAttack + SPARK
Difference [95% CI]
p
pHolm
PRAFAttack 300 steps 3 surrogates
Gemma4 12B
59.87
66.57
+6.70 [4.90, 8.50]
5.04×10−13
1.21×10−11
GLM4.6V Flash
56.17
65.37
+9.20 [7.44, 10.96]
3.50×10−24
1.19×10−22
InternVL3.5 8B
56.73
64.43
+7.70 [5.97, 9.43]
5.62×10−18
1.74×10−16
KimiVL A3B
52.77
60.90
+8.13 [6.37, 9.89]
2.77×10−19
8.85×10−18
Phi4 RV 15B
38.53
45.73
+7.20 [5.45, 8.95]
1.20×10−15
3.23×10−14
Qwen3VL 8B
62.60
72.07
+9.47 [7.76, 11.17]
4.05×10−27
1.46×10−25
Table 4: Paired ASR significance tests of amortized initialization. PRAFAttack uses 5 surrogate ensembles. Bold p -values indicate significance at 0.05.
Comparison
VLM
PRAFAttack
PRAFAttack + SPARK
Difference [95% CI]
p
pHolm
PRAFAttack 300 steps 3 surrogates
Gemma4 12B
0.5407
0.5847
+0.0440 [0.0361, 0.0518]
1.20×10−27
4.44×10−26
GLM4.6V Flash
0.5092
0.5643
+0.0550 [0.0470, 0.0630]
2.07×10−40
8.27×10−39
InternVL3.5 8B
0.5211
0.5645
+0.0434 [0.0357, 0.0511]
5.81×10−28
2.21×10−26
KimiVL A3B
0.4834
0.5352
+0.0519 [0.0436, 0.0601]
4.33×10−34
1.69×10−32
Phi4 RV 15B
0.3946
0.4395
+0.0449 [0.0364, 0.0535]
2.10×10−24
7.35×10−23
Qwen3VL 8B
0.5565
0.6168
+0.0603 [0.0525, 0.0681]
7.22×10−50
3.03×10−48
Table 5: Paired GPTScore significance tests of amortized initialization. PRAFAttack uses 5 surrogate ensembles. Bold p -values indicate significance at 0.05.
Gemma-4-12B
Qwen3-VL-8B
InternVL3.5-8B
GLM-4.6V-Flash
Kimi-VL-A3B
Phi-4-RV-15B
Avg.
Judge
Method
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
ID-test-S
PRAFAttack
77.9
0.651
79.4
0.660
79.2
0.666
74.0
0.614
70.0
0.586
55.1
0.492
72.6
0.612
Qwen3.8-27B
+ SPARK
83.4
0.682
84.0
0.708
82.2
0.687
77.1
0.641
73.5
0.615
57.3
0.510
76.2
0.640
Δ
+5.5
+0.031
+4.6
+0.047
+3.0
+0.021
+3.1
+0.027
+3.5
+0.028
+2.2
+0.018
+3.7
+0.029
PRAFAttack
89.2
0.768
87.2
0.762
87.8
0.769
82.1
0.725
80.1
0.704
67.9
0.617
82.4
0.724
Table 6: Judge sensitivity. Per-victim ASR (score ≥0.5 ) and mean judge score for PRAFAttack and PRAFAttack + SPARK, with the same attacked images and victim captions scored by two judges, Qwen-3.8-27B and GPT 6.1 Terra.
Figure 8: ASR gain across judge thresholds. Difference in ASR between amortized (PRAFAttack + SPARK) and random initialization as the score required for success varies, under both judges; bands are ±1 SEM.
ID Test
OOD Test
ObjectNet Test
Loss
Supervised Iteration
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
SPARK ( K=4 )
PRAF
[1...K]
53.4
0.484
40.8
0.413
19.9
0.293
PRAF
Only Kth
52.2
0.481
39.5
0.408
18.9
0.291
InfoNCE
[1...K]
41.6
0.431
30.7
0.372
13.3
0.280
SPARK ( K=6 )
Table 7: Training objective ablation.
Figure 9: Final-call PRAF loss during training K=4 looped generator with and without weight-tying.
imageGFLOPs
ID Test
OOD Test
ObjectNet Test
Method
Params
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
Gθ ( K=1 )
Default
9.8M
161.0
42.2
0.415
31.6
0.347
14.2
0.251
w/o Transformer
6.4M
153.5
31.2
0.357
19.8
0.282
8.6
0.215
2 × Channel Width
35.5M
366.9
43.7
0.423
31.8
0.351
13.7
0.250
Gθ ( K=4 )
Table 8: Architecture ablations
ℓ∞ ( ϵ/255 )
ID Test
OOD Test
ObjectNet Test
Method
Trained
Evaluated
ASR
AvgScore
ASR
AvgScore
ASR
AvgScore
Generative Attack ( K=4 )
Kth iteration rescaled
16
8
2.6
0.084
1.4
0.075
3.6
0.149
Kth iteration clipped
16
8
3.8
0.096
2.4
0.087
3.9
0.157
[0..K] iterations clipped
16
8
5.3
0.116
3.6
0.103
4.6
0.163
Trained with ϵ=8
8
8
22.1
0.279
15.7
0.232
8.9
0.210
Table 9: Noise budget ablations. Gθ uses K=4 ; PRAFAttack runs the stated number of optimization steps.
Method
Kinference
ID-test
OOD-test
ObjectNet-test
ASR
GPTScore
ASR
GPTScore
ASR
GPTScore
Native Training
4
53.22
0.4888
40.98
0.4184
20.00
0.2983
6
54.93
0.4971
42.80
0.4265
20.67
0.3032
Clamp
8
53.52
0.4900
41.25
0.4221
20.98
0.3030
12
52.77
0.4894
41.58
0.4237
21.58
0.3057
16
53.52
0.4919
41.93
0.4250
20.60
0.3047
Table 10: Inference-time unrolling of a SPARK generator trained with Ktrain=4 steps, using clamped or interpolated step indices for Kinference>Ktrain .
Figure 10: Qualitative examples from ObjectNet-test .
Figure 11: Qualitative VLM response examples for PRAFAttack (5 surrogates).
Figure 12: Qualitative VLM response examples for PRAFAttack (5 surrogates).
Adversarial attacks on vision-language models exploit images, text, and multimodal interactions to manipulate outputs, bypass safety, or degrade reliability.