Semantic-Guided Pruning Approach for Large Language Model-based Class-Level Code Generation
Recent advancements in code generation from natural language have been driven by large language models (LLMs) like GPT-4 and WizardCoder, but current methods often underutilize their capabilities, especially for class-level code generation. The ClassEval benchmark addresses this by focusing on longer, more complex code snippets, but LLMs face challenges with input length constraints. Traditional approaches like zero-shot and few-shot learning struggle with the complexity and length of class-level code, limiting their effectiveness. To overcome this, we propose a semantic-guided pruning method, which optimizes input length through coarse- and fine-grained pruning, retaining only the most semantically relevant tokens. Our method improves LLM performance, increasing pass@1 accuracy by over 4% on the ClassEval benchmark.
Authors
- Hongyang Chen (ORCID: https://orcid.org/0000-0002-7626-0162)
- Bo Duan
- Yunlong Guo
- Zhenshun Shi (ORCID: https://orcid.org/0000-0001-6250-1351)
- Mingyang Geng (ORCID: https://orcid.org/0000-0001-9020-4581)
Institutions
- Xichang University (CN)
Publication Details
- Published
- 2024-12-06
- DOI
- https://doi.org/10.1109/ricai64321.2024.10911408
- Citations
- 1
- Primary Topic
- Model-Driven Software Engineering Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.49