← Back to Library

SafeTuneBed: A Toolkit for Benchmarking LLM Safety Alignment in Fine-Tuning

Authors: Saad Hossain, Samanvay Vajpayee, Sirisha Rambhatla

Published: 2025-05-31

arXiv ID: 2506.00676v1

Added to Library: 2025-06-04 04:02 UTC

Safety

πŸ“„ Abstract

As large language models (LLMs) become ubiquitous, parameter-efficient fine-tuning methods and safety-first defenses have proliferated rapidly. However, the number of approaches and their recent increase have resulted in diverse evaluations-varied datasets, metrics, and inconsistent threat settings-making it difficult to fairly compare safety, utility, and robustness across methods. To address this, we introduce SafeTuneBed, a benchmark and toolkit unifying fine-tuning and defense evaluation. SafeTuneBed (i) curates a diverse repository of multiple fine-tuning datasets spanning sentiment analysis, question-answering, multi-step reasoning, and open-ended instruction tasks, and allows for the generation of harmful-variant splits; (ii) enables integration of state-of-the-art defenses, including alignment-stage immunization, in-training safeguards, and post-tuning repair; and (iii) provides evaluators for safety (attack success rate, refusal consistency) and utility. Built on Python-first, dataclass-driven configs and plugins, SafeTuneBed requires minimal additional code to specify any fine-tuning regime, defense method, and metric suite, while ensuring end-to-end reproducibility. We showcase its value by benchmarking representative defenses across varied poisoning scenarios and tasks. By standardizing data, code, and metrics, SafeTuneBed is the first focused toolkit of its kind to accelerate rigorous and comparable research in safe LLM fine-tuning. Code is available at: https://github.com/criticalml-uw/SafeTuneBed

πŸ” Key Points

  • Introduction of the SafeTuneBed toolkit which standardizes benchmarking methodologies for safety-preserving fine-tuning of large language models (LLMs).
  • Comprehensive curation of diverse datasets and controlled harmful data scenarios, enabling rigorous and reproducible evaluations.
  • Integration of various state-of-the-art defense methods into a single framework, facilitating direct comparison of their effectiveness against safety threats.
  • Clear definition of utility and safety metrics, ensuring that evaluations capture both performance and protective capabilities reliably.
  • Demonstration of the toolkit's value through benchmark experiments revealing trade-offs between safety and utility across different defense techniques.

πŸ’‘ Why This Paper Matters

SafeTuneBed represents a pivotal advancement in the evaluation and improvement of safety-alignment techniques in large language models. By addressing the inconsistencies and scattered nature of current evaluation frameworks, this toolkit not only standardizes experiments but also accelerates the development of robust and responsible AI systems. Its contribution is crucial for ensuring that fine-tuned models maintain adherence to safety protocols during practical deployments.

🎯 Why It's Interesting for AI Security Researchers

This paper is of significant interest to AI security researchers as it tackles a critical issue in the fieldβ€”ensuring safety alignment in large language models during fine-tuning. The methodologies and tools proposed can guide researchers in developing defenses against adversarial manipulations and data poisoning, shaping the safety landscape for future AI applications. Additionally, the emphasis on reproducibility and transparency in safety evaluations aligns with the broader goals of the security community to enhance trustworthiness in AI systems.

πŸ“š Read the Full Paper