全部 标题 作者
关键词 摘要

OALib Journal期刊
ISSN: 2333-9721
费用:99美元

查看量下载量

相关文章

更多...

How Does Naming Affect Language Models on Code Analysis Tasks?

DOI: 10.4236/jsea.2024.1711044, PP. 803-816

Keywords: LLMs, CodeBERT, Code Analysis

Full-Text   Cite this paper   Add to My Lib

Abstract:

The Large Language Models (LLMs), such as GPT and BERT, were proposed for natural language processing (NLP) and have shown promising results as general-purpose language models. An increasing number of industry professionals and researchers are adopting LLMs for program analysis tasks. However, one significant difference between programming languages and natural languages is that a programmer has the flexibility to assign any names to variables, methods, and functions in the program, whereas a natural language writer does not. Intuitively, the quality of naming in a program affects the performance of LLMs in program analysis tasks. This paper investigates how naming affects LLMs on code analysis tasks. Specifically, we create a set of datasets with code containing nonsense or misleading names for variables, methods, and functions, respectively. We then use well-trained models (CodeBERT) to perform code analysis tasks on these datasets. The experimental results show that naming has a significant impact on the performance of code analysis tasks based on LLMs, indicating that code representation learning based on LLMs heavily relies on well-defined names in code. Additionally, we conduct a case study on some special code analysis tasks using GPT, providing further insights.

References

[1]  Sarzynska-Wawer, J., Wawer, A., Pawlak, A., Szymanowska, J., Stefaniak, I., Jarkiewicz, M., et al. (2021) Detecting Formal Thought Disorder by Deep Contextualized Word Representations. Psychiatry Research, 304, Article ID: 114135.
https://doi.org/10.1016/j.psychres.2021.114135
[2]  Radford, A., Narasimhan, K., Salimans, T. and Sutskever, I. (2018) Improving Language Understanding by Generative Pre-Training.
[3]  Devlin, J., Chang, M.-W., Lee, K. and Toutanova, K. (2018) Bert: Pre-Training of Deep Bidirectional Transformers for Language Understanding.
[4]  Feng, Z., Guo, D., Tang, D., Duan, N., Feng, X., Gong, M., et al. (2020) Codebert: A Pre-Trained Model for Programming and Natural Languages. Findings of the Association for Computational Linguistics: EMNLP 2020, November 2020, 1536-1547.
https://doi.org/10.18653/v1/2020.findings-emnlp.139
[5]  Guo, D.Y., Ren, S., Lu, S., Feng, Z.Y., Tang, D.Y., Liu, S.J., Zhou, L. and Duan, N., et al. (2020) Graphcodebert: Pre-Training Code Representations with Data Flow.
[6]  Guo, Q., Cao, J., Xie, X., Liu, S., Li, X., Chen, B., et al. (2024) Exploring the Potential of ChatGPT in Automated Code Refinement: An Empirical Study. Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, Lisbon, 14-20 April 2024, 1-13.
https://doi.org/10.1145/3597503.3623306
[7]  Chen, C., Su, J.Z., Chen, J.C., Wang, Y.L., Bi, T.T., Wang, Y.L., et al. (2023) When ChatGPT Meets Smart Contract Vulnerability Detection: How Far Are We?
[8]  (2023) Github Copilot.
[9]  Katz, D.S., Ruchti, J. and Schulte, E. (2018) Using Recurrent Neural Networks for Decompilation. 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER), Campobasso, 20-23 March 2018, 346-356.
https://doi.org/10.1109/saner.2018.8330222
[10]  Butler, S., Wermelinger, M. and Yu, Y. (2015) Investigating Naming Convention Adherence in Java References. 2015 IEEE International Conference on Software Maintenance and Evolution (ICSME), Bremen, 29 September-1 October 2015, 41-50.
https://doi.org/10.1109/icsm.2015.7332450
[11]  OpenAI (2023) Introducing ChatGPT.
[12]  Feng, Z.Y., Guo, D.Y., Tang, D.Y., Duan, N., Feng, X.C., Gong, M., et al. (2021) Code Pretraining Models.
[13]  Husain, H., Wu, H.-H., Gazit, T., Allamanis, M. and Brockschmidt, M. (2019) CodeSearchNet Challenge: Evaluating the State of Semantic Code Search.
[14]  Svajlenko, J., Islam, J.F., Keivanloo, I., Roy, C.K. and Mia, M.M. (2014) Towards a Big Data Curated Benchmark of Inter-Project Code Clones. 2014 IEEE International Conference on Software Maintenance and Evolution, Victoria, 29 September-3 October 2014, 476-480.
https://doi.org/10.1109/icsme.2014.77
[15]  Surameery, N.M.S. and Shakor, M.Y. (2023) Use Chat GPT to Solve Programming Bugs. International Journal of Information technology and Computer Engineering, 3, 17-22.
https://doi.org/10.55529/ijitc.31.17.22
[16]  Cheshkov, A., Zadorozhny, P. and Levichev, R. (2023) Evaluation of ChatGPT Model for Vulnerability Detection.

Full-Text

Contact Us

service@oalib.com

QQ:3279437679

WhatsApp +8615387084133