Distinguishing AI- and Human-Generated Code: A Case Study. Bukhari, S., Tan, B., & De Carli, L. In Proceedings of the 2023 Workshop on Software Supply Chain Offensive Research and Ecosystem Defenses, of SCORED '23, pages 17–25, Copenhagen Denmark, November, 2023. ACM.
Paper doi abstract bibtex While the use of AI assistants for code generation has the potential to revolutionize the way software is produced, assistants may generate insecure code, either by accident or as a result of poisoning attacks. They may also inadvertently violate copyright laws by mimicking code protected by restrictive licenses. We argue for the importance of tracking the provenance of AI-generated code in the software supply chain, so that adequate controls can be put in place to mitigate risks. For that, it is necessary to have techniques that can distinguish between human- and AI-generate code, and we conduct a case study in regards to whether such techniques can reliably work. We evaluate the effectiveness of lexical and syntactic features for distinguishing AI- and human-generated code on a standardized task. Results show accuracy up to 92%, suggesting that the problem deserves further investigation.
@inproceedings{bukhari_distinguishing_2023,
address = {Copenhagen Denmark},
series = {{SCORED} '23},
title = {Distinguishing {AI}- and {Human}-{Generated} {Code}: {A} {Case} {Study}},
isbn = {979-8-4007-0263-1},
shorttitle = {Distinguishing {AI}- and {Human}-{Generated} {Code}},
url = {https://dl.acm.org/doi/10.1145/3605770.3625215},
doi = {10.1145/3605770.3625215},
abstract = {While the use of AI assistants for code generation has the potential to revolutionize the way software is produced, assistants may generate insecure code, either by accident or as a result of poisoning attacks. They may also inadvertently violate copyright laws by mimicking code protected by restrictive licenses. We argue for the importance of tracking the provenance of AI-generated code in the software supply chain, so that adequate controls can be put in place to mitigate risks. For that, it is necessary to have techniques that can distinguish between human- and AI-generate code, and we conduct a case study in regards to whether such techniques can reliably work. We evaluate the effectiveness of lexical and syntactic features for distinguishing AI- and human-generated code on a standardized task. Results show accuracy up to 92\%, suggesting that the problem deserves further investigation.},
language = {en},
urldate = {2025-08-23},
booktitle = {Proceedings of the 2023 {Workshop} on {Software} {Supply} {Chain} {Offensive} {Research} and {Ecosystem} {Defenses}},
publisher = {ACM},
author = {Bukhari, Sufiyan and Tan, Benjamin and De Carli, Lorenzo},
month = nov,
year = {2023},
keywords = {\#nosource, ai code generation, program analysis, supply chain security},
pages = {17--25},
}
Downloads: 0
{"_id":"yqDxz6J2oD7vQXoZF","bibbaseid":"bukhari-tan-decarli-distinguishingaiandhumangeneratedcodeacasestudy-2023","author_short":["Bukhari, S.","Tan, B.","De Carli, L."],"bibdata":{"bibtype":"inproceedings","type":"inproceedings","address":"Copenhagen Denmark","series":"SCORED '23","title":"Distinguishing AI- and Human-Generated Code: A Case Study","isbn":"979-8-4007-0263-1","shorttitle":"Distinguishing AI- and Human-Generated Code","url":"https://dl.acm.org/doi/10.1145/3605770.3625215","doi":"10.1145/3605770.3625215","abstract":"While the use of AI assistants for code generation has the potential to revolutionize the way software is produced, assistants may generate insecure code, either by accident or as a result of poisoning attacks. They may also inadvertently violate copyright laws by mimicking code protected by restrictive licenses. We argue for the importance of tracking the provenance of AI-generated code in the software supply chain, so that adequate controls can be put in place to mitigate risks. For that, it is necessary to have techniques that can distinguish between human- and AI-generate code, and we conduct a case study in regards to whether such techniques can reliably work. We evaluate the effectiveness of lexical and syntactic features for distinguishing AI- and human-generated code on a standardized task. Results show accuracy up to 92%, suggesting that the problem deserves further investigation.","language":"en","urldate":"2025-08-23","booktitle":"Proceedings of the 2023 Workshop on Software Supply Chain Offensive Research and Ecosystem Defenses","publisher":"ACM","author":[{"propositions":[],"lastnames":["Bukhari"],"firstnames":["Sufiyan"],"suffixes":[]},{"propositions":[],"lastnames":["Tan"],"firstnames":["Benjamin"],"suffixes":[]},{"propositions":[],"lastnames":["De","Carli"],"firstnames":["Lorenzo"],"suffixes":[]}],"month":"November","year":"2023","keywords":"#nosource, ai code generation, program analysis, supply chain security","pages":"17–25","bibtex":"@inproceedings{bukhari_distinguishing_2023,\n\taddress = {Copenhagen Denmark},\n\tseries = {{SCORED} '23},\n\ttitle = {Distinguishing {AI}- and {Human}-{Generated} {Code}: {A} {Case} {Study}},\n\tisbn = {979-8-4007-0263-1},\n\tshorttitle = {Distinguishing {AI}- and {Human}-{Generated} {Code}},\n\turl = {https://dl.acm.org/doi/10.1145/3605770.3625215},\n\tdoi = {10.1145/3605770.3625215},\n\tabstract = {While the use of AI assistants for code generation has the potential to revolutionize the way software is produced, assistants may generate insecure code, either by accident or as a result of poisoning attacks. They may also inadvertently violate copyright laws by mimicking code protected by restrictive licenses. We argue for the importance of tracking the provenance of AI-generated code in the software supply chain, so that adequate controls can be put in place to mitigate risks. For that, it is necessary to have techniques that can distinguish between human- and AI-generate code, and we conduct a case study in regards to whether such techniques can reliably work. We evaluate the effectiveness of lexical and syntactic features for distinguishing AI- and human-generated code on a standardized task. Results show accuracy up to 92\\%, suggesting that the problem deserves further investigation.},\n\tlanguage = {en},\n\turldate = {2025-08-23},\n\tbooktitle = {Proceedings of the 2023 {Workshop} on {Software} {Supply} {Chain} {Offensive} {Research} and {Ecosystem} {Defenses}},\n\tpublisher = {ACM},\n\tauthor = {Bukhari, Sufiyan and Tan, Benjamin and De Carli, Lorenzo},\n\tmonth = nov,\n\tyear = {2023},\n\tkeywords = {\\#nosource, ai code generation, program analysis, supply chain security},\n\tpages = {17--25},\n}\n\n","author_short":["Bukhari, S.","Tan, B.","De Carli, L."],"key":"bukhari_distinguishing_2023","id":"bukhari_distinguishing_2023","bibbaseid":"bukhari-tan-decarli-distinguishingaiandhumangeneratedcodeacasestudy-2023","role":"author","urls":{"Paper":"https://dl.acm.org/doi/10.1145/3605770.3625215"},"keyword":["#nosource","ai code generation","program analysis","supply chain security"],"metadata":{"authorlinks":{}}},"bibtype":"inproceedings","biburl":"https://api.zotero.org/users/4645877/collections/5QADJUWI/items?key=OGCZ3uLZZq4lLIXadnuJrB1J&format=bibtex&limit=100","dataSources":["TRtmubHSqHw6999cH","Wsv2bQ4jPuc7qme8R"],"keywords":["#nosource","ai code generation","program analysis","supply chain security"],"search_terms":["distinguishing","human","generated","code","case","study","bukhari","tan","de carli"],"title":"Distinguishing AI- and Human-Generated Code: A Case Study","year":2023}