Understanding the Role of Prompt Template in Knowledge Distillation for Safety Alignment
Abstract
Prior research has demonstrated that the choice of prompt template during Supervised Fine-Tuning (SFT) significantly impacts the robustness of safety alignment afterwards. However, the influence of template selection during Knowledge Distillation (KD) from teacher to student remains largely unexplored. Thus, we fill this gap by analyzing how different template configurations influence the pre-existing safety alignment of the student. We observe a significant degradation of safety alignment present in the aligned base instruct-tuned model. Specifically, we find that utilizing chat templates renders the model more compliant with harmful queries compared to a non-chat template. These findings are consistent across three models: LLaMA, Gemma and Qwen model families and are evaluated across multiple safety benchmarks. We further show that using a non-chat template during distillation better preserves the base student's internal representations, while chat template distillation induces a larger representational shift. Code: https://github.com/anjilab/role-of-prompt-template-in-kd
Create a lesson
Related papers
Rethinking Knowledge Distillation for Diffusion Language Models
Shared title terminologycs.CLYuxuan Sun, Yuanjian Xu, Jianing Hao et al.
MargEmbed-Akan: Bridging Twi Questions and English Knowledge through Cross-Lingual Score Distillation
Shared title terminologycs.CLPrince N. Y. Annan, Ali A. A. Aziz, Stephen E. Moore
TeacherGRPO: Closing the Capacity Gap in Reasoning Distillation via Teacher Alignment
Shared title terminologycs.CLZhenyu Lei, Zihan Chen, Yaochen Zhu et al.
ViSTA: A Simple Bridge Extends Visual Alignment to Clinical Time-Series Understanding in Multimodal LLMs
Shared title terminologycs.CLJunyi Gao, Yu Shi, Pingzhao Hu et al.
ARGUS: Role-Aware Event Knowledge Graphs for U.S. Employment-Discrimination Complaints
Shared title terminologycs.CLSriram Kannan, Swetha Saseendran, Vishnu Vardhan Reddy Kandi et al.
MINE: A Training-Free Defense against Indirect Prompt Injection via Mutual Information and Embedding Variance
Shared title terminologycs.CLTruong Phan, Ngoc-Quan Pham, Dat Quoc Nguyen