One Leak Away: How Pretrained Model Exposure Amplifies Jailbreak Risks in Finetuned LLMs
Organizations: Institute of Science Tokyo, Tokyo, Japan · RIKEN Center for Advanced Intelligence Project (AIP), Tokyo, Japan
Abstract
Finetuning pretrained large language models (LLMs) has become the standard paradigm for developing downstream applications. However, its security implications remain unclear, particularly regarding whether finetuned LLMs inherit jailbreak vulnerabilities from their pretrained sources. We investigate this question in a realistic pretrain-to-finetune threat model, where an attacker has full access to a released pretrained LLM but no access to its proprietary finetuned derivatives. Empirical analysis shows that adversarial prompts optimized on the pretrained model transfer most effectively to its finetuned variants, revealing inherited vulnerabilities from pretrained to finetuned LLMs. To further examine this inheritance, we conduct representation-level probing, which shows that transferable prompts are linearly separable within the pretrained hidden states, suggesting that transferability-relevant structure is already encoded in pretrained representations. Building on this insight, we propose the Probe-Guided Projection (PGP) attack, which steers optimization toward transferability-relevant directions. Experiments across multiple LLM families and diverse finetuned tasks confirm PGP's strong transfer success, underscoring the security risks inherent in the pretrain-to-finetune paradigm. Finally, we demonstrate that the same representation-level insights also enable a lightweight defense that mitigates pretrain-to-finetune jailbreak transfer while preserving downstream utility.
Figures & tables
| Method | Target Model Access | Source Model Access |
| GCG ( Zou et al., 2023 ) | white-box | - |
| AutoDAN ( Liu et al., 2024 ) | white-box | - |
| TUJA ( Lin et al., 2024 ) | white-box | - |
| SCAV ( Xu et al., 2024 ) | white-box | - |
| IRIS ( Huang et al., 2025 ) | white-box | - |
| DSN ( Zhou et al., 2025 ) | white-box | - |
| Method | Pretrained LLM Backbones | |||||||
| Llama2-7b | Llama2-13b | Llama3-8b | Deepseek-7b | Qwen-7b | Qwen2.5-7b | Gemma-7b | Baichuan2-7b | |
| (1) Methods requiring more information than our threat model (white-box access) | ||||||||
| GCG (white) | 47.4 | 29.6 | 34.8 | 43.8 | 48.4 | 59.0 | 65.0 | 70.2 |
| AutoDan (white) | 15.8 | 7.0 | 47.0 | 100.0 | 82.0 | 89.4 | 53.6 | 87.4 |
| (2) Methods under our threat model (pretrained known) | ||||||||
| GCG (adaptation) | 24.4 | 9.4 | 12.4 | 17.2 | 17.8 | 30.0 | 24.4 | 39.6 |
| Pretrained Backbone | LoRA | RLHF | WM | NF4 | INT8 | FP16 |
| Llama2-7b | 72 | 62 | 72 | 70 | 66 | 69 |
| Llama2-13b | 66 | 54 | 64 | 57 | 62 | 62 |
| Llama3-8b | 79 | 71 | 77 | 77 | 83 | 77 |
| DeepSeek-7b | 85 | 70 | 85 | 79 | 86 | 83 |
| Qwen-7b | 77 | 68 | 76 | 74 | 76 | 76 |
| Qwen2.5-7b | 82 | 76 | 81 | 80 | 85 | 81 |
| Method | Finetuned LLMs from Llama2-7b | ||||
| Alpaca | Dolly | Codealpaca | CodeEvol | Gsm8k | |
| (1) Gradient-based Optimization Methods | |||||
| GCG (white) | 50 | 48 | 47 | 46 | 46 |
| GCG (adaptation) | 26 | 21 | 27 | 23 | 25 |
| PGP (Ours) | 55 | 52 | 65 | 56 | 55 |
| (1) Mutation-based Optimization Methods | |||||
| Defense Method | Pretrained LLM Backbones | |||
| Llama2-7b | Llama3-8b | DeepSeek-7b | Gemma-7b | |
| No defense | 69.6 | 75.8 | 89.0 | 67.2 |
| Perplexity | 69.6 | 75.8 | 89.0 | 67.2 |
| ICD | 67.4 | 74.0 | 85.2 | 64.4 |
| Self-reminder | 64.8 | 73.6 | 86.0 | 62.2 |
| Safety-example | 66.6 | 68.0 | 75.4 | 51.6 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Alpaca | Dolly | CodeEvol | Codealpaca | Gsm8k |
| Size | 20k | 15k | 18k | 80k | 8k |
| Task | General | General | Coding | Coding | Math |
| Model | Safety Alignmnet | Abbreviation |
| Llama2-7b-chat ( Touvron et al., 2023 ) | SFT+RLHF | Llama2-7b |
| Llama2-13b-chat ( Touvron et al., 2023 ) | SFT+RLHF | Llama2-13b |
| Llama3-8b-instruct ( Grattafiori et al., 2024 ) | SFT+RLHF | Llama3-8b |
| Deepseek-7b-chat ( Bi et al., 2024 ) | SFT+RLHF | Deepseek-7b |
| Qwen-7b-chat ( Bai et al., 2023 ) | SFT+RLHF | Qwen-7b |
| Qwen2.5-7b-Instruct ( Qwen et al., 2025 ) | SFT+RL | Qwen2.5-7b |
LLM Security
Large language model (LLM) security studies attacks, privacy risks, and defenses across model training, inference, and deployment.
See all 327 papers