When would you use separate embeddings for queries and documents?
- 1 min — symmetric vs asymmetric tasks
- 1 min — separate encoders or prefixes
- 2 min — the silent mismatch bug
- 1 min — shared client + contract test
When the task is asymmetric — short questions matched against long passages. Symmetric models are trained for similar-length, similar-shape pairs (deduplication, "find similar articles"). Asymmetric models use separate encoders or instruction prefixes (query: / passage:) so each side is mapped appropriately.
Almost all question-answering RAG is asymmetric. A very common and very quiet bug is using an instruction-prefixed model but forgetting the prefix on one side — quality drops noticeably and nothing errors.
Add the prefix handling inside a shared client library, not in each caller. The reason is operational: query-time and index-time embedding usually happen in different services, written by different teams, and they will drift. I've seen a six-month-old quality regression traced to exactly that. Org scope: the shared embedding client is owned by the platform team and is the only sanctioned path to the model; a contract test in CI asserts identical prefix handling on both sides.
What the answer sounds like at each level
Some models need different prefixes for queries and documents.
Explains symmetric vs asymmetric tasks and the prefix-mismatch failure mode.
Prevents the bug structurally with a shared client library and a CI contract test, since index and query paths are owned by different teams.
Follow-ups the interviewer will push
1How would you detect a prefix mismatch already in production?
Recall@10 on the golden set drops by a few points with no error. Re-embed 100 golden queries with and without the prefix; if the 'wrong' variant scores higher against the index, the index side is missing it.
2Now the use case is near-duplicate detection between support tickets.
That task is symmetric: use the same (document-side) prefix or a symmetric model on both sides.
Red flags interviewers listen for
- Unaware that instruction-prefixed models exist.
- Puts prefix handling in each caller.
- Uses an asymmetric setup for a symmetric dedup task.
How it's scored
| Dimension | What strong looks like |
|---|---|
| Concept | Explains why asymmetric training suits QA retrieval. |
| Failure awareness | Names the silent prefix-mismatch regression. |
| Prevention | Proposes a structural fix across team boundaries. |
Sources
- Dense Passage Retrieval for Open-Domain Question Answering — Karpukhin et al., 2020paper