用动态系统方法提前预警并引导大模型生成更安全内容。
Preemptive Detection and Steering of LLM Misalignment via Latent Reachability
- 将语言模型生成视为潜空间中的动态系统,通过反向可达性分析建模安全边界。
- 能提前数个词预测危险输出,且在不破坏文本流畅性的前提下纠正生成路径。
- 适合关注推理阶段安全、需实时干预的AI应用开发者和安全研究人员。
大语言模型在日常工具中广泛应用,但其生成有害内容的风险日益突出。当前主流的安全方法——基于人类反馈的强化学习(RLHF)——仅在训练阶段有效,无法保障推理时的安全。本文提出BRT-Align,一种基于可达性分析的框架,将自回归生成建模为潜空间中的动力系统,利用反向可达性学习安全价值函数,估算轨迹最坏演化情况。该方法实现两种互补机制:(1) 运行时监控器可提前数个词预测不安全生成;(2) 最小约束引导滤波器通过轻微扰动潜变量,将生成导向安全区域。在多个大模型与毒性评测基准上的实验表明,BRT-Align比基线更早、更准确地检测到不安全输出。同时,在保持句子多样性和连贯性的前提下,显著降低不安全生成比例。定性结果进一步显示,该方法生成的内容更具安全性:更少暴力、更少粗俗、更少冒犯性,政治偏见也更低。这些结果证明,可达性分析为推理阶段的模型安全提供了原理清晰且实用的解决方案。
原文摘要 · Abstract (English)
Large language models (LLMs) are now ubiquitous in everyday tools, raising urgent safety concerns about their tendency to generate harmful content. The dominant safety approach -- reinforcement learning from human feedback (RLHF) -- effectively shapes model behavior during training but offers no safeguards at inference time, where unsafe continuations may still arise. We propose BRT-Align, a reachability-based framework that brings control-theoretic safety tools to LLM inference. BRT-Align models autoregressive generation as a dynamical system in latent space and learn a safety value function via backward reachability, estimating the worst-case evolution of a trajectory. This enables two complementary mechanisms: (1) a runtime monitor that forecasts unsafe completions several tokens in advance, and (2) a least-restrictive steering filter that minimally perturbs latent states to redirect generation away from unsafe regions. Experiments across multiple LLMs and toxicity benchmarks demonstrate that BRT-Align provides more accurate and earlier detection of unsafe continuations than baselines. Moreover, for LLM safety alignment, BRT-Align substantially reduces unsafe generations while preserving sentence diversity and coherence. Qualitative results further highlight emergent alignment properties: BRT-Align consistently produces responses that are less violent, less profane, less offensive, and less politically biased. Together, these findings demonstrate that reachability analysis provides a principled and practical foundation for inference-time LLM safety.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。