How Does Naming Affect LLMs on Code Analysis Tasks?

Zhilong Wang, Lan Zhang, Chen Cao, Nanqing Luo, Xinzhi Luo +1 more
7/24/2023
cs.CRcs.AI

No confident code implementation found for this paper. 2 possible matches can be shown below.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wang2023does,
  title  = {How Does Naming Affect LLMs on Code Analysis Tasks?},
  author = {Zhilong Wang and Lan Zhang and Chen Cao and Nanqing Luo and Xinzhi Luo and Peng Liu},
  year   = {2023},
  eprint = {2307.12488},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2307.12488v5}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2307.12488.svg)](https://codeofpaper.com/paper/2307.12488)

Discussion