Query-aware index pruning for retrieval under budget constraints
2026
Production search indices operate under strict storage and latency budgets that prevent indexing the full corpus (e.g.: web documents). When only a fraction of documents can be retained, the system must decide which ones to keep. Existing pruning methods make this decision using query-agnostic signals, including lexical quality, embedding magnitude, and corpus centrality or single-feature query-aware heuristics (e.g., query similarity, nearest-neighbour coverage), without optimising which documents actually contribute to answering the queries the system will serve. We recast index pruning as query-aware subset selection: given a fixed budget and an expected query workload, the goal is to retain the document subset that maximises retrieval performance for the queries the system will serve. We introduce Query-aware Document Selection (QDS), a lightweight framework that scores documents using 13 retrieval-structural features derived from query-document interactions and index redundancy, capturing how many queries a document serves, whether viable alternatives exist, and how replaceable the document is within the retained set. A linear scorer trained with Evolution Strategies optimises nDCG@10 of the pruned index end-to-end, requiring no differentiable surrogate while remaining fully interpretable. Across 10 IR benchmarks (1K-120M documents), four dense encoders plus BM25, and three modalities (text, image, audio), QDS consistently outperforms query-agnostic and single-feature query-aware baselines under aggressive pruning budgets. We show that coverage-oriented heuristics degrade at web scale by over-selecting high-frequency hard negatives, i.e., documents that are nearest neighbours to many queries but relevant to none. Given its simplicity, QDS can operate on existing indexes of 100M-1B documents in minutes with limited hardware.
Research areas