arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.02487cs.SEcs.AIcs.LG
收藏

LiCoEval:评估大型语言模型在代码生成中的许可证合规性

LiCoEval: Evaluating LLMs on License Compliance in Code Generation

School of Computer Science, Peking University(北京大学计算机学院);University of Science and Technology Beijing(北京科技大学);Carnegie Mellon University(卡内基梅隆大学)

Weiwei Xu, Kai Gao, Hao He, Minghui Zhou

AI总结:

本研究提出LiCoEval基准,通过实证确定“显著相似性”标准,评估14个LLM在代码生成中的许可证合规能力,发现多数模型在Copyleft代码上无法提供准确许可证信息,凸显增强合规能力的紧迫性。

摘要:

大型语言模型(LLM)的最新进展彻底改变了代码生成领域,使得开发者广泛采用AI编码工具。然而,LLM可能生成受许可证保护的代码而不提供必要的许可证信息,从而在软件生产过程中导致潜在的知识产权侵权。本文通过建立一个基准来评估LLM为其生成的代码提供准确许可证信息的能力,从而解决了LLM生成代码中许可证合规这一关键但尚未充分探索的问题。为建立该基准,我们进行了一项实证研究,以确定“显著相似性”的合理标准,该标准排除了独立创作的可能性,表明LLM输出与某些开源代码之间存在复制关系。基于该标准,我们提出了LiCoEval,用于评估LLM的许可证合规能力,即当它们生成与已有受版权保护代码具有显著相似性的代码时,提供准确许可证或版权信息的能力。使用LiCoEval,我们评估了14个流行的LLM,发现即使是表现最好的LLM也会产生不可忽视的比例(0.88%至2.01%)的代码与现有开源实现显著相似。值得注意的是,大多数LLM未能提供准确的许可证信息,尤其是对于在Copyleft许可证下的代码。这些发现强调了在代码生成任务中增强LLM合规能力的紧迫性。我们的研究为未来研究和开发提供了基础,以改善AI辅助软件开发中的许可证合规性,既有助于保护开源软件版权,也有助于降低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 open-source 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 AI-assisted software development, contributing to both the protection of open-source software copyrights and the mitigation of legal risks for LLM users.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑