Purdy0228 commited on
Commit
0883a43
·
verified ·
1 Parent(s): 3a38151

Add ConvMemory v3 validity context checkpoint

Browse files
MANIFEST.json ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "backbone": "/root/autodl-tmp/hf_models/nli-deberta-v3-base",
3
+ "batch_size": 1,
4
+ "dev_metrics": {
5
+ "demote_recall": 1.0,
6
+ "event_all_type_consistency": 1.0,
7
+ "fn": 0,
8
+ "fp": 0,
9
+ "old_target_all_type_consistency": 1.0,
10
+ "pair_accuracy": 1.0,
11
+ "protect_recall": 1.0,
12
+ "target_all_type_consistency": 1.0,
13
+ "tn": 1225,
14
+ "tp": 175
15
+ },
16
+ "dev_rows": 1400,
17
+ "device": "cuda",
18
+ "epochs": 1,
19
+ "export": "representative_checkpoint",
20
+ "lr": 2e-05,
21
+ "margin": 1.0,
22
+ "max_length": 192,
23
+ "module": "ConvMemory v3 Validity Context Layer",
24
+ "notes": [
25
+ "The released checkpoint implements the v511 query-conditioned validity method.",
26
+ "Multi-seed quality claims should cite the v511/v513/v514 evaluation packets, not this single checkpoint alone.",
27
+ "Default mode is context annotation; demotion is explicit opt-in for dense current-state/update workloads."
28
+ ],
29
+ "params": 184423682,
30
+ "role_weight": 1.0,
31
+ "seed": 7,
32
+ "source_config": "results/v514_v3_freeze_config/final_config.json",
33
+ "source_method_metrics": "results/v511_memora_retrieval_demotion_benchmark_5seed/REPORT.md",
34
+ "source_recipe": "experiments/v511_memora_retrieval_demotion_benchmark.py",
35
+ "threshold": 0.5,
36
+ "train_frac": 0.8,
37
+ "train_rows": 5520,
38
+ "train_seconds": 31.500682814978063,
39
+ "training_curves": [
40
+ {
41
+ "ce_loss": 0.27147598006590473,
42
+ "epoch": 1,
43
+ "role_loss": 0.17152404859223389,
44
+ "train_loss": 0.4430000293751895
45
+ }
46
+ ],
47
+ "wall_seconds": 39.408347606658936,
48
+ "hub_repo": "Purdy0228/ConvMemory-v3-Validity-Context",
49
+ "artifact_sha256": {
50
+ "cross_encoder/model.safetensors": "446ee0cf6df4a8967e1a78c46d2ff3a2d777de65efbf475d2278d99468faa8d9",
51
+ "validity_config.json": "81eddb5f2ff4545dcf4b7655fedd1f7cf846248ad8962394195e6960a2e07849"
52
+ }
53
+ }
README.md ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ConvMemory v3 Validity Context Model Card
2
+
3
+ This document separates the three source-of-truth layers for ConvMemory v3:
4
+
5
+ 1. method-level evaluation;
6
+ 2. the exported representative checkpoint;
7
+ 3. package-level API measurement with that checkpoint.
8
+
9
+ These are intentionally different provenance layers. Method-level numbers
10
+ estimate the v3 approach across seeds. The checkpoint is a representative
11
+ implementation of that approach. The package-level benchmark is the number a
12
+ user should expect when loading that checkpoint through the public API on the
13
+ fixed dense Memora retrieval benchmark.
14
+
15
+ ## Scope
16
+
17
+ ConvMemory v3 adds validity evidence to the existing v1/v2 retrieval path.
18
+ The default v3 use is `validity_mode="context"`: it attaches a structured
19
+ `validity` field to returned memories and preserves the candidate set and
20
+ ranking order.
21
+
22
+ `validity_mode="demote"` is explicit opt-in. It is intended for dense
23
+ current-state/update workloads where a top-1 source evidence policy is
24
+ available. It preserves the candidate set and may reorder by applying a validity
25
+ penalty.
26
+
27
+ ConvMemory v3 does not make full automatic dependency-graph propagation the
28
+ default retrieval path. Multi-hop graph propagation is used as an evidence-path
29
+ and analysis capability unless the caller supplies a workload where graph
30
+ construction has been validated.
31
+
32
+ ## Checkpoint
33
+
34
+ The representative v3 validity checkpoint is exported by the v557 recipe:
35
+
36
+ | Field | Value |
37
+ |---|---|
38
+ | Module | ConvMemory v3 Validity Context Layer |
39
+ | Backbone | `nli-deberta-v3-base` |
40
+ | Parameters | `184,423,682` |
41
+ | Export seed | `7` |
42
+ | Training rows | `5,520` |
43
+ | Dev rows | `1,400` |
44
+ | Threshold | `0.5` |
45
+ | Max length | `192` |
46
+ | Source policy | `top1` |
47
+ | Default mode | `context` |
48
+ | Hub repository | `Purdy0228/ConvMemory-v3-Validity-Context` |
49
+ | `cross_encoder/model.safetensors` SHA256 | `446ee0cf6df4a8967e1a78c46d2ff3a2d777de65efbf475d2278d99468faa8d9` |
50
+ | `validity_config.json` SHA256 | `81eddb5f2ff4545dcf4b7655fedd1f7cf846248ad8962394195e6960a2e07849` |
51
+
52
+ The checkpoint implements the v511 query-conditioned validity method. It
53
+ should not be used as a replacement for the v511 multi-seed method-level
54
+ estimate when reporting method quality.
55
+
56
+ ## Input Format
57
+
58
+ The validity scorer uses the v506/v511 query/source/target format:
59
+
60
+ ```text
61
+ USER_QUERY:
62
+ ...
63
+
64
+ SOURCE_EVIDENCE:
65
+ ...
66
+
67
+ TASK: Decide whether the target memory should be demoted for this user query.
68
+ ```
69
+
70
+ paired with:
71
+
72
+ ```text
73
+ TARGET_MEMORY:
74
+ ...
75
+ ```
76
+
77
+ The package exposes two scoring paths:
78
+
79
+ - `ValidityEvidenceModule.apply(...)`: annotate or demote `RerankResult`
80
+ objects while preserving the mode contracts.
81
+ - `ValidityEvidenceModule.score_evidence_pairs(...)`: batch explicit
82
+ query/source/target pairs after source evidence has already been selected.
83
+
84
+ The second path is the preferred dense-workload path because it avoids per-pair
85
+ CrossEncoder calls.
86
+
87
+ ## Method-Level Evaluation
88
+
89
+ The v511 5-seed Memora-retrieval benchmark is the method-level estimate. It
90
+ scores `69,200` source-query rows across seeds `[7, 11, 23, 31, 47]`.
91
+
92
+ Top-1 retrieved source, max aggregation:
93
+
94
+ | Metric | v511 method-level |
95
+ |---|---:|
96
+ | Pair accuracy | `98.6% +/- 0.2%` |
97
+ | Demote recall | `92.9% +/- 1.1%` |
98
+ | Protect recall | `99.4% +/- 0.1%` |
99
+ | Old-target all-type consistency | `92.8% +/- 1.1%` |
100
+ | Event all-type consistency | `89.1% +/- 1.3%` |
101
+ | Current active H@1 | `95.7% +/- 1.2%` |
102
+ | Scoring cost | `1.9291` ms/source-query pair |
103
+
104
+ This table is the right citation for method-level claims.
105
+
106
+ ## Package-Level Check
107
+
108
+ The v558 public API benchmark loads the exported v557 checkpoint through
109
+ `ValidityEvidenceModule.from_pretrained(...)` and scores the same top-1 source
110
+ policy through the package API.
111
+
112
+ Top-1 retrieved source, max aggregation:
113
+
114
+ | Metric | v558 package/API check |
115
+ |---|---:|
116
+ | Source-query rows | `6,920` |
117
+ | Target predictions | `20,760` |
118
+ | Pair accuracy | `98.7%` |
119
+ | Demote recall | `93.6%` |
120
+ | Protect recall | `99.4%` |
121
+ | Old-target all-type consistency | `93.1%` |
122
+ | Event all-type consistency | `89.6%` |
123
+ | Current active H@1 | `96.5%` |
124
+ | API scoring batch size | `512` |
125
+ | Scoring cost | `1.5844` ms/source-query pair |
126
+ | Module load time | `2.16` s |
127
+
128
+ The v558 number is the package-level reproducibility check for this checkpoint.
129
+ It is a single-checkpoint measurement, not a replacement for the v511
130
+ multi-seed method-level estimate.
131
+
132
+ ## Safety Contracts
133
+
134
+ The package-level safety checks from v558 all pass:
135
+
136
+ | Contract | Status |
137
+ |---|---:|
138
+ | `context` mode preserves order | `pass` |
139
+ | `context` mode preserves ranks | `pass` |
140
+ | `context` mode attaches validity metadata | `pass` |
141
+ | `demote` mode preserves candidate set | `pass` |
142
+ | `demote` mode preserves result count | `pass` |
143
+
144
+ The test suite also covers off-mode byte identity, context-mode rank
145
+ preservation, demote candidate-set preservation, explicit opt-in semantics,
146
+ forbidden-field rejection, safe evidence output, checkpoint round-trip, and
147
+ batched CrossEncoder scoring.
148
+
149
+ ## Operating Policy
150
+
151
+ | Workload | Recommended mode | Source policy | Ranking mutation |
152
+ |---|---|---|---|
153
+ | General ConvMemory retrieval | `context` | top-1 evidence when available | no |
154
+ | Dense current-state/update retrieval | `demote` opt-in | lexical top-1 source | yes, candidate set preserved |
155
+ | Multi-hop graph explanation | `context` | conservative graph evidence | no |
156
+
157
+ Top-3/top-5 source aggregation is not the default policy because earlier v499,
158
+ v502, and v503 runs showed that adding more sources can introduce false
159
+ positive demotions. Full top-500 graph construction is also not the default
160
+ path because learned graph errors can be amplified by propagation.
161
+
162
+ ## Source-Of-Truth Ledger
163
+
164
+ | Claim or artifact | Value or role | Source file | Provenance layer | Availability |
165
+ |---|---|---|---|---|
166
+ | v3 method-level dense benchmark | v511 5-seed top1: old-target all-type `92.8% +/- 1.1%`, current active H@1 `95.7% +/- 1.2%` | `results/v511_memora_retrieval_demotion_benchmark_5seed/REPORT.md` | method-level evaluation | author-retained results |
167
+ | v3 frozen configuration policy | default context mode; demote opt-in for dense current-state/update workloads; top1 source | `results/v514_v3_freeze_config/final_config.json` | configuration freeze | author-retained results |
168
+ | exported checkpoint manifest | seed-7 representative checkpoint; `184,423,682` params; threshold `0.5`; Hub repo `Purdy0228/ConvMemory-v3-Validity-Context` | `results/v557_v3_validity_checkpoint/seed_7/MANIFEST.json` | checkpoint export | checkpoint artifact / author-retained manifest |
169
+ | checkpoint scorer config | `mode_default="context"`, `source_policy="top1"`, `cross_encoder_num_labels=2` | `results/v557_v3_validity_checkpoint/seed_7/validity_config.json` | checkpoint export | checkpoint artifact / author-retained config |
170
+ | package API benchmark | v558 top1 package check: old-target all-type `93.1%`, current active H@1 `96.5%` | `results/v558_v3_public_api_benchmark_batch/REPORT.md` | package-level measurement | author-retained results |
171
+ | package API latency | `1.5844` ms/source-query pair, API batch size `512` | `results/v558_v3_public_api_benchmark_batch/summary.json` | package-level measurement | author-retained results |
172
+ | validity module code | `ValidityEvidenceModule`, `ValidityEvidenceConfig`, `score_evidence_pairs` | `convmemory/validity.py` | package code | public package when tagged `v0.6.0` |
173
+ | public API integration | `load_validity_module`, `validity_mode`, retrieve/rerank integration | `convmemory/api.py` | package code | public package when tagged `v0.6.0` |
174
+ | result payload | `RerankResult.validity` | `convmemory/reranker.py` | package code | public package when tagged `v0.6.0` |
175
+ | safety tests | `41 passed` after v558 batch update | `tests/test_validity_context.py` and existing package tests | machine-checkable tests | public package when tagged `v0.6.0` |
176
+ | user documentation | mode semantics, safety contracts, scorer format | `docs/VALIDITY_CONTEXT.md` | package documentation | public package when tagged `v0.6.0` |
177
+
178
+ The `results/...` packets are source-of-truth evaluation artifacts kept with
179
+ the author workspace unless explicitly packaged with a release. The package
180
+ code, tests, and documentation are the public reproducibility surface once tag
181
+ `v0.6.0` is cut.
182
+
183
+ ## Known Boundaries
184
+
185
+ - The v3 checkpoint is trained for query-conditioned validity decisions with
186
+ source evidence. It is not a generic factuality judge.
187
+ - Automatic demotion is intended for dense current-state/update workloads.
188
+ General sparse retrieval should use context annotation by default.
189
+ - Broad learned source retrieval and automatic strict dependency graph
190
+ construction are not part of the default v3 retrieval contract.
191
+ - The v511 method-level estimate and v558 package-level benchmark use different
192
+ but connected provenance layers; report them with their layer names.
cross_encoder/config.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "DebertaV2ForSequenceClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": null,
7
+ "dtype": "float32",
8
+ "eos_token_id": null,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "initializer_range": 0.02,
13
+ "intermediate_size": 3072,
14
+ "layer_norm_eps": 1e-07,
15
+ "legacy": true,
16
+ "max_position_embeddings": 512,
17
+ "max_relative_positions": -1,
18
+ "model_type": "deberta-v2",
19
+ "norm_rel_ebd": "layer_norm",
20
+ "num_attention_heads": 12,
21
+ "num_hidden_layers": 12,
22
+ "pad_token_id": 0,
23
+ "pooler_dropout": 0,
24
+ "pooler_hidden_act": "gelu",
25
+ "pooler_hidden_size": 768,
26
+ "pos_att_type": [
27
+ "p2c",
28
+ "c2p"
29
+ ],
30
+ "position_biased_input": false,
31
+ "position_buckets": 256,
32
+ "relative_attention": true,
33
+ "share_att_key": true,
34
+ "tie_word_embeddings": true,
35
+ "transformers_version": "5.8.0",
36
+ "type_vocab_size": 0,
37
+ "vocab_size": 128100
38
+ }
cross_encoder/model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:446ee0cf6df4a8967e1a78c46d2ff3a2d777de65efbf475d2278d99468faa8d9
3
+ size 737719272
cross_encoder/tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
cross_encoder/tokenizer_config.json ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_prefix_space": true,
3
+ "backend": "tokenizers",
4
+ "bos_token": "[CLS]",
5
+ "clean_up_tokenization_spaces": false,
6
+ "cls_token": "[CLS]",
7
+ "do_lower_case": false,
8
+ "eos_token": "[SEP]",
9
+ "is_local": true,
10
+ "local_files_only": false,
11
+ "mask_token": "[MASK]",
12
+ "model_max_length": 512,
13
+ "pad_token": "[PAD]",
14
+ "sep_token": "[SEP]",
15
+ "sp_model_kwargs": {},
16
+ "split_by_punct": false,
17
+ "tokenizer_class": "DebertaV2Tokenizer",
18
+ "unk_id": 3,
19
+ "unk_token": "[UNK]",
20
+ "vocab_type": "spm"
21
+ }
run.log ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [transformers] You passed `num_labels=2` which is incompatible to the `id2label` map of length `3`.
2
+
3
+ [transformers] DebertaV2ForSequenceClassification LOAD REPORT from: /root/autodl-tmp/hf_models/nli-deberta-v3-base
4
+ Key | Status |
5
+ ------------------+----------+---------------------------------------------------------------------------------------
6
+ classifier.weight | MISMATCH | Reinit due to size mismatch - ckpt: torch.Size([3, 768]) vs model:torch.Size([2, 768])
7
+ classifier.bias | MISMATCH | Reinit due to size mismatch - ckpt: torch.Size([3]) vs model:torch.Size([2])
8
+
9
+ Notes:
10
+ - MISMATCH: ckpt weights were loaded, but they did not match the original empty weight shapes.
11
+
12
+ {
13
+ "backbone": "/root/autodl-tmp/hf_models/nli-deberta-v3-base",
14
+ "batch_size": 1,
15
+ "dev_metrics": {
16
+ "demote_recall": 1.0,
17
+ "event_all_type_consistency": 1.0,
18
+ "fn": 0,
19
+ "fp": 0,
20
+ "old_target_all_type_consistency": 1.0,
21
+ "pair_accuracy": 1.0,
22
+ "protect_recall": 1.0,
23
+ "target_all_type_consistency": 1.0,
24
+ "tn": 1225,
25
+ "tp": 175
26
+ },
27
+ "dev_rows": 1400,
28
+ "device": "cuda",
29
+ "epochs": 1,
30
+ "export": "representative_checkpoint",
31
+ "lr": 2e-05,
32
+ "margin": 1.0,
33
+ "max_length": 192,
34
+ "module": "ConvMemory v3 Validity Context Layer",
35
+ "notes": [
36
+ "The released checkpoint implements the v511 query-conditioned validity method.",
37
+ "Multi-seed quality claims should cite the v511/v513/v514 evaluation packets, not this single checkpoint alone.",
38
+ "Default mode is context annotation; demotion is explicit opt-in for dense current-state/update workloads."
39
+ ],
40
+ "params": 184423682,
41
+ "role_weight": 1.0,
42
+ "seed": 7,
43
+ "source_config": "results/v514_v3_freeze_config/final_config.json",
44
+ "source_method_metrics": "results/v511_memora_retrieval_demotion_benchmark_5seed/REPORT.md",
45
+ "source_recipe": "experiments/v511_memora_retrieval_demotion_benchmark.py",
46
+ "threshold": 0.5,
47
+ "train_frac": 0.8,
48
+ "train_rows": 5520,
49
+ "train_seconds": 31.500682814978063,
50
+ "training_curves": [
51
+ {
52
+ "ce_loss": 0.27147598006590473,
53
+ "epoch": 1,
54
+ "role_loss": 0.17152404859223389,
55
+ "train_loss": 0.4430000293751895
56
+ }
57
+ ],
58
+ "wall_seconds": 39.408347606658936
59
+ }
validity_config.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "context_threshold": 0.05,
4
+ "cross_encoder_model": null,
5
+ "cross_encoder_num_labels": 2,
6
+ "demote_score_scale": 1.0,
7
+ "demote_threshold": 0.5,
8
+ "max_length": 192,
9
+ "max_sources_per_candidate": 1,
10
+ "mode_default": "context",
11
+ "source_policy": "top1"
12
+ },
13
+ "format": "convmemory_validity_evidence",
14
+ "version": 1
15
+ }