Code generation aims to automatically generate code from input requirements, significantly enhancing development efficiency. Recent large language models (LLMs) based approaches have shown promising results and revolutionized code generation task. Despite the promising performance, LLMs often generate contents with hallucinations, especially for the code generation scenario requiring the handling of complex contextual dependencies in practical development process. Although previous study has analyzed hallucinations in LLM-powered code generation, the study is limited to standalone function generation. In this paper, we conduct an empirical study to study the phenomena, mechanism, and mitigation of LLM hallucinations within more practical and complex development contexts in repository-level generation scenario. First, we manually examine the code generation results from six mainstream LLMs to establish a hallucination taxonomy of LLM-generated code. Next, we elaborate on the phenomenon of hallucinations, analyze their distribution across different models. We then analyze causes of hallucinations and identify four potential factors contributing to hallucinations. Finally, we propose an RAG-based mitigation method, which demonstrates consistent effectiveness in all studied LLMs.
7 December 2017 in IEEE Transactions on Industrial Informatics
Improvement of the real-time performance of tracking control is increasingly desirable. It is a routine for most conventional algorithms that the control input at current time instant is to track the current desired output. However, lagging errors resulting from computational time and the fluctuation of the desired output exist for the tracking control. Different from conventional algorithms, a look-ahead scheme of zeroing dynamics (ZD) is established in this paper to achieve the real-time tracking control of both serial and parallel manipulators. With the exploitation of data at current time and that in history, the control inputs generated by the proposed ZD algorithms never lead to lagging errors with the source from the inevitable computational time. To tackle prediction errors for ZD algorithms, a new high-precision discretization formula, as an essential part of ZD algorithms, is presented to confine the prediction error in an ignorable range in comparison with lagging errors.
1 January 2018 in Journal of Computational and Applied Mathematics
Different-level dynamic linear system (DLDLS) is an interesting and challenging topic due to its complicated structure and time-variant characteristic. To solve this difficult problem, the equivalency of solutions at different levels is analyzed and obtained via zeroing neural network (ZNN) method. Based on the equivalency, a continuous ZNN model is proposed to solve the continuous DLDLS. For easier hardware realization, a new Zhang et al. discretization formula with high precision is proposed for the continuous ZNN model discretization, and the corresponding new discrete ZNN (NDZNN) model is proposed to solve discrete DLDLS. Note that the NDZNN model satisfies the requirement of real-time computation because it has the online ability to predict the solution for the future instant. Furthermore, the problems of robot manipulator control with additional restrictions (e.g., joint damage) are formulated as specific discrete DLDLS, and the proposed NDZNN model is employed to solve such problems. Simulation results substantiate the effectiveness of NDZNN model.
This study investigates the tracking‐control problems of the Lorenz, Chen and Lu chaotic systems. Note that the input–output linearisation method cannot solve these tracking‐control problems because of the existence of singularities, at which such chaotic systems fail to have a well‐defined relative degree. By combining Zhang dynamics and gradient dynamics, an effective controller‐design method, termed Zhang‐gradient (ZG) method, is proposed for tracking control of the three chaotic systems. This ZG method, with singularities conquered, is capable of solving the tracking‐control problems of the chaotic systems. Both theoretical analyses and simulative verifications substantiate that the tracking controllers based on the ZG method can achieve satisfactory tracking accuracy and successfully conquer singularities encountered during the tracking‐control process.