AegisCodeGen: Toward Copyright-Aware Code Generation with Runnability-Guided Fusion

Rui Chu, Nicole Meng, Tanusree Das Tithy, Thomas Cao, Faysal Hossain Shezan, Yingjie Lao


Abstract
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.
Anthology ID:
2026.emnlp-main.2521
Volume:
Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
EMNLP
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
57326–57337
Language:
URL:
https://aclanthology.org/2026.emnlp-main.2521/
DOI:
Bibkey:
Cite (ACL):
Rui Chu, Nicole Meng, Tanusree Das Tithy, Thomas Cao, Faysal Hossain Shezan, and Yingjie Lao. 2026. AegisCodeGen: Toward Copyright-Aware Code Generation with Runnability-Guided Fusion. In Proceedings of the 2026 Conference on Empirical Methods in Natural Language Processing, pages 57326–57337, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
AegisCodeGen: Toward Copyright-Aware Code Generation with Runnability-Guided Fusion (Chu et al., EMNLP 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.emnlp-main.2521.pdf