In recent years, the application of artificial intelligence (AI) techniques for source code authorship attribution has gained significant attention from academia and industry. Accurately attributing source code to its original author is crucial for various purposes, such as intellectual property protection, cybersecurity, and software forensics. Advances in AI technologies, like ChatGPT, which can generate code, present new challenges and opportunities in distinguishing between human- and machine-generated code. This article aims to comprehensively review existing research on source code authorship attribution and present a series of experiments using a dataset of 600 source codes. The study involves extracting lexical and layout features, ranking methods, and employing several machine learning models (SVM, LR, MLP, XGBoost, and RF) and deep learning models (LSTM, RNN, and CNN). The objectives include identifying the best model to determine whether source codes were written by a human or ChatGPT-4 and providing insights into two human characteristics: gender and region. Our results show that we achieved up to 94.7% accuracy with RF using TF-IDF and 95% accuracy with the CNN model. Finally, we identify emerging trends and potential future research directions in AI for authorship attribution.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

A Comparative Study on Source Code Attribution Using AI: Datasets, Features, and Techniques

  • Shamma Alalawi,
  • Saed Alrabaee,
  • Wasif Khan,
  • Issam Al-Azzoni,
  • Medha Mohan Ambali Parambil

摘要

In recent years, the application of artificial intelligence (AI) techniques for source code authorship attribution has gained significant attention from academia and industry. Accurately attributing source code to its original author is crucial for various purposes, such as intellectual property protection, cybersecurity, and software forensics. Advances in AI technologies, like ChatGPT, which can generate code, present new challenges and opportunities in distinguishing between human- and machine-generated code. This article aims to comprehensively review existing research on source code authorship attribution and present a series of experiments using a dataset of 600 source codes. The study involves extracting lexical and layout features, ranking methods, and employing several machine learning models (SVM, LR, MLP, XGBoost, and RF) and deep learning models (LSTM, RNN, and CNN). The objectives include identifying the best model to determine whether source codes were written by a human or ChatGPT-4 and providing insights into two human characteristics: gender and region. Our results show that we achieved up to 94.7% accuracy with RF using TF-IDF and 95% accuracy with the CNN model. Finally, we identify emerging trends and potential future research directions in AI for authorship attribution.