CA-HNM: Constraint-Aware Hard Negative Mining for Dense Retrieval with Structured Domain Models
Organizations: Gamaizer, 93340 Le Raincy, France · Université de technologie de Compiègne, CNRS, Heudiasyc (Heuristics and Diagnosis of Complex Systems), CS 60319, 60203 Compiègne Cedex, France · Sorbonne Université, CNRS UMR 7585, LPNHE (Laboratoire de Physique Nucléaire et des Hautes Énergies), 75252 Paris Cedex 05, France
Abstract
Dense retrievers are commonly trained with hard negatives selected from lexical or dense retrieval results. Retrieval proximity, however, does not indicate whether a candidate conflicts with explicit domain structure. We introduce CA-HNM, a constraint-aware hard-negative mining framework that combines retrieval-based candidate generation with deterministic incompatibility rules derived from a structured domain model. The framework removes known positives, constructs a local typed context around the query target, records relational, scope, target, and level mismatches, and uses the resulting candidates to fine-tune a standard dual encoder. Structured information is required only during offline negative construction. We evaluate CA-HNM on MOOCCubeX and Course-Skill Atlas with two encoders, two training losses, and ten seeds. Relative to a retrieval-rank-matched control, CA-HNM-Pure has higher mean NDCG@10 in six of eight dataset--encoder--loss configurations. Four hierarchical 95% bootstrap intervals are entirely above zero, mostly under triplet loss. In a separate experiment, CA-HNM-Mixed shows slightly higher mean NDCG@10 than a matched-mixed control on both collections. Structural variants show that changes in available structure can also change candidate eligibility and negative-pool composition. The results indicate that the contribution of constraint-aware selection depends on the training objective and the composition of the negative pool.
Figures & tables
| Classification | Detection condition |
|---|---|
| Target match | Target evidence occurs and no incompatibility is detected |
| Relational mismatch | A sibling, prerequisite, or postrequisite concept occurs without sufficient target evidence |
| Scope or level mismatch | A broader or narrower concept, or an incompatible level, occurs without sufficient target evidence |
| Target-context mismatch | A candidate associated with a related context lacks sufficient evidence for the target concept under the implemented matching rules |
| Ambiguous | Target evidence and incompatibility evidence occur together |
| No constraint evidence | Neither sufficient target evidence nor an explicit structured incompatibility is detected |
| Collection | Documents | Queries | Qrels | Relations |
|---|---|---|---|---|
| MOOCCubeX | 3,781 | 3,500/500/1,000 | 10,241/1,453/3,025 | requires |
| Course-Skill Atlas | 281,153 | 227/32/65 | 22,700/3,200/6,500 | is_a , related |
| Encoder | Loss | Strategy | NDCG@10 | MRR@10 | MAP@100 | R@100 |
|---|---|---|---|---|---|---|
| Course-Skill Atlas | ||||||
| BGE | Cached MNRL | DPR-Random | 0.0608 | 0.0853 | 0.0177 | 0.0775 |
| DenseNeg | 0.0901 | 0.1911 | 0.0153 | 0.0696 | ||
| Rank-matched | 0.0379 | 0.0598 | 0.0074 | 0.0425 | ||
| CA-HNM -Pure | 0.0311 | 0.0581 | 0.0066 | 0.0384 | ||
| Triplet | DPR-Random | 0.2283 | 0.3203 | 0.0713 | 0.1550 | |
| Course-Skill Atlas | MOOCCubeX | |||||||
|---|---|---|---|---|---|---|---|---|
| Strategy | NDCG | MRR | MAP | R@100 | NDCG | MRR | MAP | R@100 |
| DPR-Random | 0.0608 | 0.0853 | 0.0177 | 0.0775 | 0.3280 | 0.3031 | 0.2980 | 0.8808 |
| DenseNeg | 0.0901 | 0.1911 | 0.0153 | 0.0696 | 0.3020 | 0.2869 | 0.2700 | 0.7164 |
| CA-HNM -Mixed | 0.1120 | 0.1597 | 0.0238 | 0.0818 | 0.3031 | 0.2848 | 0.2747 | 0.8090 |
| Matched-mixed | 0.1082 | 0.1633 | 0.0214 | 0.0777 | 0.2955 | 0.2759 | 0.2676 | 0.8041 |
| Course-Skill Atlas | MOOCCubeX | |||||||
|---|---|---|---|---|---|---|---|---|
| Strategy | NDCG | MRR | MAP | R@100 | NDCG | MRR | MAP | R@100 |
| CA-HNM -Pure | 0.0311 | 0.0581 | 0.0066 | 0.0384 | 0.1724 | 0.1596 | 0.1530 | 0.5657 |
| Label-only | 0.0263 | 0.0417 | 0.0067 | 0.0389 | 0.1733 | 0.1581 | 0.1528 | 0.5617 |
| Shuffled graph | 0.1174 | 0.1895 | 0.0220 | 0.0745 | 0.1744 | 0.1614 | 0.1540 | 0.5666 |
| No structure | 0.0950 | 0.1669 | 0.0166 | 0.0693 | 0.1835 | 0.1690 | 0.1629 | 0.5768 |
Hard Negative Mining
Hard negative mining selects plausible, confusable non-matches to train models to distinguish fine-grained similarities.
See all 34 papers