mlsanityData to 7 Oct 2026

Pharmacist: Safety Alignment Data Curation for Large Language Models against Harmful Fine-tuning

arXiv 2510.10085 ↗First posted 11 Oct 2025cs.CR cs.AI cs.LGcited by 6

On the map: LLM alignment / RLHF / preference optimisation → Safety alignment and jailbreak attacks

also in 1 more
Abstract (arXiv)

Harmful fine-tuning issues present significant safety challenges for fine-tuning-as-a-service in large language models. Existing alignment-stage defenses, e.g., Vaccine, Repnoise, Booster, and T-Vaccine, mitigate harmful fine-tuning issues by enhancing the model's robustness during the alignment phase. While these methods have been proposed to mitigate the issue, they often overlook a critical upstream factor: the role of the original safety-alignment data. We observe that their defense performance and computational efficiency remain constrained by the quality and composition of the alignment dataset. To address this limitation, we propose Pharmacist, a safety alignment data curation solution that enhances defense against harmful fine-tuning by selecting a high-quality and safety-critical core subset from the original alignment data. The core idea of Pharmacist is to train an alignment data selector to rank alignment data. Specifically, up-ranking high-quality and safety-critical alignment data, down-ranking low-quality and non-safety-critical data. Empirical results indicate that models trained on datasets selected by Pharmacist outperform those trained on datasets selected by existing selection methods in both defense and inference performance. In addition, Pharmacist can be effectively integrated with mainstream alignment-stage defense methods. For example, when applied to RepNoise and T-Vaccine, using the dataset selected by Pharmacist instead of the full dataset leads to improvements in defense performance by 2.60% and 3.30%, respectively, and enhances inference performance by 3.50% and 1.10%. Notably, it reduces training time by 56.83% and 57.63%, respectively. Our code is available at https://github.com/Lslland/Pharmacist.

Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Safety alignment and jailbreak attacks, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 36 of its 40 references that are in the map. First posted on arXiv 11 Oct 2025.

Builds on

36 of 40 references.

Closest ancestors · 8

Same direction, newest first

  1. 2025Why LLM Safety Guardrails Collapse After Fine-tuning: A Similarity Analysis Between Alignment and Fine-tuning Datasets5 Jun
  2. 2024Targeted Vaccine: Safety Alignment for Large Language Models against Harmful Fine-Tuning via Layer-wise Perturbation13 Oct
  3. 2024Harmful Fine-tuning Attacks and Defenses for Large Language Models: A Survey26 Sep
  4. 2024Safety Alignment Should Be Made More Than Just a Few Tokens Deep10 Jun
  5. 2024Vaccine: Perturbation-aware Alignment for Large Language Models against Harmful Fine-tuning Attack2 Feb
  6. 2023Fine-tuning Aligned Language Models Compromises Safety, Even When Users Do Not Intend To!5 Oct
  7. 2023Shadow Alignment: The Ease of Subverting Safely-Aligned Language Models4 Oct
  8. 2023BeaverTails: Towards Improved Safety Alignment of LLM via a Human-Preference Dataset10 Jul

Other references · 28

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2023GPT-4 Technical Reportcited by 18,132
  3. 2022Training language models to follow instructions with human feedbackcited by 15,712
  4. 2024The Llama 3 Herd of Modelscited by 14,192
  5. 2021LoRA: Low-Rank Adaptation of Large Language Modelscited by 14,084
  6. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  7. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  8. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Modelcited by 7,916
  9. 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,861
  10. 2023Mistral 7Bcited by 3,065
  11. 2015Character-level Convolutional Networks for Text Classificationcited by 2,293
  12. 2017Decoupled Weight Decay Regularizationcited by 1,722
16 more
  1. 2023LIMA: Less Is More for Alignmentcited by 1,080
  2. 2024Gemma: Open Models Based on Gemini Research and Technologycited by 889
  3. 2023RAFT: Reward rAnked FineTuning for Generative Foundation Model Alignmentcited by 672
  4. 2023Is ChatGPT a General-Purpose Natural Language Processing Task Solver?cited by 486
  5. 2023RRHF: Rank Responses to Align Language Models with Human Feedback without tearscited by 454
  6. 2023What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuningcited by 354
  7. 2023MathCoder: Seamless Code Integration in LLMs for Enhanced Mathematical Reasoningcited by 155
  8. 2024Tamper-Resistant Safeguards for Open-Weight LLMscited by 132
  9. 2024Booster: Tackling Harmful Fine-tuning for Large Language Models via Attenuating Harmful Perturbationcited by 92
  10. 2024SEAL: Safety-enhanced Aligned LLM Fine-tuning via Bilevel Data Selectioncited by 64
  11. 2025Reinforcement Learning from Human Feedbackcited by 53
  12. 2025A Survey on Large Language Models with some Insights on their Capabilities and Limitationscited by 41
  13. 2025Principled Data Selection for Alignment: The Hidden Risks of Difficult Examplescited by 37
  14. 2024Immunization against harmful fine-tuning attackscited by 33
  15. 2025SDPO: Segment-Level Direct Preference Optimization for Social Agentscited by 29
  16. 2025Panacea: Mitigating Harmful Fine-tuning for Large Language Models via Post-fine-tuning Perturbationcited by 20

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2025: 1; 2026: 5.

6 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026When Medical Safety Alignment Fails: A Benchmark for Evaluating LLMs on High-Risk Medical Queries
  2. 2024Data Advisor: Dynamic Data Curation for Safety Alignment of Large Language Models
  3. 2026SafeMed-R1: Clinician-Audited Safety and Ethics Alignment for Medical Large Language Models
  4. 2024Locking Down the Finetuned LLMs Safety
  5. 2026Beyond Safe Data: Pretraining-Stage Alignment with Regular Safety Reflection
  6. 2026Few Tokens, Big Leverage: Preserving Safety Alignment by Constraining Safety Tokens during Fine-tuning
  7. 2024Controllable Safety Alignment: Inference-Time Adaptation to Diverse Safety Requirements
  8. 2024Antidote: Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning