Abstract
While large language models (LLMs) efficiently generate code, they also introduce potential risks regarding copyright attribution and code misuse. To address this, LLM-watermarking techniques have emerged to trace code provenance. However, when applied to code, a unique medium, their effectiveness and robustness face severe challenges. Existing abstract syntax tree (AST)-based attack strategies for evaluating code watermark robustness suffer from inefficiencies and instability. To overcome this, this paper proposes DeMark, a novel compilation-decompilation-based watermark removal method. This method first compiles watermarked code into a low-level binary representation, leveraging compiler optimizations to eliminate watermark traces. Subsequently, using an innovative automated function call graph construction algorithm, it decompiles the optimized binary code back into high-level language code that preserves core functionality and readability, thereby efficiently removing the watermark. Experimental results demonstrate that DeMark exhibits significant effectiveness and superior adaptability in attacking existing watermarking methods, particularly when dealing with watermarks involving complex semantic-preserving transformations. Furthermore, this study pioneers a systematic evaluation of the robustness of watermarks in compiled languages like C++ under code refactoring and cross-language conversion scenarios. It reveals the inherent weaknesses of current text-based watermarking algorithms when applied to code generation and offers valuable insights for designing more robust code provenance mechanisms in the future.
Author supplied keywords
Cite
CITATION STYLE
Huang, H., Zhou, R., Luo, J., Ma, X., Li, Y., & Liu, Y. (2025). From compile to decompile: efficient watermark removal via source-to-source transformations. Scientia Sinica Informationis, 55(11), 2886–2901. https://doi.org/10.1360/SSI-2025-0255
Register to see more suggestions
Mendeley helps you to discover research relevant for your work.