HackerPapers

arXiv:2408.02487cs.SE

LiCoEval: Evaluating LLMs on License Compliance in Code Generation

Weiwei Xu, Kai Gao, Hao He, Minghui Zhou

Abstract

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.

arXiv comments
The 47th International Conference on Software Engineering(ICSE 2025)
Journal reference
DOI
Subjects
cs.SESoftware Engineering cs.AIArtificial Intelligence cs.LGMachine Learning

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from Dec 2025 to Sep 2026.

Comments linking this paper, per year.

Discussed in comments2 threads

    • LLMs can output near-exact segments of copyrighted code used for training. https://arxiv.org/html/2408.02487v3 I wonder how would Microsoft react if someone would synthesize a code solution based on Windows source code. https://en.wikipedia.org/wiki/Shared_Source_Initiative

      leonidasrupView on HNParent context

    • This particular case appears to me to be a straight derivative at best but I'm by no means an expert on copyright laws. That's not to say there hasn't already been more direct cases with set examples [1], from an author directly who would have a better right to claim than I [2]…

      bilekasView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.