arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.00012cs.CLcs.AI
收藏

发现并重新激活已训练大语言模型的隐藏安全机制

Finding and Reactivating Post-Trained LLMs' Hidden Safety Mechanisms

Cranberry-Lemon University(蔓越莓柠檬大学)

Mingjie Li, Wai Man Si, Michael Backes, Yang Zhang, Yisen Wang

AI总结:

本文研究了大语言模型在后训练过程中安全机制的退化原因,提出SafeReAct方法通过LoRA适配器恢复被抑制的安全行为,提升模型在有害提示下的安全性而不影响推理性能。

摘要:

尽管通用大语言模型(LLMs)在通用任务中表现优异,但它们通常需要微调或后训练以在特定任务上表现更佳。例如,大型推理模型(LRMs)如DeepSeek-R1系列在经过后训练后,能展现出强大的推理能力。然而,这种额外的训练往往以安全性的降低为代价,因为微调或后训练的模型相比未训练前的LLMs更可能表现出有害行为,从而导致潜在的有害结果。以LRMs为例,本文首先探讨了这种安全退化的根本原因。我们的分析表明,后训练会掩盖基础LLM的原始安全机制,同时过度放大与后训练能力相关的表示。但幸运的是,我们还发现LRMs的安全机制并未在后训练过程中被移除。基于这些发现,我们提出了一种轻量且成本效益高的解决方案,称为SafeReAct,通过在少数层上对LoRA适配器进行对齐,以恢复被抑制的安全行为。在四个最先进的LRMs上的实验表明,我们的方法在有害提示下显著提高了安全性,而不会影响推理性能。此外,针对其他领域特定的LLMs,如医疗模型,额外的结果进一步验证了我们方法的通用性和有效性。

英文摘要:

Despite the impressive performance of general-purpose large language models (LLMs), they often require fine-tuning or post-training to excel at specific tasks. For instance, large reasoning models (LRMs), such as the DeepSeek-R1 series, demonstrate strong reasoning capabilities after post-training different general large language models on diverse chain-of-thought (CoT) datasets. However, this additional training frequently comes at the cost of reduced safety, as the fine-tuned or post-trained models tend to exhibit more harmful behaviors compared with the regular LLMs before post-training or fine-tuning, potentially leading to harmful outcomes due to their enhanced capabilities. Taking LRMs as an example, we first investigate the underlying cause of this safety degradation in this paper. Our analysis reveals that post-training can mask the original safety mechanisms of the base LLM, while over-amplifying representations related to their post-training ability. But luckily, we also find that LRMs' safety mechanisms still exist instead of being removed during their post-training. Based on these findings, we propose a lightweight and cost-effective solution called SafeReAct that restores the suppressed safety behaviors by aligning with LoRA adapters on a few layers. Experiments on four state-of-the-art LRMs show that our method significantly improves safety on harmful prompts without compromising reasoning performance. Besides LRMs, additional results on other domain-specific LLMs, like medical models, further confirm the generality and effectiveness of our approach.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑