{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/pre-training-graph-neural-networks","title":"Strategies for Pre-training Graph Neural Networks","arxiv_id":"1905.12265","date":"2019-05-29","proceeding":"ICLR 2020 1","authors":["Weihua Hu","Bowen Liu","Joseph Gomes","Marinka Zitnik","Percy Liang","Vijay Pande","Jure Leskovec"],"abstract":"Many applications of machine learning require a model to make accurate pre-dictions on test examples that are distributionally different from training ones, while task-specific labels are scarce during training. An effective approach to this challenge is to pre-train a model on related tasks where data is abundant, and then fine-tune it on a downstream task of interest. While pre-training has been effective in many language and vision domains, it remains an open question how to effectively use pre-training on graph datasets. In this paper, we develop a new strategy and self-supervised methods for pre-training Graph Neural Networks (GNNs). The key to the success of our strategy is to pre-train an expressive GNN at the level of individual nodes as well as entire graphs so that the GNN can learn useful local and global representations simultaneously. We systematically study pre-training on multiple graph classification datasets. We find that naive strategies, which pre-train GNNs at the level of either entire graphs or individual nodes, give limited improvement and can even lead to negative transfer on many downstream tasks. In contrast, our strategy avoids negative transfer and improves generalization significantly across downstream tasks, leading up to 9.4% absolute improvements in ROC-AUC over non-pre-trained models and achieving state-of-the-art performance for molecular property prediction and protein function prediction.","url_abs":"https://arxiv.org/abs/1905.12265v3","url_pdf":"https://arxiv.org/pdf/1905.12265v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/snap-stanford/pretrain-gnns/","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/Wenlin-Chen/ADKF-IFT","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/fransou/is-meta-learning-necessary","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/gnn4dr/DRKG","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/hld67890/prml2020_pj","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/jacquesboitreaud/DeepFRED","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/jacquesboitreaud/rna_ne","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/maplightrx/maplight-tdc","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/microsoft/fs-mol","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/snap-stanford/pretrain-gnns","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"pre-training-graph-neural-networks","repo_url":"https://github.com/leffff/any-domain-pretrain-gnns","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"molecular-property-prediction","task_name":"Molecular Property Prediction"},{"task_slug":"open-question","task_name":"Open-Ended Question Answering"},{"task_slug":"property-prediction","task_name":"Property Prediction"},{"task_slug":"protein-function-prediction","task_name":"Protein Function Prediction"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/drug-discovery-on-bace","task":"Drug Discovery","dataset":"BACE","model":"ContextPred","rank_in_archive_order":5,"of":6,"metrics":{"AUC":"0.845"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-bbbp","task":"Drug Discovery","dataset":"BBBP","model":"ContextPred","rank_in_archive_order":4,"of":4,"metrics":{"AUC":"0.687"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-hiv-dataset","task":"Drug Discovery","dataset":"HIV dataset","model":"ContextPred","rank_in_archive_order":4,"of":5,"metrics":{"AUC":"0.799"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-muv","task":"Drug Discovery","dataset":"MUV","model":"ContextPred","rank_in_archive_order":4,"of":5,"metrics":{"AUC":"0.813"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-sider","task":"Drug Discovery","dataset":"SIDER","model":"ContextPred","rank_in_archive_order":4,"of":4,"metrics":{"AUC":"0.627"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-tox21","task":"Drug Discovery","dataset":"Tox21","model":"ContextPred","rank_in_archive_order":9,"of":11,"metrics":{"AUC":"0.781"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-toxcast","task":"Drug Discovery","dataset":"ToxCast","model":"ContextPred","rank_in_archive_order":5,"of":5,"metrics":{"AUC":"0.657"},"uses_additional_data":false},{"leaderboard":"/sota/drug-discovery-on-clintox","task":"Drug Discovery","dataset":"clintox","model":"ContextPred","rank_in_archive_order":4,"of":4,"metrics":{"AUC":"0.726"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-bace-1","task":"Molecular Property Prediction","dataset":"BACE","model":"PretrainGNN","rank_in_archive_order":5,"of":20,"metrics":{"ROC-AUC":"84.5"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-bbbp-1","task":"Molecular Property Prediction","dataset":"BBBP","model":"PretrainGNN","rank_in_archive_order":24,"of":29,"metrics":{"ROC-AUC":"68.7"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-freesolv","task":"Molecular Property Prediction","dataset":"FreeSolv","model":"PretrainGNN","rank_in_archive_order":21,"of":22,"metrics":{"RMSE":"2.764"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on","task":"Molecular Property Prediction","dataset":"Lipophilicity","model":"PretrainGNN","rank_in_archive_order":6,"of":13,"metrics":{"RMSE":"0.739"},"uses_additional_data":true},{"leaderboard":"/sota/molecular-property-prediction-on-qm7","task":"Molecular Property Prediction","dataset":"QM7","model":"PretrainGNN","rank_in_archive_order":8,"of":8,"metrics":{"MAE":"113.2"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm8","task":"Molecular Property Prediction","dataset":"QM8","model":"PretrainGNN","rank_in_archive_order":4,"of":8,"metrics":{"MAE":"0.0200"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-qm9","task":"Molecular Property Prediction","dataset":"QM9","model":"PretrainGNN","rank_in_archive_order":4,"of":8,"metrics":{"MAE":"0.00922"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-sider-1","task":"Molecular Property Prediction","dataset":"SIDER","model":"PretrainGNN","rank_in_archive_order":14,"of":19,"metrics":{"ROC-AUC":"62.7"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-tox21-1","task":"Molecular Property Prediction","dataset":"Tox21","model":"PretrainGNN","rank_in_archive_order":8,"of":20,"metrics":{"ROC-AUC":"78.1"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-toxcast-1","task":"Molecular Property Prediction","dataset":"ToxCast","model":"PretrainGNN","rank_in_archive_order":5,"of":8,"metrics":{"ROC-AUC":"65.7"},"uses_additional_data":false},{"leaderboard":"/sota/molecular-property-prediction-on-clintox-1","task":"Molecular Property Prediction","dataset":"clintox","model":"PretrainGNN","rank_in_archive_order":17,"of":20,"metrics":{"ROC-AUC":"72.6"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1905.12265","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1905.12265"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/microsoft/fs-mol","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jacquesboitreaud/rna_ne","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/snap-stanford/pretrain-gnns/","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leffff/any-domain-pretrain-gnns","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hld67890/prml2020_pj","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/maplightrx/maplight-tdc","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Wenlin-Chen/ADKF-IFT","reach":{"status":"ok","spdx":"NOASSERTION"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/jacquesboitreaud/DeepFRED","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/fransou/is-meta-learning-necessary","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/gnn4dr/DRKG","reach":{"status":"ok","spdx":"Apache-2.0"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/snap-stanford/pretrain-gnns","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":3,"ran_honours":3,"ran_draft_wrong":4,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"repositories":1},"listed":{"samples":6,"ran":6,"repositories":2}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":2,"samples":[{"code_sha256_prefix":"bbcb70f28827b5eb","entry":"ExtractSubstructureContextPair","repo":"leffff/any-domain-pretrain-gnns","repo_kind":"listed","path":"modules/util.py","file_url":"https://github.com/leffff/any-domain-pretrain-gnns/blob/HEAD/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bbcb70f28827b5eb"}},{"code_sha256_prefix":"1d31c46fec1fe3d1","entry":"compute_accuracy","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/pretrain_masking.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/pretrain_masking.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1d31c46fec1fe3d1"}},{"code_sha256_prefix":"b822dd00427403bf","entry":"cycle_index","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/pretrain_contextpred.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/pretrain_contextpred.py","link_basis":"plan_row","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b822dd00427403bf"}},{"code_sha256_prefix":"222d4809f4d05157","entry":"draw_rec","repo":"jacquesboitreaud/DeepFRED","repo_kind":"listed","path":"model.py","file_url":"https://github.com/jacquesboitreaud/DeepFRED/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"222d4809f4d05157"}},{"code_sha256_prefix":"17ef9103436a92bf","entry":"eval","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/finetune.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/finetune.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"17ef9103436a92bf"}},{"code_sha256_prefix":"287484b87212f47d","entry":"graph_data_obj_to_nx_simple","repo":"leffff/any-domain-pretrain-gnns","repo_kind":"listed","path":"modules/util.py","file_url":"https://github.com/leffff/any-domain-pretrain-gnns/blob/HEAD/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"287484b87212f47d"}},{"code_sha256_prefix":"1aa34efbfaf5d9ec","entry":"nx_to_graph_data_obj_simple","repo":"leffff/any-domain-pretrain-gnns","repo_kind":"listed","path":"modules/util.py","file_url":"https://github.com/leffff/any-domain-pretrain-gnns/blob/HEAD/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1aa34efbfaf5d9ec"}},{"code_sha256_prefix":"7164f5ee51907055","entry":"pool_func","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/pretrain_contextpred.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/pretrain_contextpred.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7164f5ee51907055"}},{"code_sha256_prefix":"3ea05514e649e301","entry":"pretrainLoss","repo":"jacquesboitreaud/DeepFRED","repo_kind":"listed","path":"model.py","file_url":"https://github.com/jacquesboitreaud/DeepFRED/blob/HEAD/model.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3ea05514e649e301"}},{"code_sha256_prefix":"6203c137185fa051","entry":"reset_idxes","repo":"leffff/any-domain-pretrain-gnns","repo_kind":"listed","path":"modules/util.py","file_url":"https://github.com/leffff/any-domain-pretrain-gnns/blob/HEAD/modules/util.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6203c137185fa051"}},{"code_sha256_prefix":"9e5655ddc71338f6","entry":"eval","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"chem/pretrain_supervised.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/chem/pretrain_supervised.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9e5655ddc71338f6"}},{"code_sha256_prefix":"4a6a649883d9c960","entry":"train","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/pretrain_contextpred.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/pretrain_contextpred.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4a6a649883d9c960"}},{"code_sha256_prefix":"72b72fdcfbe3d398","entry":"train","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/pretrain_deepgraphinfomax.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/pretrain_deepgraphinfomax.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"72b72fdcfbe3d398"}},{"code_sha256_prefix":"b59818bdda2f75f5","entry":"train","repo":"snap-stanford/pretrain-gnns","repo_kind":"official","path":"bio/pretrain_edgepred.py","file_url":"https://github.com/snap-stanford/pretrain-gnns/blob/HEAD/bio/pretrain_edgepred.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b59818bdda2f75f5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}