arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.26167cs.CLcs.AIcs.LG
收藏

测试时安全性对齐

Test-Time Safety Alignment

Department of Electrical and Computer Engineering(电气与计算机工程系);Yale University(耶鲁大学)

Baturay Saglam, Dionysis Kalogerias

AI总结:

研究探讨了输入嵌入如何通过优化减少对齐模型生成文本的有害性,展示了在安全任务中通过梯度下降提升文本安全性的方法。

摘要:

最近的研究表明,模型的输入词嵌入可以作为有效的控制变量,以引导其行为产生满足期望属性的输出。然而,这一发现仅在预训练文本补全模型上针对减少短延续表面级冒犯性进行了演示。一个自然且实际重要的问题是输入嵌入如何控制对齐模型,这些模型产生不平衡的双模拒绝或服从输出分布,而非开放式生成的平滑分布。我们在此背景下探索安全性,展示输入词嵌入可以通过子词级方式优化以最小化对齐模型响应的语义有害性。我们的方法使用黑盒文本审核API对输入嵌入的零阶梯度估计,然后在这些嵌入上应用梯度下降以最小化生成文本的有害性。实验表明,所提出的方法可以中和标准安全基准上所有安全标记的响应。

英文摘要:

Recent work has shown that a model's input word embeddings can serve as effective control variables for steering its behavior toward outputs that satisfy desired properties. However, this has only been demonstrated for pretrained text-completion models on the relatively simple objective of reducing surface-level profanity in short continuations. A natural and practically important question is how well input embeddings can control aligned models, which produce an imbalanced bimodal refuse-or-comply output distribution rather than the smooth distribution characteristic of open-ended generation. We explore this in the context of safety, showing that input word embeddings can be optimized in a sub-lexical manner to minimize the semantic harmfulness of aligned model responses. Our approach uses zeroth-order gradient estimation of a black-box text-moderation API with respect to the input embeddings, and then applies gradient descent on these embeddings to minimize the harmfulness of the generated text. Experiments show that the proposed method can neutralize every safety-flagged response on standard safety benchmarks.

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

↑