LMSM:受Linux安全模块启发的LLM安全框架

·

研究论文 · 2026/08/31

大型语言模型(LLM)的部署常采用分层防御,但恶意提示仍可绕过。可解释性方法能暴露生成路径中的模型内部信号,但这些信号本身并非安全控制。现有部署将每个信号与各自的校准、策略逻辑和干预代码耦合,导致集成工作繁重。我们提出语言模型安全模块(LMSM),借鉴Linux安全模块(LSM)的分离思想,将安全后端、策略评估和输出门控分离,实现中介正确性与策略有效性的解耦。原型在Hugging Face Transformers和vLLM上验证,支持多种安全后端,保持请求级决策,并显著降低攻击成功率,同时保持高吞吐量。

该论文提出了一种新颖的LLM安全框架,借鉴操作系统安全模块的设计,解决了现有可解释性方法集成困难的问题,并通过实验验证了其有效性和低开销,对LLM安全部署具有重要参考价值。

Large language models (LLMs) are increasingly deployed with layered defenses, yet malicious prompts can still bypass them. Interpretability methods can expose model-internal signals along the generation path that could inform enforcement, but these signals are not security controls by themselves. Deployments that adapt them for safety typically couple each signal to its own calibration, policy logic, and intervention code, so each new artifact creates integration work instead of strengthening a shared defense. We present Language Model Security Modules (LMSM), a security framework that adapts the separation behind Linux Security Modules (LSM) to LLM serving. In LMSM, a selected security backend exposes calibrated evidence, a versioned policy evaluates active rules over trusted per-request context, and a separate gate authorizes buffered output release. This design separates mediation correctness from policy effectiveness, and it allows backend, rule, or schedule changes without rebuilding request handling or enforcement. Our prototype shows the separation working in practice: with Hugging Face Transformers and continuously batched vLLM, the same substrate hosts artifact-backed sparse autoencoder (SAE) and transcoder deployments and task-fitted dense probes, preserves request-specific decisions under scheduler churn, and selectively enforces and composes multiple rules per request. On Qwen3-4B, LMSM-Checkpoint reduces HarmBench attack success rate from 39.20% to 3.32%, with XSTest false refusals rising from 2.40% to 4.40%, while retaining 98.14% of the throughput of a matched serving path that performs no monitoring work at 32 active sequences. LMSM gives advances in interpretability and model-internal analysis a common path to runtime enforcement.

阅读原文

参与讨论