{"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/evaluating-modules-in-graph-contrastive","title":"Evaluating Modules in Graph Contrastive Learning","arxiv_id":"2106.08171","date":"2021-06-15","proceeding":null,"authors":["Ganqu Cui","Yufeng Du","Cheng Yang","Jie zhou","Liang Xu","Xing Zhou","Xingyi Cheng","Zhiyuan Liu"],"abstract":"The recent emergence of contrastive learning approaches facilitates the application on graph representation learning (GRL), introducing graph contrastive learning (GCL) into the literature. These methods contrast semantically similar and dissimilar sample pairs to encode the semantics into node or graph embeddings. However, most existing works only performed \\textbf{model-level} evaluation, and did not explore the combination space of modules for more comprehensive and systematic studies. For effective \\textbf{module-level} evaluation, we propose a framework that decomposes GCL models into four modules: (1) a \\textbf{sampler} to generate anchor, positive and negative data samples (nodes or graphs); (2) an \\textbf{encoder} and a \\textbf{readout} function to get sample embeddings; (3) a \\textbf{discriminator} to score each sample pair (anchor-positive and anchor-negative); and (4) an \\textbf{estimator} to define the loss function. Based on this framework, we conduct controlled experiments over a wide range of architectural designs and hyperparameter settings on node and graph classification tasks. Specifically, we manage to quantify the impact of a single module, investigate the interaction between modules, and compare the overall performance with current model architectures. Our key findings include a set of module-level guidelines for GCL, e.g., simple samplers from LINE and DeepWalk are strong and robust; an MLP encoder associated with Sum readout could achieve competitive performance on graph classification. Finally, we release our implementations and results as OpenGCL, a modularized toolkit that allows convenient reproduction, standard model and module evaluation, and easy extension. OpenGCL is available at \\url{https://github.com/thunlp/OpenGCL}.","url_abs":"https://arxiv.org/abs/2106.08171v2","url_pdf":"https://arxiv.org/pdf/2106.08171v2.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":"evaluating-modules-in-graph-contrastive","repo_url":"https://github.com/thunlp/opengcl","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"},{"task_slug":"graph-classification","task_name":"Graph Classification"},{"task_slug":"graph-representation-learning","task_name":"Graph Representation Learning"},{"task_slug":"representation-learning","task_name":"Representation Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"},{"method_slug":"deepwalk","method_name":"DeepWalk"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2106.08171","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2106.08171"}},"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/thunlp/opengcl","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":1},"by_repo_kind":{"official":{"samples":1,"ran":0,"repositories":1}},"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":0,"samples":[{"code_sha256_prefix":"8168a1e07d2c4a1f","entry":"sample_mask","repo":"thunlp/opengcl","repo_kind":"official","path":"src/opengcl/datasets/planetoid_dataset.py","file_url":"https://github.com/thunlp/opengcl/blob/HEAD/src/opengcl/datasets/planetoid_dataset.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":"8168a1e07d2c4a1f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}