{"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/self-supervised-bug-detection-and-repair","title":"Self-Supervised Bug Detection and Repair","arxiv_id":"2105.12787","date":"2021-05-26","proceeding":"NeurIPS 2021 12","authors":["Miltiadis Allamanis","Henry Jackson-Flux","Marc Brockschmidt"],"abstract":"Machine learning-based program analyses have recently shown the promise of integrating formal and probabilistic reasoning towards aiding software development. However, in the absence of large annotated corpora, training these analyses is challenging. Towards addressing this, we present BugLab, an approach for self-supervised learning of bug detection and repair. BugLab co-trains two models: (1) a detector model that learns to detect and repair bugs in code, (2) a selector model that learns to create buggy code for the detector to use as training data. A Python implementation of BugLab improves by up to 30% upon baseline methods on a test dataset of 2374 real-life bugs and finds 19 previously unknown bugs in open-source software.","url_abs":"https://arxiv.org/abs/2105.12787v3","url_pdf":"https://arxiv.org/pdf/2105.12787v3.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":"self-supervised-bug-detection-and-repair","repo_url":"https://github.com/microsoft/neurips21-self-supervised-bug-detection-and-repair","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"methods":[{"method_slug":"repair","method_name":"Repair"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2105.12787","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2105.12787"}},"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/neurips21-self-supervised-bug-detection-and-repair","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"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":"f385e4bf8deef9c1","entry":"buggy_sample_weight_schedule","repo":"microsoft/neurips21-self-supervised-bug-detection-and-repair","repo_kind":"official","path":"buglab/models/modelregistry.py","file_url":"https://github.com/microsoft/neurips21-self-supervised-bug-detection-and-repair/blob/HEAD/buglab/models/modelregistry.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":"f385e4bf8deef9c1"}},{"code_sha256_prefix":"5a5d42ea7fa2b1b1","entry":"const_schedule","repo":"microsoft/neurips21-self-supervised-bug-detection-and-repair","repo_kind":"official","path":"buglab/models/modelregistry.py","file_url":"https://github.com/microsoft/neurips21-self-supervised-bug-detection-and-repair/blob/HEAD/buglab/models/modelregistry.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":"5a5d42ea7fa2b1b1"}},{"code_sha256_prefix":"09c42a9541eed9de","entry":"linear_warmdown","repo":"microsoft/neurips21-self-supervised-bug-detection-and-repair","repo_kind":"official","path":"buglab/models/modelregistry.py","file_url":"https://github.com/microsoft/neurips21-self-supervised-bug-detection-and-repair/blob/HEAD/buglab/models/modelregistry.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":"09c42a9541eed9de"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}