Recent technical breakthroughs in large language models (LLMs) have enabled them to fluently generate source code. Software developers often leverage both general-purpose and code-specialized LLMs to revise existing code or even generate a whole function from scratch. These capabilities are also beneficial in no-code or low-code contexts, in which one can write programs without a technical background. However, due to their internal design, LLMs are prone to generating hallucinations, which are incorrect, nonsensical, and not justifiable information but difficult to identify its presence. This problem also occurs when generating source code. Once hallucinated code is produced, it is often challenging for users to identify and fix it, especially when such hallucinations can be identified under specific execution paths. As a result, the hallucinated code may remain unnoticed within the codebase. This survey investigates recent studies and techniques relevant to hallucinations generated by CodeLLMs. We categorize the types of hallucinations in the code generated by CodeLLMs, review existing benchmarks and mitigation strategies, and identify open challenges. Based on these findings, this survey outlines further research directions in the detection and removal of hallucinations produced by CodeLLMs.
When AI Fails, What Works? A Data-Driven Taxonomy of Real-World AI Risk Mitigation Strategies
Faculty of Computer Science and Engineering(计算机科学与工程系);Ss. Cyril and Methodius University(西里尔和方法ius大学);Department of Computer Science(计算机科学系);Metropolitan College(Metropolitan学院)
Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Code
2 State Key Laboratory of Complex \& Critical Software Environment (SKLCCSE) School of Computer Science;Engineering, Beihang University, Beijing, China;3 School of Software, Beihang University, Beijing, China;4 School of Computer Science;Technology, Shandong University, Qingdao, China;5 Huawei Cloud Computing Technologies Co., Ltd, China
In-Context Sharpness as Alerts: An Inner Representation Perspective for Hallucination Mitigation
City University of Hong Kong(香港城市大学);National University of Singapore(新加坡国立大学);Shanghai Jiao Tong University(上海交通大学);Stanford University(斯坦福大学);Penn State University(宾夕法尼亚州立大学);Hong Kong University of Science and Technology(香港科技大学)
LLM-based Agents Suffer from Hallucinations: A Survey of Taxonomy, Methods, and Directions
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);Nanyang Technological University(南洋理工大学);Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);Hong Kong University of Science and Technology(香港科技大学);School of Cyber Science and Engineering, Wuhan University(武汉大学网络安全科学与工程学院);Gaoling School of Artificial Intelligence, Renmin University of China(中国人民大学中关村人工智能学院);Academy of Mathematics and Systems Science, Chinese Academy of Sciences(中国科学院数学与系统科学研究院);School of Computing, Faculty of Science and Engineering, Macquarie University(麦考瑞大学计算机学院);Cyberspace Institute of Advanced Technology, Guangzhou University(广州大学高级技术网络研究所);Squirrel Ai Learning;Xiaomi Company(小米公司)
Mitigating Hallucination in Large Language Models: A Capability-Oriented Survey on RAG, Reasoning, and Agentic Systems
Electronic Information School, Wuhan University(武汉大学电子信息学院);School of Computing, Dublin City University(都柏林城市大学计算机学院);School of Public Health, Wuhan University(武汉大学公共卫生学院);Insight Centre for Data Analytics, University of Galway(Galway大学数据分析研究中心);Insight Centre for Data Analytics, Dublin City University(都柏林城市大学数据分析研究中心)
Towards Mitigation of Hallucination for LLM-empowered Agents: Progressive Generalization Bound Exploration and Watchdog Monitor
College of Computer Science, Nankai University(南开大学计算机科学学院);Haihe Lab of ITAI College of intelligent Science and Technology, Inner Mongolia University of Technology(内蒙古工业大学智能科学与技术学院海河实验室);Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);Department of Electrical and Computer Engineering, Stony Brook University(石溪大学电气与计算机工程系);Department of Computer Science, Michigan Technological University(密歇根技术大学计算机科学系)
HalluClear: Diagnosing, Evaluating and Mitigating Hallucinations in GUI Agents
MAIS&NLPR, Institute of Automation, Chinese Academy of Sciences(自动化研究所人工智能与自然语言处理实验室,中国科学院);School of Artificial Intelligence, UCAS(中国科学院大学人工智能学院);Meituan(美团)
Looking Back and Forth: Cross-Image Attention Calibration and Attentive Preference Learning for Multi-Image Hallucination Mitigation
Tsinghua Shenzhen International Graduate School, Tsinghua University(清华大学深圳国际研究生院);Harbin Institute of Technology(哈尔滨工业大学);Beijing Institute of Technology(北京理工大学);Harbin Institute of Technology, Shenzhen(哈尔滨工业大学深圳分校)
Cross-Modal Attention Calibration for LVLM Hallucination Mitigation
Sun Yat-sen University(中山大学);The University of Hong Kong(香港大学);Meituan(美团);Inspur Database Technology(Inspur数据库技术);Guilin University of Electronic Technology(桂林电子科技大学);Shenzhen Loop Area Institute(深圳河套学院);Guangdong Key Laboratory of Big Data Analysis and Processing(广东大数据分析与处理重点实验室)
An Evolutionary Large Language Model for Hallucination Mitigation
BIOSTIM Laboratory Faculty of Medicine Salah Boubnider University Constantine, Algeria(BIOSTIM实验室医学院萨拉赫·布宾德大学阿尔及利亚科纳克特);Department of IFA Faculty of NTIC Abdelhamid Mehri University Constantine, Algeria(IFA部门NTIC学院阿卜杜勒哈米德·梅赫里大学阿尔及利亚科纳克特)
RSHallu: Dual-Mode Hallucination Evaluation for Remote-Sensing Multimodal Large Language Models with Domain-Tailored Mitigation
College of Computer Science, Chongqing University(重庆大学计算机科学学院);Heavy Rainfall Research Center of China(中国强降水研究中心);CMA Key Open Laboratory of Transforming Climate Resources to Economy, Chongqing Institute of Meteorological Sciences(中国气象局气候资源转化经济重点开放实验室、重庆气象科学研究院);Chongqing Metropolitan College of Science(重庆科学理工学院);School of Intelligence Science(智能科学学院);College of Artificial Intelligence, Harbin Institute of Technology(人工智能学院、哈尔滨工业大学);BNU-UIC Institute of Artificial Intelligence(北京师范大学-国际学院人工智能与未来网络研究院);Future Networks, Beijing Normal University at Zhuhai(未来网络、北京师范大学珠海分校)
Risk Taxonomy, Mitigation, and Assessment Benchmarks of Large Language Model Systems
Zhongguancun Laboratory(中关村实验室);Tsinghua University(清华大学);Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);Ant Group(蚂蚁集团)
Steering LVLMs via Sparse Autoencoder for Hallucination Mitigation
School of Computer Science and Engineering, Southeast University(东南大学计算机科学与工程学院);Key Laboratory of New Generation Artificial Intelligence Technology and Its Interdisciplinary Applications (Southeast University)(东南大学新一代人工智能技术及其交叉应用关键实验室);Foundation Model Research Center, Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所基础模型研究中心);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Department of Computer Science and Technology, Tsinghua University(清华大学计算机科学与技术系);Wuhan University of Technology(武汉理工大学);National University of Singapore(新加坡国立大学)
MHSA: A Lightweight Framework for Mitigating Hallucinations via Steered Attention in LVLMs
Tsinghua University(清华大学);Tsinghua University, Tencent(清华大学腾讯);Tencent(腾讯);University of Science and Technology Beijing(北京科技大学);University of Macau(澳门大学)
HAVE: Head-Adaptive Gating and ValuE Calibration for Hallucination Mitigation in Large Language Models
Xin Tong School of Information and Cyber Security People’s Public Security University of China(信息与网络安全学院 中国人民公安大学);Zhi Lin School of Safety Science Tsinghua University(安全科学学院 清华大学);Jingya Wang School of Information and Cyber Security People’s Public Security University of China(信息与网络安全学院 中国人民公安大学);Bo Jin* The Third Research Institute of the Ministry of Public Security of China(公安部第三研究所)