ACL2026

Train in Vain: Functionality-Preserving Poisoning to Prevent Unauthorized Use of Code Datasets

Yuan Xiao, Jiaming Wang, Yuchen Chen, Wei Song, Jun Sun, Shiqing Ma, Yanzhou Mu, Juan Zhai, Chunrong Fang, Jin Song Dong, Zhenyu Chen

Abstract

The widespread availability of large-scale code datasets has accelerated the development of code large language models (CodeLLMs), raising concerns about unauthorized dataset usage. Dataset poisoning offers a proactive defense by reducing the utility of such unauthorized training. However, existing poisoning methods often require full-dataset poisoning and introduce transformations that break code compilability. In this paper, we introduce FUNPOISON, a functionality-preserving poisoning approach that injects short, compilable weak-use fragments into executed code paths. FUNPOISON leverages reusable statement-level templates with automatic repair and conservative safety checking to ensure side-effect freedom, while a type-aware synthesis module preserves type correctness, suppresses static-analysis warnings, and improves stealth. Extensive experiments across multiple CodeLLMs and codegeneration benchmarks show that FUNPOISON achieves effective poisoning by contaminating only 10% of the dataset, while maintaining 100% compilability and functional correctness. FUNPOISON also remains robust against advanced code sanitization techniques, including detection, purification, rewriting, staticanalysis, and formatting defenses. * Equal contribution. Yuan Xiao led the overall project, defined the research problem, technical direction, and experimental agenda, carried out the key final implementation and method convergence, and took primary responsibility for paper writing, revision, and submission; Jiaming Wang contributed to early-stage exploration, implementation, evaluation runs, and dynamic analysis under Yuan Xiao's guidance; Yuchen Chen contributed substantially to experiment construction, robustness experiments, paper revision, and most rebuttal-stage experiments.