# CS3319 Recommendation Exploration Summary 更新日期:2026-06-15 ## 1. 目标与验证协议 本轮探索目标是保留当前 LightGCN 主模型,同时通过模型融合、显式图结构特征、rank calibration 和提交比例校准,把 Kaggle 分数尽量推高到 0.95 以上。 最重要的调整是放弃只看固定 `notebook_seed0` 的结果,改为尽量复现示例 notebook 的随机划分方式: - 从完整 author-paper 训练边中随机抽取 90% 作为训练边。 - 剩余 10% 作为 validation positives。 - 随机采样同数量非训练边作为 validation negatives。 - validation 是 1:1 构造,因此本地最佳 threshold 不能直接等价于官方 test 最佳正例比例。 相关代码: - `code/train_val_lgcn_ensemble.py` - `code/search_dynamic_fusion.py` - `code/stack_rank_calibration.py` ## 2. LightGCN 主线 LightGCN 仍然是最强 backbone。当前 LightGCN 并不是只使用 author-paper 边,它还使用: - author-paper train edges - author-author coauthor edges - paper-paper citation edges - paper reference degree / citation in degree / citation out degree 等增强特征 动态验证中,最稳定有效的 LightGCN 区间是: - 2 layers - 512 dim 左右 - BPR loss - dot score - `neg_per_pos=3` - `train_batch_size=131072` - 多 seed ensemble 代表性动态验证结果: | split | run | F1 | |---|---|---:| | dynamic_seed202 | `dyn202_l2d512_bpr_bigbatch_more` | 0.938576 | | dynamic_seed203 | `dyn203_l2d512_bpr_bigbatch_extra` | 0.938555 | | dynamic_seed202 | `dyn202_l2d640_bpr_bigbatch` | 0.938355 | | dynamic_seed202 | `dyn202_l2d512_bpr_xlbatch` | 0.938273 | 分数层融合后,dynamic_seed202 上最高约为 0.9395,仍明显低于 0.95。 ## 3. 失败或收益有限的方向 以下方向已经尝试过,但没有稳定超过 LightGCN 主线: | 方法 | 结论 | |---|---| | 更深 LightGCN 4/5 layers | 4 层弱于 2 层,5 层大 batch OOM,midbatch 也只有约 0.934-0.935 | | 更宽 LightGCN 768/896/1024 dim | 没有显著超过 512 dim | | 1-layer LightGCN | 明显弱,约 0.927 | | BCE loss | 明显失败,约 0.86 | | hinge loss | 比 BCE 好,但仍低于 BPR | | normalized embedding training | 明显弱 | | MF/BPR | 约 0.92 | | SAGE/BPR | 约 0.926 | | HGT / graph attention | 128/256d 约 0.920-0.924,384d OOM | | standalone handcrafted LightGBM | 单独约 0.944-0.945 OOF,高于早期版本但仍不如 hybrid | 注意:HGT 是比普通 GAT 更强的 heterogeneous graph attention/Transformer 变体,但在当前全图训练设定下没有追上 LightGCN。 ## 4. 有效突破:Hybrid Stacking / Rank Calibration 最终有效提升来自以下组合: ```text LightGCN score + rank features + explicit graph/meta-path features -> LightGBM stacking ``` ### 4.1 输入特征 对每个 author-paper pair 构造: - `score_lgcn` - global rank of LightGCN score - author-wise rank of LightGCN score - author degree - paper degree - coauthor count - coauthors_read_paper_count - coauthors_read_paper_ratio - paper citation in/out degree - overlap between author historical papers and candidate paper references - overlap between author historical papers and papers citing candidate paper - Jaccard versions of the above overlaps - A-A-P count / binary feature - A-P-P count - A-P-A-P count / ratio ### 4.2 OOF 训练方式 为了避免在 validation 上训练又在同一批 validation 上评估造成虚高,stacking 使用 5-fold OOF: - 每次用 4/5 validation rows 训练 LightGBM。 - 用剩余 1/5 预测。 - 拼成完整 validation OOF 分数。 - 最后搜索 threshold,使 F1 最大。 ### 4.3 动态 split 结果 | split | LightGCN raw | handcrafted only | stack LightGCN + handcrafted | |---|---:|---:|---:| | dynamic_seed201 | 0.937696 | 0.944096 | 0.955874 | | dynamic_seed202 | 0.938576 | 0.944992 | 0.955992 | | dynamic_seed203 | 0.938555 | 0.945094 | 0.955588 | | dynamic_seed204 | 0.937888 | 0.943760 | 0.955557 | 结论:显式图结构和 meta-path 特征稳定补上了 LightGCN 的盲区,是目前真正突破 0.95 的关键。 ## 5. Test 正例比例校准 由于 validation 是人工 1:1 构造,直接使用 validation threshold 到 test 不可靠。因此提交阶段采用 rank cutoff: ```text 按 hybrid test score 排序,取 top ratio 为 1,然后强制 known positives 为 1。 ``` 本地 4 个 dynamic split 的 OOF 最优 threshold 对应预测正例比例: | split | pred_ratio | best F1 | |---|---:|---:| | dynamic_seed201 | 0.4993 | 0.955874 | | dynamic_seed202 | 0.5013 | 0.955992 | | dynamic_seed203 | 0.4989 | 0.955588 | | dynamic_seed204 | 0.5037 | 0.955557 | 固定 ratio sweep 的 4-split 均值: | ratio | mean F1 | |---:|---:| | 0.500 | 0.955632 | | 0.502 | 0.955574 | | 0.498 | 0.955532 | | 0.504 | 0.955521 | | 0.505 | 0.955361 | | 0.506 | 0.955307 | | 0.521 | 0.951956 | | 0.530 | 0.948353 | 这解释了为什么最初 `0.521` 偏高,而 public LB 上 `0.500` 和 `0.505` 更好。 用户提交反馈: - `submission_stack_r0.505_fixed.csv`: public LB 约 0.95218 - `submission_stack_r0.500_fixed.csv`: public LB 约 0.95306 - `submission_post95_ens_r0.500.csv`: public LB 约 0.95760 - `submission_post95_content_mf_lgb_score_ge0.500.csv`: public LB 约 0.95996 当前最可信的比例区间是: ```text 0.498 - 0.504 ``` 如果提交次数有限,优先保留 `0.500` 附近。 ## 6. 已生成文件 主要代码: - `code/stack_rank_calibration.py` - `code/train_val_lgcn_ensemble.py` - `code/search_dynamic_fusion.py` - `code/train_val_sage_bpr.py` - `code/train_val_hgt_bpr.py` 主要结果: - `validation_runs/stack_threshold_summary.csv` - `validation_runs/stack_ratio_analysis.csv` - `validation_runs/dynamic_seed202/stack_rank_calibration/result.csv` - `validation_runs/dynamic_seed203/stack_rank_calibration/result.csv` - `validation_runs/dynamic_seed201/stack_rank_calibration/result.csv` - `validation_runs/dynamic_seed204/stack_rank_calibration/result.csv` 提交候选: - `validation_runs/dynamic_seed202/stack_rank_calibration/ratio_refine_around_0505/submission_stack_r0.500_fixed.csv` - `validation_runs/dynamic_seed202/stack_rank_calibration/ratio_refine_around_0505/submission_stack_r0.502_fixed.csv` - `validation_runs/dynamic_seed202/stack_rank_calibration/ratio_refine_around_0505/submission_stack_r0.504_fixed.csv` - `validation_runs/dynamic_seed202/stack_rank_calibration/ratio_refine_around_0505/submission_stack_r0.505_fixed.csv` 提交格式已修正为: ```csv Index,Predicted ``` 并检查: - 行数正确:2,047,262 条预测。 - `Index` 连续。 - `Predicted` 只有 0/1。 - train/test overlap known positives 均强制为 1。 ## 7. 当前结论 当前最有效方案不是单纯放大 GNN,也不是单独依赖 attention,而是: ```text 保留 LightGCN backbone, 显式加入 coauthor / citation / degree / overlap / meta-path 特征, 用 LightGBM 做 OOF stacking, 再加入多 LightGCN 变体分数/rank/mean/std 作为二级特征, 最后基于 OOF ratio 进行 test rank cutoff 校准。 ``` 这个方案在 seed202 dynamic split 上达到 0.957070 validation F1,并在 public LB 上达到 0.95760。后续加入 pure content mean-cos 和 BPR-MF score 后,public LB 进一步达到 0.95996。 ## 8. Post-0.95 incremental ablation 按要求保留当前 LightGCN + LightGBM stacking 主流程,只做增量优化。新增脚本: - `code/post95_ablation.py` seed202 上的逐步消融结果: | stage | validation F1 | precision | recall | features | |---|---:|---:|---:|---:| | baseline stacking | 0.955992 | 0.954790 | 0.957196 | 22 | | + group threshold by author_degree | 0.956121 | 0.955925 | 0.956317 | 22 | | + group threshold by score_lgcn | 0.952937 | 0.938049 | 0.968304 | 22 | | + author quota by degree | 0.816287 | 0.771479 | 0.866622 | 22 | | + negative evidence features | 0.955757 | 0.955519 | 0.955995 | 30 | | + top-k paper similarity features | 0.956571 | 0.953112 | 0.960054 | 33 | | + ensemble LightGCN score features | 0.957070 | 0.960724 | 0.953445 | 76 | 输出文件: - `validation_runs/dynamic_seed202/post95_ablation/ablation_table.csv` - `validation_runs/dynamic_seed202/post95_ablation/error_analysis_buckets.csv` - `validation_runs/dynamic_seed202/post95_ablation/*_oof.npy` - `validation_runs/dynamic_seed202/post95_ablation/lgcn_variant_feature_names.txt` 错误分析结论: - `paper_degree < 1` 和 `paper_degree 1-3` 是最明显短板,F1 分别约 0.754 和 0.862。 - `score_lgcn` 中间段错误最多,尤其 `(2.198, 3.583]` F1 约 0.647,`(3.583, 4.934]` F1 约 0.889。 - `author_internal_rank` 前几名并不总可靠,`[1,3)` F1 约 0.497,`[3,5)` F1 约 0.602,说明对每个作者内部低排名或边界候选需要额外 rerank。 - 高 `paper_degree`、高 `score_lgcn`、高 `author_internal_rank` 区间已经非常稳,后处理不应大幅扰动这些样本。 当前新增方法判断: - 有效:`author_degree` 分组阈值、小幅 top-k 相似度特征、多 LightGCN 变体 score/rank/mean/std 特征。 - 暂时无效:按 `score_lgcn` 分组阈值、简单 author quota、当前定义的 negative-evidence 特征。 - 需要继续验证:把 top-k similarity 从 `feature.pkl` 内容向量换成 LightGCN paper embedding;在 seed201/203/204 上复测 ensemble score 特征;只对 `score_lgcn` 中间段和低 `paper_degree` 样本做局部 rerank。 ## 9. Post-0.95 submission generation 新增提交生成脚本: - `code/generate_post95_submission.py` 生成逻辑: - 使用 seed202 dynamic validation split 训练二级 LightGBM。 - 特征集合保持为 seed202 消融最优的 76 维: - LightGCN main score/rank/author rank - explicit graph/meta-path features - negative-evidence features - top-k paper content similarity - selected multi-LightGCN variant score/rank/mean/std features - test 侧显式图特征使用 full train graph。 - test 侧 LightGCN 变体分数由保存的 checkpoint 前向推理生成,并缓存到 `validation_runs/dynamic_seed202/post95_test_scores/`。 - 提交文件强制使用 Kaggle 要求的 `Index,Predicted` 格式,并对 known positive test mask 强制置 1。 生成文件: - `validation_runs/dynamic_seed202/post95_submission/submission_post95_ens_r0.498.csv` - `validation_runs/dynamic_seed202/post95_submission/submission_post95_ens_r0.500.csv` - `validation_runs/dynamic_seed202/post95_submission/submission_post95_ens_r0.502.csv` - `validation_runs/dynamic_seed202/post95_submission/submission_post95_ens_r0.504.csv` - `validation_runs/dynamic_seed202/post95_submission/submission_post95_ens_r0.505.csv` - `validation_runs/dynamic_seed202/post95_submission/test_post95_ens_pred.npy` - `validation_runs/dynamic_seed202/post95_submission/selected_variant_val_scores.txt` 格式检查: - 行数:2,047,262 条预测加 1 行 header。 - 表头:`Index,Predicted`。 - `Index` 从 0 到 2,047,261 连续递增。 - `Predicted` 只有 0/1。 建议优先提交: ```text validation_runs/dynamic_seed202/post95_submission/submission_post95_ens_r0.500.csv ``` 原因:旧版 public LB 最好的比例也是 0.500,且 4 个 dynamic split 的 ratio sweep 均值显示 0.500 附近最稳。 提交反馈: | submission | ratio | public LB | |---|---:|---:| | `submission_stack_r0.500_fixed.csv` | 0.500 | 0.95306 | | `submission_post95_ens_r0.500.csv` | 0.500 | 0.95760 | | `submission_post95_content_mf_lgb_score_ge0.500.csv` | score >= 0.500 | 0.95996 | `submission_post95_content_mf_lgb_score_ge0.500.csv` 是目前已验证的最佳版本。相比旧的 hybrid stacking,核心改进是: - 继续保留 LightGCN + explicit graph features + LightGBM stacking。 - 增加 top-k paper content similarity 特征。 - 增加多个 LightGCN 变体的 score、rank、mean、std 特征,让二级 LightGBM 学习不同 LightGCN 视角下的一致性和分歧。 - 额外增加 pure content mean-cos score 和 BPR-MF score。 - 当前最佳提交使用 fixed probability threshold:`score >= 0.500`。 ## 10. XGBoost second-stage trial 在同样的 seed202 dynamic split 和同样的 76 维 post95 特征上,将二级模型从 LightGBM 换成 XGBoost 做 5-fold OOF: | second-stage model | validation F1 | threshold | AUC | precision | recall | |---|---:|---:|---:|---:|---:| | LightGBM | 0.957070 | 0.506129 | 0.992189 | 0.960724 | 0.953445 | | XGBoost | 0.957426 | 0.452655 | 0.992390 | 0.956048 | 0.958808 | XGBoost 在 validation 上比 LightGBM 高约 0.00036,属于小幅增益,值得提交验证。 生成的 XGBoost 提交候选: - `validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_r0.498.csv` - `validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_r0.500.csv` - `validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_r0.502.csv` - `validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_r0.504.csv` - `validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_r0.505.csv` - `validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_score_ge0.500.csv` 优先提交: ```text validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_r0.500.csv ``` 如果想验证 fixed probability threshold,则提交: ```text validation_runs/dynamic_seed202/post95_xgboost_submission/submission_post95_xgb_score_ge0.500.csv ``` ## 11. Extra non-LightGCN score sources 按新增要求,在不替换 post95 主流程的前提下,额外尝试了几类不同来源的分数特征: - pure content mean-cos score:作者历史论文内容向量均值与候选论文内容向量的 cosine。 - BPR-MF score:只基于 author-paper 交互训练的矩阵分解 BPR 模型。 - LGBMRanker score:使用 post95 76 维特征,按 `author_id` 分组做 LambdaRank 排序,输出 OOF ranker score。 新增脚本: - `code/extra_score_sources_ablation.py` - `code/generate_extra_bprmf_submission.py` seed202 validation 消融结果: | stage | validation F1 | threshold | AUC | precision | recall | features | |---|---:|---:|---:|---:|---:|---:| | post95_lgbm_baseline | 0.957110 | 0.473307 | 0.992215 | 0.957742 | 0.956478 | 76 | | + content mean-cos | 0.957629 | 0.443363 | 0.992198 | 0.954998 | 0.960274 | 80 | | + BPR-MF | 0.959308 | 0.446104 | 0.992757 | 0.957718 | 0.960904 | 84 | | + LGBMRanker author-group | 0.959025 | 0.478800 | 0.992529 | 0.960477 | 0.957577 | 88 | 结论: - BPR-MF 是这轮最有效的新分数源,虽然单模型 validation F1 只有约 0.920,但放进 post95 stacking 后带来明显增益。 - pure content mean-cos 有小幅正收益,说明它和 top-k similarity 不是完全重复。 - LGBMRanker 本身按 author 分组排序很强,但在已经加入 content + BPR-MF 后没有继续提升;当前不建议优先提交 ranker 叠加版。 - Node2Vec 依赖已安装并确认可 import,但尚未完成 embedding 训练和提交生成,作为下一轮继续探索。 当前新增推荐提交: ```text validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_score_ge0.500.csv ``` 备用: ```text validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_r0.500.csv validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_r0.498.csv validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_r0.502.csv validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_r0.504.csv validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_r0.505.csv ``` 格式检查: - 表头:`Index,Predicted` - 行数:2,047,262 条预测加 1 行 header - `Index` 连续递增 - `Predicted` 只有 0/1 提交反馈: | submission | decision rule | public LB | |---|---|---:| | `submission_post95_ens_r0.500.csv` | rank top 50.0% | 0.95760 | | `submission_post95_content_mf_lgb_score_ge0.500.csv` | score >= 0.500 | 0.95996 | 因此当前最强方案是: ```text post95 76维特征 + pure content mean-cos score + BPR-MF score + LightGBM 二级模型 + score >= 0.500 ``` ## 12. Rich feature.pkl content features 进一步加强 `feature.pkl` 的利用,不再只用 top-k similarity 和 mean-cos,而是加入作者内容画像和候选论文相对作者历史分布的位置。 新增脚本: - `code/content_rich_ablation.py` - `code/generate_content_rich_submission.py` 新增 rich content 特征包括: - author content center cosine - candidate 到 author content center 的 L2 distance - author history embedding variance / dispersion - author historical paper pairwise cosine mean - candidate 与历史论文的 max / mean / std / median similarity - candidate 与历史论文的 top3 / top5 / top10 mean similarity - similarity above 0.5 / 0.7 的比例 - content rank / percentile within the same author's candidate set seed202 validation 消融: | stage | validation F1 | threshold | AUC | precision | recall | features | |---|---:|---:|---:|---:|---:|---:| | content_mf_baseline | 0.959285 | 0.478013 | 0.992830 | 0.961013 | 0.957563 | 84 | | rich_content_only_lgb | 0.873182 | 0.437771 | 0.946715 | 0.871354 | 0.875018 | 18 | | + rich_content_features | 0.959905 | 0.452128 | 0.992864 | 0.958747 | 0.961065 | 102 | | + rich_content_model_score | 0.959448 | 0.462284 | 0.992920 | 0.959048 | 0.959849 | 106 | 结论: - rich content 原始特征有效,把 validation F1 从 0.959285 提升到 0.959905。 - 只基于 rich content 的模型本身不强,且把它的 OOF score 再融合反而低于直接加入原始 rich content 特征。 - test 上 `score >= 0.500` 的正类比例为 0.4950,和当前最高的 content+BPR-MF ge0.5 版本不同;因此 rich content 版本建议先试 rank cutoff。 生成的 rich content 提交候选: ```text validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_r0.500.csv validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_r0.498.csv validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_r0.502.csv validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_r0.504.csv validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_r0.505.csv validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_score_ge0.500.csv ``` 优先验证: ```text validation_runs/dynamic_seed202/content_rich_submission/submission_content_rich_mf_lgb_r0.500.csv ``` ## 13. Threshold refinement around current best 当时最高 public LB 来自: ```text validation_runs/dynamic_seed202/extra_bprmf_submission/submission_post95_content_mf_lgb_score_ge0.500.csv public LB = 0.95996 ``` 该版本使用 `score >= 0.500`,实际 test 正类比例约 0.49734。围绕 0.500 做了局部阈值微调,并额外生成 rank-ratio 版本: ```text validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.4850.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.4900.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.4950.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.4975.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.5000.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.5025.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_th0.5050.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_rank_r0.497.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_rank_r0.498.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_rank_r0.499.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_rank_r0.500.csv validation_runs/dynamic_seed202/extra_bprmf_submission/threshold_refine_ge0500/submission_content_mf_lgb_rank_r0.501.csv ``` 阈值版本对应正类比例: | threshold | positive ratio | |---:|---:| | 0.4850 | 0.49880 | | 0.4900 | 0.49832 | | 0.4950 | 0.49782 | | 0.4975 | 0.49760 | | 0.5000 | 0.49734 | | 0.5025 | 0.49711 | | 0.5050 | 0.49686 | 建议优先尝试: ```text submission_content_mf_lgb_th0.4950.csv submission_content_mf_lgb_th0.4850.csv submission_content_mf_lgb_rank_r0.499.csv ``` ## 14. DeepWalk / Node2Vec score sources 继续尝试非 LightGCN 图 embedding 分数源。构图使用混合无向图: - author-paper dynamic train edges,权重 3.0 - author coauthor edges,权重 1.0 - paper citation edges,权重 1.0 新增脚本: - `code/node2vec_deepwalk_ablation.py` - `code/generate_node2vec_deepwalk_submission.py` 轻量配置: - dim = 128 - walk_length = 24 - num_walks = 4 - window = 8 - Node2Vec p = 1.0, q = 2.0 seed202 validation 消融: | stage | validation F1 | threshold | AUC | precision | recall | features | |---|---:|---:|---:|---:|---:|---:| | content_mf_baseline | 0.959285 | 0.478013 | 0.992830 | 0.961013 | 0.957563 | 84 | | + DeepWalk | 0.961796 | 0.466974 | 0.993513 | 0.961296 | 0.962296 | 92 | | + DeepWalk + Node2Vec | 0.962115 | 0.455694 | 0.993570 | 0.960752 | 0.963483 | 100 | 结论: - DeepWalk/Node2Vec 明显有效,是目前 validation 上最强的增量分数源。 - Node2Vec 在 DeepWalk 基础上仍有小幅增益。 - 这类 embedding 与 LightGCN/BPR-MF/content 特征互补,主要提供随机游走意义下的结构接近度。 生成提交: ```text validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_r0.498.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_r0.499.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_r0.500.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_r0.501.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_r0.502.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_th0.455694.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_th0.480000.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_th0.490000.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_th0.500000.csv ``` 优先提交: ```text validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_r0.500.csv validation_runs/dynamic_seed202/node2vec_deepwalk_submission/submission_content_mf_deepwalk_node2vec_lgb_th0.480000.csv ``` 这两个版本的正类比例都约为 0.500。 提交反馈: | submission family | decision rule | public LB | |---|---|---:| | `submission_post95_content_mf_lgb_score_ge0.500.csv` | score >= 0.500 | 0.95996 | | `submission_content_mf_deepwalk_node2vec_lgb_th0.480000.csv` | score >= 0.480000 | 0.96252 | `DeepWalk + Node2Vec + content + BPR-MF + post95 LightGBM` 是目前已验证的最佳方案。相比 0.95996 版本,主要新增了随机游走图 embedding 分数源: ```text DeepWalk cosine/dot score + rank features Node2Vec cosine/dot score + rank features ``` 这说明随机游走结构接近度和已有的 LightGCN、BPR-MF、content features 存在明显互补。 ## 15. Random-walk systematic ablation 在不替换主 pipeline 的前提下,继续专门压榨 DeepWalk / Node2Vec 特征。固定基础特征为: - post95 LightGCN stacking 特征 - explicit graph handcrafted features - content mean-cos / top-k content similarity - BPR-MF score - LightGCN ensemble score/rank features 只新增或替换 random-walk embedding 特征。每个 embedding 版本为 author-paper pair 构造: ```text dot, cosine, hadamard_mean, absdiff_mean, l2_distance, dot/cos global rank, dot/cos author-wise rank, dot/cos author-wise percentile ``` 新增脚本: ```text code/randomwalk_systematic_ablation.py code/randomwalk_one_ablation.py code/generate_randomwalk_single_submission.py code/generate_randomwalk_ensemble_submission.py code/randomwalk_ensemble_ablation.py ``` 关键 validation 结果: | version | graph | method | dim | walk_length | p/q | validation F1 | threshold | AUC | |---|---|---:|---:|---:|---:|---:|---:|---:| | dw_base_d128_l40 | full | DeepWalk | 128 | 40 | - | 0.962734 | 0.513498 | 0.993767 | | dw_long_d128_l80 | full | DeepWalk | 128 | 80 | - | 0.963096 | 0.508277 | 0.993874 | | dw_highdim_d256_l40 | full | DeepWalk | 256 | 40 | - | 0.963328 | 0.500688 | 0.993841 | | dw_graph_ap_only | AP only | DeepWalk | 128 | 40 | - | 0.961057 | 0.487265 | 0.993165 | | dw_graph_ap_aa | AP+AA | DeepWalk | 128 | 40 | - | 0.960774 | 0.514391 | 0.993194 | | dw_graph_ap_pp | AP+PP | DeepWalk | 128 | 40 | - | 0.962939 | 0.455344 | 0.993774 | | n2v_p0.5_q1 | full | Node2Vec | 128 | 40 | 0.5/1 | 0.962042 | 0.462000 | 0.993666 | | n2v_p2_q1 | full | Node2Vec | 128 | 40 | 2/1 | 0.962576 | 0.494402 | 0.993727 | | 5-model rw ensemble | mixed | ensemble | mixed | mixed | mixed | 0.963932 | 0.500695 | 0.994246 | 结论: - 提高 DeepWalk 维度到 256 是当前最有效的单点改动,说明 random-walk embedding 容量仍有收益。 - walk_length 从 40 提到 80 也稳定提升,说明更长路径补充了 LightGCN / handcrafted features 没完全覆盖的结构关系。 - AP+PP 图优于 AP-only 和 AP+AA,论文引用边对 random-walk embedding 很关键。 - Node2Vec 单独不超过最强 DeepWalk,但 p=2,q=1 版本和 DeepWalk 有互补性。 - 5 模型 ensemble 把 full DeepWalk base/long/highdim、AP+PP DeepWalk、Node2Vec p2q1 合并后,本地 F1 达到 0.963932,是当前 validation 最强 random-walk 方案。 当前优先提交: ```text validation_runs/dynamic_seed202/randomwalk_ensemble_submission/submission_rwens_dw_basel40_dw_longl80_dw_highdim_d256_l40_dw_graph_ap_pp_n2v_p2_q1l40_r0.500.csv validation_runs/dynamic_seed202/randomwalk_ensemble_submission/submission_dw_highdim_d256_l40_w10_win10_r0.500.csv validation_runs/dynamic_seed202/randomwalk_ensemble_submission/submission_dw_long_d128_l80_w10_win10_r0.500.csv ``` 注意:这些版本优先使用 top-ratio 规则保持约 50% 正例比例。对应 score threshold 版本在 test 上正例比例漂到 52%-54%,暂不作为首选提交。 ## 16. Public feedback after larger random-walk ensembles 后续继续增加 random-walk 版本: | version | validation F1 | notes | |---|---:|---| | dw_d256_l80 | 0.963371 | dim=256 + walk_length=80,单模型略高于 highdim | | 7-model rw ensemble | 0.964921 | base/long/highdim/d256l80/seed3407/AP+PP/n2v_p2q1 | 但是 `7-model rw ensemble r0.500` public LB 反馈只有约 `0.96229`,低于已知较好的 `0.96252`。这说明 seed202 validation 对“更多 random-walk 模型堆叠”偏乐观,继续无约束加模型会过拟合当前动态 split。 因此策略调整为: - 不再把 validation F1 最高的大 ensemble 作为默认首选。 - 以 public 已验证较好的 `submission_content_mf_deepwalk_node2vec_lgb_th0.480000.csv` / 其 score rank 为锚点。 - 只用 10%-20% 权重混入 highdim、d256l80、ens5/ens7 rank,控制相对锚点的 prediction changes。 - 继续使用约 50% positive ratio,避免 score threshold 在 test 上漂到 52%-54%。 保守 blend 文件: ```text validation_runs/dynamic_seed202/randomwalk_conservative_blends/blend_anchor90_highdim10_r0.500.csv validation_runs/dynamic_seed202/randomwalk_conservative_blends/blend_anchor85_highdim15_r0.500.csv validation_runs/dynamic_seed202/randomwalk_conservative_blends/blend_anchor90_d256l80_10_r0.500.csv ``` 这些文件相对 public anchor 只改约 2700-4300 个预测,比 7-model ensemble 直接改约 31900 个预测保守很多,更适合下一轮提交窗口测试。 ## 17. High-order citation propagation breakthrough 在停止继续 random-walk 参数搜索之后,新的有效突破来自显式高阶图传播特征。这个方向不是再训练更多 DeepWalk / Node2Vec embedding,而是把学术推荐中可解释的 citation meta-path 直接作为 pair-level 特征加入二级 LightGBM。 新增脚本: ```text code/high_order_graph_stack.py code/rich_randomwalk_stack.py ``` ### 17.1 方法动机 DeepWalk / Node2Vec 提供的是随机游走意义下的结构接近度,能够捕捉全局图邻近性,但 embedding 会把具体路径类型压缩进向量里,模型无法直接区分信号来自作者历史论文、合作者历史论文、引用前向路径还是引用反向路径。 High-order citation propagation 的核心思想是显式计算: ```text author -> historical papers -> citation graph -> candidate paper ``` 也就是 meta-path: ```text A-P-P^k ``` 同时加入合作者版本: ```text A-A-P-P^k ``` 这类特征直接回答:候选论文是否处在作者本人或合作者历史论文的 citation neighborhood 中。 ### 17.2 数学形式 设: - `R` 为 author-paper 历史交互矩阵。 - `C` 为 paper-paper citation 邻接矩阵。 - `S` 为 author-author coauthor 邻接矩阵。 所有矩阵做 row normalization 后,作者自身的 k-hop citation propagation 为: ```text H_k = R_norm C_norm^k ``` 对 validation / test pair `(a, p)`,取: ```text H_k[a, p] ``` 作为特征。合作者传播为: ```text G_k = S_norm R_norm C_norm^k ``` 对 pair `(a, p)`,取: ```text G_k[a, p] ``` Directed 版本中,`C_norm` 进一步拆成三类: ```text C_forward_norm C_backward_norm C_undirected_norm ``` 因此模型能区分: - 作者历史论文引用过的方向。 - 引用作者历史论文或其邻域的方向。 - 不关心方向的 citation neighborhood 接近度。 为了降低热门论文天然容易被多条路径命中的偏置,每个传播分数还加入 popularity-normalized 版本: ```text propagation_score / log(1 + paper_degree + citation_degree) ``` ### 17.3 Validation 和 public 结果 在 `post95 + content/BPR-MF + rich content + 7 systematic random-walk blocks` 的基础上,加入 high-order propagation 后得到: | stage | validation F1 | threshold | AUC | notes | |---|---:|---:|---:|---| | `rich_rw7` | 0.964947 | 0.490447 | 0.994555 | rich content + 7 random-walk blocks | | `rich_rw7_highorder` | 0.966556 | 0.469339 | 0.994890 | 加入无向 citation high-order propagation | | `rich_rw7_highorder_directed` | 0.966874 | 0.461731 | 0.994918 | 加入 forward/backward/undirected directed propagation | 生成的主要提交: ```text validation_runs/dynamic_seed202/high_order_graph_stack/submissions/submission_rich_rw7_highorder_directed_r0.500000.csv ``` 提交反馈: | submission | decision rule | public LB | |---|---|---:| | `submission_content_mf_deepwalk_node2vec_lgb_th0.480000.csv` | score >= 0.480000 | 0.96252 | | `submission_rich_rw7_highorder_directed_r0.500000.csv` | rank top 50.0% | 0.96626 | 这是继“加入显式图结构 / content / BPR-MF stacking”和“加入 DeepWalk / Node2Vec random-walk embedding”之后的第三次实质突破。它说明 citation graph 中的显式高阶路径和 random-walk embedding 是互补的:random-walk embedding 提供全局结构接近度,high-order propagation 提供可解释的 typed meta-path 证据。 可以在正式报告中将该点表述为: ```text We introduce citation-aware high-order propagation features that explicitly model author-paper relevance through typed meta-paths such as A-P-P^k and A-A-P-P^k over directed and undirected citation graphs. These features complement neural graph embeddings by preserving interpretable path semantics and reducing popularity bias through degree-normalized propagation scores. ``` ## 18. Validation threshold vs test rank cutoff 这轮还暴露出一个重要现象:validation 上最优 probability threshold 不能直接迁移到 test,但 rank cutoff 更稳定。 `rich_rw7_highorder_directed` 在 validation 上的最优 threshold 是: ```text 0.461730808 ``` 用这个 threshold 直接切 test score,生成: ```text validation_runs/dynamic_seed202/high_order_graph_stack/submissions/submission_rich_rw7_highorder_directed_th0.461731.csv ``` 但是 test 正例比例漂到了: ```text 0.524195 ``` 相比之下,public 表现好的 `r0.500000` 使用的是 rank cutoff: ```text 按 test score 排序,取 top 50% 为 1,再强制 known positives 为 1。 ``` 该版本正例比例为: ```text 0.500000 ``` 阈值版本和 ratio 版本的对比如下: | rule | test positive ratio | changed vs previous anchor | |---|---:|---:| | `th0.461731` | 0.524195 | 55,638 | | `th0.480000` | 0.522134 | 52,513 | | `th0.500000` | 0.519917 | 49,277 | | `r0.500000` | 0.500000 | 34,863 | 这个现象说明二级模型的输出更适合作为排序分数,而不是跨 split 稳定校准的概率。 主要原因: - 当前 validation 是人工 1:1 构造:从 train edges 抽 10% 作为 positives,再随机采同数量 negatives。这个分布和 Kaggle test candidate 分布不完全一致。 - LightGBM / XGBoost 的 `predict_proba` 并不是经过校准的真实概率,同一个 score threshold 在 validation 和 test 上可能对应不同的正例比例。 - test 中存在大量 train/test overlap known positives,后处理会强制这些 pair 为 1。固定 threshold 更容易被该后处理推高整体正例比例。 - F1 对预测正例比例非常敏感。之前多轮 public feedback 表明稳定区间大致在 `0.498 - 0.502`,而 validation-best threshold 在 test 上会推到约 `0.524`,很可能引入大量 false positives。 因此,当前更稳的提交策略是: ```text 模型负责学习排序; test 阶段使用 rank-based cutoff 控制正例比例; 不要直接迁移 validation probability threshold。 ``` 可以将这一点总结为: ```text The second-stage model is a strong ranker but a poorly calibrated probability estimator under validation-test distribution shift. Rank-based cutoff is therefore more robust than transferring the validation-optimal probability threshold to the test set. ```