Large Language Models for UML Class Diagram Modeling: A Preliminary Empirical Evaluation
Source abstract
Abstract
UML class diagram modeling is a fundamental task in software engineering, yet the application of large language models (LLMs) to this domain remains underexplored. Existing studies predominantly focus on single closed-source models with simple prompting strategies, lacking systematic comparisons across model types, prompt engineering techniques, and iterative refinement approaches. In this paper, we construct a difficulty-stratified dataset of 30 UML class diagram exercises and propose an automated weighted evaluation metric over generated PlantUML code—both of which are rarely constructed and systematically applied in existing LLM-driven UML modeling research. We present a preliminary empirical evaluation comparing open-source and closed-source LLMs across multiple scales and types, diverse prompting strategies, and varying requirement complexity levels. Beyond the single-round static paradigm of prior work, we further introduce and evaluate iterative prompting schemes that continuously improve model outputs through structured feedback. Our findings reveal that chain-of-thought prompting has different effects on improving the quality of different models, that relationship modeling is the persistent bottleneck under increasing complexity, and attribute extraction remains a largely unsolved technical challenge across all tested LLMs. Further, automated feedback-driven iterative refinement yields varied improvements: it brings notable performance gains for reasoning-oriented thinking models while delivering only marginal promotion for high-performance general chat models. These results provide actionable guidance for practitioners and researchers applying LLMs to UML modeling tasks.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Model-Driven Software Engineering Techniques · Software Engineering Research · Software Engineering Techniques and Practices
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
National University of Defense Technology, Changsha 410073, China
References (42)
Show source-provided references
1. Modeling software architectures in the unified modeling language10.1145/504087.504088 ↗
2. Ahmed, S., Ahmed, A., and Eisty, N.U. (2022). Automatic transformation of natural to unified modeling language: A systematic review. IEEE/ACIS 20th International Conference on Software Engineering Research, Management and Applications (SERA), IEEE.10.1109/SERA54885.2022.9806783 ↗
3. LLM-Driven MDA Pipeline for Generating UML Class Diagrams and code10.1109/ACCESS.2025.3615828 ↗
4. Ferrari, A., Abualhaija, S., and Arora, C. (2024). Model generation with LLMs: From requirements to UML sequence diagrams. IEEE 32nd International Requirements Engineering Conference Workshops (REW), IEEE.10.1109/REW61692.2024.00044 ↗
5. UCD-LLM: A use case diagram requirement modeling multi-agent framework with large language model10.1016/j.infsof.2025.107955 ↗
6. Khamsepour, P., Cole, M., Ashraf, I., Tan, D., Puri, S., Sabetzadeh, M., and Nejati, S. (2025). The Impact of Critique on LLM-Based Model Generation from Natural Language: The Case of Activity Diagrams. arXiv.
7. Sharma, R., Srivastava, P.K., and Biswas, K.K. (2015). From natural language requirements to UML class diagrams. IEEE Second International Workshop on Artificial Intelligence for Requirements Engineering (AIRE), IEEE.10.1109/AIRE.2015.7337625 ↗
8. From requirements engineering to uml using natural language processing–survey study
9. Abdelnabi, E.A., Maatuk, A.M., and Hagal, M. (2021). Generating uml class diagram from natural language requirements: A survey of approaches and techniques. International Maghreb Meeting of the Conference on Sciences and Techniques of Automatic Control and Computer Engineering MI-STA, IEEE.10.1109/MI-STA52233.2021.9464433 ↗
10. Almazroi, A.A., Abualigah, L., Alqarni, M.A., Houssein, E.H., AlHamad, A.Q.M., and Elaziz, M.A. (2022). Class diagram generation from text requirements: An application of natural language processing. Deep Learning Approaches for Spoken and Natural Language Processing, Springer.10.1007/978-3-030-79778-2_4 ↗
11. A survey on large language model (llm) security and privacy: The good, the bad, and the ugly10.1016/j.hcc.2024.100211 ↗
12. Jin, H., Huang, L., Cai, H., Yan, J., Li, B., and Chen, H. (2024). From llms to llm-based agents for software engineering: A survey of current, challenges and future. arXiv.
13. Demystifying llm-based software engineering agents10.1145/3715754 ↗
14. He, J., Shi, J., Zhuo, T.Y., Treude, C., Sun, J., Xing, Z., Du, X., and Lo, D. (2025). Llm-as-a-judge for software engineering: Literature review, vision, and the road ahead. ACM Trans. Softw. Eng. Methodol., 1–28. accepted.10.1145/3797276 ↗
15. Can llms replace human evaluators? An empirical study of llm-as-a-judge in software engineering10.1145/3728963 ↗
16. Li, Y., Keung, J., Ma, X., Chong, C.Y., Zhang, J., and Liao, Y. (2024). Llm-based class diagram derivation from user stories with chain-of-thought promptings. 48th Annual Computers, Software, and Applications Conference (COMPSAC), IEEE.10.1109/COMPSAC61105.2024.00017 ↗
17. De Bari, D., Garaccione, G., Coppola, R., Torchiano, M., and Ardito, L. (2024). Evaluating large language models in exercises of uml class diagram modeling. Proceedings of the 18th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, IEEE.10.1145/3674805.3690741 ↗
18. Giannouris, P., and Ananiadou, S. (2025). NOMAD: A Multi-Agent LLM System for UML Class Diagram Generation from Natural Language Requirements. arXiv.10.5220/0014301900004058 ↗
19. Calamo, M., Mecella, M., and Snoeck, M. (2025). Assessing the suitability of large language models in generating uml class diagrams as conceptual models. International Conference on Business Process Modeling, Development and Support, Springer.10.1007/978-3-031-95397-2_13 ↗
20. Garaccione, G., Calabrese, D.M., Coppola, R., and Ardito, L. (2025). A comparison of different Large Language Models for the generation of UML class diagrams. 28th International Conference on Model Driven Engineering Languages and Systems Companion (MODELS-C), IEEE.10.1109/MODELS-C68889.2025.00078 ↗
21. Chen, M., Tworek, J., Jun, H., Yuan, Q., Pinto, H.P.D.O., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., and Brockman, G. (2021). Evaluating large language models trained on code. arXiv.
22. Nijkamp, E., Pang, B., Hayashi, H., Tu, L., Wang, H., Zhou, Y., Savarese, S., and Xiong, C. (2022). Codegen: An open large language model for code with multi-turn program synthesis. arXiv.
23. Guo, D., Zhu, Q., Yang, D., Xie, Z., Dong, K., Zhang, W., Chen, G., Bi, X., Wu, Y., and Li, Y.K. (2024). DeepSeek-Coder: When the large language model meets programming–the rise of code intelligence. arXiv.
24. Kang, S., Yoon, J., and Yoo, S. (2023). Large language models are few-shot testers: Exploring llm-based general bug reproduction. International Conference on Software Engineering (ICSE), IEEE.10.1109/ICSE48619.2023.00194 ↗
25. Large language models for software engineering: A systematic literature review10.1145/3695988 ↗
26. Pudlitz, F., Brokhausen, F., and Vogelsang, A. (2019). Extraction of system states from natural language requirements. International Requirements Engineering Conference (RE), IEEE.10.1109/RE.2019.00031 ↗
27. Automatic transformation of user stories into UML use case diagrams using NLP techniques10.1016/j.procs.2018.04.010 ↗
28. Zakaria, B., Bouziane, E.M., Jakimi, A., Oualla, N., and Saadane, R. (2024). Towards an approach for extracting uml class diagrams using advanced language models. International Conference on Smart City Applications, Springer.10.1007/978-3-031-88653-9_9 ↗
29. Nguyen, J., Koe, R.E., Wang, F., Arora, C., and Ferrari, A. (2026). Class Model Generation from Requirements using Large Language Models. arXiv.10.1145/3786146.3788643 ↗
30. Machine learning-based design concept evaluation10.1115/1.4045126 ↗
31. Chain-of-thought prompting elicits reasoning in large language models10.52202/068431-1800 ↗
32. Language models are few-shot learners
33. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing
34. White, J., Fu, Q., Hays, S., Sandborn, M., Olea, C., Gilbert, H., Elnashar, A., Spencer-Smith, J., and Schmidt, D.C. (2023, January 22–25). A Prompt Pattern Catalog to Enhance Prompt Engineering with ChatGPT. Proceedings of the 30th Conference on Pattern Languages of Programs, Monticello, IL, USA.
35. Large language models are zero-shot reasoners10.52202/068431-1613 ↗
36. Self-refine: Iterative refinement with self-feedback10.52202/075280-2019 ↗
37. Reflexion: Language agents with verbal reinforcement learning10.52202/075280-0377 ↗
38. Chen, X., Lin, M., Schärli, N., and Zhou, D. (2023). Teaching Large Language Models to Self-Debug. Twelfth International Conference on Learning Representations, ICLR.
39. Olausson, T.X., Inala, J.P., Wang, C., Gao, J., and Solar-Lezama, A. (2023). Is Self-Repair a Silver Bullet for Code Generation?. Twelfth International Conference on Learning Representations, ICLR.
40. Peng, B., Li, C., He, P., Galley, M., and Gao, J. (2023). Instruction tuning with gpt-4. arXiv.
41. Flesch, R.F. (1974). The Art of Readable Writing: With the Flesch Readability Formula, Harper & Brothers.
42. Chissom, B.S. (1975). Derivation of new readability formulas (automated readability index, fog count and flesch reading ease formula) for navy enlisted personnel. Scientific Studies of Reading, Naval Technical Training Command of the United States Navy.