# Query Rewriting

> Query rewriting uses a language model to reformulate a user's question into one or more queries better suited to the retriever before retrieval is run.

- Identifier: PTL-0131
- Category: Retrieval & Tool Use
- Canonical URL: https://protologue.com/t/query-rewriting/
- Also known as: query expansion, query reformulation, rewrite-retrieve-read, multi-query retrieval
- Introduced: 2023

## Description

User questions are often ambiguous, conversational, or phrased differently from the documents that answer them. Rewriting can resolve references to earlier turns, split a question into sub-queries, add keywords, or expand the query with a generated pseudo-document. It is closely related to HyDE, which embeds a hypothetical answer instead of the question.

## Related terms

- [Hypothetical Document Embeddings](https://protologue.com/t/hypothetical-document-embeddings/)
- [Retrieval-Augmented Generation](https://protologue.com/t/retrieval-augmented-generation/)
- [Agentic RAG](https://protologue.com/t/agentic-rag/)

## Sources

- Ma et al. (2023). Query Rewriting for Retrieval-Augmented Large Language Models. https://arxiv.org/abs/2305.14283
- Wang et al. (2023). Query2doc: Query Expansion with Large Language Models. https://arxiv.org/abs/2303.07678

## Cite this entry

Protologue. (2026). Query Rewriting. In Protologue: A Taxonomy of Prompting and LLM Techniques (v1.4.0, PTL-0131). https://protologue.com/t/query-rewriting/

License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
