arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2502.01208cs.LGcs.CL
收藏

论大型语言模型在推理时几乎必然安全的对齐

On Almost Surely Safe Alignment of Large Language Models at Inference-Time

Huawei Noah’s Ark Lab(华为诺亚实验室);Imperial College London(帝国理工学院伦敦分校);University College London(伦敦大学学院);UCL Centre for Artificial Intelligence(UCL人工智能中心)

Xiaotong Ji, Shyam Sundhar Ramesh, Matthieu Zimmer, Ilija Bogunovic, Jun Wang, Haitham Bou Ammar

AI总结:

本文提出InferenceGuard,一种基于约束马尔可夫决策过程的LLM推理时对齐方法,通过动态惩罚不安全生成实现几乎必然安全,无需修改权重,平衡安全与性能。

摘要:

我们提出了一种新颖的大型语言模型(LLM)推理时对齐方法,旨在以几乎必然(即概率趋近于一)的方式生成安全响应。我们的方法将安全响应的生成建模为LLM潜在空间内的约束马尔可夫决策过程(MDP)。我们增加了一个安全状态,用于跟踪安全约束的演变,并动态惩罚不安全的生成,以确保生成安全响应。因此,我们证明了在潜在空间中求解该MDP并施加足够大的惩罚时,相对于给定成本模型的形式化安全保证。在此基础上,我们提出了InferenceGuard,一种无需修改模型权重即可安全对齐LLM的实用实现。实验上,我们展示了InferenceGuard能有效平衡安全性与任务性能,在生成安全且对齐的响应方面优于现有的推理时对齐方法。我们的发现通过推理时对齐促进了更安全的LLM部署,为资源密集且易过拟合的对齐技术(如RLHF)提供了一种有前景的替代方案。

英文摘要:

We introduce a novel inference-time alignment approach for LLMs that aims to generate safe responses almost surely, i.e., with probability approaching one. Our approach models the generation of safe responses as a constrained Markov Decision Process (MDP) within the LLM's latent space. We augment a safety state that tracks the evolution of safety constraints and dynamically penalize unsafe generations to ensure the generation of safe responses. Consequently, we demonstrate formal safety guarantees w.r.t. the given cost model upon solving the MDP in the latent space with sufficiently large penalties. Building on this foundation, we propose InferenceGuard, a practical implementation that safely aligns LLMs without modifying the model weights. Empirically, we demonstrate that InferenceGuard effectively balances safety and task performance, outperforming existing inference-time alignment methods in generating safe and aligned responses. Our findings contribute to the advancement of safer LLM deployment through alignment at inference-time, thus presenting a promising alternative to resource-intensive, overfitting-prone alignment techniques like RLHF.

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

↑