Skip to content
InfoResearchPreprint

Exact Embedding Verification on an Edge NPU: Measurements and Deployment Constraints

Published
Record updated
View JSON

Summary

Offline RAG on edge devices needs exact embedding verification, but recomputing vectors on a Raspberry Pi 5 CPU costs the concurrent language model 23-31% of its decoding speed. On a Raspberry Pi 5 with a Hailo-8L NPU, verification at 8 text-vector pairs per second reduces that cost to 1.3%, and re-embedding a 1,745-window corpus takes 3.4 s instead of 72.9 s in FP32 on the CPU. The NPU's INT8 embeddings deviate from floating point, so a cosine tolerance would let an attacker controlling the vectors displace correct documents for essentially all evaluated queries.

Mitigation

The device recomputes every chunk, retrieves only with its own vectors and, where the reference comes from a reproducible computation, compares shipped reference vectors bit for bit. A mismatch is treated as an integrity event to be investigated rather than resolved by a tolerance, and a signed manifest binds every element that determines the bits.