arXiv:2505.01315cs.CLcs.AI2025-05被引 2

不重训模型即可让大模型自动识别并过滤恶意输入。

Helping Large Language Models Protect Themselves: An Enhanced Filtering and Summarization System

  • 用零样本分类等NLP技术检测编码内容和操纵性语言
  • 98.71%准确识别恶意模式与编码提示
  • 通过摘要学习防御知识,提升越狱抵抗能力

大型语言模型的广泛应用使其易受复杂对抗攻击、操纵性提示和编码恶意输入的影响。现有防护措施常需重新训练,计算成本高且难以部署。本文提出一种无需重训练或微调的新型防御范式,使大模型可自主识别、过滤并抵御恶意输入。该框架包含两部分:(1) 提示过滤模块,利用零样本分类、关键词分析及编码内容检测(如base64、十六进制、URL编码)识别、解码并分类有害输入;(2) 摘要模块,对对抗研究文献进行处理与摘要,为模型提供上下文感知的防御知识。该方法融合文本提取、摘要与有害提示分析,显著提升模型抗攻击能力。实验显示,该集成方案在识别有害模式、操纵语言结构及编码提示方面成功率高达98.71%。仅使用少量对抗研究文献作为上下文,该方法还能有效提升模型对恶意输入的越狱抵抗率与拒绝率。在保持响应质量的同时,大幅增强模型对恶意滥用的防御能力,验证了其作为耗时重训练防御的快速替代方案的有效性。

原文摘要 · Abstract (English)

The recent growth in the use of Large Language Models has made them vulnerable to sophisticated adversarial assaults, manipulative prompts, and encoded malicious inputs. Existing countermeasures frequently necessitate retraining models, which is computationally costly and impracticable for deployment. Without the need for retraining or fine-tuning, this study presents a unique defense paradigm that allows LLMs to recognize, filter, and defend against adversarial or malicious inputs on their own. There are two main parts to the suggested framework: (1) A prompt filtering module that uses sophisticated Natural Language Processing (NLP) techniques, including zero-shot classification, keyword analysis, and encoded content detection (e.g. base64, hexadecimal, URL encoding), to detect, decode, and classify harmful inputs; and (2) A summarization module that processes and summarizes adversarial research literature to give the LLM context-aware defense knowledge. This approach strengthens LLMs' resistance to adversarial exploitation by fusing text extraction, summarization, and harmful prompt analysis. According to experimental results, this integrated technique has a 98.71% success rate in identifying harmful patterns, manipulative language structures, and encoded prompts. By employing a modest amount of adversarial research literature as context, the methodology also allows the model to react correctly to harmful inputs with a larger percentage of jailbreak resistance and refusal rate. While maintaining the quality of LLM responses, the framework dramatically increases LLM's resistance to hostile misuse, demonstrating its efficacy as a quick and easy substitute for time-consuming, retraining-based defenses.

大模型安全对抗防御零样本检测

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