CLASP:防御混合大语言模型中的隐藏状态污染攻击
CLASP: Defending Hybrid Large Language Models Against Hidden State Poisoning Attacks
AI总结:
CLASP通过分析Mamba块输出嵌入的差异模式,利用XGBoost分类器检测恶意token,实现高效防御隐藏状态污染攻击,具有轻量级部署优势。
摘要:
状态空间模型(SSMs)如Mamba因其线性复杂度和竞争力性能成为Transformer的高效替代方案。然而,最近发现的隐藏状态污染攻击(HiSPAs)通过对抗性字符串污染SSM内存,对这些架构及其混合变体构成重大威胁。将HiSPA缓解任务框架为token级别的二分类问题,引入CLASP模型(对抗状态污染分类器)以防御此类威胁。CLASP利用Mamba块输出嵌入(BOEs)的差异模式,并使用XGBoost分类器以最小计算开销识别恶意token。在SSMs和HiSPAs可能同时使用的现实场景中,即LLM筛选简历以识别最佳候选人时进行评估。在包含2,483份简历共计9.5M tokens的语料库上,CLASP在恶意token检测上实现了95.9%的token级F1分数和99.3%的文档级F1分数。关键的是,模型能泛化到未见过的攻击模式:在留一法交叉验证中,性能保持高(96.9%文档级F1),而在结构新颖的触发器集群交叉验证中,仍保持有用的检测能力(91.6%平均文档级F1)。CLASP独立于任何下游模型,每秒处理1,032个token,消耗不到4GB VRAM,可能使其成为SSM和混合架构的轻量级前线防御方案。所有代码和详细结果可在https://anonymous.4open.science/r/hispikes-91C0获取。
英文摘要:
State space models (SSMs) like Mamba have gained significant traction as efficient alternatives to Transformers, achieving linear complexity while maintaining competitive performance. However, Hidden State Poisoning Attacks (HiSPAs), a recently discovered vulnerability that corrupts SSM memory through adversarial strings, pose a critical threat to these architectures and their hybrid variants. Framing the HiSPA mitigation task as a binary classification problem at the token level, we introduce the CLASP model (Classifier Against State Poisoning) to defend against this threat. CLASP exploits distinct patterns in Mamba's block output embeddings (BOEs) and uses an XGBoost classifier to identify malicious tokens with minimal computational overhead. We consider a realistic scenario in which both SSMs and HiSPAs are likely to be used: an LLM screening résumés to identify the best candidates for a role. Evaluated on a corpus of 2,483 résumés totaling 9.5M tokens with controlled injections, CLASP achieves 95.9% token-level F1 score and 99.3% document-level F1 score on malicious tokens detection. Crucially, the model generalizes to unseen attack patterns: under leave-one-out cross-validation, performance remains high (96.9% document-level F1), while under clustered cross-validation with structurally novel triggers, it maintains useful detection capability (91.6% average document-level F1). Operating independently of any downstream model, CLASP processes 1,032 tokens per second with under 4GB VRAM consumption, potentially making it suitable for real-world deployment as a lightweight front-line defense for SSM-based and hybrid architectures. All code and detailed results are available at https://anonymous.4open.science/r/hispikes-91C0.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。