mlsanityData to 14 Oct 2026

An Empirical Study on Capability of Large Language Models in Understanding Code Semantics

arXiv 2407.03611 ↗First posted 4 Jul 2024cs.SE cs.AIcited by 7

Not on the map. Why?

Abstract (arXiv)

Large Language Models for Code (code LLMs) have demonstrated remarkable performance across various software engineering (SE) tasks, increasing the application of code LLMs in software development. Despite the success of code LLMs, there remain significant concerns about the actual capabilities and reliability of these models, "whether these models really learn the semantics of code from the training data and leverage the learned knowledge to perform the SE tasks". In this paper, we introduce EMPICA, a comprehensive framework designed to systematically and empirically evaluate the capabilities of code LLMs in understanding code semantics. Specifically, EMPICA systematically introduces controlled modifications/transformations into the input code and examines the models' responses. Generally, code LLMs must be robust to semantically equivalent code inputs and be sensitive to non-equivalent ones for all SE tasks. Specifically, for every SE task, given an input code snippet c and its semantic equivalent variants, code LLMs must robustly produce consistent/equivalent outputs while they are expected to generate different outputs for c and its semantic non-equivalent variants. Our experimental results on three representative code understanding tasks, including code summarization, method name prediction, and output prediction, reveal that the robustness and sensitivity of the state-of-the-art code LLMs to code transformations vary significantly across tasks and transformation operators. In addition, the code LLMs exhibit better robustness to the semantic preserving transformations than their sensitivity to the semantic non-preserving transformations. These results highlight a need to enhance the model's capabilities of understanding code semantics, especially the sensitivity property.

Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 36 of its 51 references that are in the map. First posted on arXiv 4 Jul 2024.

Builds on

36 of 51 references.

References · 36

  1. 2017Attention Is All You Needcited by 60,361
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  3. 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
  4. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  5. 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
  6. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  7. 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
  8. 2021Program Synthesis with Large Language Modelscited by 3,637
  9. 2022Competition-Level Code Generation with AlphaCodecited by 1,462
  10. 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
  11. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  12. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
24 more
  1. 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
  2. 2022A Systematic Evaluation of Large Language Models of Codecited by 363
  3. 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
  4. 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 168
  5. 2020Deep Learning Based Text Classification: A Comprehensive Reviewcited by 141
  6. 2022Large Language Models Meet NL2Code: A Surveycited by 138
  7. 2023Self-planning Code Generation with Large Language Modelscited by 124
  8. 2023Impact of Code Language Models on Automated Program Repaircited by 85
  9. 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
  10. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
  11. 2022CCTEST: Testing and Repairing Code Completion Systemscited by 35
  12. 2021Code Structure Guided Transformer for Source Code Summarizationcited by 30
  13. 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
  14. 2023Unveiling Memorization in Code Modelscited by 30
  15. 2023On the Reliability and Explainability of Language Models for Program Generationcited by 17
  16. 2023A Comprehensive Survey of Sentence Representations: From the BERT Epoch to the ChatGPT Era and Beyondcited by 12
  17. 2024Graph Neural Networks for Vulnerability Detection: A Counterfactual Explanationcited by 12
  18. 2022Syntax-Aware On-the-Fly Code Completioncited by 10
  19. 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
  20. 2023Code-centric Learning-based Just-In-Time Vulnerability Detectioncited by 8
  21. 2024Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systemscited by 8
  22. 2024Mutation-based Consistency Testing for Evaluating the Code Understanding Capability of LLMscited by 6
  23. 2021A Context-based Automated Approach for Method Name Consistency Checking and Suggestioncited by 5
  24. 2023INSPECT: Intrinsic and Systematic Probing Evaluation for Code Transformerscited by 2

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 1; 2025: 3; 2026: 3.

7 papers.