Micro Operational Robustness of LLMs on Code Generation
Abstract
It is now common practice in software development for large language models (LLMs) to be used to generate program code. It is desirable to evaluate the robustness of LLMs for this usage. This paper is concerned in particular with how sensitive LLMs are to variations in descriptions of the coding tasks. However, existing techniques for evaluating this robustness are unsuitable for code generation because the input data space of natural language (NL) descriptions is discrete and sparse. To address this problem, we propose a robustness evaluation method called scenario domain analysis, which aims to find the expected minimal change in the NL descriptions of coding tasks that would cause the LLMs to produce incorrect outputs. We have formally proved the theoretical properties of the method and also conducted extensive experiments to evaluate the robustness of four state-of-the-art LLMs: Gemini-pro, Codex, Llamma2 and Falcon 7B, and have found that we are able to rank these with confidence from best to worst. Moreover, we have also studied how robustness varies in different scenarios, including the variations with the topic of the coding task and with the complexity of its sample solution, and found that robustness is lower for more complex tasks and also lower for more advanced topics, such as multi-threading and data structures.
Create a lesson
Related papers
fx(hash): Salvaging The Source Code of 28k Generative Artworks
Shared title terminology · Benoit Baudry, Valeriia Bezklynska, Martin Monperrus
How Far Can LLMs Go in Generating Android Lint Checks from Natural Language?
Shared title terminology · Moshood A. Fakorede, A. B. Siddique, Manu Sridharan et al.
From Observation to Explanation: Mechanistic Interpretability of LLM-Generated Code for Principled Repair
Shared title terminology · Musfiqur Rahman
Static Analysis Guidance for Secure LLM Code Generation
Shared title terminology · Daniele Lunghi, Alberick Euraste Djiré, Zacharie Chenail-Larcher et al.
Option-GRPO: Hierarchical RL Against AI Slop in Code Generation for Unseen SDKs
Shared title terminology · Prashank Kadam
Think Before You Code: A Benchmark for Testing LLMs on Software Engineering Deliberation
Shared title terminology · Ashman Mehra