How Does Naming Affect LLMs on Code Analysis Tasks?

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Wang, Zhilong, Zhang, Lan, Cao, Chen, Luo, Nanqing, Luo, Xinzhi, Liu, Peng
Formato: Preprint
Publicado: 2023
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866913576868904960
author Wang, Zhilong
Zhang, Lan
Cao, Chen
Luo, Nanqing
Luo, Xinzhi
Liu, Peng
author_facet Wang, Zhilong
Zhang, Lan
Cao, Chen
Luo, Nanqing
Luo, Xinzhi
Liu, Peng
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2307_12488
institution arXiv
publishDate 2023
record_format arxiv
spellingShingle How Does Naming Affect LLMs on Code Analysis Tasks?
Wang, Zhilong
Zhang, Lan
Cao, Chen
Luo, Nanqing
Luo, Xinzhi
Liu, Peng
Cryptography and Security
Artificial Intelligence
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.
title How Does Naming Affect LLMs on Code Analysis Tasks?
topic Cryptography and Security
Artificial Intelligence
url https://arxiv.org/abs/2307.12488