Traditional caching matches exact inputs: ask the identical question, get the stored answer. But users phrase the same question a hundred different ways. Semantic caching solves that — it reuses answers for questions that mean the same thing, even when the words differ.
How it differs from normal caching
A normal cache keys on exact text: "What is your refund policy?" and "how do refunds work?" are different strings, so it treats them as different requests and pays the model for both. A semantic cache keys on meaning — it embeds the query, checks whether a semantically similar question was already answered, and if so, returns the cached answer. Same intent, one computation.
Exact-match caching only helps when people repeat themselves word-for-word. Semantic caching helps when they repeat themselves at all — which is far more often.
How it works
When a query arrives, you embed it and search a cache of past questions (using vector similarity). If a close-enough match exists, return its stored answer instead of calling the model. If not, call the model and add this Q&A to the cache. It's RAG-like machinery applied to caching: retrieve by meaning, but to reuse answers rather than to ground new ones.
The tradeoffs
The key knob is the similarity threshold. Too loose, and you return a cached answer to a question that's subtly different (wrong answer). Too strict, and you cache-miss on genuine paraphrases (lost savings). It also fits questions with stable answers better than ones where the answer depends on fresh data or context.
Why it matters
For applications with repetitive queries — customer support, FAQs, common how-tos — semantic caching can cut a large fraction of model calls, slashing cost and latency. It's an underused optimization that pays off exactly where traffic is repetitive and answers are stable. Tune the threshold carefully, and it's close to free money.