How Many Are Left? Seed-Robust Class Prior Estimation for Deciding When Set Expansion Should Stop

Many retrieval and extraction tasks start from a handful of examples and ask a system to find everything else like them. A curator gives twenty PubMed abstracts on a topic, or three brand names, and the system ranks millions of candidates. Ranking is the part that is well studied. The part that decides whether the output is usable is the stopping point: how far down the ranked list to go. Choosing it requires knowing how many relevant items exist in the pool, a quantity called the class prior (the fraction of the unlabeled pool that truly belongs to the target class). Methods for estimating this fraction exist, but they assume the labeled examples are a fair random sample of the class. A seed set picked by a person almost never is. It clusters around whatever the person thought of first, and the prior estimate inherits that bias.

We propose to estimate the class prior and the ranker's recall together from a tiny, possibly biased seed set, and to report an honest interval rather than a point estimate. Both bounds come from the same source: how the ranker's held-out seeds behave when we deliberately hide whole regions of the seed set from it. The output is a label-free estimate of precision, recall, and F1 at every cutoff, plus a stopping rule chosen from that estimate. The question is whether seed-set sensitivity, usually treated as a nuisance in bootstrapping, can be measured and turned into a correction for the prior.

Core Claim

Fix a ranker trained on seeds. Let it assign a score $s(x)$ to each item, and let $U$ be the candidate pool of size $|U|$. Assume the seeds are representative of the positives in score space; this is the "selected completely at random" assumption. Then the recall at threshold $\tau$, written $R(\tau)$, can be read off as the fraction of held-out seeds scoring above $\tau$. The F1 of keeping everything above $\tau$ is then

$$\mathrm{F1}(\tau) = \frac{2\,\pi |U|\, R(\tau)}{n_U(\tau) + \pi |U|},$$

where $\pi$ is the class prior and $n_U(\tau)$ is the number of pool items above $\tau$. Everything here is observable except $\pi$ and the validity of $R(\tau)$. The seed set controls both. When seeds cover only part of the class, held-out seeds from the same region score higher than the positives the ranker has never seen. Recall is then overestimated. Prior estimators that compare the seed distribution with the pool, such as AlphaMax-style mixture fitting, also measure only the prevalence of the seed-like part of the class.

Our claim is that a cluster-wise cross-fitting procedure brackets both quantities. We split the seeds into groups by embedding similarity. One version of the ranker is trained with random held-out seeds; the other is trained with an entire group held out ("leave-one-cluster-out"). The first version gives an optimistic recall curve. The second gives a pessimistic one that simulates meeting an uncovered part of the class. Running a one-dimensional prior estimator on the scores of each version gives a matching pair of prior estimates. The gap between the two versions is a direct, label-free measure of seed-set sensitivity. We hypothesize that the true F1-optimal cutoff falls inside the resulting interval. We also hypothesize that a cutoff chosen from the interval beats both fixed-size retrieval and the fixed-prior heuristic, with the largest gains when seeds are biased.

Relation to Prior Work

The proposal grows directly out of Scalable Evaluation and Improvement of Document Set Expansion via Neural Positive-Unlabeled Learning. That paper casts PubMed document set expansion from 5 to 50 seeds as positive-unlabeled learning, which means learning from confirmed positives plus an unlabeled pool. It sidesteps the prior by fixing $\pi = 0.5$, which turns the loss into a balanced-error objective, and it names better prior estimation as an open problem. Their fixed prior is a sound choice for training a ranker. It says nothing about how many documents to return, and that is the gap we target.

Several prior estimators supply our building blocks:

All four assume a reasonably large, representative positive sample. With three to ten seeds this assumption fails. That is why we move estimation into the one-dimensional score space, where the samples are dense enough to work with.

Three papers relax the random-sampling assumption, and they are our closest competitors:

  • Class Prior Estimation with Biased Positives and Unlabeled Examples clusters the biased positives with k-means, solves a separate estimation problem per cluster, and combines the results. It assumes the clusters have disjoint support and that clustering the positives recovers the true sub-components. Neither assumption holds for a handful of seeds in overlapping text embeddings. We use seed clusters for a different purpose: to simulate missing coverage, not to assume coverage is complete within each cluster.
  • Class Prior Estimation in Active Positive and Unlabeled Learning corrects bias when the selection policy is known, through propensity scores. A user's seed choice has no known propensity, so that correction is unavailable to us.
  • Rethinking Class-Prior Estimation for Positive-Unlabeled Learning handles positives that lie entirely inside the negative region ("reducibility"). It moves the top 10% of confident pool items into the positive set. We reuse this regrouping step in score space.

Two papers constrain our design. Understanding seed selection in bootstrapping and UltraWiki: Ultra-Fine-Grained Entity Set Expansion with Negative Seed Entities show that the most confident candidates in classes that are not well separated are often near-misses. That warns us that the regrouping step's auxiliary positives may be contaminated, so we treat the regrouping fraction as a quantity to stress-test rather than a constant.

Finally, there is the drift-control literature. Learning to Bootstrap for Entity Set Expansion uses Monte Carlo tree search, a lookahead that simulates several future expansion steps, to avoid drifting into the wrong category. Global Bootstrapping Neural Network for Entity Set Expansion uses a graph encoder with a gated decoder for the same purpose. Both control what gets added but never estimate how much of the target class exists. A volume estimate is complementary to them and much cheaper.

Research Program

The pipeline has three stages, and each is a separate object of study.

Stage 1: cross-fitting. Given seeds $P$ and pool $U$, we embed the seeds and group them by agglomerative clustering. For random-fold cross-fitting, we train the ranker on the remaining seeds and score both the held-out seeds and $U$. For leave-one-cluster-out cross-fitting, we hold out each cluster in turn and do the same. For the ranker we use the BM25 plus non-negative PU pipeline of Jacovi et al. on documents and an embedding-based PU classifier on entities.

Stage 2: score-space estimation. From each fold type we form the empirical score distribution of held-out seeds and of $U$. We estimate $\pi$ by one-dimensional mixture fitting, taking the largest proportion of the seed-score density that the pool-score density can contain. We run this with and without score-space regrouping. The random folds give $(\hat\pi_{\mathrm{in}}, \hat R_{\mathrm{in}})$ and the cluster folds give $(\hat\pi_{\mathrm{out}}, \hat R_{\mathrm{out}})$. Plugging each pair into the F1 expression yields two estimated F1 curves.

Stage 3: the cutoff rule. Seed sensitivity is summarized as the gap between the two curves. The stopping rule picks the threshold that maximizes the average of the two curves, and it reports the gap alongside the choice.

The analysis questions are:

  • Do the two estimates actually bracket the truth, and how often?
  • How does the gap scale with seed count and with how concentrated the seeds are?
  • Does the gap shrink when explicit negative seeds are added, in the sense of UltraWiki, which would constrain the negative score distribution?

For iterative bootstrapping, the same machinery gives a per-round check. The number of items accepted so far should not exceed $\hat\pi_{\mathrm{out}}|U|$ by more than the interval allows, which provides a cheap stopping signal against drift.

Baselines

The naive reference is to return a fixed number of top-ranked candidates, using the same ranker. We sweep the number returned and report its value at the cutoff that is best on average across topics, tuned on a separate set of development topics. This is what practitioners do, and any useful method must beat it on F1 at the chosen cutoff.

The strongest existing system for document expansion is BM25 plus non-negative PU with the fixed prior of 0.5, from Scalable Evaluation and Improvement of Document Set Expansion via Neural Positive-Unlabeled Learning. We run it with the same candidate pools, seed draws, and training budget as our method. Its stopping point is defined two ways: the classifier's natural decision threshold, and a threshold tuned on development topics. That paper prints no per-topic F1 numbers in text; the file states that exact values appear only in a figure, so we will reproduce them. To beat it, our method must achieve higher mean F1 at the selected cutoff on held-out topics, with no topic-level tuning.

For prior estimation itself, the strongest competitor is Corrected AlphaMax from Class Prior Estimation with Biased Positives and Unlabeled Examples. Averaged over 12 biased UCI benchmarks, it reports mean absolute prior error of 0.1579, against 0.2277 uncorrected and 0.0900 with oracle cluster assignments. We rerun it on the same UCI protocol to check our replication against these numbers. We also run it on text embeddings with matched seed counts. Our bar is a lower error than 0.1579 on that protocol when seeds are restricted to 10 or fewer. On text, the bar is lower error at every seed count we test. We also include regrouping plus AlphaMax from Rethinking Class-Prior Estimation for Positive-Unlabeled Learning, which the file reports as the best average performer across its 9 datasets. Its per-dataset numbers are not printed in the file.

Three ablations isolate the key ingredient:

  • Random folds only. This drops the leave-one-cluster-out half, keeping the optimistic estimate and no interval.
  • Prior estimated in embedding space. This uses the full-dimensional estimators directly instead of moving to score space.
  • Elkan–Noto-style ratio. Prior is estimated as the pool's mean score divided by the held-out seeds' mean score.

If the first ablation matches the full method on biased seeds, the cluster-wise idea is not earning its place.

Why not just…?

Why not just keep the fixed prior of 0.5 and stop at the classifier's threshold? The fixed prior works for training a ranker in needle-in-a-haystack settings, and Jacovi et al. show this. But a fixed prior encodes no information about how many positives exist, so the implied cutoff cannot adapt across topics whose prevalence differs by orders of magnitude. Prior misestimation does hurt downstream classifiers. Positive Unlabeled Learning with Class-prior Approximation reports F-score of 96.38% for prior-aware CAPU against 91.93% for the next method on the audit dataset. Class Prior Estimation in Active Positive and Unlabeled Learning finds classifiers using inaccurate prior estimates fall well short of those using the true prior. Our direct test is the per-topic F1 regret against the oracle cutoff.

Why not just stop when held-out seeds reach a target recall, say 90%? This is a real threat. It needs no prior and is very simple. It has two weaknesses. First, it cannot trade recall against precision, which is what F1 requires. Second, under biased seeds the held-out recall is exactly the optimistic quantity we expect to be inflated. We include it as a baseline at several recall targets. If it matches our F1 when seeds are drawn at random, we will say so. The decisive comparison is on deliberately biased seed sets, where its realized recall should fall well below its target.

Why not just use the Elkan–Noto ratio of mean scores? It is a one-line estimator and runs as an ablation. It assumes calibrated scores and representative seeds. Under overlapping classes, penalized-divergence work on Class-prior estimation for learning from positive and unlabeled data shows that this kind of matching overestimates the prior. If this ablation is within noise of our method, the contribution reduces to the interval alone, and we will report it that way.

Why not just apply Corrected AlphaMax to the seeds? It is designed for biased positives. Its k-means step, however, needs enough positives to find sub-components, and the file notes its disjoint-support assumption is unlikely to hold in text embeddings. The seed-count sweep below tests exactly where it degrades.

Proposed Experiments

On the UCI biased benchmarks from Jain et al., we reproduce their bias protocol. We then subsample positives to 5, 10, 20, and 50 and report mean absolute prior error and how often the interval covers the true prior. This setting gives ground-truth priors and a published reference number.

On PubMed document set expansion, we follow Jacovi et al.'s topics and BM25 candidate pools. We use random seed draws and two biased draws: their short-abstract bias and a single-subtopic bias formed by clustering a topic's true positives and seeding from one cluster. We report prior error, F1 at the chosen cutoff, regret against the oracle cutoff, and variance across seed draws.

On UltraWiki and OntoNotes, we use 3 to 5 seeds and report the same quantities. On UltraWiki we additionally test whether supplying its negative seeds narrows the interval. For reference, Global Bootstrapping Neural Network for Entity Set Expansion reports a mean average precision of 0.611 on OntoNotes. For UltraWiki itself, the file has no class-level number: no reported result found on Lacuna for UltraWiki F1 or MAP values. We add the volume-cap stopping signal to plain bootstrapping on OntoNotes and ask whether it recovers part of the gap to the lookahead search of Learning to Bootstrap for Entity Set Expansion at a small fraction of the compute.

Three checks are decisive:

  • Coverage. The interval should contain the true prior in most biased-seed runs. If it does not, the bracketing hypothesis is wrong.
  • Biased-seed F1. On biased seeds, the cluster-wise method should beat the random-folds-only ablation and the recall-target rule in F1 at the chosen cutoff. If it does not, seed-sensitivity measurement adds nothing beyond ordinary cross-validation.
  • Gap as a signal. Across topics, the width of the gap should correlate with the realized error. That would make it usable as a warning to the curator that their seeds miss part of the class.