Large Language Models (LLMs) can generate functional source code from natural-language prompts, but often fail to consistently follow higher-level architectural structures or design patterns. Since LLMs are increasingly used in software engineering, their ability to apply established design principles to generated code is crucial to the long-term success of software products. Therefore, the goal of this paper is to identify strategies for guiding LLMs to incorporate design patterns into the generated source code. We designed a computational experiment to evaluate the ability of 13 LLMs to generate code that follows the Singleton design pattern, using four prompting strategies: instructions, binary automated feedback, extensive automated feedback, and extensive feedback with few-shot prompts, in 164 Java coding challenges from HumanEval-X. Our results shows that the optimal strategy to guide LLMs to include design patterns depends heavily on the type of model. Still, overall, iterative binary feedback provides the best alignment with Singleton while preserving or improving the code's functionality. With guiding with instructions, Llama 3.3 generated Singleton classes in 100% of cases and improved code functionality, increasing the number of tests passed by 34.1 percentage points. It achieved a similar result with guidance through instructions and binary feedback. Qwen 3 (8B) increased the alignment with Singleton to 99.2% and the functionality to 58.6% using binary feedback. Our result suggests that even simple strategies can be used to guide LLMs to use design patterns.
本文件记录了FAIR for Research Software(FAIR4RS)小组的讨论和审议,该小组重新审视了FAIR指导原则对科学数据管理和研究软件管理的适用性。我们讨论了理想的可复制的,开放的,可用的,公认的,可持续的和强大的研究软件的愿景,然后审查研究软件和数据的特性和实践的差异。这种对初始条件的愿景和理解可以作为尝试翻译和解释指导原则的背景,以更充分地与研究软件保持一致。我们发现,只要提供了大量的解释,许多原则仍然相对完整。“可找到”和“可证明”的基本原则尤其如此。我们发现,“互操作性”和“可重用性”特别容易出现广泛的,有时甚至是相反的解释。我们提出了两个新的原则模仿现有的,并提供修改后的指导性文字,这些原则,以帮助澄清我们的最终解释。在这一过程中发现了翻译方面的一系列差距,这些差距仍有待解决。最后,我们将考虑这些翻译后的原则在哪些方面与开篇所阐述的愿景有所差距。
Guiding Software Developers by Social Networking Application Plug-in using the Multiple Bridge Source Repository through a Data Mining Integrated Approach
Improving LLM Reasoning for Vulnerability Detection via Group Relative Policy Optimization
Institute of Informatics and Telematics, National Research Council of Italy(意大利国家研究理事会信息与电信研究所);Department of Excellence in Robotics and AI, TeCIP, Scuola Superiore Sant'Anna(卓越机器人与人工智能系,TeCIP,圣安娜高等学院)
Designing LLM-based Multi-Agent Systems for Software Engineering Tasks: Quality Attributes, Design Patterns and Rationale
School of Computer Science, Wuhan University(武汉大学计算机学院);School of Computing Technologies, RMIT University(皇家墨尔本理工学院计算技术学院);School of Computer Science, Central China Normal University(中央师范大学计算机学院)
Deep Learning and Machine Learning: Advancing Big Data Analytics and Management with Design Patterns
Georgia Institute of Technology(佐治亚理工学院);Indiana University(印第安纳大学);Xi’an Jiaotong-Liverpool University(西安交通大学利物浦大学);University of Hawaii(夏威夷大学);National Taiwan Normal University(台湾师范大学);Kyoto University(京都大学);Rutgers University(罗格斯大学);AppCubic;University of Wisconsin-Madison(威斯康星大学麦迪逊分校);Purdue University(普渡大学);Emory University(埃默里大学)