RD2ESC: Multi-Agent Collaborative Framework for Intelligent Embedded Code Generation
-
Graphical Abstract
-
Abstract
Large Language Models (LLM) are increasingly being applied in software engineering, but current automated code generation research primarily focuses on general-purpose functional code, lacking effective solutions for the specific requirements of embedded systems. This study proposes RD2ESC (Requirements Documents to Embedded System Code), a prompt-based fine-tuning method that enables LLMs to understand the complex relationships between embedded code and requirements documents, and constructs a multi-agent collaborative code generation framework capable of rapidly generating high-quality embedded code using requirements documents and reference code. Experimental results demonstrate that RD2ESC improves the Pass@1 metric from 0.15 to 0.71 compared to the GPT-4o baseline model, achieving a test pass rate of 0.75 and compilation pass rate of 0.96. Sensitivity analysis reveals that the method exhibits certain dependency on reference code quality, with Pass@1 declining from 0.68 to 0.47 under 10%~50% perturbation conditions and dropping to 0.25 without reference code, while still maintaining basic code generation capabilities. Ablation experiments confirm the synergistic effects among multi-agents, with the complete system demonstrating significant performance improvements compared to individual components. This research provides an effective technical framework for embedded code automatic generation, substantially enhancing embedded system development efficiency.
-
-