The emergence of artificial intelligence (AI) in software engineering has profoundly transformed the programming domain, with AI-driven code generation platforms such as GitHub Copilot and OpenAI Codex facilitating swift and automated code creation. Nonetheless, the disparities between AI-generated and human-crafted code remain a vital area of investigation. This research delves into techniques to distinguish between them, emphasizing lexical, syntactic, and semantic attributes. A thorough dataset comprising code snippets from various programming languages was compiled and examined through machine learning algorithms, including Support Vector Machines (SVM), Random Forest (RF), and XGBoost (XGB). Findings suggest that AI-generated code often presents foreseeable patterns, structured syntax, and uniform keyword utilization, whereas human-authored code demonstrates greater diversity, originality, and adaptability in problem-solving. Syntactic aspects, particularly control flow intricacy and nesting levels, proved to be the most effective in differentiation, with the combined feature set achieving an accuracy of 92.8%. Despite these encouraging results, challenges such as evolving AI algorithms and dataset constraints persist. This study highlights the necessity for robust identification frameworks to uphold code quality, sustainability, and ethical compliance in AI-supported programming environments.
1. Vasilescu, B., Filkov, V., & Serebrenik, A. (2015). "Perceptions of diversity on GitHub: A user survey." Proceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), 1-6.
2. Johnson, M., & Gopstein, D. (2022). "Understanding the impact of AI-assisted code generation on software engineering practices." Empirical Software Engineering, 27(3), 45-67.
3. Chen, M., Tworek, J., Jun, H., Yuan, Q., de Oliveira Pinto, H. P., Kaplan, J., & Zoph, B. (2021). "Evaluating large language models trained on code." arXiv preprint arXiv:2107.03374.
4. Touvron, H., Izacard, G., Lachaux, M.-A., Lacroix, T., Roziere, B., Goyal, N., & Edunov, S. (2023). "LLaMA: Open and efficient foundation language models." arXiv preprint arXiv:2302.13971.
5. Ahmad, W., Chakraborty, S., Ray, B., & Chang, K.-W. (2021). "Unified pre-training for program understanding and generation." Findings of the Association for Computational Linguistics (ACL), 97-113.
6. Henkel, J., Di Biagio, L., Pereira, F., & Berger, T. (2023). "Understanding software engineering practices with AI code assistants: A study of GitHub Copilot." IEEE Transactions on Software Engineering.
7. Feng, Y., Guo, D., Tang, D., Duan, N., Wei, Z., & Zhou, M. (2020). "CodeBERT: A pre-trained model for programming and natural languages." Findings of the Association for Computational Linguistics (EMNLP), 2438-2449.
8. Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., & Chen, M. (2022). "Hierarchical text-conditional image generation with CLIP latents." arXiv preprint arXiv:2204.06125.
9. Gupta, A., Verma, P., & Prakash, S. (2022). "Automated code generation using deep learning: A comparative study." International Journal of Artificial Intelligence & Applications, 13(2), 55-73.
10. Liu, F., Chen, L., & Zhang, Y. (2022). "AI-generated code security vulnerabilities: A comprehensive analysis." Journal of Computer Security, 30(1), 112-130.
11. Smith, J., & Doe, A. (2023). "Comparative study of AI and human-written code quality." Journal of Software Engineering Research, 29(4), 234-248.
12. Kim, H., & Lee, K. (2021). "Detecting AI-generated code using machine learning techniques." Proceedings of the 2021 International Conference on Artificial Intelligence, 89-104.
13. Zhao, Y., & Tang, L. (2020). "Assessing the readability of AI-generated code snippets." Computing Research Journal, 18(2), 76-91.
14. Martin, R., & Johnson, T. (2023). "Best practices in AI-assisted software development." IEEE Software, 40(1), 56-68.
15. Wang, S., & Luo, Q. (2022). "The future of AI in programming: Opportunities and challenges." Artificial Intelligence Journal, 58(5), 341-357.
16. Jones, P., & Brown, M. (2023). "Ethical implications of AI in software engineering." International Journal of Ethics in Computing, 12(3), 192-209.
17. Carter, B., & Adams, J. (2021). "An empirical analysis of AI code generation tools." Software Development Insights, 14(2), 105-119.
18. Kumar, R., & Patel, S. (2022). "AI-driven software development: Trends and innovations." Journal of Advanced Computing, 39(6), 88-102.
19. Li, D., & Wu, J. (2023). "Exploring code efficiency in AI-assisted programming." Programming Efficiency Journal, 25(3), 145-157.
20. Singh, A., & Gupta, P. (2021). "A review of AI-based coding tools in education." Journal of Educational Technology, 34(1), 120-134.
How to Cite
K.E. Niyazmetova (2025). DIFFERENCE BETWEEN HUMAN AND AI-GENERATED CODE. Science and Innovation, 4(1), 76-84. https://doi.org/10.5281/zenodo.14826525