arXiv:2506.00676cs.LGcs.AI2025-06被引 4

统一评估大模型微调安全性的工具,让不同方法能公平对比。

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

  • 构建多任务数据集并支持生成有害变体,覆盖情感分析到开放指令
  • 集成免疫、训练中防护和微调后修复三类防御方法,测试成功率与拒绝一致性
  • 代码简洁易用,适合研究者快速对比安全微调方案

随着大语言模型广泛应用,参数高效微调方法和以安全为先的防御机制迅速发展。然而,方法数量激增导致评估标准不一:数据集、指标与威胁设置差异大,难以公平比较安全性、实用性与鲁棒性。为此,我们提出 SafeTuneBed,一个统一微调与防御评估的基准与工具包。SafeTuneBed(i)整合了涵盖情感分析、问答、多步推理和开放指令任务的多样化微调数据集,并支持生成有害变体;(ii)可集成前沿防御策略,包括对齐阶段免疫、训练中防护和微调后修复;(iii)提供安全(攻击成功率、拒绝一致性)与实用性能评估。基于面向Python、数据类驱动的配置与插件架构,仅需少量代码即可定义任意微调范式、防御方法与评估指标组合,保障全流程可复现。通过在多种投毒场景与任务上评测代表性防御,验证其价值。通过标准化数据、代码与指标,SafeTuneBed 是首个聚焦安全微调评估的专用工具包,推动严谨、可比的研究进展。代码开源:https://github.com/criticalml-uw/SafeTuneBed

原文摘要 · Abstract (English)

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

大模型安全微调评估防御工具

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。