Tool Reviews

Signed but Steerable Offline Retrieval-Augmented Generation Can Measure and Close the Text-Vector Integrity Gap.

Signed offline LLM retrieval packs can hide tampered vectors; tolerance and margin gaps let attackers steer answers, as Raspberry Pi 5 tests show.

Signed but Steerable Offline Retrieval-Augmented Generation Can Measure and Close the Text-Vector Integrity Gap.

Key Takeaways

  • Signatures can verify who published an offline knowledge pack, but they do not guarantee that its stored vectors faithfully match the stored text.
  • If embeddings are tampered with, a local RAG system can be guided toward attacker-chosen documents while the visible text and signature still appear normal.
  • A verifier’s “close enough” tolerance can create a blind spot: queries with small retrieval margins may pass checks but still be redirected, and overly loose tolerance can expose nearly all queries.
  • Testing on a Raspberry Pi 5 showed that such attacks can sharply reduce correct answers, from 0.75 to 0.39, even if the knowledge pack passes signature-based integrity checks.
  • Practical audits should test the verifier itself, not just the pack signature, because tolerance settings can be exploited as a silent retrieval attack.

Meta description: A study shows signed knowledge packs for local retrieval systems can hide tampered vectors; Raspberry Pi 5 tests cut correct answers from 0.75 to 0.39.

Signed but Steerable Offline Retrieval-Augmented Generation Can Measure and Close the Text-Vector Integrity Gap.

Tags: offline retrieval, signed knowledge packs, embedding integrity, Raspberry Pi 5, local LLM

Featured image: Abstract friendly illustration of signed document packs, vector arrows, and a small computer board; no people, logos, or text.

Who this is for and what was found

Builders and auditors of offline retrieval-augmented generation systems get a concrete warning from a study: the signature on a knowledge pack can identify its publisher, yet it does not guarantee that the pack’s stored vectors faithfully represent the pack’s stored text. The work evaluated five corpora and two embedding models, and it also tested an end-to-end attack on a Raspberry Pi 5 running a local LLM.

For a local assistant, retrieval usually starts by turning a user query into a numerical vector and comparing it with vectors already stored in the knowledge pack. If those stored vectors are altered, the assistant can be guided toward a chosen document while the visible text and the publisher signature still appear normal.

Why signatures are not enough

A signed knowledge pack is designed to travel offline with both the text and precomputed embeddings, so the receiving system can search without rebuilding the vector database. The gap appears because the signature can answer a different question from the one that matters for retrieval. It can show who published the pack, but it does not check whether each embedding still corresponds to its matching passage.

Signed but Steerable Offline Retrieval-Augmented Generation Can Measure and Close the Text-Vector Integrity Gap.

A verifier may try to solve this by recomputing the vectors and accepting the published ones if the recomputed values are close enough, using a cosine tolerance. The study frames the outcome as the margin law: the verifier gives up on exactly those queries whose angular retrieval margin is smaller than the accepted tolerance. In simpler terms, the margin is the gap between the top retrieval candidate and the next candidate. When that gap is smaller than the allowed numerical drift, a tampered vector can pass the check and still change the ranking.

What the measured exposure means

The reported numbers show that a tolerance chosen for harmless noise can still leave queries vulnerable. A floating-point-noise tolerance leaves up to 5.5% of queries exposed. When exact duplicate documents are excluded, the exposure is at most 1.2% in any corpus. That is a smaller share, but it still means some queries can be redirected without breaking the signature.

A second result is more severe. A threshold calibrated from CPU INT8-FP32 differences leaves 98-100% of queries exposed. This suggests that a verifier can become almost ineffective if it accepts too much variation between the vector published by the pack and the vector recomputed under low-precision inference settings.

The Raspberry Pi 5 test shows the user-level impact. Under such an attack, correct answers fall from 0.75 to 0.39. In a local system, that turns retrieval from a mostly reliable helper into one that gives the right answer at 0.39 in the tested setting, even though the knowledge pack may still pass a signature check.

Signed but Steerable Offline Retrieval-Augmented Generation Can Measure and Close the Text-Vector Integrity Gap.

Why bit-for-bit checking is hard

The study notes that common floating-point and dynamic-INT8 inference pipelines are not bit-reproducible across batch sizes or architectures. The same document can therefore produce slightly different numerical vectors depending on how the embedding model is run. Some tolerance is unavoidable if a verifier wants to accept honest packs on different machines.

That creates a narrow design problem. The verifier needs to allow enough drift for normal numerical differences, but not enough drift for an attacker to alter retrieval. The margin law explains why a single fixed tolerance can fail: each query has its own retrieval margin, so the same “close enough” rule may be safe for one query and unsafe for another.

A possible fix and what readers should watch

The authors also tested verifying quantisation codes instead of raw vector closeness. With verifier-decided ambiguity, a calibrated guard band and canonicalisation, the method accepted every honest vector on three platforms and left the publisher with no choice, according to the paper. Put simply, the verifier checks the compressed embedding form more strictly, rather than allowing a broad “close enough” range.

The need for a stronger check is visible in the index test. On a FAISS product-quantisation index over 57,638 documents, tampered vectors that all passed the integrity audit put the attacker's document first for 25% of targets. That means an audit can be satisfied while the retrieval order is still controlled by the attacker.

The work reports that code, data, and pre-registered negative results, including abstention, context pruning and semantic screening, are open, with a digital object identifier and GitHub links provided in the source. For anyone deploying or auditing local retrieval packs, the practical follow-up is to test the verifier itself: the key question is not only whether the pack is signed, but whether its tolerance setting can be turned into a silent retrieval attack.

Comments (0)

  1. No comments yet. Be the first to share what worked for you.

Leave a comment

Comments are reviewed before they appear. Your email address is not published.