cs.CLMar 8, 2026

Few Tokens, Big Leverage: Preserving Safety Alignment by Constraining Safety Tokens during Fine-tuning

Authors: Guoli Wang, Haonan Shi, Tu Ouyang, An Wang

Organizations: Case Western Reserve University, Cleveland, OH, USA

Abstract

Large language models (LLMs) often require fine-tuning (FT) to perform well on downstream tasks, but FT can induce safety-alignment drift even when the training dataset contains only benign data. Prior work shows that introducing a small fraction of harmful data can substantially compromise LLM refusal behavior, causing LLMs to comply with harmful requests. Existing defense methods often rely on model-wide interventions, such as restricting which parameters are updated or injecting additional safety data, which can limit generality and degrade downstream task performance. To address these limitations, we propose a fine-tuning framework called Preserving Safety Alignment via Constrained Tokens (PACT), which stabilizes the model's confidence on safety tokens. Our approach is motivated by the empirical observation that safety-aligned behavior is reflected in the model's token-level output confidence and is often concentrated on a small subset of safety-related tokens. During downstream fine-tuning, we regularize the fine-tuned model to match the aligned reference model's confidence on safety-related tokens at each response step, while leaving non-safety tokens largely unconstrained to allow effective task adaptation. This targeted constraint prevents alignment drift without imposing global restrictions that typically trade off with model utility. Our code is available at {https://github.com/Glresearch1/PACT}.

Figures & tables

Appendix figures & tables7 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Guardrails in Logit Space: Safety Token Regularization for LLM Alignment

    Apr 19, 2026Thong Bach, Truyen TranLLM Fine-TuningLLM Safety Alignment

  2. Token-level Data Selection for Safe LLM Fine-tuning

    Mar 1, 2026Yanping Li, Zhening Liu, Zijian Li +2LLM Fine-TuningLLM Safety

  3. MOSAIC: Composable Safety Alignment with Modular Control Tokens

    Mar 17, 2026Jingyu Peng, Hongyu Chen, Jiancheng Dong +5LLM Safety AlignmentInference-Time Language Model Alignment