Structure-Guided and Semantics-Enhanced Collaborative Code Generation
To improve the quality of pseudocode-to-C++ code generation, this paper proposes a Structure-guided and Semantics-enhanced Collaborative Generation method (SSCGen). By integrating a lightweight translation model and a large language model, SSCGen enhances both the structural diversity and semantic correctness of generated programs. Specifically, it first uses a Mixture-of-Experts (MoE) module within an encoderdecoder architecture to perform line-by-line translation and generate well-formed code fragments. These fragments are then assembled into complete programs via best-first search. The resulting candidates serve as structural guidance for a large model, which further performs semantics-enhanced generation. Experiments on the SPoC dataset demonstrate that SSCGen significantly outperforms existing methods, achieving Pass@100 scores of 77.7% and 85.9% on two test subsets.
Authors
- Yanfei Cao (ORCID: https://orcid.org/0000-0001-6835-6837)
- Xingmin Zhang (ORCID: https://orcid.org/0000-0002-7284-3950)
- Daiyuan Yang
Institutions
- University of Science and Technology of China (CN)
Publication Details
- Published
- 2025-05-09
- DOI
- https://doi.org/10.1109/aemcse65292.2025.11042693
- Primary Topic
- Service-Oriented Architecture and Web Services
- Type
- article
- Field-Weighted Citation Impact
- 0.00