arXiv:2506.04302cs.LG2025-06被引 1

为强化学习微调红队测试设计轻量级标准化基准

RedRFT: A Light-Weight Benchmark for Reinforcement Fine-Tuning-Based Red Teaming

  • 融合CleanRL简洁性与Tianshou模块化,提供可复现的RFT实现
  • 通过消融实验揭示LoRA、KL散度等组件对性能的关键影响
  • 适合快速迭代红队算法创新的研究者使用

红队测试已被证明是发现和缓解大语言模型漏洞的有效方法。强化微调(RFT)作为现有红队技术中颇具前景的策略,但缺乏统一基准限制了其发展。基于PPO的RFT实现细节显著影响结果稳定性和可复现性。为此,我们提出RedRFT,一个轻量级基准,旨在简化并标准化RFT驱动的红队测试。RedRFT结合CleanRL单文件设计与Tianshou高度模块化优势,提供高质量单文件红队实现及模块化PPO核心组件(如广义优势估计)。支持多种词汇与句子多样性度量,具备模块化内在奖励计算,便于即插即用实验。我们对关键组件(包括低秩适配LoRA、KL散度、拉格朗日乘子)进行了全面消融研究,以厘清其对RFT性能的影响。本工作期望促进对RFT红队算法实现细节的深入理解,并支持创新功能的快速原型开发。代码开源地址:https://github.com/x-zheng16/RedRFT.git。

原文摘要 · Abstract (English)

Red teaming has proven to be an effective method for identifying and mitigating vulnerabilities in Large Language Models (LLMs). Reinforcement Fine-Tuning (RFT) has emerged as a promising strategy among existing red teaming techniques. However, a lack of a unified benchmark hinders current RFT-based red teaming methods. Implementation details, especially in Proximal Policy Optimization (PPO)-based RFT, significantly affect outcome stability and reproducibility. To address this issue, we introduce RedRFT, a lightweight benchmark designed to simplify and standardize the implementation and evaluation of RFT-based red teaming. RedRFT combines the design strengths of both single-file CleanRL and highly modularized Tianshou, offering high-quality single-file red teaming implementations and modular PPO core components, such as the General Advantage Estimator. It supports a variety of token and sentence diversity metrics, featuring modularized intrinsic reward computation that facilitates plug-and-play experimentation. To clarify their influence on RFT performance, we conducted an extensive ablation study on key components, including Low-Rank Adaptation (LoRA), Kullback-Leibler (KL) divergence, and Lagrange Multiplier. We hope this work contributes to 1) gaining a comprehensive understanding of the implementation nuances of RFT-based red teaming algorithms, and 2) enabling rapid prototyping of innovative features for RFT-based red teaming. Code for the benchmark can be accessed at https://github.com/x-zheng16/RedRFT.git.

红队测试强化学习LLM安全基准测试

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