Machine Learning Pills

Machine Learning Pills

Share this post

Machine Learning Pills
Machine Learning Pills
Issue #70 - Advanced Retrieval Strategies: Query Translation II

Issue #70 - Advanced Retrieval Strategies: Query Translation II

David Andrés's avatar
David Andrés
Aug 25, 2024
∙ Paid
5

Share this post

Machine Learning Pills
Machine Learning Pills
Issue #70 - Advanced Retrieval Strategies: Query Translation II
1
Share

💊 Pill of the week

In our previous RAG issue:

Issue #67 - Advanced Retrieval Strategies: Query Translation I

Issue #67 - Advanced Retrieval Strategies: Query Translation I

David Andrés
·
July 20, 2024
Read full story

we explored how Retrieval-Augmented Generation (RAG) models have dramatically enhanced the landscape of natural language processing by integrating robust retrieval systems with the generative power of large language models. These hybrid models have set new standards in tasks like question answering, fact verification, and open-domain dialogues by delivering more accurate and context-aware results.

A key takeaway is the importance of leveraging advanced retrieval strategies to fully unlock the potential of RAG models.

By refining how these models retrieve and utilize information, we can improve their accuracy, reduce instances of hallucination, and make them more adaptable to complex and diverse queries.

This article continues that exploration by delving into advanced Query Translation techniques, essential for fine-tuning the retrieval process in RAG models. Query translation involves reformulating the user’s initial query to align better with how information is indexed or stored in a system. This can include rephrasing, expanding with synonyms, breaking down the query into smaller parts, or generating hypothetical contexts, all aimed at improving retrieval precision and the quality of generated responses.

We will revisit and expand upon five key types of Query Translation techniques:

  • Multi Query

  • RAG Fusion

  • Query Decomposition 👈 this issue

  • Step Back

  • Hypothetical Document Embeddings (HyDE)

Each of these techniques plays a vital role in optimizing the retrieval process and, by extension, the performance of RAG models. In this issue we will focus on Query Decomposition.

✂️Query Decomposition

Query decomposition involves breaking down complex queries into simpler sub-queries. This technique helps isolate different aspects of the original query, allowing the retrieval system to fetch more precise and relevant pieces of information.

When to Use

Decomposition is particularly effective when dealing with multifaceted or complex queries that can be logically split into smaller, standalone sub-queries. It is especially useful in domains such as healthcare, research, and legal queries, where addressing multiple aspects of a question individually is crucial for forming a complete and accurate response.

Example

Consider the query: "What are the health benefits of a Mediterranean diet for cardiovascular health and mental health?"

This can be decomposed into:

  1. "What are the cardiovascular health benefits of a Mediterranean diet?"

  2. "What are the mental health benefits of a Mediterranean diet?"

Implementation Details

To effectively implement query decomposition, several advanced techniques can be utilized. The following methods were derived from the following two techniques:

  • Least-to-Most Strategy: This approach can be aligned with the "least-to-most" strategy, where the simplest sub-questions are answered first. The answers to these simpler questions then provide a foundation for tackling more complex sub-queries. This progression from basic to complex ensures that the system develops a robust understanding of the query as it moves forward.

  • IR-CoT (Interleaved Retrieval with Chain of Thought): IR-CoT is an advanced method that interleaves retrieval with reasoning. In this approach, retrieval and thought processes are dynamically combined. For each sub-query, the system retrieves relevant information, reasons over it (as in the Chain of Thought method), and then uses this reasoning to guide further retrieval and answering. This is particularly useful in recursive answering, where the context evolves and the retrieval process must adapt dynamically to incorporate new insights.

This method can be implemented following to slightly different approaches:

  1. Individual Answering Approach:

    • Process: The query is decomposed into sub-queries and processed independently in parallel. Once all sub-queries are addressed, their individual responses are combined to form a comprehensive final answer.

    • Advantage: This approach is efficient when the sub-queries are largely independent and do not require sequential context-building. By leveraging parallelism, it speeds up the processing time and is ideal for scenarios where sub-questions are not interdependent.

  2. Recursive Answering Approach:

Keep reading with a 7-day free trial

Subscribe to Machine Learning Pills to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 MLPills
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share