Faysal Hossain Shezan

Author directory

2026

Code large language model introduces copyright risks when models reproduce protected implementations from training data. Existing inference-time copyright-protection methods overlook the power of using the original LLM capability for a runnable code generation. In this paper, we propose AegisCodeGen (ACG), an inference-time copyright-aware controlled generation framework for code LLMs, effectively extending the text copyright protection towards the code generation domain. We argue that code copyright protection should be formulated as a region-aware generation control problem, where the model first identifies where modification is safe and then decides how strongly copyright-aware fusion should be applied. Based on this insight, ACG mainly consists of two stages. Firstly, ACG performs multiple sampling generations to construct an agreement profile over the target program, indicating which regions are more likely to affect core code logic after modification. Secondly, ACG uses this profile to adaptively control fusion strength, applying stronger copyright protection in low-agreement regions and weaker shifts near executable anchors. Through intense experiments, we demonstrate that ACG reduces protected-content reproduction while preserving runability and generation utility, providing a lightweight copyright-aware module that requires neither model retraining nor access to training data.