Enhancing Code Optimization in LLMs with Dual Encoder Architecture for Syntax and Semantic Refinement
Despite their impressive efficiency in code generation, large language models (LLMs) frequently perform poorly on code optimization objectives like lowering algorithmic complexity or enhancing code quality. In order to improve code optimization capabilities in LLMs, we present a unique dual-encoder architecture in this study. After the encoder stage of the DeepSeek-Coder 33B model, we specifically incorporate two specialized encoders: (1) CodeBERT-base for syntactic analysis and correction, and (2) CodeLlama-7b-Optimize for semantic-level code modifications. In order to provide cleaner, more effective code outputs, our design divides the tasks of semantic optimization and syntax inspection. According to empirical tests, our method maintains a low inference latency of 170 ms per sample, obtains a BLEU score of 88, and corrects grammar with 94% correctness. These outcomes demonstrate how well specialized encoder modules work to get beyond the present drawbacks of LLMs in code optimization.
Authors
- Nouman Ahmad
- Changsheng Zhang (ORCID: https://orcid.org/0000-0003-3762-1954)
Institutions
- Northeastern University (CN)
Publication Details
- Published
- 2025-05-29
- DOI
- https://doi.org/10.1109/icaide65466.2025.11189637
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00