Manuscript Offprint

arXiv:2610.35045

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

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

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Ngoc Luyên Lê 1,2^{1,2}[0000-0002-2043-0679], Marie-Hélène

Abel 2^{2}[0000-0003-1812-6763], and Bertrand Laforge 3^{3}[0000-0002-4209-4194]

1^{1} Gamaizer, 93340 Le Raincy, France

2^{2} Université de technologie de Compiègne, CNRS, Heudiasyc (Heuristics and Diagnosis of Complex Systems), CS 60319, 60203 Compiègne Cedex, France {ngoc-luyen.le,marie-helene.abel}@hds.utc.fr

3^{3} Sorbonne Université, CNRS UMR 7585, LPNHE (Laboratoire de Physique Nucléaire et des Hautes Énergies), 75252 Paris Cedex 05, France

laforge@lpnhe.in2p3.fr

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.

Keywords: Dense retrieval · Hard-negative mining · Structured domain models · Educational retrieval · Contrastive learning

1 Introduction

Dense retrieval models are typically trained by contrasting a relevant document with one or more documents treated as negatives. The choice of negatives has a direct effect on the training signal: random negatives are often too easy, whereas lexical or dense retrieval can provide candidates that are close to the query and therefore more informative [9, 27, 16, 29]. Existing hard-negative strategies consequently define hardness mainly through lexical score, embedding similarity, or retrieval rank. These signals are useful for locating difficult candidates, but they do not determine whether an unjudged candidate is a valid negative. Incomplete relevance judgments can leave missing positives or ambiguous cases among highly ranked documents [2].

Structured domains provide another source of information. Concepts may be linked through prerequisite, hierarchical, related-concept, scope, or level relations. A document can therefore be retrieval-hard while still conflicting with the target represented by the query. For example, a resource about advanced SQL optimization may be close to a query for “beginner SQL joins” even though its target concept and level differ. Such structure can be used during training-data construction without changing the retriever architecture.

We introduce CA-HNM, a constraint-aware hard-negative mining framework. Starting from lexical and dense retrieval results, CA-HNM removes known positives, constructs a local typed context for the query target, evaluates the remaining candidates with deterministic compatibility rules, and records the rule evidence associated with each selected negative. The structured model is used only during offline negative construction; training and inference use a standard dual encoder.

To evaluate the proposed selection mechanism, the empirical study addresses three research questions: RQ1 - How does constraint-aware negative selection compare with retrieval-rank-matched selection? RQ2 - What is the contribution of constraint-aware negatives within a mixed negative pool? RQ3 - How do changes in the structured information available to the classifier affect negative selection and retrieval performance? The evaluation covers MOOCCubeX and Course-Skill Atlas, BGE and E5 encoders [26, 25], triplet loss and cached multiple-negatives ranking loss (cached MNRL) [5], and ten training seeds.

The contributions are threefold. First, we formulate hard-negative mining by separating retrieval hardness, positive annotation, and operational incompatibility under a structured domain model. Second, we define a mining pipeline that associates selected negatives with explicit relation, scope, target, or level evidence while leaving the inference-time retriever unchanged. Third, we provide a multi-seed evaluation aligned with these research questions through rank-matched, matched-mixed, and structural controls across multiple encoders, losses, and datasets.

The remainder of the paper is organized as follows. Section 2 reviews hard-negative mining, generated supervision, and structured knowledge in retrieval. Section 3 defines the problem, and Section 4 presents CA-HNM. Section 5 describes the experimental protocol. Section 6 reports the results, followed by the discussion in Section 7 and the conclusion in Section 8.

References (29)