Datasets:
Tasks:
Text Classification
Formats:
parquet
Sub-tasks:
semantic-similarity-classification
Languages:
code
Size:
1M - 10M
License:
sync EmbedEd artifacts (phase01-v5)
Browse files- artifacts/hardness_diagnostics.json +91 -0
- report/measurements.md +40 -8
- sync_manifest.json +4 -2
artifacts/hardness_diagnostics.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"n_anchors": 1600,
|
| 3 |
+
"k": 20,
|
| 4 |
+
"corpus_size": 6451,
|
| 5 |
+
"scale": {
|
| 6 |
+
"random_pair_cos": 0.9603,
|
| 7 |
+
"anchor_positive_cos_mean": 0.96512,
|
| 8 |
+
"anchor_positive_cos_sd": 0.02333
|
| 9 |
+
},
|
| 10 |
+
"conditions": {
|
| 11 |
+
"C1": {
|
| 12 |
+
"mean_cos": 0.96056,
|
| 13 |
+
"sd": 0.02585,
|
| 14 |
+
"gap_vs_C1": 0.0,
|
| 15 |
+
"d_vs_C1": 0.0,
|
| 16 |
+
"position_in_C1_C3_range": 0.0,
|
| 17 |
+
"percentile_mean": 50.02,
|
| 18 |
+
"percentile_median": 50.12,
|
| 19 |
+
"closer_than_positive_frac": 0.3957,
|
| 20 |
+
"n": 32000,
|
| 21 |
+
"in_anchor_top20_frac": 0.0029,
|
| 22 |
+
"in_anchor_top100_frac": 0.0147
|
| 23 |
+
},
|
| 24 |
+
"C2": {
|
| 25 |
+
"mean_cos": 0.97552,
|
| 26 |
+
"sd": 0.02126,
|
| 27 |
+
"gap_vs_C1": 0.01496,
|
| 28 |
+
"d_vs_C1": 0.632,
|
| 29 |
+
"position_in_C1_C3_range": 0.539,
|
| 30 |
+
"percentile_mean": 79.61,
|
| 31 |
+
"percentile_median": 91.92,
|
| 32 |
+
"closer_than_positive_frac": 0.715,
|
| 33 |
+
"n": 32000,
|
| 34 |
+
"in_anchor_top20_frac": 0.1537,
|
| 35 |
+
"in_anchor_top100_frac": 0.2825
|
| 36 |
+
},
|
| 37 |
+
"C3": {
|
| 38 |
+
"mean_cos": 0.98834,
|
| 39 |
+
"sd": 0.00774,
|
| 40 |
+
"gap_vs_C1": 0.02778,
|
| 41 |
+
"d_vs_C1": 1.456,
|
| 42 |
+
"position_in_C1_C3_range": 1.0,
|
| 43 |
+
"percentile_mean": 99.81,
|
| 44 |
+
"percentile_median": 99.83,
|
| 45 |
+
"closer_than_positive_frac": 0.9922,
|
| 46 |
+
"n": 32000,
|
| 47 |
+
"in_anchor_top20_frac": 0.9481,
|
| 48 |
+
"in_anchor_top100_frac": 0.9998
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
"negative_set_overlap_frac": {
|
| 52 |
+
"C1&C2": 0.0034,
|
| 53 |
+
"C1&C3": 0.0032,
|
| 54 |
+
"C2&C3": 0.1578
|
| 55 |
+
},
|
| 56 |
+
"label_noise": {
|
| 57 |
+
"C1": {
|
| 58 |
+
"n": 32000,
|
| 59 |
+
"train_labelled_clone_frac": 0.0,
|
| 60 |
+
"valid_labelled_clone_frac": 0.0002,
|
| 61 |
+
"jaccard_mean": 0.2253,
|
| 62 |
+
"jaccard_median": 0.2121,
|
| 63 |
+
"near_dup_frac_ge_0.5": 0.0093,
|
| 64 |
+
"near_dup_frac_ge_0.75": 0.0003
|
| 65 |
+
},
|
| 66 |
+
"C2": {
|
| 67 |
+
"n": 32000,
|
| 68 |
+
"train_labelled_clone_frac": 0.0,
|
| 69 |
+
"valid_labelled_clone_frac": 0.0004,
|
| 70 |
+
"jaccard_mean": 0.4166,
|
| 71 |
+
"jaccard_median": 0.3731,
|
| 72 |
+
"near_dup_frac_ge_0.5": 0.2799,
|
| 73 |
+
"near_dup_frac_ge_0.75": 0.0664
|
| 74 |
+
},
|
| 75 |
+
"C3": {
|
| 76 |
+
"n": 32000,
|
| 77 |
+
"train_labelled_clone_frac": 0.0,
|
| 78 |
+
"valid_labelled_clone_frac": 0.0005,
|
| 79 |
+
"jaccard_mean": 0.4306,
|
| 80 |
+
"jaccard_median": 0.3974,
|
| 81 |
+
"near_dup_frac_ge_0.5": 0.3138,
|
| 82 |
+
"near_dup_frac_ge_0.75": 0.0688
|
| 83 |
+
},
|
| 84 |
+
"positives": {
|
| 85 |
+
"jaccard_mean": 0.3024,
|
| 86 |
+
"jaccard_median": 0.2838,
|
| 87 |
+
"near_dup_frac_ge_0.5": 0.0512,
|
| 88 |
+
"near_dup_frac_ge_0.75": 0.0019
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
}
|
report/measurements.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
|
| 3 |
## Phase 0 — measured numbers
|
| 4 |
|
| 5 |
-
generated by `python -m embeded.data.prepare_data` — version `phase01-
|
| 6 |
|
| 7 |
| quantity | spec value | measured | ok |
|
| 8 |
|---|---|---|---|
|
|
@@ -16,20 +16,21 @@ generated by `python -m embeded.data.prepare_data` — version `phase01-v2`
|
|
| 16 |
|
| 17 |
**Token lengths** (microsoft/graphcodebert-base): p50=474 p90=1535 p95=2233 p99=5944 max=36823 → **max_len = 512**.
|
| 18 |
|
|
|
|
| 19 |
## Phase 0.5 — throughput (measured, fixes BATCH / TRAIN_PAIRS_CAP / EPOCHS)
|
| 20 |
|
| 21 |
-
generated by `python -m scripts.phase0_throughput --candidates 512:4 512:8 512:16 512:32 --minutes 0.5` — version `phase01-v5`, recipe `AMP_DTYPE=float16`, `GRAD_CHECKPOINT=False`
|
| 22 |
|
| 23 |
| max_len:batch (triples) | triples/s | peak GB | cap for one 40-min epoch |
|
| 24 |
|---|---|---|---|
|
| 25 |
-
| 512:4 | 11.
|
| 26 |
-
| 512:8 | 13.
|
| 27 |
-
| 512:16 |
|
| 28 |
| 512:32 | OOM on Tesla T4 | — | — |
|
| 29 |
|
| 30 |
-
Suggested: **BATCH = 8, TRAIN_PAIRS_CAP =
|
|
|
|
| 31 |
|
| 32 |
-
Frozen in `settings.py` as `TRAIN_PAIRS_CAP = 32_000` (= 1,600 anchors × k=20 = 4,000 steps of 8; measured cap rounded down). Context: the same test in plain fp32 with the original candidates OOMed on its first candidate (256:32 = 96 sequences/step, 14.3 GB), which is why the training recipe is fp16 AMP.
|
| 33 |
|
| 34 |
## s′ acquisition (Phase 0.7)
|
| 35 |
|
|
@@ -331,8 +332,8 @@ Frozen in `settings.py` as `TRAIN_PAIRS_CAP = 32_000` (= 1,600 anchors × k=20 =
|
|
| 331 |
"label"
|
| 332 |
],
|
| 333 |
"label_counts": {
|
| 334 |
-
"4": 20000,
|
| 335 |
"5": 20000,
|
|
|
|
| 336 |
"0": 20000,
|
| 337 |
"3": 18317,
|
| 338 |
"1": 15555,
|
|
@@ -468,3 +469,34 @@ Frozen in `settings.py` as `TRAIN_PAIRS_CAP = 32_000` (= 1,600 anchors × k=20 =
|
|
| 468 |
- **verdict: FAIL** — C1→C2 gap +0.0146 < margin 0.02 (mining produced equally easy negatives)
|
| 469 |
|
| 470 |
Context recorded at the time: ordering C1 < C2 ≤ C3 holds; the C1→C2 gap is ≈70 standard errors (n = 20,000) and d ≈ 0.6, but the full C1→C3 range of this untuned, anisotropic space is only 0.028, so the absolute 0.02 margin (set in `settings.py` before the spread was known) asks C2 to cover ~75% of it. Per SCOPE P6-3 training is blocked; next step is `python -m scripts.hardness_diagnostics` (percentile-rank view), then either a mining fix or an explicit, documented re-operationalisation of "visible gap" — decided before any training, with this run kept here either way.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
## Phase 0 — measured numbers
|
| 4 |
|
| 5 |
+
generated by `python -m embeded.data.prepare_data` — version `phase01-v5`
|
| 6 |
|
| 7 |
| quantity | spec value | measured | ok |
|
| 8 |
|---|---|---|---|
|
|
|
|
| 16 |
|
| 17 |
**Token lengths** (microsoft/graphcodebert-base): p50=474 p90=1535 p95=2233 p99=5944 max=36823 → **max_len = 512**.
|
| 18 |
|
| 19 |
+
|
| 20 |
## Phase 0.5 — throughput (measured, fixes BATCH / TRAIN_PAIRS_CAP / EPOCHS)
|
| 21 |
|
| 22 |
+
generated by `python -m scripts.phase0_throughput --candidates 512:4 512:8 512:16 512:32 --minutes 0.5` — version `phase01-v5`, recipe `AMP_DTYPE=float16`, `GRAD_CHECKPOINT=False`
|
| 23 |
|
| 24 |
| max_len:batch (triples) | triples/s | peak GB | cap for one 40-min epoch |
|
| 25 |
|---|---|---|---|
|
| 26 |
+
| 512:4 | 11.7 | 4.37 | 28,048 |
|
| 27 |
+
| 512:8 | 13.0 | 6.71 | 31,268 |
|
| 28 |
+
| 512:16 | 12.9 | 11.39 | 30,937 |
|
| 29 |
| 512:32 | OOM on Tesla T4 | — | — |
|
| 30 |
|
| 31 |
+
Suggested: **BATCH = 8, TRAIN_PAIRS_CAP = 31,268, EPOCHS = 1** (rule: fastest-within-10% with the lowest peak memory; 13.0 vs top 13.0 triples/s). `settings.py` at run time: BATCH = 8, TRAIN_PAIRS_CAP = 32,000, EPOCHS = 1.
|
| 32 |
+
|
| 33 |
|
|
|
|
| 34 |
|
| 35 |
## s′ acquisition (Phase 0.7)
|
| 36 |
|
|
|
|
| 332 |
"label"
|
| 333 |
],
|
| 334 |
"label_counts": {
|
|
|
|
| 335 |
"5": 20000,
|
| 336 |
+
"4": 20000,
|
| 337 |
"0": 20000,
|
| 338 |
"3": 18317,
|
| 339 |
"1": 15555,
|
|
|
|
| 469 |
- **verdict: FAIL** — C1→C2 gap +0.0146 < margin 0.02 (mining produced equally easy negatives)
|
| 470 |
|
| 471 |
Context recorded at the time: ordering C1 < C2 ≤ C3 holds; the C1→C2 gap is ≈70 standard errors (n = 20,000) and d ≈ 0.6, but the full C1→C3 range of this untuned, anisotropic space is only 0.028, so the absolute 0.02 margin (set in `settings.py` before the spread was known) asks C2 to cover ~75% of it. Per SCOPE P6-3 training is blocked; next step is `python -m scripts.hardness_diagnostics` (percentile-rank view), then either a mining fix or an explicit, documented re-operationalisation of "visible gap" — decided before any training, with this run kept here either way.
|
| 472 |
+
|
| 473 |
+
### run 2026-09-27 06:55 UTC — version `phase01-v5`, margin 0.02
|
| 474 |
+
|
| 475 |
+
- C1: mean cos(anchor, negative) = 0.96068 (sd 0.026, n = 20000)
|
| 476 |
+
- C2: mean cos(anchor, negative) = 0.97526 (sd 0.022, n = 20000)
|
| 477 |
+
- C3: mean cos(anchor, negative) = 0.98845 (sd 0.007, n = 20000)
|
| 478 |
+
- **verdict: FAIL** — C1→C2 gap +0.0146 < margin 0.02 (mining produced equally easy negatives)
|
| 479 |
+
|
| 480 |
+
## Gate G1 — diagnostics (scale of the space; no verdict)
|
| 481 |
+
|
| 482 |
+
`python -m scripts.hardness_diagnostics` — version `phase01-v5`, 1600 anchors × k=20, corpus 6451. Percentile = share of corpus fragments less similar to the anchor than the negative (50 = random, 100 = nearest).
|
| 483 |
+
|
| 484 |
+
Scale: random corpus pair cos = **0.9603**; cos(anchor, positive) = **0.9651** (sd 0.023).
|
| 485 |
+
|
| 486 |
+
| cond | mean cos | sd | gap vs C1 | d vs C1 | position C1→C3 | pct mean | pct median | in top-20 | in top-100 | closer than positive |
|
| 487 |
+
|---|---|---|---|---|---|---|---|---|---|---|
|
| 488 |
+
| C1 | 0.9606 | 0.026 | +0.0000 | 0.00 | 0.00 | 50.0 | 50.1 | 0.3% | 1.5% | 39.6% |
|
| 489 |
+
| C2 | 0.9755 | 0.021 | +0.0150 | 0.63 | 0.54 | 79.6 | 91.9 | 15.4% | 28.2% | 71.5% |
|
| 490 |
+
| C3 | 0.9883 | 0.008 | +0.0278 | 1.46 | 1.00 | 99.8 | 99.8 | 94.8% | 100.0% | 99.2% |
|
| 491 |
+
|
| 492 |
+
Negative-set overlap per anchor: C1&C2 = 0.3%, C1&C3 = 0.3%, C2&C3 = 15.8%
|
| 493 |
+
|
| 494 |
+
Label-noise floors (correction 5; proxies, not the audit): share of negatives that the valid split labels as a clone of the anchor, and share whose BM25 token set is near-identical to the anchor's (Jaccard). Positives shown with the same yardstick.
|
| 495 |
+
|
| 496 |
+
| set | train-labelled clone (must be 0) | valid-labelled clone | Jaccard median | ≥ 0.5 | ≥ 0.75 |
|
| 497 |
+
|---|---|---|---|---|---|
|
| 498 |
+
| C1 negatives | 0.00% | 0.02% | 0.21 | 0.9% | 0.0% |
|
| 499 |
+
| C2 negatives | 0.00% | 0.04% | 0.37 | 28.0% | 6.6% |
|
| 500 |
+
| C3 negatives | 0.00% | 0.05% | 0.40 | 31.4% | 6.9% |
|
| 501 |
+
| labelled positives | — | — | 0.28 | 5.1% | 0.2% |
|
| 502 |
+
|
sync_manifest.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
{
|
| 2 |
"version": "phase01-v5",
|
| 3 |
-
"synced_at_utc": "2026-09-27T06:
|
| 4 |
"staged_files": [
|
| 5 |
"artifacts/codexglue_data.jsonl",
|
| 6 |
"artifacts/corpus_emb.meta.json",
|
| 7 |
"artifacts/corpus_emb.npy",
|
| 8 |
"artifacts/fragments.jsonl",
|
|
|
|
| 9 |
"artifacts/manifest.json",
|
| 10 |
"artifacts/mining_summary.json",
|
| 11 |
"artifacts/overlap.json",
|
|
@@ -2144,6 +2145,7 @@
|
|
| 2144 |
"artifacts/token_lengths.json",
|
| 2145 |
"artifacts/triples_C1.jsonl",
|
| 2146 |
"artifacts/triples_C2.jsonl",
|
| 2147 |
-
"artifacts/triples_C3.jsonl"
|
|
|
|
| 2148 |
]
|
| 2149 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"version": "phase01-v5",
|
| 3 |
+
"synced_at_utc": "2026-09-27T06:55:56Z",
|
| 4 |
"staged_files": [
|
| 5 |
"artifacts/codexglue_data.jsonl",
|
| 6 |
"artifacts/corpus_emb.meta.json",
|
| 7 |
"artifacts/corpus_emb.npy",
|
| 8 |
"artifacts/fragments.jsonl",
|
| 9 |
+
"artifacts/hardness_diagnostics.json",
|
| 10 |
"artifacts/manifest.json",
|
| 11 |
"artifacts/mining_summary.json",
|
| 12 |
"artifacts/overlap.json",
|
|
|
|
| 2145 |
"artifacts/token_lengths.json",
|
| 2146 |
"artifacts/triples_C1.jsonl",
|
| 2147 |
"artifacts/triples_C2.jsonl",
|
| 2148 |
+
"artifacts/triples_C3.jsonl",
|
| 2149 |
+
"report/measurements.md"
|
| 2150 |
]
|
| 2151 |
}
|