Query classification aims to understand if the user's information need is conversational, informational, transactional, or navigational. In other words, what is the user's information need, also called "intent," and how should the [[Information Retrieval (IR) System]] system try to solve the problem? For [[Retrieval Augmented Generation (RAG)]] applications, query classification means determining if retrieval is needed or not, since retrieval is generally recommended when knowledge beyond the model’s parameters is needed, but not all queries require retrieval-augmented due to the inherent capabilities of LLMs. You may train a classifier to automate this decision-making process (BERT-base-multilingual-cased with a batch size of 16 and a learning rate of 1e-5). Keep in mind, that while RAG can enhance information accuracy and reduce hallucinations, frequent retrieval can increase response time. aka "Query Understanding" and "Intent Classification." Techniques to increase recall or speed detailed in [[Query Transformation]], [[Query Augmentation]], and [[Query Routing]]. This can be done by breaking the query down into three parts: 1. holistic understanding 2. reductionist understanding 3. resolution - https://en.wikipedia.org/wiki/Query_understanding - https://queryunderstanding.com/ Steps include: - **Query Parsing:** Breaks down the user query into its components (e.g., keywords, phrases). - **Spell Correction:** Suggests corrections for misspelled queries. - **Synonym Expansion:** Expands queries with synonyms to improve recall. - **Entity Recognition:** Identifies named entities (e.g., people, places, organizations) in the query. - **Intent Classification:** Classifies the intent of the query (e.g., informational, transactional, navigational). - **Query Rewriting:** Rewrites the query for better retrieval performance, possibly based on historical data.