{"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/augment-with-care-contrastive-learning-for","title":"Augment with Care: Contrastive Learning for Combinatorial Problems","arxiv_id":"2202.08396","date":"2022-02-17","proceeding":null,"authors":["Haonan Duan","Pashootan Vaezipoor","Max B. Paulus","Yangjun Ruan","Chris J. Maddison"],"abstract":"Supervised learning can improve the design of state-of-the-art solvers for combinatorial problems, but labelling large numbers of combinatorial instances is often impractical due to exponential worst-case complexity. Inspired by the recent success of contrastive pre-training for images, we conduct a scientific study of the effect of augmentation design on contrastive pre-training for the Boolean satisfiability problem. While typical graph contrastive pre-training uses label-agnostic augmentations, our key insight is that many combinatorial problems have well-studied invariances, which allow for the design of label-preserving augmentations. We find that label-preserving augmentations are critical for the success of contrastive pre-training. We show that our representations are able to achieve comparable test accuracy to fully-supervised learning while using only 1% of the labels. We also demonstrate that our representations are more transferable to larger problems from unseen domains. Our code is available at https://github.com/h4duan/contrastive-sat.","url_abs":"https://arxiv.org/abs/2202.08396v2","url_pdf":"https://arxiv.org/pdf/2202.08396v2.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":"augment-with-care-contrastive-learning-for","repo_url":"https://github.com/h4duan/contrastive-sat","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2202.08396","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2202.08396"}},"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/h4duan/contrastive-sat","reach":null}],"summary":{"ran_honours":3},"by_repo_kind":{"official":{"samples":3,"ran":3,"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":3,"samples":[{"code_sha256_prefix":"108cf35f7d4bf004","entry":"generate_k_iclause","repo":"h4duan/contrastive-sat","repo_kind":"official","path":"src/augmentation.py","file_url":"https://github.com/h4duan/contrastive-sat/blob/HEAD/src/augmentation.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"108cf35f7d4bf004"}},{"code_sha256_prefix":"166ed374d5a6df75","entry":"get_num_literal","repo":"h4duan/contrastive-sat","repo_kind":"official","path":"src/augmentation.py","file_url":"https://github.com/h4duan/contrastive-sat/blob/HEAD/src/augmentation.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"166ed374d5a6df75"}},{"code_sha256_prefix":"fe7a82700050aba5","entry":"remove_space","repo":"h4duan/contrastive-sat","repo_kind":"official","path":"src/augmentation.py","file_url":"https://github.com/h4duan/contrastive-sat/blob/HEAD/src/augmentation.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"fe7a82700050aba5"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}