arXiv:2412.06748cs.LGcs.CL2024-12被引 16

用特殊标记控制大模型拒绝回答的敏感度,无需重新训练。

Refusal Tokens: A Simple Way to Calibrate Refusals in Large Language Models

  • 为每类拒绝请求添加专用标记,训练时注入模型
  • 推理时通过调节标记生成概率,动态调整拒绝率
  • 单模型适配多用户需求,省去重复训练

构建安全可靠的语言模型关键在于使其能适当拒绝执行特定指令或回答某些问题。我们希望模型对结构不当的问题、违法指令或超出知识范围的查询输出拒绝回应。但不同用户对各类问题的拒绝敏感度要求不同,当前方法需针对不同拒绝率训练多个模型,计算成本高且难以灵活适配。为此,本文提出拒绝标记(refusal tokens),在训练时将每个拒绝类别一个标记或统一标记前置到模型输出中。推理时,通过调节各标记的生成概率,可动态调控模型拒绝行为。该方法仅需干预生成过程,无需额外微调,即可实现单一模型对多种拒绝率偏好支持。

原文摘要 · Abstract (English)

A key component of building safe and reliable language models is enabling the models to appropriately refuse to follow certain instructions or answer certain questions. We may want models to output refusal messages for various categories of user queries, for example, ill-posed questions, instructions for committing illegal acts, or queries which require information past the model's knowledge horizon. Engineering models that refuse to answer such questions is complicated by the fact that an individual may want their model to exhibit varying levels of sensitivity for refusing queries of various categories, and different users may want different refusal rates. The current default approach involves training multiple models with varying proportions of refusal messages from each category to achieve the desired refusal rates, which is computationally expensive and may require training a new model to accommodate each user's desired preference over refusal rates. To address these challenges, we propose refusal tokens, one such token for each refusal category or a single refusal token, which are prepended to the model's responses during training. We then show how to increase or decrease the probability of generating the refusal token for each category during inference to steer the model's refusal behavior. Refusal tokens enable controlling a single model's refusal rates without the need of any further fine-tuning, but only by selectively intervening during generation.

大模型安全拒绝策略可控生成

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