Lune

ACL Findings2026

Duplicate-Aware Controlled Code Generation: Enhancing Copyright Protection with Targeted Reordering Beam Search in LLMs

Junbo Fu, Guoshuai Zhao, Linkang Yang, Yunqi Mi, Xueming Qian

摘要

The increasing integration of large language models (LLMs) in code generation has raised critical copyright concerns, particularly regarding the verbatim repetition of copyrighted code. To address this challenge, we propose a novel task: Duplicate-Aware Controlled Code Generation (DACCG), which aims to mitigate verbatim repetition while preserving the quality of generated code. To this end, we introduce Targeted Reordering Beam Search (TRBS), a plug-and-play decoding method that dynamically reorders beam candidates to reduce direct copying. TRBS leverages the FM-index for efficient substring detection and employs a spikeentropy-based protection mechanism to safeguard structural anchors critical to code coherence. Experimental results on a multi-language code generation benchmark demonstrate that TRBS effectively reduces verbatim repetition while maintaining functional adequacy. Our research represents a pioneering effort in code copyright protection from the model user's perspective, offering novel insights into responsible code generation practices 1 .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

可以从这些问题问起

Lune 可以查阅

全文 · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllability 引用了 Controlled Text Generation with Natural Language Instructions
  • COLD-Attack: Jailbreaking LLMs with Stealthiness and Controllability 引用了 Controlled Decoding from Language Models
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

它引用的 Paper16

  1. LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu 等ICLR 2022 · 18,833 次引用
  2. AutoPrompt: Eliciting Knowledge from Language Models with Automatically Generated PromptsTaylor Shin, Yasaman Razeghi, Robert L. Logan IV, Eric Wallace 等EMNLP 2020 · 1,162 次引用
  3. COLD-Attack: Jailbreaking LLMs with Stealthiness and ControllabilityXingang Guo, Fangxu Yu, Huan Zhang, Lianhui Qin 等ICML 2024 · 173 次引用
  4. Controlled Decoding from Language ModelsSidharth Mudgal, Jong Lee, Harish Ganapathy, YaGuang Li 等ICML 2024 · 130 次引用
  5. Controlled Text Generation with Natural Language InstructionsWangchunshu Zhou, Yuchen Eleanor Jiang, Ethan Wilcox, Ryan Cotterell 等ICML 2023 · 121 次引用

相关 Paper

  1. Rethinking Repetition Problems of LLMs in Code GenerationYihong Dong, Yuchen Liu, Xue Jiang, Bin Gu 等ACL 2025
  2. CodeGenGuard: A Watermark for Code Generation ModelsBorui Yang, Mingxuan Ma, Liyao Xiang, Nan Chen 等ICLR 2026
  3. Anchored Decoding: Provably Reducing Copyright Risk for Any Language ModelJacqueline He, Jonathan Hayase, Scott Yih, Sewoong Oh 等ICML 2026
  4. DuCodeMark: Dual-Purpose Code Dataset Watermarking via Style-Aware Watermark-Poison DesignYuchen Chen, Yuan Xiao, Chunrong Fang, Zhenyu Chen 等FSE 2026
  5. Practical and Effective Code Watermarking for Large Language ModelsZhimeng Guo, Minhao ChengNeurIPS 2025 · 1 次引用
黄昏的海面,两侧是细线勾勒的悬崖