# Match-vector based hard negative policy
This file defines how fact-retrieval training should consume the enriched InfoSeek fact maps.
1. Source fields
For each InfoSeek numeric/time-style training row:
positive = selected_positive_fact_ids
negative metadata = hard_negative_meta_v2[fact_id]
Do not rely on the old negative type label alone. The type label is useful as provenance/debug metadata, but the training sampler should use match_vector.
2. Match vector
Each hard negative fact has:
{
"entity": true/false,
"property": true/false,
"qualifier": true/false/null,
"value": true/false/null
}
Order shorthand:
entity / property / qualifier / value
Examples:
11n0 = same entity, same property, no qualifier constraint, wrong value
1110 = same entity, same property, same qualifier, wrong value
10n1 = same entity, different property, same value
01n0 = different entity, same property, wrong value
null means the dimension is not applicable or cannot be judged. It is not the same as false.
3. Positive-like negatives
The following vectors must not be used as negatives:
1111
11n1
These mean entity/property/value all match the selected positive, so they are likely duplicate positives or unresolved aliases.
Current sanity after vector recomputation:
val: missing_vector = 0, positive_like_negative = 0
train: missing_vector = 0, positive_like_negative = 0
4. Training negative priority
Recommended sampling priority:
Tier A: strongest hard negatives
Same entity and same property, but wrong value or wrong qualifier:
1110
11n0
1100
1101
These directly teach the fact retriever not to select a fact just because the entity and relation are right.
Tier B: same entity, different property
Same subject entity, but the requested property is different:
10n1
10n0
10nn
1001
1010
1011
These are useful because the visual entity is correct, but the retrieved fact answers the wrong question.
Tier C: same property, different entity
Same or similar property, but from another subject:
01n0
0100
0110
01n1
0101
0111
These teach the model not to retrieve a globally plausible property fact from the wrong entity.
Tier D: mixed/easy negatives
Everything else:
00n0
00n1
0010
0011
Use only as filler if there are not enough Tier A/B/C negatives.
5. Dataloader rule
For each row:
positive_ids = selected_positive_fact_ids
negative_ids =
sample Tier A first
then Tier B
then Tier C
then Tier D if needed
The sampler should keep the vector metadata, because later codebook analysis will compute:
same_code_prefix_len(positive_fact, negative_fact)
This will be added after fact embeddings/codebooks are built.
6. Important caveat
The existing type labels may still contain noisy names such as same_entity_property_matched_wrong_value even when the final match_vector.property is false.
That is expected after the correction. Training must follow match_vector, not the legacy label.