MATRIX: Multi-Layer Code Watermarking via Dual-Channel Constrained Parity-Check Encoding

๐Ÿ“… 2026-04-17
๐Ÿ“ˆ Citations: 0
โœจ Influential: 0
๐Ÿ“„ PDF

career value

202K/year
๐Ÿค– AI Summary
This work addresses key limitations in existing code watermarking techniquesโ€”namely, insufficient detectability, poor interpretability, inadequate functional preservation, and limited support for multi-level provenance tracing. To overcome these challenges, the authors propose a multi-layer watermarking framework based on constrained parity-check matrices, which embeds watermarks through a dual-channel mechanism combining variable renaming and semantics-preserving transformations. The framework further integrates BCH error-correcting codes to enhance robustness. Evaluated on Python code, the method achieves a detection accuracy of 99.20%, with negligible functional degradation (0โ€“0.14%), improved resilience against attacks (7.70โ€“26.67% gain), and 2โ€“6ร— greater applicability across diverse scenarios, effectively enabling multi-level ownership attribution and version tracking.

Technology Category

Application Category

๐Ÿ“ Abstract
Code Large Language Models (Code LLMs) have revolutionized software development but raised critical concerns regarding code provenance, copyright protection, and security. Existing code watermarking approaches suffer from two fundamental limitations: black-box methods either exhibit detectable syntactic patterns vulnerable to statistical analysis or rely on implicit neural embedding behaviors that weaken interpretability, auditability, and precise control, while white-box methods lack code-aware capabilities that may compromise functionality. Moreover, current single-layer watermarking schemes fail to address increasingly complex provenance requirements such as multi-level attribution and version tracking. We present MATRIX, a novel code watermarking framework that formulates watermark encoding as solving constrained parity-check matrix equations. MATRIX employs dual-channel watermarking through variable naming and semantic-preserving transformations, enhancing watermark coverage across a wider range of code while ensuring mutual backup for robustness. By integrating BCH error-correction codes with solution space diversity, our approach achieves robustness against statistical analysis. Extensive evaluation on Python code generated by multiple Code LLMs demonstrates that MATRIX achieves an average watermark detection accuracy of 99.20% with minimal functionality loss (0-0.14%), improves robustness by 7.70-26.67% against various attacks, and increases watermarking applicability by 2-6x compared with existing methods. These results establish MATRIX as an effective solution for complex code provenance scenarios while balancing among detectability, fidelity, and robustness.
Problem

Research questions and friction points this paper is trying to address.

code watermarking
code provenance
copyright protection
large language models
robustness
Innovation

Methods, ideas, or system contributions that make the work stand out.

dual-channel watermarking
constrained parity-check encoding
BCH error-correction codes
code provenance
semantic-preserving transformation
๐Ÿ”Ž Similar Papers
No similar papers found.