In [[Information Retrieval (IR) System]] & [[Retrieval Augmented Generation (RAG)]] systems, given a user query, the retrieval module selects the top-k relevant documents from a pre-built corpus based on the similarity between the query and the documents. The generation model then uses these documents to formulate an appropriate response to the query. However, original queries often under-perform due to poor expression and lack of semantic information, negatively impacting the retrieval process. Furthermore, also consider [[Information Retrieval (IR)]] issues arising from [[Symmetric & Asymmetric Semantic Search]]. Queries for GenAI should mostly be informational and long-tail (these trigger AIO more often) (ref. [[Types of Queries]]) [[query (and context) understanding]] To address these issues, there are several query transformation **methods**: - [[Query Rewriting]] - [[Query Decomposition]] - Pseudo-documents Generation (might be subset of [[Query Expansion]]): This approach generates a hypothetical document based on the user query and uses the embedding of hypothetical answers to retrieve similar documents. One notable implement is [[Hypothetical Document Embeddings (HyDE)]] - [[Query Relaxation]] - Is [[Query Embedding]] a transformation? - NEW: Google's coined "query fan-out" -> find sub-intents and generates sub-queries, then execute in parallel and merge results These need to be categorized: More complex query expansion frameworks include [[Hypothetical Document Embeddings (HyDE)]], [[Query2doc]] (query2doc combines the original query with the generated pseudo-document, while HyDE only uses the generated document as the query to retrieve), and [[Multi-Text Generation Integration (MUGI)]] (designed to improve dense *and* sparse retrieval). ![[Pasted image 20240911185551.png]] ![[Pasted image 20240911185547.png]] Query transformations (and [[Text Normalization]]) should precede [[Query Embedding]]. Related: [[Query Augmentation]].