对黑盒LLM的受控解码攻击

·

研究论文 · 2026/10/02

在生成过程中操纵下一个词元的概率可以绕过大型语言模型的安全对齐。然而,现有方法依赖于对模型权重或数值词元概率的访问,因此不适用于仅返回采样文本的接口。从采样输出中重建概率提供了一种可能的替代方案,但有限采样会产生稀疏且嘈杂的估计,而在每个生成步骤重复此过程会带来大量的查询成本。我们的实证观察表明,在成功的越狱轨迹中,大的分布变化集中在少数位置上,这促使我们进行选择性控制。我们引入了(框架名称),一个通过纯文本延续接口进行越狱的框架,该接口允许重复采样和助手前缀延续。基于采样的分布重建将采样输出与未观察动作的先验相结合,以获得可用的控制信号。风险门控残差控制使用不断演变的响应前缀来决定何时重建和修改分布,将采样成本集中在选定的位置。推测性多词元执行通过验证和接受无需干预的草稿前缀,进一步分摊目标调用。在四个目标端点和三个基准测试中,(框架名称)在大多数比较中相对于基线取得了最高的平均分数。

该研究提出了一种在仅能访问文本输出的黑盒条件下实现越狱的新方法,通过选择性控制和推测执行有效降低了查询成本,并在多个基准测试中取得了优于基线的效果,对LLM安全评估和防御具有参考价值。

Manipulating next-token probabilities during generation can bypass the safety alignment of large language models. Existing approaches, however, rely on access to model weights or numerical token probabilities and therefore do not apply to interfaces that return only sampled text. Reconstructing probabilities from sampled outputs offers a possible alternative, but finite sampling produces sparse and noisy estimates, while repeating this process at every generation step incurs substantial query costs. Our empirical observations suggest that large distributional changes along successful jailbreak trajectories are concentrated at a small subset of positions, motivating selective control. We introduce , a framework for jailbreaking through text-only continuation interfaces that permit repeated sampling and assistant-prefix continuation. Sample-Based Distribution Reconstruction combines sampled outputs with a prior over unobserved actions to obtain a usable control signal. Risk-Gated Residual Control uses the evolving response prefix to decide when to reconstruct and modify the distribution, concentrating sampling costs at selected positions. Speculative Multi-Token Execution further amortizes target calls by verifying and accepting draft prefixes that require no intervention. Across four target endpoints and three benchmarks, achieves the highest mean score most comparisons against baselines.

阅读原文

参与讨论