GP-KG Phase 0 Reproduction — Formal Writeup

Authors: whafa, Claude (Maple project) Date: 2026-05-06 Status: Phase 0 Step 1 (CV link prediction) CLOSED. Phase 0 Step 2 (AD case study) approaching closure (~7% AUROC gap from KG-Predict target). Companion document: pdr_phase0_gpkg_results.md — earlier conversational summary, retained as historical record. Pipeline plan: PDR_PIPELINE_PLAN.md — patched 2026-05-04 to reflect the closures reported here.

Template note. This document follows the Purpose / Materials & Methods / Procedure / Results / Discussion structure for project writeups. Future Maple writeups should use the same outline so results across phases are directly comparable.


Summary

We reproduced the foundational CompGCN + InteractE (corrected 2026-10-15, #912; earlier text said ConvE) link-prediction model from KG-Predict (Gao et al., 2022) and PDR1 (Oğuztüzün et al., 2025) on the GP-KG knowledge graph (61,146 nodes, 1,246,726 edges, 9 relation types). Across four training runs that varied only in the train/valid/test split seed and the choice of head-direction evaluation, the final run (Run 4, no -skip_head) achieved a held-out test MRR of 0.319 and a rank-derived AUROC of 0.993 on cross-validation–style link prediction, exceeding KG-Predict’s published 5-fold targets of 0.261 and 0.981 by 22% and 1.2% respectively. On the secondary AD case-study evaluation (60 NCT-evidence positives among 1,430 candidate drugs), Runs 1–4 cluster at AUROC 0.79–0.81, ~7% below KG-Predict’s 0.868 — a gap stable across training conditions and likely driven by the unrecoverable split used by the original authors.


1. Purpose

The Maple MODS subsystem aims to deliver personalized drug-repurposing recommendations for Maureen’s metastatic colorectal cancer (CRC). Doing this with confidence requires demonstrating that our knowledge-graph link-prediction stack reproduces published results on a well-characterized public benchmark before we trust it on patient-specific applications.

Concrete objective. Reproduce the GP-KG results from KG-Predict (Gao 2022) and PDR1 (Oğuztüzün 2025), specifically:

  • Step 1 — CV link prediction (validates the foundational GCN). Match KG-Predict’s published 5-fold cross-validation AUROC = 0.981 and MRR = 0.261 within a 5% closure band on held-out triples drawn from the full GP-KG.
  • Step 2 — AD drug-ranking case study. Match KG-Predict’s AD-CS AUROC = 0.868 and AUPR = 0.364 within 5% on 60 Alzheimer’s drugs with NCT clinical-trial evidence, ranked among the 1,430 GP-KG drug nodes.
  • Secondary — Spearman ρ ≥ 0.90 between our AD ranking and the published case_study_predict_results.csv. This target depends on the original authors’ train/valid/test split, which was not shipped with the public release; we report the best ρ obtainable without it.

Closing both steps establishes a production-ready foundational ranker on the smaller, paper-comparable GP-KG. Downstream phases (PrimeKG, RGCC patient-specific validation, semantic embedder pickoff, post-hoc combination) build on this checkpoint.


2. Materials and Methods

2.1 Dataset

GP-KG — biomedical knowledge graph distributed by the KG-Predict authors at nlp.case.edu/public/data/GPKG-Predict/, mirrored locally at docs/References/kg-predict/Data/.

PropertyValue
Nodes61,146
Edges1,246,726
Entity types (7)gene (18,357), phenotype (17,594), molecular_function (15,924), disease (7,790), drug (1,430), anatomy (51)
Relation types (9)gene_uao_phenotype, gene_go_phenotype, gene_mp_phenotype, drug_hp_phenotype, disease_hp_phenotype, drug_mp_phenotype, associate, target, treat
Drug ID conventionPubChem CID with 100,000,000 offset (e.g., cid100002907 = PubChem CID 2907 = cyclophosphamide)
Disease ID conventionUMLS CUI (e.g., c0009402 = colorectal neoplasms)

2.2 Train/valid/test split

split_GPKG.py (mirrored at docs/References/PDR1/split_GPKG.py) produces a 60/20/20 transductive split. The upstream script does not call random.seed(), so each invocation produces a different split and the paper’s exact split is unrecoverable from the script alone. We patched a random.seed(41504) call into our local copy at split_GPKG() line 87, fixing the split for Runs 3 and 4. (2026-11-02, #1344: the seed fixes the split only when PYTHONHASHSEED is fixed too, because the list it shuffles is built from a set (§3.4), and no Run 1–4 notebook fixes it. That Runs 3 and 4 share a split is not shown; #1414.) The authors were contacted; we are not waiting on a response.

2.3 Architecture and hyperparameters

Foundational model. CompGCN (Vashishth et al., 2020) encoder + InteractE (Vashishth et al., 2020) decoder (corrected 2026-10-15, #912; earlier text said ConvE (Dettmers et al., 2018); model/predict.py uses chequer_perm and circular-padded convolution), as used by both KG-Predict (2022) and PDR1 (2025). The codebase is PDR1’s code/main.py plus Maple patches (-eval_freq, -skip_head, a vocab and RNG sidecar, opt-in run telemetry; lib/pdr/README.md lists them); not the upstream KG-Predict code/main.py. (Corrected 2026-11-02, #1344: this sentence used to say “Maple-local throughput patches (num_workers tunable, dataloader fixes)”. Diffed against upstream code/main.py at 9d47af5, -num_workers is the authors’ flag, default 10, and neither main.py nor model/data_loader.py changes how data loads. Maple’s test.py lowers that default to 0, and the Phase 0 Colab notebooks pass -num_workers 2.)

HyperparameterValueSource
opn (CompGCN composition)corr (circular correlation)PDR1 main.py default
gcn_layer1KG-Predict paper
gcn_dim (hidden dim)200KG-Predict paper
init_dim (entity init)100PDR1 main.py default
embed_dimNone (uses gcn_dim)PDR1 default
k_w / k_h (InteractE reshape; earlier text said ConvE)10 / 20PDR1 main.py default
num_filt / ker_sz (InteractE conv; earlier text said ConvE)200 / 7PDR1 main.py default
batch_size128KG-Predict paper
lr0.001 (Adam)KG-Predict paper
dropout (GCN)0.1KG-Predict paper
lbl_smooth0.1PDR1 main.py default
max_epochs200Maple’s Colab notebooks (-epoch 200; the main.py default is 500)
eval_freq5Maple patch (PDR1’s main.py validates every epoch)
neg_num (eval sampling)1000PDR1 default
seed (model: numpy and torch)41504PDR1 main.py default
PYTHONHASHSEEDNot set by any Run 1–4 notebookmain.py never sets it. Nor do the notebooks that ran Runs 1–3 (their copies archived on Drive on 2026-04-27) or Run 4 (backend/scripts/pdr_colab_train_run4.ipynb). Maple’s lib/pdr notebooks, which postdate Run 4, set it from SEED (41504)
seed (split, when applied)41504Maple patch (Run 3 onward)

(Corrected 2026-10-25, #1270: the Source column used to read “KG-Predict paper” for opn, init_dim, k_w / k_h, num_filt / ker_sz, lbl_smooth, max_epochs and the model seed, and “PDR1 default” for eval_freq. The KG-Predict paper (§3.1) states only gcn_layer 1, gcn_dim 200, lr 0.001, batch_size 128, and dropout 0.1 in the embedding module and 0.3 in the predicting module, with Adam, ReLU and 500 iterations. PDR1 (Appendix A.4) states the same five values. The rest are defaults in PDR1’s code/main.py, where -epoch defaults to 500 and there is no -eval_freq flag. The Run 1 and Run 4 Colab notebooks (backend/scripts/pdr_colab_train*.ipynb) pass -epoch 200, with the note “paper’s 500 is overkill; early stop will halt earlier”, and the Run 1, 2 and 4 training logs record max_epochs: 200 (Run 3’s log was not kept). Early-stopping patience is 5% of max_epochs, so that flag also set it to 10 evaluations; Run 4 stopped on it after epoch 165.)

(Corrected 2026-10-30, #1270: the model seed row used to read “seed (model + PYTHONHASHSEED)”, crediting both to the main.py default. main.py passes -seed only to np.random.seed and torch.manual_seed. PYTHONHASHSEED, which fixes Python’s hash order and so the ent2id order of §3.4, is set by Maple’s lib/pdr Colab notebooks in the environment they launch main.py with. The Run 1 and Run 4 notebooks kept in the repo do not set it; the run catalog (backend/scripts/seed_research_catalog.py) records PYTHONHASHSEED=41504 for Run 3.)

(Corrected 2026-11-02, #1344: the PYTHONHASHSEED row’s value used to read “41504 where a notebook sets it”, and its source named only the Run 1 and Run 4 notebooks kept in the repo. The copies of the notebooks that ran Runs 1–3, archived on Drive, set it nowhere either: no PYTHONHASHSEED, %env or os.environ line. The catalog’s Run 3 note had put the hash seed where the split seed belongs, and now names random.seed(41504). Two April accounts, the 2026-04-19 pipeline plan and the essay “Training My First Neural Network”, say the first split ran under PYTHONHASHSEED=41504; no notebook shows it.)

2.4 Hardware and runtime

Spec
HardwareColab Pro+ A100 40 GB
CU rate6.77 CU/hour
Per-run training time4.8–5.4 hours (~33–37 CU)
Drive mountG:\My Drive\PDR\ for checkpoints; runs synced to backend/data/pdr_models/Run{N}/ post-hoc

2.5 Evaluation metrics — definitions and worked examples

The KG holds triples (head, relation, tail). To evaluate, we hide some triples from the model. For each held-out triple, the model ranks all candidate completions; the position of the actual held-out entity in the ranked list is the rank. Every metric below operates on those ranks.

The “right answer” depends on the evaluation track:

  • CV / link prediction (Run 4 test.py + main.py): for each held-out test triple (h, r, t), mask the tail and rank every entity in the graph; repeat masking the head. The right answer is the entity that was actually present in the held-out triple.
  • AD case study (compute_metrics.py): rank the 1,430 GP-KG drug nodes as candidate completions of (?, treat, alzheimer). Positives = 60 drugs with NCT clinical-trial evidence (ad_nct_evidence.csv).

MRR — Mean Reciprocal Rank

MRR = (1/N) · Σ (1/rank_i) for N queries.

Worked example. Three queries; correct answers ranked at 1, 4, 10: MRR = (1/1 + 1/4 + 1/10) / 3 = (1.000 + 0.250 + 0.100) / 3 = 0.450.

The reciprocal compresses the tail: rank 1→2 hurts a lot (1.0→0.5), rank 1000→5000 barely registers (0.001→0.0002). Range 0–1.

Hits@k

Hits@k = (queries with rank ≤ k) / N.

Same example, ranks 1, 4, 10:

  • Hits@1 = 1/3 = 0.333
  • Hits@5 = 2/3 = 0.667
  • Hits@10 = 3/3 = 1.000

Range 0–1.

Mean Rank (MR)

MR = (1/N) · Σ rank_i. Lower is better. Reported alongside MRR for completeness but dominated by outliers; not used for closure judgment.

AUROC — Area Under the ROC curve

Rank-based form (used here): for each positive ranked among N entities, AUROC contribution = (N − rank) / (N − 1). Average across all positives.

Worked example. 5 candidates, 1 positive ranked second: AUROC = (5 − 2) / (5 − 1) = 0.75.

Equivalent intuition: probability that a random positive scores above a random negative. Random ranker = 0.5; perfect = 1.0.

In our two regimes:

  • CV AUROC (N = 61,146): per-query AUROC = (61146 − rank) / 61145, averaged over 76,928 test predictions.
  • AD case-study AUROC (N = 1,430): sklearn AUROC over 60 positives + 1,370 negatives.

AUPR — Area Under the Precision-Recall curve

Walks the ranked list from top to bottom; at each rank where a positive appears, records (precision so far, recall so far); takes the area under the resulting curve.

Worked example. 10 candidates, 3 positives at ranks 1, 3, 5:

RankLabelPrecisionRecall
1✓1.000.33
3✓0.670.67
5✓0.601.00

AUPR ≈ mean of the precisions at recall changes ≈ (1.00 + 0.67 + 0.60) / 3 = 0.756 (sklearn computes via trapezoidal rule).

AUPR is sensitive to class imbalance: random baseline equals the positive rate, not 0.5. For our AD case study with 60/1,430 = 4.2% positive rate, random AUPR = 0.042.

Spearman ρ — rank correlation

ρ = 1 − (6 · Σdᵢ²) / (n · (n² − 1)), where dᵢ is the difference in ranks for item i across the two orderings (no ties).

Worked example. Five drugs ranked by paper vs by us:

ItemPaper rankOur rankdᵢdᵢ²
A12-11
B2111
C3300
D45-11
E5411

ρ = 1 − (6 · 4) / (5 · 24) = 0.80. Range −1 to +1; 0 = uncorrelated; 1 = identical ordering.

The “right answer” here is the published case_study_predict_results.csv. ρ = 1.0 would require the paper’s exact unshipped split.

2.6 Two evaluation regimes (and why we report both for Run 4)

The PDR1 codebase produces two distinct CV-link-prediction evaluations from a single training run:

main.py end-of-train testtest.py post-hoc
Negative sampling1000 negatives per queryNone — full ranking against all 61,146 entities
OutputMRR / Hits@k written to logPer-triple rank + score written to test_predictions.txt
KG-Predict comparatorMRR 0.261 (paper convention)AUROC 0.981 (paper convention, via rank-derived form)
Computation costNegligible (one pass at end of training)~1 minute (one pass over test set)

The two answer different questions: 1000-neg sampling matches the paper’s MRR convention; full ranking matches their AUROC convention. We report both to enable a complete closure check against the paper’s published numbers.

2.7 Comparison targets

SourceTrackNumber we target
KG-Predict (Gao 2022)CV link prediction (5-fold)AUROC 0.981, MRR 0.261, AUPR 0.409
KG-Predict (Gao 2022)AD case studyAUROC 0.868, AUPR 0.364
PDR1 (Oğuztüzün 2025)Foundational on GP-KG (5-fold)MR 1390.6, MRR 0.19231, Hits@10 0.31331, AUC 0.866

Closure threshold: within 5% (relative) of the headline KG-Predict numbers on each track.

Note on “CV”: KG-Predict reports 5-fold cross-validation. Our Run 4 evaluates on a single 60/20/20 split. We compare to the paper’s 5-fold mean — this is a known asymmetry in the comparison, acceptable because all four of our runs land within tight bands on the AD-CS track (suggesting low between-fold variance) and because adding 4 more folds would multiply compute spend without changing the closure call.


3. Procedure

Four GP-KG training runs were conducted between 2026-04-18 and 2026-04-25. All four shared the architecture and hyperparameters in §2.3. They differed only in operational variables that affected reproducibility and evaluation rigor.

RunDateSplitter seededVocab sidecar-skip_head
Run 12026-04-18NoNoTrue (tail-only)
Run 22026-04-24 02:13
2026-04-24 07:02
NoYesTrue
Run 32026-04-24 07:20Yes (seed 41504)YesTrue
Run 42026-04-24 19:12
2026-04-25 00:36
Yes (same split as Run 3)YesFalse

Run IDs follow the pattern gpkg_corr_1l_200d_v{1..4}. Best epoch and training time are reported in §4.1 / §4.8.

3.1 What changed across runs and why

Run 1 — first successful Colab run end-to-end, after several free-tier timeouts. Train and inference in the same session (required for ent2id consistency, see §3.4). Established that the published hyperparameters trained without modification on Maple’s PDR1 fork.

Run 2 — added a vocab sidecar export (gpkg_repro_v2_vocab.pkl, 873 KB) so the entity→index mapping is durable and inference can be performed in a separate Colab session from training. Same unseeded splitter as Run 1, so this is genuinely a different random split — useful for measuring split-level variance on the AD case study.

Run 3 — first run with the seeded splitter. After patching random.seed(41504) into split_GPKG.py line 87, this run produces the frozen Phase 0 baseline split. Inference completed; training log was not saved due to a Colab session interruption, so per-epoch validation MRR and best epoch are unrecoverable.

Run 4 — the closure run. Identical configuration to Run 3 (same seeded split, same hyperparameters, same checkpoint structure) with -skip_head toggled OFF for the first time. Validation now evaluates both directions (head and tail), giving an honest MRR rather than the inflated tail-only number. Early-stopping fired at epoch 165 with the saved checkpoint coming from epoch 155. Held-out test evaluation ran in the same Colab cell immediately after training closed.

3.2 Inference

For each run, after training, two domain-specific ranking tasks were executed:

python test.py -name <run_id> -test_file ad_pre.txt  -save_result ad_predictions.txt
python test.py -name <run_id> -test_file crc_pre.txt -save_result crc_predictions.txt

ad_pre.txt / crc_pre.txt contain prepared queries (?, treat, alzheimer) and (?, treat, colorectal_neoplasms) respectively. Output is a list of (head, relation, tail, rank, score) for each query, against the full 1,430 drug nodes.

PubChem CID lookup was performed locally via lookup_drugs.py to convert opaque cid100xxxxxxx IDs to drug names, producing ad_top30_named.csv / crc_top30_named.csv.

3.3 Metric computation

backend/scripts/pdr/compute_metrics.py (added 2026-04-20, comparator targets corrected 2026-04-24) consumes the named CSVs and emits metrics.json per run. It computes Spearman ρ vs case_study_predict_results.csv, plus AUROC / AUPR / MRR / Hits@k against the 60 NCT-evidence positives. Run locally; no GPU required.

For Run 4 only, an additional script in this writeup (backend/scripts/pdr_phase0_charts.py) parses test_predictions.txt to compute the rank-derived full-ranking AUROC reported in §4.

3.4 Same-session inference constraint

The PDR1 codebase builds the entity→index map (ent2id) by reading train.txt and then valid.txt into an OrderedSet in file order, so the same split files give the same map in any process. The file order comes from split_GPKG.py, which writes train.txt from a Python set and shuffles a list made from one, so it follows Python’s string-hash order. That order never changes within a process; Python changes it in each new process unless PYTHONHASHSEED is fixed, which is what makes it repeat across processes. The Colab notebooks re-run the splitter on the VM’s own disk in every session. Without a fixed PYTHONHASHSEED, a new session writes train.txt in a different order, and so builds a different ent2id; it also puts different triples in valid and test, random.seed(41504) (§2.2) notwithstanding. Runs 1–3 trained and inferred in the same Colab session; Run 2 onward also exports a vocab sidecar that lets inference happen later if needed.

(Corrected 2026-11-02, #1344: this paragraph used to say “With PYTHONHASHSEED set, this is stable within a process; across processes it can drift”, which had it backwards, and it put the hash-order dependence in main.py, which reads the files in order. Checked by running this fork’s split_GPKG.py on a synthetic graph in fresh processes: two runs under PYTHONHASHSEED=41504 wrote identical files, and runs under 0, 1 or no PYTHONHASHSEED each wrote different valid and test sets. None of the notebooks that ran Runs 1–4 sets it (§2.3), so the repo does not show that Runs 3 and 4 share a split; #1414.)


4. Results

4.1 Validation MRR trajectory across runs

Validation MRR per epoch, all four GP-KG runs

Runs 1, 2, and 4 are plotted; Run 3’s training log was not preserved.

  • Runs 1 and 2 plateau at MRR ≈ 0.49 by epoch ~150. With -skip_head enabled, main.py reports Tail ≡ Head ≡ Avg, so the headline is the tail-only number.
  • Run 4 plateaus at MRR ≈ 0.31 because its “Avg” is honestly (Tail + Head) / 2. Run 4’s curve crosses KG-Predict’s CV target of 0.261 by epoch ~25 and stays above it.

4.2 Run 4 head vs tail dynamics

Run 4 head vs tail validation, with held-out test marker

Run 4 is the only run with separable head and tail evaluation. Tail prediction (MRR ≈ 0.485) is consistently easier than head prediction (MRR ≈ 0.150) — a roughly 3× asymmetry that explains why -skip_head inflated Runs 1–3 by the same factor. The gold star marks the held-out test result (MRR 0.319), within noise of the validation plateau.

4.3 Held-out test results (Run 4)

Metricmain.py
(1000-neg
sampled)
test.py
(full ranking,
61,146 entities)
KG-Predict
CV target
MRR avg0.31899 ✅0.070760.261
MRR tail0.48531——
MRR head0.15268——
Hits@10.256230.01595—
Hits@30.336850.05067—
Hits@50.378690.08517—
Hits@100.440450.16487—
Hits@30—0.42795—
AUROC
(rank-derived)
—0.99260 ✅0.981
Mean Rank—453.5—

✅ = within the 5% closure band of the KG-Predict CV target. main.py MRR avg exceeds target by 22%; test.py rank-derived AUROC exceeds target by 1.2%.

Run 4 hits@k under both eval regimes

Both Step 1 closure criteria are met within the 5% band.

4.4 AUROC paired comparison

Run 4 vs KG-Predict — paired AUROC on the two tracks

CV link prediction passes; AD case study is short by ~7%.

4.5 AD case-study results (all four runs)

AD case-study AUROC and AUPR per run

MetricRun 1Run 2Run 3Run 4KG-Predict AD-CS
AUROC0.80240.80780.79350.80500.868
AUPR0.17400.13010.12670.19040.364
MRR (60 positives among 1,430)0.02930.01240.01160.0294not published
Hits@100.03330.01670.00000.0667not published
Hits@300.08330.06670.11670.1333not published
n positives resolved60/6060/6060/6060/60—

AUROC is stable across all four runs in the 0.79–0.81 range, indicating the result is not driven by run-to-run noise. AUPR is more variable (0.13–0.19) because of the 4.2% positive rate.

4.6 Spearman ρ vs paper AD ranking

Spearman ρ across runs

RunSpearman ρp
Run 1 (unseeded split)0.7397< 10⁻²⁴⁷
Run 2 (unseeded split)0.8053~ 0
Run 3 (seeded split)0.7125< 10⁻²²¹
Run 4 (seeded split, no skip_head)0.7392< 10⁻²⁴⁶

ρ ranges 0.71–0.81; the secondary 0.90 target is not met in any run. All p-values are vanishingly small — the agreement with the paper’s ranking is statistically extremely significant, just imperfect.

4.7 Top-30 sanity check (Run 4)

Top-5 AD candidates: fluoxetine, venlafaxine, citalopram, methotrexate, thalidomide. Three SSRIs/SNRIs (depression-AD comorbidity), plus methotrexate (AD-inflammation pathway) and thalidomide (TNF-α modulation). Top-5 CRC: cyclophosphamide, vincristine, cisplatin, bortezomib, mitoxantrone — standard cytotoxics; capecitabine appears at rank 14. Both lists pass face validity. Full lists at ad_top30_named.csv / crc_top30_named.csv.

4.8 Compute cost

RunTraining (h)Inference (h)Total (h)CU
Run 14.800.104.9033.2
Run 24.820.505.3236.0
Run 34.800.305.1034.5
Run 45.330.065.3936.5
Total——20.71 h140.2 CU

5. Discussion

5.1 Step 1 closes cleanly

Run 4’s test MRR (0.319) and rank-derived AUROC (0.993) both clear the 5% closure band against KG-Predict’s published CV targets. The MRR exceeds the target by 22% on the head+tail-averaged metric, which is the form KG-Predict reports — there is no -skip_head confound. AUROC exceeds by 1.2% under the rank-derived form, which is a defensible reconstruction of the paper’s published 0.981 (the paper does not specify the exact AUROC computation method, but rank-derived AUROC is the standard form for full-ranking link-prediction evaluation and is commonly within 0.01–0.02 of sampled-pairs AUROC for the same model).

The single-split-vs-5-fold-CV asymmetry in §2.7 is acknowledged. Given the consistency of AUROC across our four runs on the AD-CS track (range 0.79–0.81, span 0.014), between-fold variance is unlikely to swing the closure call. We do not plan additional folds for Phase 0.

5.2 Step 2 is approaching closure but not closed

The AD-CS AUROC sits at ~0.80 across all four runs, ~7% short of KG-Predict’s 0.868. Three observations:

  1. Stability across training conditions. The number is essentially unchanged whether the splitter is seeded (Runs 3, 4) or unseeded (Runs 1, 2), and whether evaluation includes the head direction (Run 4) or not (Runs 1–3). This rules out the model architecture, the training procedure, and the -skip_head setting as drivers of the gap.
  2. Variance in AUPR but not AUROC. AUPR ranges 0.13–0.19 across runs, considerably wider than AUROC (0.79–0.81). This is consistent with the 4.2% positive rate — AUPR is imbalance-sensitive and reorders quickly when ties or near-ties get permuted between training runs.
  3. Spearman ρ ceiling at ~0.74–0.81. All four runs agree on most of the ranking but not on enough of the top-30 to push ρ to 0.90. This pattern is what we’d expect from a different but functionally equivalent split — many drug pairs in the same ballpark, but the precise top-30 ordering differs.

The most parsimonious explanation is split mismatch: KG-Predict produced their published ranking using an unseeded run of split_GPKG.py (verified — the script has no random.seed() call) and the resulting train/test partition was not shipped with the public release. Without it, ρ ≈ 0.74 is a reasonable floor for a different but legitimate split, and the AD-CS AUROC’s 7% gap is plausibly the same effect.

We do not plan further runs to chase Step 2 closure. The remaining gap will be documented as a known asterisk in the final reproducibility writeup. PrimeKG (which uses an entirely different drug ID scheme and edge structure) is the production graph going forward; GP-KG remains in the pipeline only as the paper-comparator validation.

5.3 Two methodological lessons

(i) -skip_head was a trap. Runs 1–3 reported MRR ≈ 0.49 and that number looked like it was beating KG-Predict’s 0.261 by 88%. It was actually a tail-only metric, masking the harder head-direction prediction; the honest number (Run 4) is 0.319. Future runs should never use -skip_head for closure-critical evaluation. The flag remains useful for fast iteration during architecture exploration, when a 2× speedup matters more than head-tail symmetry.

(ii) Two evaluation regimes coexist for the same checkpoint. main.py’s end-of-train test uses 1000-neg sampling; test.py uses full ranking. They produce numerically different MRRs (0.319 vs 0.071 for Run 4) and different Hits@k profiles. Neither is wrong; they answer different questions and compare to different paper conventions. For closure, we report both and match each to its appropriate KG-Predict target.

5.4 The document-state discrepancy that prompted this writeup

PDR_PIPELINE_PLAN.md carried the Run 4 results in its Run Catalog (lines 183–210) but had not propagated the closure into the Phase 0 checklist (lines 482, 533–535, 670–694). The checklist still flagged Step 1 as blocked on a run that had completed 11 days earlier. The plan document was patched on 2026-05-04 to reflect closure; both the closure narrative and the corrected reproducibility tables now match the artifacts on disk.

This is a reminder that the Run Catalog and the checklist are two different views of the same project state and need to be updated together. Going forward, run-completion commits should touch both sections in the same diff.

5.5 What’s next

PhaseActivityStatus
0 Step 2AD case-study closure — accept ~7% gap as split-mismatch asteriskNot pursuing further
5.4PrimeKG architecture grid (opn × layer × dim) — Run A1 (primekg_sub_1l_300d_v1) leads at MRR 0.415In progress
7.5RGCC patient-specific validation — 224 drug sensitivities → tier-1 Spearman, tier-2 AUROCPending PrimeKG checkpoint promotion
7.6OpenAI vs SapBERT semantic embedder pickoffReported done, pending verification
7.7Warm-init vs post-hoc combination decisionGated on 7.6

Run 4’s checkpoint (gpkg_repro_v4) is the canonical Phase 0 baseline for any future GP-KG comparison work.

5.6 Limitations

  • Single-split CV vs paper’s 5-fold mean. §2.7 and §5.1.
  • Unrecovered original split. §5.2.
  • Rank-derived AUROC formula. §5.1 — this is the standard reconstruction but not necessarily the exact form used in the KG-Predict paper.
  • GP-KG drug ID opacity. Drugs are stored as cid100xxxxxxx PubChem-offset strings; nothing in the KG provides drug names directly. Drug-name resolution is post-hoc via lookup_drugs.py. Errors in the offset convention (we hit one early on) cascade silently.
  • Run 3 training log loss. §3.1, footnote 1. Recoverable only by retraining; not pursued because Run 4 supersedes it.

6. Reproducibility

The numbers in this writeup are reproducible from a checkout of the repo at this commit:

# from C:\Maple
python backend/scripts/pdr_phase0_charts.py

That script (backend/scripts/pdr_phase0_charts.py) parses the training logs and metrics JSONs in backend/data/pdr_models/Run{1..4}/ and writes the six PNGs in docs/charts/pdr_phase0_*.png. All numbers in §4 are taken verbatim from the script’s stdout.

Source artifacts

PathContents
backend/data/pdr_models/Run{1..4}/log/*Per-epoch validation MRR trajectories
backend/data/pdr_models/Run4/log/gpkg_repro_v4Held-out test MRR / Hits line at end of training
backend/data/pdr_models/Run4/test_predictions.txt76,928 ranked test triples → rank-derived AUROC
backend/data/pdr_models/Run{1..4}/metrics.jsonAD case-study AUROC, AUPR, MRR, Hits@k, Spearman ρ
backend/data/pdr_models/Run4/cv_metrics.jsonFinal test.py stdout snapshot
backend/data/pdr_models/compute_log.csvCU spend per run
backend/scripts/pdr_colab_train_run4.ipynbColab notebook driving Run 4

7. References

  • Gao Z, Ding P, Xu R. KG-Predict: A knowledge graph computational framework for drug repurposing. J Biomed Inform. 2022. Foundational paper for GP-KG and the CompGCN + InteractE (corrected 2026-10-15, #912; earlier text said ConvE) link-prediction model.
  • Oğuztüzün C, Gao Z, Xu R. Precision drug repurposing: Patient-level modeling and prediction combining foundational knowledge graph with biobank data. J Biomed Inform. 2025. Individualized variant of the KG-Predict model with UK Biobank patient features.
  • Vashishth S, Sanyal S, Nitin V, Talukdar P. Composition-based multi-relational graph convolutional networks (CompGCN). ICLR 2020.
  • Dettmers T, Minervini P, Stenetorp P, Riedel S. Convolutional 2D knowledge graph embeddings (ConvE). AAAI 2018.
  • Vashishth S, Sanyal S, Nitin V, Agrawal N, Talukdar P. InteractE: Improving convolution-based knowledge graph embeddings by increasing feature interactions. AAAI 2020. The decoder KG-Predict and PDR1 actually use (model/predict.py); InteractE extends ConvE. Added 2026-10-24 (#912).

Appendix A — Template instructions for future writeups

Use this document’s structure as a template:

  1. Header block. Authors, date, status (closed / approaching / open), companion documents, pipeline plan cross-link.
  2. Summary. ~150 words. The headline numbers and the one-line interpretation.
  3. Purpose. Why this work, in the context of the larger Maple project. State the closure criteria explicitly — what would count as success.
  4. Materials and Methods. Dataset, splits, architecture, hyperparameters, hardware, evaluation metrics (with worked examples for any non-obvious metric), comparison targets. This is the section that makes the work replicable.
  5. Procedure. Chronological. What was actually done, in what order, and why each variation was introduced. Differs from §4 in that §4 is the findings; §3 is the protocol.
  6. Results. Charts and tables. One subsection per major finding. Cite numbers verbatim from the metrics JSON / log artifacts; never paraphrase numerical results.
  7. Discussion. Interpret the results. Identify the closure outcome, address methodological lessons, surface limitations, point to next phases. This is where judgment lives.
  8. Reproducibility. The exact command(s) needed to regenerate the writeup’s numbers and charts. List source artifacts by path.
  9. References. Cited papers, with full bibliographic info.
  10. Appendices as needed.