镜像设计模式:基于模型尺度的严格数据几何用于提示注入检测
The Mirror Design Pattern: Strict Data Geometry over Model Scale for Prompt Injection Detection
AI总结:
本文提出镜像设计模式,通过严格数据几何提升提示注入检测效率,采用5000个公开样本构建32-cell镜像拓扑,训练线性SVM模型在子毫秒延迟下实现95.97%召回率,同时Prompt Guard 2模型在49ms延迟下达到44.35%召回率。
摘要:
提示注入防御通常被框架为语义理解问题,委托给越来越大的神经检测器。然而,对于第一层筛查,要求不同:检测器必须在每个请求上运行,因此必须快速、确定性、非提示性且可审计。我们引入Mirror,一种数据整理设计模式,将提示注入语料库分为匹配的正负单元,使分类器学习控制平面攻击机制而非偶然语料捷径。使用5000个严格整理的开源样本——在我们公开数据有效性合同下可支持的最大语料库——我们定义了32单元镜像拓扑,填充31个单元的公开数据,训练稀疏字符n-gram线性SVM,将其权重编译成静态Rust artifact,并在524个案例的验证集上获得95.97%的召回率和92.07%的F1值,延迟低于毫秒,无需外部模型运行依赖。在相同验证集上,我们的下一线防御,一个2200万个参数的Prompt Guard 2模型在49ms中位延迟和324ms p95延迟下达到44.35%的召回率和59.14%的F1值。线性模型仍留下残余语义模糊性,如使用与提及的区别,但在此范围内,我们的结果表明,对于L1提示注入筛查,严格数据几何比模型规模更重要。
英文摘要:
Prompt injection defenses are often framed as semantic understanding problems and delegated to increasingly large neural detectors. For the first screening layer, however, the requirements are different: the detector runs on every request and therefore must be fast, deterministic, non-promptable, and auditable. We introduce Mirror, a data-curation design pattern that organizes prompt injection corpora into matched positive and negative cells so that a classifier learns control-plane attack mechanics rather than incidental corpus shortcuts. Using 5,000 strictly curated open-source samples -- the largest corpus supportable under our public-data validity contract -- we define a 32-cell mirror topology, fill 31 of those cells with public data, train a sparse character n-gram linear SVM, compile its weights into a static Rust artifact, and obtain 95.97\% recall and 92.07\% F1 on a 524-case holdout at sub-millisecond latency with no external model runtime dependencies. On the same holdout, our next line of defense, a 22-million-parameter Prompt Guard~2 model reaches 44.35\% recall and 59.14\% F1 at 49\,ms median and 324\,ms p95 latency. Linear models still leave residual semantic ambiguities such as use-versus-mention for later pipeline layers, but within that scope our results show that for L1 prompt injection screening, strict data geometry can matter more than model scale.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。