Signed but Steerable: Measuring and Closing the Text-Vector Integrity Gap in Offline Retrieval-Augmented Generation

Georgios Feretzakis, Alexandros Papaspyridis

arXiv:2611.06498 · 2026-11-08 공개 · arXiv · PDF

retrieval-augmented-generation embedding-models edge-devices cosine-tolerance faiss-quantization integrity-audit vector-hijacking quantisation-codes

Abstract

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.

한국어 요약

한 줄 요약

오프라인 RAG에서 텍스트-벡터 무결성 갭을 측정하고, 정확한 코드 수준 검증으로 이 갭을 해소하는 방법을 제시한다.

핵심 기여도

핵심 아이디어

기존 오프라인 RAG 시스템은 서명된 지식 팩으로 업데이트되지만, 이 서명은 벡터가 텍스트를 정확히 인코딩하는지 보장하지 않는다. 이 연구는 텍스트-벡터 간의 무결성 갭을 측정하고, 이를 해소하는 정확한 검증 방법을 제시한다.

핵심 통찰은 **허용 오차 기반 검증**(cosine tolerance-based verification)이 공격자에게 예측 가능한 쿼리 비율을 허용한다는 점이다. 이는 **마진 법칙**으로 정량화되며, 실제 데이터셋에서 margin이 작아서 허용 오차가 작더라도 5.5%의 쿼리가 노출될 수 있음을 보여준다.

또한, **벡터 압축 저장소**(SQ8, PQ 등)는 허용 오차 기반 검증으로도 2–100%의 노출률을 보인다. 이에 대응해, **정확한 코드 수준 검증**(quantisation code verification)을 제안하며, 이는 애매모호함을 검증자에 의해 결정하고, 가드 밴드와 캐노니컬화를 통해 무결성을 확보한다.

기술적 접근법

주요 결과

의의 및 한계

이 연구는 오프라인 RAG 시스템의 텍스트-벡터 무결성 문제를 정량적으로 분석하고, 이를 해소할 수 있는 구체적인 검증 절차를 제시한다. 특히, **정확한 코드 수준 검증**은 압축된 벡터 저장소에서도 무결성을 확보할 수 있음을 보여준다. 이는 공급망 보안과 엣지 AI의 신뢰성 향상에 기여할 수 있다.

그러나, **정확한 재계산**(recomputation)은 CPU 자원을 많이 소비하며, 이는 언어 모델과의 동시 실행에 영향을 줄 수 있다. 또한, **동적 INT8 추론 파이프라인**은 bit-reproducibility가 보장되지 않아, 이에 기반한 검증이 제한적일 수 있다.

실용적 활용

이 연구는 **엣지 AI**, **공급망 보안**, **오프라인 RAG 시스템**에서 벡터 무결성을 보장하는 데 활용될 수 있다. 특히, **FAISS와 같은 벡터 저장소**에서 악의적인 벡터가 통과되는 문제를 해결할 수 있으며, **Raspberry Pi 5와 같은 엣지 장치**에서 정확한 검증을 구현할 수 있다. 연구팀은 코드와 데이터를 공개하여 실제 시스템에 적용 가능하게 했다.