# Random negatives inflate reranking metrics; only hard negatives reveal true discriminative power

Date: 2026-11-18
Category: Technology
Tags: Evaluation Sets, Reranking, Negative Sampling
Summary: Offline NDCG improved by 30% but online metrics showed no change—the problem often lies in random negatives in the evaluation set. This article explains the three sources of hard negatives, how to prevent leakage, and when random negatives are actually sufficient.

The most common disagreement in reranker model review meetings looks like this: offline NDCG@10 rises from 0.63 to 0.81, up nearly 30%, while online AB click-through rate moves only a few tenths of a percentage point, falling within noise. The modeling colleagues say traffic isn't enough and the experiment period is too short; the product colleagues start doubting the metric itself. Ask one follow-up question about how the evaluation set was constructed, and the answer is usually: one positive example per query, paired with four negatives randomly sampled from the entire corpus.

The problem lies precisely in those four negatives.

## Random negatives downgrade the task to "relevant vs. irrelevant"

With millions of items in the corpus, a randomly sampled negative has essentially zero relevance to the query. The query is "kids' hiking shoes slip-resistant," and the random negative might be "office plant" or "phone case." Feed such samples to a reranker, and the judgment it needs to make is "is this item related to the query at all," not "which of these items should rank higher."

The difficulty of these two tasks differs by an order of magnitude. The former can be handled by two-tower retrieval plus vector similarity with over 90% accuracy; the reranker shows no incremental value here. The latter is the very reason rerankers exist, because among the top 50 retrieved items, a dozen or so are often all tangentially relevant, and what the user actually wants to click may only be in the top five.

So good metrics under random negatives don't prove the reranker is useful—they only prove the model learned to distinguish "obviously irrelevant." The previous-generation system already had that capability.

The score distribution makes this clearer. Suppose two-tower similarity for positives clusters between 0.7 and 0.9, and 90% of random negatives fall below 0.3, leaving a large gap between the two piles. The reranker only needs to set a threshold in that gap and NDCG goes up. What actually determines online experience is the ranking within the narrow band between 0.72 and 0.68, and random negatives never enter that band.

If the evaluation set doesn't contain that band, the metric can't measure that band. This isn't a model problem; it's a ruler problem.

## Model differences only show up on hard negatives

A set of hypothetical numbers illustrates the sensitivity problem. Suppose two rerankers, A and B: A is the current online version, B is newly trained. On a random-negative evaluation set, A's NDCG@10 is 0.79 and B's is 0.795—half a point apart, conclusion: "no difference, don't bother." Switch to a hard-negative evaluation set: A drops to 0.61, B is 0.67—six points apart, and the conclusion flips.

The same pair of models, two sets of negatives, two opposite decisions. The difference isn't which number is more "real"—it's which number is more sensitive to model differences. The purpose of evaluation isn't to score a model; it's to choose between two candidates, so you need samples that can pull them apart.

| Evaluation set composition | A's NDCG@10 | B's NDCG@10 | Difference | Decision tendency |
| --- | --- | --- | --- | --- |
| 1 positive + 4 random negatives | 0.79 | 0.795 | 0.5 points | No visible difference |
| 1 positive + 4 retrieval hard negatives | 0.68 | 0.71 | 3 points | Lean toward B |
| 1 positive + 4 retrieval hard negatives + 2 human-labeled | 0.61 | 0.67 | 6 points | Ship B |

These numbers are assumed at common magnitudes, not raw results from a specific experiment, but the direction isn't far off: random negatives compress inter-model gaps to half a point to one point, while hard negatives amplify them to three to seven points—a factor of five to ten.

This logic explains a phenomenon: some teams report "the new model gained 0.5 points offline, decided not to ship," while others report "gained 0.5 points, shipped"—and both decisions may be correct. If the evaluation set uses random negatives, 0.5 points is roughly the ceiling it can show; if it uses hard negatives, 0.5 points roughly equals no movement. When you see a number, asking which negative set it was measured on is more useful than the number itself.

## Three sources of hard negatives, each dirty in its own way

Closest to the real distribution is online impressions without clicks. The user did see it and did not click. But it carries two biases: position bias—items ranked in the top three are far more likely to be seen than items ranked fifteenth, and the latter going unclicked may simply mean it wasn't seen; and same-screen bias—if a screen contains two nearly identical items, the user clicks only one, and the other is recorded as a negative even though both are correct.

A rough fix is to take only unclicked items from the top three as negatives—low volume but clean. A more refined approach applies a click model to correct for position, at the cost of maintaining an extra system.

The second source is unclicked items in the retrieval topK. These are the hardest, because they're the batch the system already can't separate. The problem is that when difficulty goes too far, it becomes noise: if a negative is one that even a human can't judge as irrelevant to the query, then what it teaches the model is a wrong signal. This is especially pronounced for long-tail queries—the topK may be entirely weakly relevant results, and labeling them all as negatives teaches the model that "nothing should rank high for long-tail queries."

The third source is human-constructed or generative rewrites. Controllable, able to precisely cover boundaries like "differs by one character but is a different entity"—for example, query "Xiaomi TV repair" with negative "Xiaomi TV installation." The cost is an unrealistic distribution, and rewrites easily introduce factual errors: a document that was originally correct gets a wrong number edited in, and the model learns to recognize that number, not relevance.

The diagram below is the sequence I follow when judging whether a candidate negative can enter the evaluation set.

```mermaid
flowchart TD
    A[候选负例池] --> B{用户是否看到}
    B -->|曝光且未点击| C[真实负例]
    B -->|未曝光| D[丢弃不用]
    C --> E{位置是否靠前}
    E -->|前三位| F[高置信负例]
    E -->|十位以后| G[疑似未看见]
    A --> H[召回 topK 未点击]
    H --> I{人能否判无关}
    I -->|能| J[难负例]
    I -->|不能| K[降噪后再用]
```

Mixing the three in proportion is more stable than using just one. A starting ratio I lean toward is 4:4:2—keep random negatives, but use them only for regression comparison to ensure the model hasn't degraded on new data; actual decisions look at the latter two.

## Training can mine; the evaluation set must be frozen

Difficulty mining is correct during training, and should even be aggressive—mine across batches, dynamically select by the current model's scores. But the evaluation set is a different matter. Once the evaluation set participates in mining, the model has seen the answers.

A real leakage path: to save effort, use the candidate pool sliced from online logs directly as the training negative pool, and draw the evaluation set from the same pool. Then a substantial proportion of negatives in the evaluation set may have been used as hard negatives during training. The model performs well on these samples not because it learned to judge, but because it memorized. This kind of leakage throws no errors, and the metrics look especially good—it's the hardest to detect.

The check is crude but effective: after freezing the evaluation set, run an overlap check against the training negative pool, keep the overlap rate below one percentage point, and redo the evaluation set if it exceeds that. This check should be written into the launch checklist, not left to people's memory.

One more easily overlooked point: the evaluation set's distribution should follow online traffic, but not follow the model. If the online traffic structure changes—say, from mostly mobile to mostly mini-programs—the evaluation set should be resampled; but hard cases exposed after a new model ships must not be added directly into the evaluation set, otherwise the next model is being tested on the very problems its predecessor exposed, and metrics will look better round after round while online performance doesn't move.

## Label granularity caps the evaluation set's ceiling

If labels have only two levels—"relevant / irrelevant"—then both random negatives and hard negatives get labeled 0, and the evaluation set loses internal discrimination again. You painstakingly construct hard negatives, and a single labeling pass turns them all into the same 0, and NDCG still can't show a difference.

Hard negatives therefore need graded labels, at least three tiers: completely irrelevant, partially relevant (same category but not meeting the need), fully satisfying. Four tiers would be better, but labeling cost goes up. A compromise is to grade only positives and hard negatives, and assign 0 uniformly to random negatives, so no labor is wasted.

The most easily overlooked part of the labeling spec is the definition of "partially relevant." Do same-category competitors count as partially relevant? Does information that is outdated but has the correct entity count? If these boundaries are not written clearly, different annotators will drift in the tiers they assign, and the noise in the evaluation set will be larger than the gap between models. An operational threshold is: double-label the same batch of samples, and keep the disagreement rate between two annotators on adjacent tiers within 10%; if it exceeds that, fix the spec first before scaling up.

The responsibility for this lies with product, not with the algorithm. Whoever defines "relevant" is defining the model's objective.

## When random negatives are sufficient

Don't dismiss them outright. There are several cases where random negatives do not inflate results.

The candidate pool itself is small and relevance varies widely. A vertical site search has only a few hundred SKUs, and a randomly drawn "negative" may well be partially relevant to the query; in that case "random" is already close to "hard."

In the cold-start stage, the model is not yet capable of handling hard negatives. Use random negatives first to establish a baseline, and only bring in hard negatives once training is stable. But at that point, do not report offline numbers as online gains; they are not measuring the same thing.

In multi-recall fusion scenarios. What needs to be evaluated here is "whether recall misses anything"; random negatives actually test recall quality, so Recall@K is more appropriate, and the discriminative power of reranking is not reflected at this stage.

Conversely, if the product form is "the user enters a sentence, and the system picks the top ten from hundreds of thousands," random negatives are basically worthless as a reference, because the entire value of reranking lies in the ordering of those few items at the top. The criterion is simple: are positives and negatives clearly separated in vector space? If they are separable, random negatives are enough; if not, you have to dig toward harder ones.

## Ask one question first at the next review

Now when I look at an offline metric for a reranking model, my first question is how the evaluation set was constructed, where the negatives come from, what the ratio is, and how many tiers were labeled. If the other side says "randomly sampled, one to four," I treat that number as evidence that "the model can distinguish relevant from irrelevant," not as evidence that "the model can improve online ranking."

The second action is to require a set of hard negatives to be added, even if only a few hundred queries, and first see whether the metric drops. A drop is normal; how much it drops is the information: a drop of three to five points means the model still has room on hard samples; a drop of twenty points means the earlier number was basically fake.

The least effortful and least deceptive approach is to cut a time window from online logs as a holdout and evaluate on the real exposure sequence. It does not tell you how good the model is, but it tells you whether the model gets worse on the real distribution, and that judgment is more valuable for launch decisions.
