Dense retrieval improves with constraint-aware hard negative mining

CA-HNM: Constraint-Aware Hard Negative Mining for Dense Retrieval with Structured Domain Models

Information RetrievalArtificial Intelligence

Summary

Finding relevant information can be tricky when some options look close but don't actually fit the specific rules of a topic. The authors developed a way to teach computers to avoid confusing choices by using both example searches and clear rules about what doesn’t fit. Their method helps the computer learn better by focusing on mistakes that break domain rules, rather than just picking hard examples randomly. This approach was tested on education-related data and showed it can improve how well the computer retrieves useful information.

What this means in practice

  • For education technology developers: Improve course and skill discovery systems by integrating constraint-aware candidate filtering in search algorithms to better respect educational domain rules.
  • For enterprise search engineers: Enhance search relevance in knowledge management by combining domain structure constraints with hard negative mining during retriever training.

Authors

Ngoc Luyen Le, Marie-Hélène Abel, Bertrand Laforge

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.