一句话:提出 LiCoEval 基准,评估 LLM 生成代码的许可证合规能力,发现多数模型无法准确给出许可信息。
该论文关注 LLM 代码生成中一个尚未充分探索的问题:模型可能生成与受版权保护的开源代码高度相似的代码,却未提供正确的许可证或版权信息,从而引发知识产权风险。作者首先通过实证研究确定“显著相似”的合理判定标准,以排除独立创作的可能性,并据此构建基准 LiCoEval,用于评估 LLM 在生成与已有版权代码显著相似的代码时,能否给出准确的许可证或版权信息。作者使用 LiCoEval 评估了 14 个流行 LLM,发现即使表现最好的模型也会生成一定比例(0.88% 至 2.01%)与现有开源实现显著相似的代码,且大多数模型无法提供准确的许可证信息,对 copyleft 许可证尤其如此。研究强调需提升 LLM 在代码生成任务中的合规能力,为后续研究与工具开发奠定基础。
Recent advances in Large Language Models (LLMs) have revolutionized code generation, leading to widespread adoption of AI coding tools by developers. However, LLMs can generate license-protected code without providing the necessary license information, leading to potential intellectual property violations during software production. This paper addresses the critical, yet underexplored, issue of license compliance in LLM-generated code by establishing a benchmark to evaluate the ability of LLMs to provide accurate license information for their generated code. To establish this benchmark, we conduct an empirical study to identify a reasonable standard for “striking similarity” that excludes the possibility of independent creation, indicating a copy relationship between the LLM output and certain opensource code. Based on this standard, we propose LiCoEval, to evaluate the license compliance capabilities of LLMs, i.e., the ability to provide accurate license or copyright information when they generate code with striking similarity to already existing copyrighted code. Using LiCoEval, we evaluate 14 popular LLMs, finding that even top-performing LLMs produce a non-negligible proportion (0.88 % to 2.01 %) of code strikingly similar to existing open-source implementations. Notably, most LLMs fail to provide accurate license information, particularly for code under copyleft licenses. These findings underscore the urgent need to enhance LLM compliance capabilities in code generation tasks. Our study provides a foundation for future research and development to improve license compliance in AIassisted software development, contributing to both the protection of open-source software copyrights and the mitigation of legal risks for LLM users.
DOI 原文 ·
@inproceedings{paperbot8856,
title = {Licoeval: Evaluating LLMs on License Compliance in Code Generation},
author = {Weiwei Xu and Kai Gao and Hao He and Minghui Zhou},
booktitle = {ICSE},
year = {2025},
doi = {10.1109/icse55347.2025.00052}
}