{"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/towards-code-watermarking-with-dual-channel","title":"Towards Code Watermarking with Dual-Channel Transformations","arxiv_id":"2309.00860","date":"2023-09-02","proceeding":null,"authors":["Borui Yang","Wei Li","Liyao Xiang","Bo Li"],"abstract":"The expansion of the open source community and the rise of large language models have raised ethical and security concerns on the distribution of source code, such as misconduct on copyrighted code, distributions without proper licenses, or misuse of the code for malicious purposes. Hence it is important to track the ownership of source code, in which watermarking is a major technique. Yet, drastically different from natural languages, source code watermarking requires far stricter and more complicated rules to ensure the readability as well as the functionality of the source code. Hence we introduce SrcMarker, a watermarking system to unobtrusively encode ID bitstrings into source code, without affecting the usage and semantics of the code. To this end, SrcMarker performs transformations on an AST-based intermediate representation that enables unified transformations across different programming languages. The core of the system utilizes learning-based embedding and extraction modules to select rule-based transformations for watermarking. In addition, a novel feature-approximation technique is designed to tackle the inherent non-differentiability of rule selection, thus seamlessly integrating the rule-based transformations and learning-based networks into an interconnected system to enable end-to-end training. Extensive experiments demonstrate the superiority of SrcMarker over existing methods in various watermarking requirements.","url_abs":"https://arxiv.org/abs/2309.00860v2","url_pdf":"https://arxiv.org/pdf/2309.00860v2.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":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"towards-code-watermarking-with-dual-channel","repo_url":"https://github.com/ybrua/srcmarker","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2309.00860","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2309.00860"}},"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/ybrua/srcmarker","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"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":"ee286a0244788a4d","entry":"compare_tokens","repo":"ybrua/srcmarker","repo_kind":"official","path":"dataset_filter.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/dataset_filter.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":"ee286a0244788a4d"}},{"code_sha256_prefix":"d01e3bad784f5a12","entry":"compose_function","repo":"ybrua/srcmarker","repo_kind":"official","path":"benchmark_mbxp.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/benchmark_mbxp.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":"d01e3bad784f5a12"}},{"code_sha256_prefix":"cc058164d4cea87f","entry":"fix_single_quotes","repo":"ybrua/srcmarker","repo_kind":"official","path":"code_tokenizer.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/code_tokenizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cc058164d4cea87f"}},{"code_sha256_prefix":"7e883314e36cf0ee","entry":"join_lines_default","repo":"ybrua/srcmarker","repo_kind":"official","path":"dewatermark_attack.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/dewatermark_attack.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":"7e883314e36cf0ee"}},{"code_sha256_prefix":"fe333998b485d649","entry":"join_lines_java_heuristic","repo":"ybrua/srcmarker","repo_kind":"official","path":"dewatermark_attack.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/dewatermark_attack.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":"fe333998b485d649"}},{"code_sha256_prefix":"837bc3a2b30ca8af","entry":"load_samples_with_sol","repo":"ybrua/srcmarker","repo_kind":"official","path":"benchmark_mbxp.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/benchmark_mbxp.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":"837bc3a2b30ca8af"}},{"code_sha256_prefix":"34ea0d851b876d27","entry":"pprint_res_dict","repo":"ybrua/srcmarker","repo_kind":"official","path":"dewatermark_gru.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/dewatermark_gru.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":"34ea0d851b876d27"}},{"code_sha256_prefix":"1d1817089d7c3465","entry":"fix_join_artifacts","repo":"ybrua/srcmarker","repo_kind":"official","path":"code_tokenizer.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/code_tokenizer.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":"1d1817089d7c3465"}},{"code_sha256_prefix":"c3e24749c04318fb","entry":"remove_comments","repo":"ybrua/srcmarker","repo_kind":"official","path":"dataset_filter.py","file_url":"https://github.com/ybrua/srcmarker/blob/HEAD/dataset_filter.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":"c3e24749c04318fb"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}