已签名但可操控:测量并弥合离线检索增强生成中的文本-向量完整性差距
Signed but Steerable: Measuring and Closing the Text-Vector Integrity Gap in Offline Retrieval-Augmented Generation
AI总结:
本文研究离线RAG中签名知识包的文本-向量完整性差距,发现现有验证机制易受攻击,提出验证量化代码的方案,同时报告弃权等防御手段的预注册阴性结果并发布代码数据。
摘要:
边缘设备上的离线检索增强生成(RAG)通过携带文本和预计算嵌入向量的签名知识包进行更新。签名仅证明知识包的发布者,而非其向量编码对应文本的真实性。本文研究这一文本-向量完整性差距:验证者重新计算向量并在余弦容差内接受向量时,会向控制向量的攻击者让步可预测比例的查询,劫持率等于容差下角度检索边际的分布(即边际定律)。在五个语料库和两个嵌入模型中,边际较小,因此浮点噪声级别的理想化容差会导致多达5.5%的查询暴露(排除完全重复文档后,任何语料库中最多1.2%);根据小型嵌入模型的CPU INT8-FP32比较(在诚实余弦的经验0.1%分位数处)校准的阈值,会导致98-100%的查询暴露;在运行本地语言模型的Raspberry Pi 5上,此类攻击使正确答案从0.75降至0.39。压缩向量存储的完整性审计效果也不佳:在包含57638个文档的FAISS乘积量化索引上,全部通过审计的被篡改向量会使攻击者的文档在25%的目标中排名第一。改为验证量化代码,由验证者决定歧义、使用校准保护带和规范化后,在三个平台上接受了样本中所有诚实向量,且发布者无选择余地。此外,本文还表明常见的浮点和动态INT8推理流水线在不同批次大小或架构间不具备比特级可复现性,并报告了关于弃权(不执行)、上下文剪枝和语义筛选的预注册阴性结果。本文发布代码和数据。
英文摘要:
Offline retrieval-augmented generation (RAG) on edge devices is updated through signed knowledge packs that carry text and precomputed embedding vectors. A signature proves who published a pack, not that its vectors encode its text. We study this text-vector integrity gap. A verifier that recomputes vectors and accepts them within a cosine tolerance concedes a predictable share of queries to an attacker who controls the vectors: the hijack rate equals the distribution of angular retrieval margins at the tolerance (the margin law). Margins are small in five corpora and two embedding models, so an idealised tolerance at the level of floating-point noise leaves up to 5.5% of queries exposed (at most 1.2% in any corpus once exact duplicate documents are excluded), and a threshold calibrated from our CPU INT8-FP32 comparison of a small embedding model (at the empirical 0.1% quantile of honest cosines) leaves 98-100% exposed; on a Raspberry Pi 5 running a local language model, such an attack lowers correct answers from 0.75 to 0.39. Integrity audits of compressed vector stores fare no better: on a FAISS product-quantisation index over 57,638 documents, tampered vectors that all pass the audit put the attacker's document first for 25% of targets. Verifying quantisation codes instead, with ambiguity decided by the verifier, a calibrated guard band and canonicalisation, accepted every honest vector in our samples on three platforms and left the publisher no choice. We also show that common floating-point and dynamic-INT8 inference pipelines are not bit-reproducible across batch sizes or architectures, and report pre-registered negative results on abstention, context pruning and semantic screening. We release code and data.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。