Large Language Models (LLMs) have shown remarkable capabilities in processing both natural and programming languages, which have enabled various applications in software engineering, such as requirement engineering, code generation, and software testing. However, existing code generation benchmarks do not necessarily assess the code understanding performance of LLMs, especially for the subtle inconsistencies that may arise between code and its semantics described in natural language.
In this paper, we propose a novel method to systematically assess the code understanding performance of LLMs, particularly focusing on subtle differences between code and its descriptions, by introducing code mutations to existing code generation datasets. Code mutations are small changes that alter the semantics of the original code, creating a mismatch with the natural language description. We apply different types of code mutations, such as operator replacement and statement deletion, to generate inconsistent code-description pairs. We then use these pairs to test the ability of LLMs to correctly detect the inconsistencies.
We propose a new LLM testing method, called Mutation-based Consistency Testing (MCT), and conduct a case study on the two popular LLMs, GPT-3.5 and GPT-4, using the state-of-the-art code generation benchmark, HumanEval-X, which consists of six programming languages (Python, C++, Java, Go, JavaScript, and Rust). We compare the performance of the LLMs across different types of code mutations and programming languages and analyze the results. We find that the LLMs show significant variation in their code understanding performance and that they have different strengths and weaknesses depending on the mutation type and language.
VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Models
Institute of BigData, Fudan University(复旦大学大数据研究院);School of Computer Science, Fudan University(复旦大学计算机科学学院);School of Computer Science, Huazhong University of Science and Technology(华中科技大学计算机科学学院);Purple Mountain Laboratories(紫金山实验室);School of Software Engineering, Huazhong University of Science and Technology(华中科技大学软件学院)
CodeEditorBench: Evaluating Code Editing Capability of Large Language Models
Multimodal Art Projection Research Community(多模态艺术投影研究社区);University of Waterloo(滑铁卢大学);HKUST(香港科技大学);University of Manchester(曼彻斯特大学);Tongji University(同济大学);Vector Institute(矢量研究所)
TeachBench: A Syllabus-Grounded Framework for Evaluating Teaching Ability in Large Language Models
State Key Laboratory of Multimedia Information Processing, School of Computer Science, Peking University(信息处理国家重点实验室,计算机学院,北京大学);ByteDance BandAI(字节跳动BandAI);Institute of Automation, Chinese Academy of Sciences(自动化研究所,中国科学院)
EarthSE: A Benchmark for Evaluating Earth Scientific Exploration Capability of LLMs
Shanghai Jiao Tong University(上海交通大学);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室);The Hong Kong Polytechnic University(香港理工大学);The Chinese University of Hong Kong(香港中文大学)
Beyond Instruction Following: Evaluating Inferential Rule Following of Large Language Models
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Xiaohongshu Inc AI Lab, AIGility Cloud Innovation(小红书AI实验室);Department of Computer Science and Engineering, Texas A&M University(德克萨斯农工大学计算机科学与工程学院)
SWE-Mutation: Can LLMs Generate Reliable Test Suites in Software Engineering?
State Key Laboratory of Cognitive Intelligence(认知智能国家重点实验室);University of Science and Technology of China(中国科学技术大学);Beihang University(北航);School of Mathematical Sciences, Peking University(北京大学数学科学学院);NeoShell AI;Institute of Artificial Intelligence, Hefei Comprehensive National Science Center(合肥综合性国家科学中心人工智能研究院)
Mutation-Guided Unit Test Generation with a Large Language Model
University of Limerick(利默里克大学);Research Ireland Lero Centre for Software, University of Limerick(爱尔兰研究莱罗软件中心,利默里克大学);University of Ottawa(渥太华大学);Software Engineering Application Technology Lab Huawei(华为软件工程应用技术实验室)
Search-Based Generation of Undetected Quantum Circuit Mutants
Simula Research Laboratory(Simula研究实验室);Oslo Metropolitan University(奥斯陆城市大学);Trinity College Dublin, School of Computer Science and Statistics(都柏林三一学院计算机科学与统计学院);National Institute of Informatics(信息学研究所)
BenchBrowser: Retrieving Evidence for Evaluating Benchmark Validity
Language Technologies Institute, Carnegie Mellon University(卡内基梅隆大学语言技术研究所);Thomas Lord Department of Computer Science, University of Southern California(南加州大学托马斯·洛德计算机科学系)