Skip to main content
Back

ThinkQE Beats Larger Trained Models by Making AI Rethink Search Queries

ThinkQE uses reasoning models and iterative corpus feedback to expand search queries, beating trained dense retrievers and rerankers without any fine-tuning

Pro

  • ThinkQE is a training-free query expansion framework that uses reasoning models and iterative BM25 feedback to generate diverse, multi-faceted search queries.
  • It beats trained rerankers like Rank1-32B and Rank-K-32B on DL19/DL20, reaching 68.8 nDCG@10 with a 14B model vs. 66.2 for the 32B reranker.
  • On the challenging BRIGHT benchmark, ThinkQE scores 36.0 nDCG@10 -- above all zero-shot methods and most trained rerankers.
  • Key finding: iterative corpus interaction (+2.4 pts) and thinking (+2.7 pts) both outperform simply scaling model size (+0.6 pts).
  • Limitations include ~45 seconds per query latency, English-only evaluation, and unsuitability for code/math retrieval domains.
  • Code is open-source at github.com/Yibin-Lei/Think_QE; paper accepted at EMNLP 2025.

Query expansion -- the practice of enriching a short search query with additional terms before sending it to a retrieval engine -- is one of the oldest tricks in information retrieval. But a new paper from researchers at the University of Amsterdam, University of Technology Sydney, and Johns Hopkins University argues that modern LLM-based approaches have a fundamental blind spot: they are too confident. The result is expansions that fixate on one interpretation of a query and miss the rest. Their answer is ThinkQE, a training-free framework that uses reasoning models and live corpus feedback to generate richer, more diverse expansions -- and it outperforms systems that required expensive training to build.

The overconfidence problem in query expansion

Most LLM-based query expansion methods work by prompting a model to generate a hypothetical document or a set of related terms, then appending that output to the original query before running BM25 or another sparse retriever. Methods like HyDE and Query2doc follow this pattern. The problem is that LLMs tend to latch onto the most probable interpretation of a query and run with it.

Take the query "Who is Robert Gray?" A standard expansion immediately zeroes in on the American explorer who discovered the Columbia River in 1792 -- a perfectly valid answer, but only one of many possible Robert Grays. Recent LLM-based methods often generate narrowly focused expansions that overlook exploration and result diversity. This matters because good retrieval requires surfacing documents that cover different facets of an information need, not just the most obvious one.

The root cause is well-documented: LLMs rely on their internal knowledge and high-probability completions, which may suppress alternative formulations or less common aspects of the query. The fix ThinkQE proposes is to force the model to think before it expands, and then to keep updating that expansion as new evidence comes in from the corpus itself.

Two ideas working in tandem

ThinkQE is a test-time query expansion framework with two key components: a thinking-based expansion process that encourages deeper and comprehensive semantic exploration, and a corpus-interaction strategy that iteratively refines expansions using retrieval feedback from the corpus.

The first component leverages reasoning models -- specifically models distilled from DeepSeek-R1 that are trained to emit a chain of thought before producing an answer. Instead of asking the model to immediately write an expansion, ThinkQE lets it reason first: identify latent concepts, resolve ambiguities, and surface alternative interpretations. Only then does it produce the expansion text. This is not prompt engineering; it exploits the model's native separation of thought tokens and answer tokens.

The second component is inspired by pseudo-relevance feedback (PRF), a classical IR technique where the top-ranked documents from an initial retrieval are used to refine the query. ThinkQE turns this into an iterative loop: retrieve, think, expand, retrieve again with the new query, think again with the new documents, expand again. Each round sees fresh documents that were not shown in the previous round, preventing the model from recycling the same evidence.

How it works, step by step

  1. Initial retrieval: BM25 is run on the original query to fetch the top-K documents (K=5 in experiments). These serve as the first evidence batch for the LLM.
  2. Thinking phase: An R1-distilled model (e.g., QWEN-R1-Distill-14B) reasons over the query and retrieved documents, identifying latent concepts and alternative interpretations.
  3. Expansion phase: Based on its reasoning, the model generates an expansion segment. Two candidate expansions are sampled per round to add diversity.
  4. Redundancy filtering: Documents already seen in previous rounds are blocklisted. The next retrieval call uses the updated query but is forced to return new documents only.
  5. Query update: The new expansion is concatenated onto the growing query. To prevent the original query from being diluted, it is repeated proportionally -- the number of repetitions scales with how much expansion text has accumulated.
  6. Repeat: Steps 2-5 run for T rounds (default T=3), each time grounding the LLM in a fresh slice of the corpus.

The prompt itself is deliberately simple: the model is given the query and the retrieved passages and asked to write a correct answering passage, explicitly told not to just copy the example passages. This framing nudges the model to synthesize and reason rather than paraphrase.

Benchmarks and what they reveal

ThinkQE is evaluated on two categories of natural language web search datasets: factoid-style retrieval on TREC DL19 and DL20, widely used benchmarks based on the MS MARCO document collections; and reasoning-oriented datasets from the StackExchange domain of the BRIGHT benchmark, covering seven sub-domains including Biology, Earth Science, Economics, Psychology, Robotics, Stack Overflow, and Sustainable Living.

The BRIGHT benchmark is particularly demanding. It was designed for reasoning-intensive retrieval -- queries that require multi-step inference to match with relevant documents, not just keyword overlap. Plain BM25 scores just 17.0 nDCG@10 on average across the seven domains. GPT-4o with chain-of-thought rewriting jumps that to 33.9. ThinkQE with Phi-4-Reasoning-14B reaches 36.0, beating every zero-shot method and most trained rerankers.

On the factoid DL19/DL20 benchmarks, ThinkQE with QWEN-R1-Distill-14B hits 68.8 nDCG@10 on DL19 -- above Rank1-32B (64.9) and Rank-K-32B (66.2), both of which are R1-distilled rerankers that are more than twice the parameter count. ThinkQE requires no additional training, yet surpasses recent training-intensive reranking methods, including those based on reinforcement learning and distillation from DeepSeek-R1.

The ablations tell a clear story about what is actually driving the gains:

  • Thinking matters: Enabling the reasoning chain (vs. bypassing it with a dummy think block) lifts BRIGHT average from 29.8 to 32.5 -- a +2.7 point gain at the same model size.
  • Iterative corpus interaction matters more: Going from 1 round to 3 rounds of corpus-interaction scaling adds another +2.4 points (32.5 to 34.9), outperforming even a 32B model with thinking enabled at 1 round (32.9).
  • Both sub-components of the loop are necessary: Removing redundancy filtering drops performance to 34.2; removing expansion accumulation drops it to 33.4. The full system at 34.9 needs both.

The real breakthrough: test-time compute beats training

The deeper story here is about where to spend compute. Iteratively refining queries with evolving retrieval feedback is more effective than generating static expansions, even under the same compute budget. Doubling model size from 14B to 32B (without thinking) gains only +0.6 points on BRIGHT while more than doubling latency. Adding the thinking process to the 14B model gains +2.7 points. Running three rounds of corpus interaction gains another +2.4 points on top of that.

This is a concrete demonstration that how you use inference compute matters more than how much model you have. The 14B model with 3 rounds of ThinkQE (45 seconds per query on an H100) beats the 32B model with 1 round (30 seconds per query) by a meaningful margin.

Where it falls short

ThinkQE is not a drop-in for every retrieval scenario. A few important caveats:

  • Latency: Three rounds of retrieval plus LLM inference adds up. At ~45 seconds per query on a single H100, this is not suitable for real-time search applications.
  • Language: All experiments are on English web search. Multilingual performance is untested.
  • Domain type: ThinkQE relies on natural language expansions, which may not be well-suited for symbolic or structured domains such as code or math. The math and coding subsets of BRIGHT were excluded for this reason.
  • Corpus dependency: The iterative loop requires live BM25 access to the target corpus at query time, which rules out purely offline expansion pipelines.

Practical use-cases

ThinkQE fits best in scenarios where retrieval quality matters more than latency -- think enterprise search, research assistants, legal document discovery, or any RAG pipeline where a few extra seconds per query is acceptable. Grounding-aware interactive designs like ThinkQE run multiple retrieve-expand loops, using feedback from earlier retrieval stages to guide later expansions -- a pattern that is especially valuable when queries are ambiguous or when the corpus is large and heterogeneous.

The system pairs naturally with BM25-based first-stage retrievers, which are already standard in production search stacks. No retraining of the retriever is needed; ThinkQE operates entirely at query time. The code is publicly available and the implementation uses Pyserini for BM25 retrieval, making it straightforward to plug into existing pipelines. The framework is also model-agnostic: the paper tests it across QWEN3-8B, QWEN3-14B, OpenThinker2-7B, and Phi-4-Reasoning-14B in addition to the primary QWEN-R1-Distill-14B, all showing consistent gains over baselines.

The paper was accepted at EMNLP 2025 and represents a practical argument for treating query expansion as a reasoning problem rather than a generation problem -- one where the corpus itself is part of the reasoning loop.