Not All Queries Need Rewriting: When Prompt-Only LLM Refinement Helps and Hurts Dense Retrieval
Organizations: Adobe
Abstract
Prompt-only, single-step LLM query rewriting, where a rewrite is generated from the query alone without retrieval feedback, is commonly used in production RAG pipelines, but its effect on dense retrieval is poorly understood. We present a systematic empirical study across three BEIR benchmarks, two dense retrievers, and multiple training configurations, and find strongly domain-dependent behavior: rewriting degrades nDCG@10 by 9.0 percent on FiQA, improves it by 5.1 percent on TREC-COVID, and has no significant effect on SciFact. We identify a consistent mechanism: degradations co-occur with reduced lexical alignment between rewritten queries and relevant documents, as rewriting replaces domain-specific terms in already well-matched queries. In contrast, improvements arise when rewriting shifts queries toward corpus-preferred terminology and resolves inconsistent nomenclature. Lexical substitution occurs in 95 percent of rewrites across all outcome groups, showing that effectiveness depends on the direction of substitution rather than substitution itself. We also study selective rewriting and find that simple feature-based gating can reduce worst-case regressions but does not reliably outperform never rewriting, with even oracle selection offering only modest gains. Overall, these results show that prompt-only rewriting can be harmful in well-optimized verticals and suggest that domain-adaptive post-training is a safer strategy when supervision or implicit feedback is available.
Figures & tables
| Model | Config | FiQA | SciFact | TREC-COVID |
|---|---|---|---|---|
| MPNet | Base | 0.500 | 0.656 | 0.513 |
| +FiQA PT | 0.507 ( 1.4%) | 0.658 ( 0.4%) | 0.509 ( 0.9%) | |
| BGE | Base | 0.391 | 0.738 | 0.672 |
| +FiQA PT | 0.408 ( 4.3%) | 0.742 ( 0.5%) | 0.722 ( 7.5%) |
| Model | Config | FiQA | SciFact | TREC-COVID |
|---|---|---|---|---|
| MPNet | Base | 0.500 | 0.656 | 0.513 |
| +Rewrite | 0.448 ( 10.3%) | 0.655 ( 0.1%) | 0.559 ( 8.9%) | |
| BGE | Base | 0.391 | 0.738 | 0.672 |
| +Rewrite | 0.357 ( 8.7%) | 0.753 ( 2.1%) | 0.683 ( 1.7%) | |
| MPNet-FiQA | Post-trained | 0.507 | 0.658 | 0.509 |
| +Rewrite | 0.452 ( 10.9%) | 0.659 ( 0.1%) | 0.563 ( 10.6%) |
| Dataset | VOR (orig) | VOR (rewrite) | VOR | -value | |
|---|---|---|---|---|---|
| FiQA | 648 | 0.564 | 0.550 | 0.014 | 0.013 |
| SciFact | 300 | 0.521 | 0.535 | 0.015 | 0.060 |
| TREC-COVID | 50 | 0.978 | 0.975 | 0.002 | 0.688 |
| Dataset | Outcome | Median CTF | % CTF 1 | |
|---|---|---|---|---|
| FiQA | Degraded | 216 | 1.01 | 50.9% |
| Improved | 117 | 1.68 | 59.8% | |
| Unchanged | 287 | 1.53 | 57.8% | |
| SciFact | Degraded | 36 | 0.74 | 44.4% |
| Improved | 40 | 1.45 | 55.0% | |
| Unchanged | 216 | 1.11 | 53.7% |
| Dataset | Harm Rate | AUC | CV ( ) | Threshold |
|---|---|---|---|---|
| FiQA (train) | 35.3% | 0.593 | 0.307 | |
| SciFact (test) | 13.3% | 0.547 | — | — |
| TREC-COVID (test) | 32.0% | 0.612 | — | — |
| Policy | FiQA | SciFact | TREC-COVID | Avg |
|---|---|---|---|---|
| Never rewrite | 0.500 | 0.656 | 0.513 | 0.556 |
| Always rewrite | 0.448 ∗∗∗ | 0.655 | 0.559 | 0.554 |
| Dataset-level (rewrite only TREC-COVID) | 0.500 | 0.656 | 0.559 | 0.572 |
| Gated (ours) | 0.499 | 0.653 | 0.537 | 0.563 |
| Simple VOR | 0.478 | 0.661 | 0.562 | 0.567 |
| Oracle (upper) | 0.530 | 0.689 | 0.594 | 0.604 |
| Prompt Style | Harm Rate (%) | Mean VOR | Monitoring AUC |
|---|---|---|---|
| Minimal | 23.6 | 0.663 | |
| Aggressive | 42.4 | 0.586 | |
| Baseline (original) | 35.3 | 0.593 |
| Rewrite source | FiQA nDCG@10 | |
|---|---|---|
| No rewrite | 0.500 | – |
| Ministral (temp=0.7) | 0.448 | |
| Ministral (temp=0.0) | 0.460 | |
| GPT-4o-mini | 0.461 |
Appendix figures & tables3 assets
Supplementary material from the paper’s appendix.
Appendix
| Configuration | FiQA | SciFact | TREC-COVID |
|---|---|---|---|
| MPNet Base | 0.500 | 0.656 | 0.513 |
| MPNet Base + Rewrite | 0.448 | 0.655 | 0.559 |
| MPNet-FiQA | 0.507 | 0.658 | 0.509 |
| MPNet-FiQA + Rewrite | 0.452 | 0.659 | 0.563 |
| BGE Base | 0.391 | 0.738 | 0.672 |
| BGE Base + Rewrite | 0.357 | 0.753 | 0.683 |
| Dataset | QSS MPNet | PT MPNet | QSS BGE | PT BGE |
|---|---|---|---|---|
| FiQA | 0.714 | 0.007 | 0.285 | 0.017 |
| SciFact | 0.999 | 0.003 | 0.480 | 0.004 |
| TREC-COVID | 0.958 | 0.004 | 0.489 | 0.051 |
Query Reformulation
Query reformulation transforms user questions into retrieval-ready queries to improve search, evidence coverage, and downstream answers.
See all 42 papersDo not copy and paste! Rewriting strategies for code retrieval
Answer Presence Drives RAG Rewriting Gains
answer-in-compile strata, and prepending the gold into rewrites that lacked it raises F1 by to points in of (cell, baseline) combinations. A companion five-sentinel audit shows the conventional single-[MASK] probe is itself sentinel-fragile: on 2Wiki it reports a ~F1 ``non-leakage residual'' that flips to to ~F1 under four alternative sentinels and fails an equivalence test for three of those four (~pass). We do not propose a new rewriter or mitigation; we release the intervention runner and the sentinel panel so that other rewriter-gain claims can be tested against the same standard.