Exact Embedding Verification on an Edge NPU: Measurements and Deployment Constraints: what it means for business leaders
A 13-TOPS accelerator on a Raspberry Pi 5 lets an offline RAG device recompute every embedding itself at a 1.3% cost to the language model, and its bit-identical output makes exact integrity checks possible where tolerance checks fail.
1. What the method is
This is a measurement study with a deployment design attached, not a new algorithm. The authors take an offline retrieval-augmented generation device, a Raspberry Pi 5 running a 3B-parameter language model on its CPU, and add a Hailo-8L neural processing unit to recompute the embedding vectors that arrive in signed knowledge packs. They report three measurements. Recomputing on the NPU costs the language model almost nothing. The chip returns bit-identical embeddings across repetitions, batch sizes and processes. Its quantised INT8 output differs so much from floating point that any check accepting vectors within a similarity tolerance is useless against an attacker. From these they derive a design they call verify, then discard: the device embeds every chunk itself, compares bit for bit against a reference where one legitimately exists, and retrieves only with its own vectors.
2. Why the method was developed
Knowledge packs for offline RAG ship text together with precomputed vectors, and a signature on the pack proves who published the vectors, not that they encode the text. The same authors showed earlier that a compromised publisher can ship reviewed, innocent-looking text with vectors steered towards chosen queries, and that any verifier accepting a recomputed vector within a cosine tolerance concedes a predictable share of queries. The safe options were to recompute and ignore the shipped vectors, or to compare exactly against a bit-reproducible computation. Both had a price on a small board: verifying 8 text-vector pairs per second on the Pi's CPU cost the language model 23 to 31% of its decoding speed, and none of the floating-point or dynamic-INT8 pipelines they measured reproduced its own output bit for bit. This paper asks whether a low-cost accelerator removes both obstacles.
3. Who should care
This matters most to anyone who ships RAG to devices we do not continuously control: product and engineering leads for edge, field or air-gapped deployments, and the security team that owns the update channel. For them it changes the threat model, because signing a content update does not protect retrieval if the update carries vectors. Hardware and procurement should note that an accelerator of this class does real integrity work as well as speeding up inference. Platform teams running server-side RAG should take the general lesson: if we ingest embeddings computed by a supplier or another team, a similarity threshold between their vectors and ours is not a control, and quantised recomputation makes it worse. Compliance and risk owners gain a clearer definition of an integrity event, a bit mismatch under a matching configuration, that can be logged and attributed.
4. How the method works
The device embeds each incoming chunk on the NPU before it becomes searchable and retrieves only with those vectors, so the publisher's vectors never influence ranking. Where a reference was produced by a computation shown to give the same bytes, the device also compares bit for bit, which adds detection: a tampered pack becomes a logged event instead of being silently repaired. A signed manifest must bind everything that determines the bits: model revision and tokeniser, windowing, padding, pooling and normalisation rules, the digest of the compiled graph, runtime and firmware versions, the accelerator model, and the byte representation and hash on which equality is defined. The device checks that configuration against a policy it obtained independently of the publisher. A configuration difference means no comparison is made; a bit difference under a matching configuration quarantines the affected chunks for investigation and is never resolved by falling back to a tolerance.
5. How it was evaluated
The setup is one Raspberry Pi 5 with 16 GB and the Raspberry Pi AI HAT+ carrying a Hailo-8L, running the Hailo Model Zoo build of all-MiniLM-L6-v2 with 128-token windows, beside Qwen2.5-3B-Instruct under llama.cpp on the CPU. The corpus is 1,745 windows from SQuAD 2.0 with a 300-question set covering answerable, unanswerable and out-of-corpus questions. The cost to the language model is the mean of three full runs with the encoder either saturating or verifying 8 pairs per second; CPU baselines use ONNX Runtime in FP32 and dynamic INT8 and are taken from the authors' earlier paper. Determinism was tested on 256 windows across five repetitions, three batch sizes and a fresh process. The tolerance analysis applies their earlier margin law across five corpora and two embedding models, and the end-to-end attack was run in a BGE-M3 retrieval space, not the MiniLM one. The deployment design itself was not evaluated as a system.
6. How it performed
Verification at 8 pairs per second cost the language model 1.3% of its decoding speed on the NPU against 23 to 31% on the CPU, with tail latency almost unchanged; full-speed re-indexing still cost 35.6%. Re-embedding the corpus took 3.4 s against 72.9 s. Retrieval quality held, with recall@3 of 0.85 against 0.87 in FP32. The median cosine to FP32 was 0.917, so an honest tolerance of 0.784 would expose essentially every evaluated query, and an attack within it cut correct answers from 0.75 to 0.35. The limits are substantial: one board, one chip, one embedding model, and no test of whether two chips of the same model agree bit for bit, so the results support only a device checking its own store, not detecting a publisher's tampering. The authors also sell software in this area. Our call: pilot recompute-and-discard on any edge RAG we ship now, and watch the cross-unit determinism question before relying on exact comparison against shipped vectors. (Source: arXiv 2611.37400, 2026)
← Back to dossier index