Add protocol v6: planted-signal studies for T2 and T3

Locked protocol v6 (SHA-256 0376aa18...), cue lexicon, the 21_m5_synthetic
script with its module and 22 tests. Labels are drawn at random so the truth
is known; a signal of controlled strength is written into the model input.
Null checks pass for T2 f = 0.02 and T3 s = 0 and fail for T2 f = 0.10 under
the locked rule. A post-hoc diagnosis (--arm diagnose) shows that the failure
comes from the null definition (c = 0 < f makes the absence of a cue a
signal), and the true null c = f passes. The real masked T2 AP corresponds to
a cue rate of about 0.82 and the real T3 forecast AP to a depth hazard of
about 0.66. Docs, report and logs updated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-23 01:50:28 +00:00
parent 5f780bab67
commit 8c924b7f0d
12 changed files with 965 additions and 11 deletions

View File

@@ -192,6 +192,28 @@ trên 4.894 ô T3. Kết quả ghi ở `outputs/m5/t5/`: `report.json`, `per_que
`knn_scores.parquet`. Kết quả ngày 20/11: depth nDCG@10 0,666, random 0,463, không biểu diễn nào hơn depth với CI loại 0
([plan §1.8](docs/plan.md#18-m5-t5-truy-xuất-khoảng-tương-đồng-ngày-20112026)).
### Tín hiệu cấy (protocol v6)
`configs/protocol_v6.yaml` (khóa bằng `.sha256`, mở rộng v5; cụm từ cue trong `configs/synth_cues.yaml`) cố định nhãn cấy,
cường độ, mô hình và kiểm tra null trước mọi điểm số cấy. Nhãn được bốc ngẫu nhiên nên biết chính xác; nhãn và văn bản thật
không dùng làm chân lý.
```bash
OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 \
scripts/runlog.sh -n m5_synthetic -- .venv/bin/python scripts/21_m5_synthetic.py --arm t3 # khoảng 4 phút
for i in 0 1 2 3; do # 4 tiến trình độc lập, mỗi tiến trình khoảng 2 giờ 30 phút; chạy nền bằng setsid nohup
OMP_NUM_THREADS=4 MKL_NUM_THREADS=4 OPENBLAS_NUM_THREADS=4 \
scripts/runlog.sh -n m5_synthetic -- .venv/bin/python scripts/21_m5_synthetic.py --arm t2 --shard $i/4
done
.venv/bin/python scripts/21_m5_synthetic.py --arm report # dựng lại report.json và bảng từ các lượt đã xong
.venv/bin/python scripts/21_m5_synthetic.py --arm diagnose # sau sự kiện: vì sao null c = 0 trượt khi f > 0 (khoảng 3 giây)
```
Kết quả ở `outputs/m5/synthetic/` (`report.json`, `settings_t2.csv`, `settings_t3.csv`, `seeds_t2.csv`, `seeds_t3.csv`,
`t3_scores.parquet`, `t2_runs/`). Kết quả ngày 20/11: kiểm tra null đạt ở T2 f = 0,02 và T3, không đạt ở T2 f = 0,10; điểm
TF-IDF T2 thật tương ứng c ≈ 0,82, điểm T3 thật tương ứng s ≈ 0,66. Lỗi null ở f = 0,10 là do thiết kế (null thật là c = f, đạt), xem `null_diagnosis_t2.csv`
([plan §1.9](docs/plan.md#19-m5-nghiên-cứu-tín-hiệu-cấy-planted-signal-ngày-20112026)).
## Ba phiên bản của một DDR và parser OCR
Mỗi DDR có ba phiên bản:
@@ -241,6 +263,7 @@ Dịch vụ OCR:
| `scripts/18_m5_judge.py prepare\|status\|collect` | Hiệu chuẩn LLM-judge cho G3 theo protocol v3 → `outputs/m5/judge/` (report.json, judged.csv, disagreements.csv) |
| `scripts/19_m5_errors.py` | Phân loại lỗi theo họ câu hỏi và RQ4 (EGS so với điểm tự động) theo protocol v4 → `outputs/m5/errors/` |
| `scripts/20_m5_t5.py` | T5 truy xuất khoảng tương đồng và dự báo từ láng giềng theo protocol v5 → `outputs/m5/t5/` |
| `scripts/21_m5_synthetic.py` | Tín hiệu cấy cho T2 (cue văn bản) và T3 (hazard theo độ sâu) theo protocol v6 → `outputs/m5/synthetic/` |
| `scripts/runlog.sh` | Bọc một lệnh để ghi log và runtime |
| `scripts/run_m1.sh` | Chạy pipeline M1 trên nền P0: 04_ocr_hub, 05 `--source hub`, 06–09, pytest |
| `scripts/run_p0.sh` | Chạy toàn bộ P0: 00 `--check`, 01–05 (04 ở chế độ `--pilot`), pytest |