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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Enhancing Code Optimization in LLMs with Dual Encoder Architecture for Syntax and Semantic Refinement

Nouman Ahmad, Changsheng Zhang
Natural Language Processing Techniques
article

Enhancing Code Optimization in LLMs with Dual Encoder Architecture for Syntax and Semantic Refinement

Nouman Ahmad, Changsheng Zhang
article en

Abstract

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.

Northeastern University (CN)
Openalex Percentile: Top 85%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.