Deep-Context-Awareness-Based LLM Code Generation and Accurate-Defect-Repair Integrated Architecture
In response to the issues of context fragmentation and delayed defect repair in large language model (LLM) code generation, this paper proposes a deep context-aware generation-repair fusion architecture. Through a bidirectional collaborative mechanism, it achieves a paradigm shift towards "generation as correctness." This architecture innovatively constructs multi-granularity context encoding models, dynamically integrating code structure, developer intent, and project-level constraints. It combines a neural-symbolic collaboration framework to deeply couple LLM's generative capabilities with the reliability of formal verification. The —— generation module is implemented using graph attention networks to achieve cross-file semantic association, while the repair module accurately locates and fixes defects through probabilistically guided patch search and hierarchical verification strategies. The architecture supports multi-objective optimization and human feedback reinforcement learning (RLHF), balancing code quality, performance, and security requirements, and generates traceable decision chains to ensure ethical compliance. This study provides a new generation of solutions for automated software engineering that combines efficiency and credibility, and lays the technical foundation for future directions such as multimodal context expansion and quantized code analysis.
Institutions
- China National Health Development Research Center (CN)
Publication Details
- Journal
- Journal of Artificial Intelligence Practice
- Published
- 2025-01-01
- DOI
- https://doi.org/10.23977/jaip.2025.080217
- Primary Topic
- Industrial Vision Systems and Defect Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00