File size: 3,138 Bytes
908f811 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | # 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:
```text
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:
```json
{
"entity": true/false,
"property": true/false,
"qualifier": true/false/null,
"value": true/false/null
}
```
Order shorthand:
```text
entity / property / qualifier / value
```
Examples:
```text
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:
```text
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:
```text
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:
```text
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:
```text
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:
```text
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:
```text
00n0
00n1
0010
0011
```
Use only as filler if there are not enough Tier A/B/C negatives.
## 5. Dataloader rule
For each row:
```text
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:
```text
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.
|