Enhancing adversarial resilience in semantic caching for secure retrieval augmented generation systems
Mohanad Afiffy, Mohamed Waleed Fakhr, Fahima A. Maghraby

TL;DR
This paper introduces SAFE-CACHE, a new semantic caching method that improves security and reduces adversarial attacks in retrieval-augmented language models.
Contribution
The novel SAFE-CACHE approach uses cluster centroids and a refined caching strategy to enhance adversarial resilience in semantic caching.
Findings
SAFE-CACHE reduces adversarial attack success rates from 52.77% to 14.27% compared to GPTCache.
The method achieves up to 72% improvement in adversarial resistance through cluster-based caching.
Unsupervised clustering and statistical detection improve semantic validation and system reliability.
Abstract
Large Language Models (LLMs) combined with Retrieval-Augmented Generation (RAG) frameworks greatly improve natural language processing performance, but they incur substantial computational overhead because many similar queries are processed repeatedly. To mitigate this, semantic caching has been introduced to store past responses and reuse them for semantically similar inputs, thereby reducing computation costs. Yet, semantic caching mechanisms that depend only on semantic similarity are vulnerable to adversarial exploitation: carefully engineered malicious queries with minor lexical variations can trigger incorrect cache hits, undermining both the reliability and the security of the system. This paper examines security vulnerabilities in semantic proximity caching systems such as GPTCache, a widely used open-source semantic cache that exemplifies these issues, and introduces a new…
Genes, proteins, chemicals, diseases, species, mutations and cell lines named across the full text — each resolved to its canonical identifier and authoritative record.
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdversarial Robustness in Machine Learning · Advanced Neural Network Applications · Advanced Graph Neural Networks
