NeurIPS 2026QuestionsPapersAreasAboutMarkdown

LaCache: Robust Semantic Caching for LLM Serving

JIACHENG LIANG, Yuhui Wang, Tanqiu Jiang, Ting Wang

NeurIPS page · OpenReview · alphaXiv · Open on the map

Category: Efficient LLM Inference & Training › LLM Serving Optimization · Type: new method · Keywords: semantic caching, cache collision attacks, LLM serving, robust caching, security guarantees

Areas: Safety & Security › Language Model Security › Prompt Injection and Resource Attacks

Summary

LaCache introduces a robust semantic caching scheme for LLM serving that prevents cache-collision attacks by checking the first k speculatively decoded tokens, providing formal security guarantees and improved efficiency.

Explained to a 5-year-old

Imagine a robot friend that remembers what people ask and gives quick answers later. It stores these answers in a special place called a cache. Sometimes someone can trick the robot by asking a fake question that makes the robot give the wrong answer to other people. LaCache makes the robot also look at the first few words it says before using the memory. This stops the bad tricks and helps the robot answer faster.

Explained to a 5-year-old, longer

Imagine a robot friend that remembers what people ask and gives quick answers later. It stores these answers in a special place called a cache. Sometimes someone can trick the robot by asking a fake question that makes the robot give the wrong answer to other people. This is called a cache-collision attack. The new idea makes the robot not only look at the question but also at the first few words it says before using the memory. Because the robot has less control over those words, the trick fails. This extra check also helps the robot give more accurate answers. The robot is tested on many different friends and works well. It keeps the robot safe and faster. It also saves money because it uses less work. The idea is simple but works well. It makes the robot more reliable for everyone. It also opens new ways to protect cached answers.

For a technical reader

LaCache enhances semantic caching for LLM serving by augmenting the cache index with the first k speculatively decoded tokens. This dual-check mechanism ensures that an adversarial query cannot simultaneously produce a malicious response and collide with benign entries, providing a provable security guarantee. The enriched index also improves retrieval relevance by adding token-level context. Empirical evaluations across multiple models and benchmarks confirm both the security resilience and the efficiency gains. The approach is lightweight and can be integrated into existing serving pipelines with minimal overhead.

Problem

Existing semantic caching schemes for large language models are vulnerable to cache-collision attacks, where an adversary can inject crafted queries to pollute the cache and corrupt subsequent legitimate responses.

Method

The approach checks not only the cache hit of a query but also the cache hit of its first k speculatively decoded tokens, leveraging the limited control an adversary has over the generated response to provide formal resilience against cache-collision attacks. This enriched index supplies additional semantic context, improving retrieval relevance. The design is validated empirically across multiple LLMs and benchmarks.

Results

The approach demonstrates formal resilience against cache-collision attacks and achieves efficiency gains on diverse LLMs and benchmarks.

Contributions

It provides a principled redesign of semantic caching that guarantees security against cache-collision attacks and enriches the index with token-level context, leading to more relevant cache hits. The work also offers empirical validation across multiple LLMs and benchmarks.

Practical relevance

It enables more secure and efficient LLM serving by protecting cached responses from adversarial pollution, reducing latency and cost while maintaining reliability.

Research questions this paper is counted under

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction