LLM-based assistants, such as GitHub Copilot and ChatGPT, have the potential to generate code that fulfills a programming task described in a natural language description, referred to as a prompt. The widespread accessibility of these assistants enables users with diverse backgrounds to generate code and integrate it into software projects. However, studies show that code generated by LLMs is prone to bugs and may miss various corner cases in task specifications. Presenting such buggy code to users can impact their reliability and trust in LLM-based assistants. Moreover, significant efforts are required by the user to detect and repair any bug present in the code, especially if no test cases are available. In this study, we propose a self-refinement method aimed at improving the reliability of code generated by LLMs by minimizing the number of bugs before execution, without human intervention, and in the absence of test cases. Our approach is based on targeted Verification Questions (VQs) to identify potential bugs within the initial code. These VQs target various nodes within the Abstract Syntax Tree (AST) of the initial code, which have the potential to trigger specific types of bug patterns commonly found in LLM-generated code. Finally, our method attempts to repair these potential bugs by re-prompting the LLM with the targeted VQs and the initial code. Our evaluation, based on programming tasks in the CoderEval dataset, demonstrates that our proposed method outperforms state-of-the-art methods by decreasing the number of targeted errors in the code between 21% to 62% and improving the number of executable code instances to 13%.
From Natural Language to Verified Code: Toward AI Assisted Problem-to-Code Generation with Dafny-Based Formal Verification
Department of Computer Science, The University of Alabama(阿拉巴马大学计算机科学系);The University of Alabama(阿拉巴马大学);Alabama Water Institute, The University of Alabama(阿拉巴马水研究院,阿拉巴马大学)
Can LLMs Generate Reliable Test Case Generators? A Study on Competition-Level Programming Problems
Shanghai Qi Zhi Institute(上海启智研究院);ShanghaiTech University(上海科技大学);Wuhan University(武汉大学);Fuzhou University(福州大学);Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);Tsinghua University(清华大学);Huazhong University of Science and Technology(华中科技大学);Nanjing University(南京大学);Beijing University of Posts and Telecommunications(北京邮电大学);Peking University(北京大学)
Opt-Verifier: Unleashing the Power of LLMs for Optimization Modeling via Dual-Side Verification
MoE Key Laboratory of Brain-inspired Intelligent Perception and Cognition(脑启发式感知与认知MoE实验室);University of Science and Technology of China(中国科学技术大学);Noah's Ark Lab, Huawei Technologies(华为技术诺亚实验室);Tianjin University(天津大学)
A Closer Look at the Self-Verification Abilities of Large Language Models in Logical Reasoning
Institute for Artificial Intelligence, Tsinghua University(清华大学人工智能研究院);Beijing National Research Center for Information Science and Technology(北京信息科学与技术国家研究中心);Tencent AI Lab(腾讯AI实验室)
Attribution-Guided Pruning for Insight and Control: Circuit Discovery and Targeted Correction in Small-scale LLMs
Data Science Center ScaDS.AI, Universität Leipzig(ScaDS.AI数据科学中心,莱比锡大学);Department of Artificial Intelligence, Fraunhofer Heinrich-Hertz-Institute(人工智能系,弗劳恩霍夫 Heinrich-Hertz 研究所);Department of Electrical Engineering and Computer Science, Technische Universität Berlin(电气工程与计算机科学系,柏林技术大学);BIFOLD - Berlin Institute for the Foundations of Learning and Data(柏林学习与数据基础研究所);Centre of eXplainable Artificial Intelligence, Technological University Dublin(可解释人工智能中心,都柏林技术大学)
DualSentinel: A Lightweight Framework for Detecting Targeted Attacks in Black-box LLM via Dual Entropy Lull Pattern
The Hong Kong University of Science and Technology(香港科学与技术大学);The State Key Laboratory of Blockchain and Data Security(区块链与数据安全国家重点实验室);School of Cyber Science and Technology(网络安全科学与技术学院)
ClusterUCB: Efficient Gradient-Based Data Selection for Targeted Fine-Tuning of LLMs
School of Computer Science, Peking University(北京大学计算机学院);College of Computer Science and Technology, National University of Defense Technology(国防科技大学计算机科学与技术学院)
FVEL: Interactive Formal Verification Environment with Large Language Models via Theorem Proving
Shenzhen Campus of Sun Yat-sen University(中山大学深圳校区);City Univeristy of Hong Kong(香港城市大学);Sun Yat-sen University(中山大学);The University of Hong Kong(香港大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);MBZUAI(Mohamed bin Zayed 人工智能大学);DarkMatter AI Research(DarkMatter AI 研究院)
A Survey of Safety and Trustworthiness of Large Language Models through the Lens of Verification and Validation
University of Liverpool(利物浦大学);Purple Mountain Laboratories(紫金山实验室);Université Grenoble Alpes(格勒诺布尔阿尔卑斯大学);The University of Manchester(曼彻斯特大学);KU Leuven(鲁汶大学)
Large Language Models are Better Reasoners with Self-Verification
The Laboratory of Cognition and Decision Intelligence for Complex Systems, IA, CAS(中国科学院自动化研究所复杂系统认知与决策智能实验室);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);College of Electrical and Information Engineering, Hunan University(湖南大学电气与信息工程学院);Unisound(云知声);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)