arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.22284cs.CRcs.LG
收藏

基于嵌入的分类器可检测提示注入攻击

Embedding-based classifiers can detect prompt injection attacks

Vanderbilt University Medical Center(范德堡大学医学中心)

Md. Ahsan Ayub, Subhabrata Majumdar

AI总结:

针对大语言模型易受提示注入攻击的问题,提出基于嵌入的机器学习分类器检测方法,使用三种嵌入模型生成提示嵌入,经Random Forest、XGBoost等分类器检测,性能优于现有开源的仅编码器神经网络式最先进提示注入分类器。

摘要:

大语言模型(LLM)凭借其卓越的生成能力,正被各类组织广泛采用。然而,研究发现LLM易受多种对抗性攻击,尤其是提示注入攻击,这类攻击会诱使LLM生成有害或不当内容。攻击者通过精心设计恶意提示来欺骗LLM,从而实施此类攻击。本文提出了一种基于嵌入的机器学习(ML)分类器的新方法,用于保护基于LLM的应用免受这一严重威胁。我们利用三种常用的嵌入模型生成恶意和良性提示的嵌入向量,再通过ML分类器预测输入提示是否为恶意。在多种传统ML方法中,使用Random Forest和XGBoost构建的分类器取得了最佳性能。我们的分类器性能优于现有开源实现中采用仅编码器神经网络的最先进提示注入分类器。

英文摘要:

Large Language Models (LLMs) are seeing significant adoption in every type of organization due to their exceptional generative capabilities. However, LLMs are found to be vulnerable to various adversarial attacks, particularly prompt injection attacks, which trick them into producing harmful or inappropriate content. Adversaries execute such attacks by crafting malicious prompts to deceive the LLMs. In this paper, we propose a novel approach based on embedding-based Machine Learning (ML) classifiers to protect LLM-based applications against this severe threat. We leverage three commonly used embedding models to generate embeddings of malicious and benign prompts and utilize ML classifiers to predict whether an input prompt is malicious. Out of several traditional ML methods, we achieve the best performance with classifiers built using Random Forest and XGBoost. Our classifiers outperform state-of-the-art prompt injection classifiers available in open-source implementations, which use encoder-only neural networks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑