轻量级本地防护系统,实时拦截有害提示,保障小模型安全。
LiteLMGuard: Seamless and Lightweight On-Device Prompt Filtering for Safeguarding Small Language Models against Quantization-induced Risks and Vulnerabilities
- 基于语义理解的prompt分类,无需修改原模型
- 对有害提示防御率超85%,准确率达94%
- 适合资源受限设备部署,延迟仅135毫秒
随着大模型普及,小语言模型(SLMs)在手机等边缘设备上广泛应用,带来隐私保护、低延迟和免服务器优势。但受限于设备资源,SLMs常通过量化压缩,却意外引入公平性、伦理和隐私风险。量化后的SLMs可能直接响应有害查询,无需攻击诱导,严重威胁安全与信任。为此,我们提出LiteLMGuard——一种轻量级、本地部署的防护机制,可实时对提示进行过滤。该系统模型无关,能无缝集成于任意SLM。基于自建的可回答性数据集,采用ELECTRA模型实现97.75%的分类准确率。在设备端部署中,实现超过85%的有害提示防御率(含越狱攻击),94%过滤准确率,平均延迟约135毫秒。结果表明,LiteLMGuard是高效、鲁棒的本地化安全防护方案,有效抵御开放知识类攻击。
原文摘要 · Abstract (English)
The growing adoption of Large Language Models (LLMs) has influenced the development of Small Language Models (SLMs) for on-device deployment across smartphones and edge devices, offering enhanced privacy, reduced latency, server-free functionality, and improved user experience. However, due to on-device resource constraints, SLMs undergo size optimization through compression techniques like quantization, which inadvertently introduce fairness, ethical and privacy risks. Critically, quantized SLMs may respond to harmful queries directly, without requiring adversarial manipulation, raising significant safety and trust concerns. To address this, we propose LiteLMGuard, an on-device guardrail that provides real-time, prompt-level defense for quantized SLMs. Additionally, our guardrail is designed to be model-agnostic such that it can be seamlessly integrated with any SLM, operating independently of underlying architectures. Our LiteLMGuard formalizes deep learning (DL)-based prompt filtering by leveraging semantic understanding to classify prompt answerability for SLMs. Built on our curated Answerable-or-Not dataset, LiteLMGuard employs ELECTRA as the candidate model with 97.75% answerability classification accuracy. The on-device deployment of LiteLMGuard enabled real-time offline filtering with over 85% defense-rate against harmful prompts (including jailbreak attacks), 94% filtering accuracy and ~135 ms average latency. These results demonstrate LiteLMGuard as a lightweight robust defense mechanism for effectively and efficiently securing on-device SLMs against Open Knowledge Attacks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。