An Empirical Study on Capability of Large Language Models in Understanding Code Semantics
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
- 2017Attention Is All You Needcited by 60,361
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2019Sentence-BERT: Sentence Embeddings using Siamese BERT-Networkscited by 9,170
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2017A Unified Approach to Interpreting Model Predictionscited by 6,555
- 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
- 2023Reflexion: Language Agents with Verbal Reinforcement Learningcited by 4,276
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2022Competition-Level Code Generation with AlphaCodecited by 1,462
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 906
24 more
- 2023RepoCoder: Repository-Level Code Completion Through Iterative Retrieval and Generationcited by 367
- 2022A Systematic Evaluation of Large Language Models of Codecited by 363
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 194
- 2023ClassEval: A Manually-Crafted Benchmark for Evaluating LLMs on Class-level Code Generationcited by 168
- 2020Deep Learning Based Text Classification: A Comprehensive Reviewcited by 141
- 2022Large Language Models Meet NL2Code: A Surveycited by 138
- 2023Self-planning Code Generation with Large Language Modelscited by 124
- 2023Impact of Code Language Models on Automated Program Repaircited by 85
- 2018DeepBugs: A Learning Approach to Name-based Bug Detectioncited by 65
- 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
- 2022CCTEST: Testing and Repairing Code Completion Systemscited by 35
- 2021Code Structure Guided Transformer for Source Code Summarizationcited by 30
- 2023Uncovering the Limits of Machine Learning for Automatic Vulnerability Detectioncited by 30
- 2023Unveiling Memorization in Code Modelscited by 30
- 2023On the Reliability and Explainability of Language Models for Program Generationcited by 17
- 2023A Comprehensive Survey of Sentence Representations: From the BERT Epoch to the ChatGPT Era and Beyondcited by 12
- 2024Graph Neural Networks for Vulnerability Detection: A Counterfactual Explanationcited by 12
- 2022Syntax-Aware On-the-Fly Code Completioncited by 10
- 2022Unveiling Code Pre-Trained Models: Investigating Syntax and Semantics Capacitiescited by 9
- 2023Code-centric Learning-based Just-In-Time Vulnerability Detectioncited by 8
- 2024Coca: Improving and Explaining Graph Neural Network-Based Vulnerability Detection Systemscited by 8
- 2024Mutation-based Consistency Testing for Evaluating the Code Understanding Capability of LLMscited by 6
- 2021A Context-based Automated Approach for Method Name Consistency Checking and Suggestioncited by 5
- 2023INSPECT: Intrinsic and Systematic Probing Evaluation for Code Transformerscited by 2
Built on by
Citing papers per year: 2024: 1; 2025: 3; 2026: 3.
7 papers.
- 2025Correctness Assessment of Code Generated by Large Language Models Using Internal Representationscited by 17
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completioncited by 10
- 2025EyeMulator: Improving Code Language Models by Mimicking Human Visual Attentioncited by 4
- 2026TrajGuard: Streaming Hidden-state Trajectory Detection for Decoding-time Jailbreak Defensecited by 4
- 2025FasterPy: An LLM-based Code Execution Efficiency Optimization Frameworkcited by 3
- 2026Capture the Flags: Family-Based Evaluation of Agentic LLMs via Semantics-Preserving Transformationscited by 3
- 2026ArchAgent: Scalable Legacy Software Architecture Recovery with LLMscited by 2
- 2026TrajGuard: Streaming Hidden-state Trajectory Detection for Decoding-time Jailbreak Defense9 Apr 2026
- 2026Capture the Flags: Family-Based Evaluation of Agentic LLMs via Semantics-Preserving Transformations5 Feb 2026
- 2026ArchAgent: Scalable Legacy Software Architecture Recovery with LLMs19 Jan 2026
- 2025FasterPy: An LLM-based Code Execution Efficiency Optimization Framework28 Dec 2025
- 2025EyeMulator: Improving Code Language Models by Mimicking Human Visual Attention22 Aug 2025
- 2025Correctness Assessment of Code Generated by Large Language Models Using Internal Representations22 Jan 2025
- 2024RAMBO: Enhancing RAG-based Repository-Level Method Body Completion23 Sep 2024