NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Synthetic Query Generation as Kernel Quadrature

Teaching a small retriever a new domain usually means asking a large language model to write a few synthetic search queries for nearly every document in the corpus, then filtering out the bad ones. Promptagator does this with FLAN 137B over whole BEIR corpora, and UDAPDR generates up to a million queries. Most of these calls are wasted, because corpora are full of near-duplicate documents. We propose to treat the student's training loss over the corpus as an average, which is the same thing as an integral, and to choose the documents worth sending to the language model the way numerical integration chooses its evaluation points. Concretely, we run randomly pivoted Cholesky over document embeddings. This is a matrix factorization that picks one document at a time, with probability proportional to how poorly the documents chosen so far explain it. It returns three things: a small set of pivot documents, a weight for each pivot that says how much of the corpus it stands for, and a running residual that measures how much of the corpus is still unexplained.

The language model writes queries only for the pivots. The student trains on those queries with each example's loss scaled by its pivot's weight, and generation stops once the residual falls below a tolerance. In two sentences: choose documents with a kernel quadrature rule instead of uniformly, and reweight their synthetic queries so the student still sees the corpus distribution rather than a distribution skewed toward outliers. The same residual then tells you when to stop paying for generation.

Core Claim

At a fixed budget of language-model calls, a student trained on quadrature-selected, quadrature-weighted synthetic queries should match or beat a student trained on queries for uniformly sampled documents. It should also reach most of the full-generation quality with a small fraction of the calls. The residual trace should track the student's remaining quality gap closely enough to serve as a stopping rule with no labels.

The weights are what separate this from a plain diversity heuristic. Picking the most spread-out documents covers the corpus but over-represents rare regions. The quadrature weights correct for that skew. The residual comes with an error interpretation that a fixed quota lacks.

To make this precise, let $d_1,\dots,d_n$ be the corpus documents and $\ell_\theta(d)$ the student's expected loss on queries generated for document $d$ under parameters $\theta$. The full-generation objective and its quadrature approximation are

$$\frac{1}{n}\sum_{i=1}^{n}\ell_\theta(d_i)\;\approx\;\sum_{j=1}^{m} w_j\,\ell_\theta(d_{s_j}),$$

where $s_1,\dots,s_m$ index the $m$ pivot documents and $w_j$ are their weights. If $\ell_\theta$ is smooth in the document embedding, the approximation error is bounded by the size of $\ell_\theta$ in the kernel's function space times the discrepancy between the weighted pivots and the uniform corpus. In the analysis behind Kernel Quadrature with Randomly Pivoted Cholesky, that discrepancy is controlled by the trace of the Cholesky residual. This is why the residual is a sensible stopping quantity. The smoothness assumption is exactly what the experiments must test.

Relation to Prior Work

The method comes from the kernel literature. Kernel Quadrature with Randomly Pivoted Cholesky selects integration nodes by sampling from the residual diagonal and computing weights. On QM9 it cut error threefold relative to independent sampling, and it ran 17× to 170× faster than volume sampling and kernel thinning. That paper only integrates fixed functions. We apply it in a different setting: the "function" is a student loss that changes during training, and each evaluation costs a language-model call.

Greedy pivoted incomplete Cholesky, as used by Bach et al. and Ren et al., supplies the deterministic variant we ablate against. Adaptive Cholesky Gaussian Processes halts a Cholesky factorization early by bounding and extrapolating the log-marginal likelihood. We borrow its idea of watching a residual trend to stop. That paper also constrains us in two ways. Its bounds hold only in expectation, and it reports that bookkeeping-heavy variants can lose to hardware-optimized exact Cholesky at moderate scale. We therefore claim an empirical stopping rule, not a guarantee, and we time our selection step honestly.

The synthetic-data side motivates the problem. Promptagator generates queries across entire corpora and filters them by round-trip consistency, a filter it found too strict on small corpora such as NFCorpus. UDAPDR drops filtering and absorbs noise by generating far more. DISCO reports that 75,000 filtered examples beat over a million noisier ones, and Beyond Quantity shows that volume scaling of agent trajectories saturates early while diversity-steered selection does better. These results suggest that which examples are generated matters more than how many. None of these pipelines chooses where to generate before calling the model, and none weights the resulting examples.

The closest kernel-plus-synthesis work is kernel dataset distillation. Provable and Efficient Dataset Distillation for Kernel Ridge Regression computes synthetic points in closed form, and RFAD replaces the exact kernel with random features. Both optimize synthetic inputs for a kernel student and never involve a generative model's call budget. We keep the student a neural retriever and use the kernel only to decide where to spend generation.

Research Program

The pipeline has four parts.

First, embed every corpus document with the student's initial encoder. This costs one forward pass per document, which is negligible next to generation.

Second, run blocked randomly pivoted Cholesky with a Gaussian or cosine kernel on these embeddings. Blocking keeps the computation in matrix-matrix operations and addresses the hardware caveat from Adaptive Cholesky. At each step, record the residual trace divided by $n$.

Third, compute the pivot weights by solving the small $m\times m$ kernel system against the corpus mean embedding. Optimal weights can be negative, so we compare raw weights, nonnegative least-squares weights, and clipped weights.

Fourth, send pivots to the language model in rounds. After each round, train the student with weighted loss and check the stopping rule. The rule stops when the residual falls below $\eta$, or when its decay per added pivot flattens below a slope threshold, in the spirit of the Adaptive Cholesky extrapolation.

Two analyses accompany the build. The first measures how well the residual trace predicts the student's remaining gap to full generation across corpora. This tests whether the stopping rule is calibrated. The second tests whether the smoothness assumption holds. We do this by checking whether a per-document student loss, measured on a held-out generated set, can be predicted from neighbors in embedding space.

Baselines

The naive reference is uniform document sampling at the same number of language-model calls. We use the same generator, the same prompt containing the 8 Promptagator-style examples, the same round-trip filter, and the same student training recipe. This is the "do nothing clever" point, and every curve is reported against it.

The strongest existing method is the full Promptagator pipeline, which generates for every document. The reported result is an average of 47.8 nDCG@10 for few-shot Promptagator (45.5 zero-shot) and 52.8 nDCG@10 for Promptagator++ with a reranker across its BEIR datasets (Promptagator). We cannot run FLAN 137B, so we reproduce the pipeline with an open generator. The meaningful comparison is to our own full-corpus reproduction, with the published numbers as context.

Beating it means reaching at least 95% of our full-generation nDCG@10 with at most 20% of the calls on most datasets. It also means exceeding uniform sampling at every budget below full generation. For domain adaptation we also run UDAPDR's setting on LoTTE, where it reports Lifestyle Success@5 rising from 64.5 to 74.8 (UDAPDR). There, success means matching its gain with an order of magnitude fewer generated queries. BM25 stays in every table as the zero-synthesis floor, since BEIR shows it is often hard to beat out of domain.

The diversity competitor is k-means on the same embeddings. We take the document nearest each centroid and give it a weight equal to its cluster's share of the corpus. We tune the number of clusters on the same development split and with the same budget we use to tune $\eta$. A second diversity competitor is unweighted farthest-point selection.

Three ablations isolate the ingredients. Pivoted Cholesky pivots with uniform weights tests the weights. Greedy pivoted Cholesky versus the randomized version tests the randomization. A fixed quota versus the residual stopping rule tests the stopping rule. All methods share the generator, prompt, filter, student, seed set, and the student training steps per example. Wall-clock time for selection is reported separately from generation time.

Why not just…?

Why not just sample documents at random with the same budget? Random sampling is unbiased, so it needs no weights. It does, however, waste calls on dense, redundant regions and leaves sparse topics with few or no samples. The QM9 result in Kernel Quadrature with Randomly Pivoted Cholesky shows a threefold error reduction over independent sampling at equal node count, but that was for a fixed integrand. Whether the gap survives a learned student loss is precisely what the budget curves measure. If uniform sampling ties at every budget, the idea fails.

Why not just cluster the corpus and generate for one representative per cluster, weighted by cluster size? This is the real threat. Weighted k-means is itself a crude quadrature rule and could match our method. Our expected advantages are narrow. Randomized pivoting grows one pivot at a time without refitting, so the budget can be extended mid-run, and its residual gives a stopping signal that k-means distortion does not directly provide. If weighted k-means matches us on quality, we will say so. The contribution then reduces to the residual-based stopping rule, which we would test on k-means as well by using its distortion as the stopping signal.

Why not just over-generate cheaply and filter afterwards? Filtering addresses quality, not redundancy, and it still pays for every generation. Promptagator found its filter too aggressive on NFCorpus, and UDAPDR abandoned filtering because it was unstable. Our method keeps the same filter for both arms, so the two are complementary. The experiment of interest is whether selection plus filtering beats filtering alone at equal generation cost.

Why not just set a fixed quota, as every existing pipeline does? A fixed quota works if you already know the right number. DISCO's 75,000 and TrueTeacher's 1.4 million suggest nobody does. We compare the stopping rule against the best fixed quota chosen in hindsight. The rule is useful only if it lands near that hindsight optimum without labels.

Proposed Experiments

The main study uses the BEIR datasets in Promptagator's evaluation, with NFCorpus, SciFact, ArguAna, and FiQA as small-to-medium corpora and HotpotQA and Climate-FEVER as large ones. The student is a 110M dual encoder, and the generator is an open instruction-tuned model. For every method we plot nDCG@10 against the number of generation calls, at 1%, 2%, 5%, 10%, 20%, 50%, and 100% of the corpus. We report the area under that curve and the number of calls needed to reach 95% of full-generation quality. We repeat the protocol on LoTTE's five domains, using Success@5 and the UDAPDR setup.

The decisive checks are three. The first is whether weighted pivots beat both uniform sampling and the uniform-weight ablation at low budgets. If the weights do not matter, the quadrature framing is wrong. The second is whether, across all datasets, the residual trace at stopping correlates with the remaining nDCG@10 gap well enough that the stopping rule lands within a few points of the hindsight-best quota. The third is whether the method beats weighted k-means anywhere. If it never does, we will report the result as a negative finding about kernel selection and a positive finding about weighting and stopping.

We also report selection wall-clock time against generation time, to confirm the selection step is negligible. As a stress test, we use a corpus with heavy near-duplication, built by mixing paraphrased copies into SciFact. Here the method should show its largest savings, and uniform sampling should show its largest waste.