179 questions
No questions match those filters.
What is query transformation in RAG, and why does somet...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansThe problem query transformation solves is a phrasing mismatch: how a user asks a question is often nothing like how the answer is actually written in the source documents, and dense retrieval is sensitive to that gap even though it’s supposed to be about meaning, not exact words. A few techniques address this differently. Rewriting uses an LLM to turn something like “my app keeps crashing” into keyword-dense phrasing better suited to search. Sub-query decomposition breaks a compound question — “compare Q1 and Q2 revenue” — into simpler pieces retrieved independently and then combined.
HyDE (Hypothetical Document Embeddings) is the technique worth knowing by name because it’s counterintuitive: rather than embedding the question itself, you ask the LLM to generate a plausible — possibly wrong — answer first, and then embed that hypothetical answer to search with. It works because a fabricated answer, even an inaccurate one, is written in the same register and vocabulary as a real answer document, so its embedding lands much closer to actual answer documents in vector space than the original question’s embedding does. It’s a strong default for complex or oddly-phrased queries where a direct search underperforms.