AI assistants can help developers by recommending code to be included in their implementations (e.g., suggesting the implementation of a method from its signature). Although useful, these recommendations may mirror copyleft code available in public repositories, exposing developers to the risk of reusing code that they are allowed to reuse only under certain constraints (e.g., a specific license for the derivative software). This paper presents a large-scale study about the frequency and magnitude of this phenomenon in ChatGPT. In particular, we generate more than 70,000 method implementations using a range of configurations and prompts, revealing that a larger context increases the likelihood of reproducing copyleft code, but higher temperature settings can mitigate this issue.

Colombo, G., Mariani, L., Micucci, D., Riganelli, O. (2025). On the Possibility of Breaking Copyleft Licenses When Reusing Code Generated by ChatGPT. In 2025 IEEE/ACM 33rd International Conference on Program Comprehension (ICPC) (pp.500-511). IEEE Computer Society [10.1109/ICPC66645.2025.00060].

On the Possibility of Breaking Copyleft Licenses When Reusing Code Generated by ChatGPT

Mariani L.;Micucci D.;Riganelli O.
2025

Abstract

AI assistants can help developers by recommending code to be included in their implementations (e.g., suggesting the implementation of a method from its signature). Although useful, these recommendations may mirror copyleft code available in public repositories, exposing developers to the risk of reusing code that they are allowed to reuse only under certain constraints (e.g., a specific license for the derivative software). This paper presents a large-scale study about the frequency and magnitude of this phenomenon in ChatGPT. In particular, we generate more than 70,000 method implementations using a range of configurations and prompts, revealing that a larger context increases the likelihood of reproducing copyleft code, but higher temperature settings can mitigate this issue.
paper
AI-assisted coding; code generation; copyleft;
English
33rd IEEE/ACM International Conference on Program Comprehension, ICPC 2025 - 27-28 April 2025
2025
2025 IEEE/ACM 33rd International Conference on Program Comprehension (ICPC)
9798331502232
2025
500
511
none
Colombo, G., Mariani, L., Micucci, D., Riganelli, O. (2025). On the Possibility of Breaking Copyleft Licenses When Reusing Code Generated by ChatGPT. In 2025 IEEE/ACM 33rd International Conference on Program Comprehension (ICPC) (pp.500-511). IEEE Computer Society [10.1109/ICPC66645.2025.00060].
File in questo prodotto:
Non ci sono file associati a questo prodotto.

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/10281/561182
Citazioni
  • Scopus 0
  • ???jsp.display-item.citation.isi??? 0
Social impact