Signed but Steerable: Measuring and Closing the Text-Vector Integrity Gap in Offline Retrieval-Augmented Generation
Abstract
Signed retrieval packs can contain embedding vectors that do not match their text, and practical vector verification and compressed-index audits leave many queries vulnerable, while code-level verification with calibrated ambiguity handling accepts honest vectors.
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.
Community
We study the text-vector integrity gap in offline RAG: signed knowledge packs carry text and precomputed embeddings, but a signature proves who published a pack, not that its vectors encode its text (evaluated on five corpora and two embedding models, plus an end-to-end attack on a Raspberry Pi 5 running a local LLM).
Key findings:
- A verifier that accepts recomputed vectors within a cosine tolerance concedes exactly the queries whose angular retrieval margin falls below it (the margin law). A floating-point-noise tolerance leaves up to 5.5% of queries exposed (at most 1.2% in any corpus once exact duplicate documents are excluded); a threshold calibrated from CPU INT8-FP32 differences leaves 98-100% exposed.
- Common floating-point and dynamic-INT8 inference pipelines are not bit-reproducible across batch sizes or architectures, so some tolerance is unavoidable.
- On the Pi 5, such an attack lowers correct answers from 0.75 to 0.39.
- On a FAISS product-quantisation index over 57,638 documents, tampered vectors that all pass the integrity audit put the attacker's document first for 25% of targets.
- Verifying quantisation codes instead, with verifier-decided ambiguity, a calibrated guard band and canonicalisation, accepted every honest vector on three platforms and left the publisher no choice.
Code, data, and pre-registered negative results (abstention, context pruning, semantic screening) are open (DOI and GitHub links above).
This is an automated message from the Librarian Bot. I found the following papers similar to this paper.
The following papers were recommended by the Semantic Scholar API
- Quantization Enables Private Dense Retrieval against Malicious Service Providers (2026)
- What You Sign Is Not What You Run: The Verifiability Gap in Quantized LLM Supply Chains (2026)
- In RAG We Trust? Measuring Robustness of Retrieval-Augmented Generation Under Post-Retrieval Context Tampering (2026)
- Privacy-preserving inference on hosted models: a learned input-embedding transform for frozen Qwen3.8-27B (2026)
- Bounded Provisional Visibility: Controlling Poisoning Exposure in Continuously Ingested RAG Vector Stores (2026)
- Ranking Is Not Deciding: Benchmark Shortcuts and Operating-Point Collapse in Query-Time RAG Poisoning Defenses (2026)
- What Gradients Add to Text Leakage in Split Language Models, Counted per Token and per Document (2026)
Please give a thumbs up to this comment if you found it helpful!
If you want recommendations for any Paper on Hugging Face checkout this Space
You can directly ask Librarian Bot for paper recommendations by tagging it in a comment: @librarian-bot recommend
Get this paper in your agent:
hf papers read 2611.06498 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper