Training Sparse Retrievers to Fit a Hard Term Budget

Learned sparse retrievers describe every document as a weighted list of vocabulary words, many of them "expansion" words that never appear in the text, and search those lists with the same inverted index a classical search engine uses. In principle such a list is an explanation you can read: the relevance score is exactly the sum of products of matching word weights. In practice the lists run to hundreds of mostly tiny weights, so they are neither readable nor fast. Practitioners cut them down after training, keeping each document's top 32 or 64 words, and lose accuracy, because the model was never trained to work with short lists. We propose to train the model under the cut it will actually face. The forward pass keeps only the top $k$ words per document. The backward pass uses a straight-through estimator, a trick that pretends a non-differentiable step was the identity when computing gradients. Words outside the budget therefore still receive gradient and can compete their way back in.

The goal is a retriever whose every document representation is a short, exactly faithful term list. Its accuracy as a function of $k$ should be better than any after-the-fact pruning of a strong model. The question we care about is whether the straight-through gradient to the excluded words, the "support exploration" mechanism shown to escape greedy local minima in classical sparse recovery, is what closes the gap, or whether simpler fine-tuning under a fixed mask does just as well.

Core Claim

Three lines of prior work set up this proposal. The first motivates it. Post-hoc pruning of sparse neural retrievers trades accuracy for speed: document-centric top-$k$ pruning gives a 2x speedup at up to 2% loss and a 4x speedup at up to 8% loss (A Static Pruning Study on Sparse Neural Retrievers). That study names pruning-aware training as open. Two-Step SPLADE gets 30x mean speedups, but only through a heuristic pruned first pass plus a second full index. Both act after training, which is the step we move inside training.

The second line supplies the mechanism. Straight-Through Meets Sparse Recovery: the Support Exploration Algorithm keeps a dense latent vector, applies hard top-$k$ selection in the forward pass, and sends gradients back through the selection as if it were the identity. With highly correlated dictionary columns (coherence 0.97 in spike deconvolution), this beats greedy and iterative-thresholding methods. It does so with a fixed, known linear dictionary and no notion of retrieval or readability. We carry that mechanism into a learned text encoder.

The third line frames the trade-off we evaluate. Interpret and Control Dense Retrieval with Sparse Latent Features fits a top-$k$ sparse autoencoder on frozen dense embeddings. Its raw sparse features reach 0.3306 MRR on MS MARCO against 0.3605 for the dense model. This is a post-hoc interpretability layer that costs accuracy and gives no inverted-index search. Our representation is the retrieval index itself, and its dimensions are vocabulary words rather than latents that need a separate labeling procedure.

Concretely, let $w \in \mathbb{R}^{V}$ be a document's pre-cut term weights over a vocabulary of size $V$, computed as in SPLADE with log-saturated ReLU over the language-model head. Let $m = \mathrm{top}_k(w)$ be the 0/1 mask of its $k$ largest entries. The indexed document vector is $d = m \odot w$, and the score for a query vector $q$ is $q^\top d$. The straight-through backward pass replaces the masked Jacobian with the identity:

$$\frac{\partial L}{\partial w} \;\approx\; \frac{\partial L}{\partial d} \quad \text{instead of} \quad \frac{\partial L}{\partial w} = m \odot \frac{\partial L}{\partial d}.$$

Here $L$ is the ranking loss. The difference is concrete. For a word $j$ outside the budget, $\partial L / \partial d_j$ is generally nonzero whenever the query puts weight on $j$, roughly $q_j$ times the loss's sensitivity to the document's score. A word that would have helped a relevant document match is therefore pushed upward even while it is excluded. Plain masked training never sees that signal.

Research Program

We will start from a public SPLADE-v3 checkpoint (SPLADE-v3). Every method gets the same fine-tuning budget on MS MARCO training data with the same distillation teacher and negatives, at document budgets $k \in \{16, 32, 64, 128\}$. Queries keep their usual regularization so that the document budget is the only variable.

Three engineering questions need answers. The first is stability. Identity straight-through can inflate many excluded weights at once, the gradient-mismatch failure described in Understanding Straight-Through Estimator in Training Activation Quantized Neural Nets. We will therefore scale the gradient to excluded entries by a factor $\beta$, annealed from 1 toward 0 over training, and keep a mild FLOPS penalty (Minimizing FLOPs to Learn Efficient Sparse Representations) on the pre-cut weights. Setting $\beta = 0$ recovers masked training exactly, so $\beta$ doubles as the ablation knob.

The second question is whether a fixed per-document $k$ or a learned per-word threshold is the better budget. For the threshold variant we will use the JumpReLU activation with kernel pseudo-derivatives from Jumping Ahead, which optimizes an exact count of active units without $\ell_1$ shrinkage. It is a secondary arm, compared at a matched average number of active words.

The third question is whether exploration actually happens. We will log support churn: the fraction of each document's final top-$k$ words that were outside its top-$k$ at initialization.

Interpretability gets the same care as accuracy. Because the score is an exact sum over at most $k$ visible words, faithfulness holds by construction. The open question is whether the words are sensible. We will draw 300 MS MARCO passages and have annotators judge, blind to method, whether each word in a $k = 32$ list is relevant to the passage. Alongside that we report two automatic proxies: the share of the list that consists of expansion words, and the share of the list taken up by subword fragments and stopwords. The accuracy-interpretability curve is then MRR@10 against $k$, with list quality reported at each point.

Baselines

The naive reference point is BM25. SPLADE reports MRR@10 of 0.184 for it on MS MARCO dev, which tells us how much of the learned-sparse advantage survives at small $k$. The uncut upper reference is SPLADE-v3 itself, reported at MRR@10 40.2 on MS MARCO (SPLADE-v3). We will re-measure it in our own setup.

The strongest existing method at a matched budget is SPLADE-v3 with document-centric static top-$k$ pruning at index time (A Static Pruning Study on Sparse Neural Retrievers). It is the competitor because it delivers exactly our output format, $k$ words per document, with no training at all. That paper reports aggregate trade-offs of up to 2% loss at 2x speedup and up to 8% at 4x. For SPLADE-v3 pruned to 32 terms specifically, no reported result was found on Lacuna, so we will measure it. Beating it means a higher MS MARCO dev MRR@10 and BEIR nDCG@10 at each $k$, with the gap growing as $k$ shrinks. We would count recovering at least half the distance between pruned and uncut SPLADE-v3 at $k = 32$ as a clear win.

Two trained baselines get the same number of fine-tuning steps and the same learning-rate search, eight configurations each, as our method. The first is prune-then-fine-tune: the top-$k$ mask is computed once from the initial model and frozen while the model fine-tunes. The second is masked dynamic top-$k$, which recomputes the mask every step but passes gradient only to kept words, i.e. our method with $\beta = 0$. This second baseline is the ablation that isolates the key ingredient.

We will also run SPLADE-v3 fine-tuned with a stronger FLOPS penalty, sweeping the penalty until the average number of active words matches $k$. This baseline is evaluated both as trained and with a final top-$k$ cut. Finally, we report the post-hoc sparse autoencoder of Interpret and Control Dense Retrieval at its published $k = 128$ (raw sparse MRR 0.3306) as the reference point for post-hoc interpretable sparsity.

Why not just…?

Why not just prune SPLADE-v3 after training? This is the default, and its cost is documented: the model weights were fit assuming all expansion words are present, and A Static Pruning Study on Sparse Neural Retrievers reports losses up to 8% at aggressive cuts. The static-pruning baseline above measures this directly at each $k$ on the same checkpoint. If its curve matches ours, the proposal fails, and we will say so.

Why not just fine-tune with the mask frozen or recomputed, without straight-through gradients? This is the real threat. Much of any gain may come simply from letting the model readjust kept weights once it knows the rest are gone, with no exploration needed. The $\beta = 0$ and frozen-mask baselines settle the question. The support-recovery result in Straight-Through Meets Sparse Recovery predicts straight-through helps most when candidate columns are highly correlated. The text analogue is a document with many near-synonym or subword candidates competing for few slots. We will stratify documents by the mean cosine similarity among their top-$2k$ candidate words' output embeddings and test whether the straight-through advantage concentrates in the high-similarity stratum. If masked training matches ours everywhere and churn is near zero, we drop the exploration claim and report pruning-aware fine-tuning as the finding.

Why not just turn up the FLOPS or $\ell_1$ penalty? Continuous penalties give sparsity on average, not a per-document cap. Jumping Ahead shows that $\ell_1$-style penalties shrink the weights of genuinely active features, and Two-Step SPLADE needs a BM25-style re-saturation to make continuously regularized weights suit dynamic pruning. The penalty sweep matched on average active words tests this. It also reveals whether the penalty leaves a long tail of documents far over budget, which hurts both readability and worst-case posting-list size.

Why not just explain a dense retriever post hoc with a sparse autoencoder? That route keeps the dense model's accuracy but splits representation from explanation and gives up inverted-index search. Its reported raw sparse features lose about 8% MRR on MS MARCO (Interpret and Control Dense Retrieval). Its latents also need a separate labeling procedure to be read, whereas our dimensions are words. The comparison on MRR at $k = 128$ and on annotated list quality shows which gives more accuracy per readable unit.

Decisive Experiments

All methods are evaluated on MS MARCO dev (MRR@10, Recall@1000), on TREC DL 2019 and 2020 (nDCG@10), and zero-shot on BEIR (nDCG@10) and LoTTe. Efficiency is measured as posting-list sizes and query latency in a standard inverted index with dynamic pruning, plus the block-skipping index of Bruch et al..

The proposal stands or falls on three results. First, the straight-through model must dominate static pruning across $k$ on MS MARCO and BEIR. Second, it must beat the $\beta = 0$ masked ablation by more than seed variance; we run three seeds per configuration. That advantage should come with measurable support churn and be concentrated in high-similarity documents. Third, the $k = 32$ lists must score at least as well on blind annotator relevance as statically pruned SPLADE-v3 lists, so the accuracy gain is not bought with stranger words.

There is also an informative failure mode. If accuracy improves but annotators find more fragments and odd expansions, the experiment will have shown that pruning-aware training trades readability for retrieval accuracy at a fixed budget.