Do Code LLMs Understand Design Patterns?
Code Large Language Models (LLMs) demonstrate great versatility in adapting to various downstream tasks, including code generation and completion, as well as bug detection and fixing. However, Code LLMs often fail to capture existing coding standards, leading to the generation of code that conflicts with the required design patterns for a given project. As a result, developers must post-process to adapt the generated code to the project’s design norms. In this work, we empirically investigate the biases of Code LLMs in software development. Through carefully designed experiments, we assess the models’ understanding of design patterns across recognition, comprehension, and generation. Our findings reveal that biases in Code LLMs significantly affect the reliability of downstream tasks.
Authors
- X. M. Song (ORCID: https://orcid.org/0000-0002-9282-3578)
- Yunkun Wang (ORCID: https://orcid.org/0009-0007-8121-0163)
- Rongyu Cao (ORCID: https://orcid.org/0000-0002-3779-5885)
- Zhenyu Pan (ORCID: https://orcid.org/0000-0002-5798-3672)
- Binhua Li (ORCID: https://orcid.org/0000-0002-4179-6979)
- Yongbin Li (ORCID: https://orcid.org/0009-0008-4504-2163)
- Han Liu (ORCID: https://orcid.org/0009-0008-1692-9064)
Institutions
- Alibaba Group (United States) (US)
- Zhejiang University (CN)
Publication Details
- Published
- 2025-05-03
- DOI
- https://doi.org/10.1109/llm4code66737.2025.00031
- Citations
- 1
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 2.48