Why hard-negative mining can increase hidden-positive contamination

Last updated: September 10, 2026

In a knowledge graph, an unobserved link is not necessarily false. Some links used as training negatives are hidden positives: true relationships that have not yet been recorded. Type filtering can concentrate these links among the plausible candidates used for hard-negative sampling.

Explore hidden positives in negative sampling

Each dot is a candidate link, not a graph node. In this constructed example, all hidden positives belong to the type-compatible hard pool.

10–500 candidate links
1–100 links; a subset of Ng
0–50 links; all inside Nh
1–50 links per batch

Reducing a pool also reduces any dependent values that exceed its size.

Hidden positive (dark center) True negative Blue ring: member of the hard pool

A · Random sampling

↓ Uniform sampling from the full pool

B · Hard-negative mining

↓ Uniform sampling from the type-filtered pool

What the comparison means

Because the hard pool contains all hidden positives, the probability that a uniformly sampled link is a hidden positive is Pu / Ng for random sampling and Pu / Nh for hard sampling. Multiplying these probabilities by k gives the expected hidden-positive counts per batch.

With Ng = 100, Pu = 10, Nh = 50, and k = 10, expected contamination increases from 10% to 20%, and the expected counts increase from 1 to 2. For Pu > 0, the enrichment ratio is Ng / Nh. If Nh equals Ng, the two methods have the same expected contamination. If Pu is zero, both rates are zero and their ratio is undefined.

Illustrative mode deliberately selects a batch with the expected number of hidden positives, rounded to the nearest integer when needed. It is a teaching example. Random mode independently samples each pool without replacement; a single batch can differ from its expectation or even reverse the ordering. Resampling keeps the constructed pools fixed.

This example demonstrates what happens when type filtering enriches hidden positives. It does not imply that every hard-negative mining method does so. Here, “false-negative contamination” means the fraction of sampled negatives that are actually positive, rather than the classifier metric FN / (TP + FN).

Written on September 10, 2026