Find the flaw: this semantic answer cache started serving answers to the wrong questions
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Click any words you think contain an error. Click again to unmark.
The bug is the cosine threshold of 0.75 — too loose for a semantic answer cache. Distinct questions sharing topic words collide above it, so it serves wrong answers. A tight bar near 0.95 admits only true paraphrases.
Imagine a help desk that keeps a folder of past answers. When a new question comes in, the clerk checks if it 'feels similar' to one already answered and, if so, hands over that old answer instead of doing the work again. The trouble is the clerk's bar for 'similar' is way too low. 'How do I reset my password' and 'how do I change my password' feel similar — they share most of the same words — but they want different answers. With a loose bar, the clerk confidently hands over the wrong one. The fix is to make the clerk much stricter, only reusing an old answer when the new question is nearly word for word the same.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: identify the loose 0.75 threshold, explain why caching needs precision unlike retrieval, show how topical neighbors collide, and cover calibration plus intent gating and invalidation as the rest of a correct cache.
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating cosine similarity as a calibrated quality score and picking a low threshold like 0.75 the way you would for retrieval recall — caching needs precision, so the bar has to be near-identical, not just topically close.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.