Semi-formal modeling as foundation for hybrid model-driven and LLM-based code generation

Model-driven software engineering (MDSE) generates executable code from models, but typically requires fully formal specifications that are costly to create and maintain, particularly for behavioral aspects. Large language models (LLMs) provide a flexible means to generate such behavior, yet their non-deterministic nature conflicts with the reproducibility and traceability expected in MDSE. This article presents a hybrid approach that combines object-oriented modeling with controlled LLM-based code generation. The approach is realized by MoProCo, a semi-formal modeling tool for UML-like class diagrams that contain natural-language behavioral specifications in addition to structural elements. The tool is primarily textual, rendering diagram visualization on demand. From these models, Java code skeletons are first generated deterministically, before behavioral fragments such as method bodies are synthesized by LLMs based on the natural-language behavioral specifications in a second step. In a human feedback phase, LLM-generated fragments can either be regenerated or be propagated back into the model, restoring determinism for subsequent regeneration cycles in order to reconcile LLM-based generation with model-driven principles. A quantitative evaluation based on three scenarios shows that the semi-formal hybrid generation approach produces syntactically and behaviorally correct results. It furthermore represents specifications more efficiently than both fully formal MDSE and manual coding, and reduces the complexity of specifications. While doing so, it requires less LLM runtime and generates fewer tokens. MoProCo considerably increases determinism when compared to black-box LLM-based development. In an additional application scenario, we demonstrate MoProCo’s practical feasibility by transferring the approach to REST backend applications and successfully reengineering a sample application of realistic extent.

Authors

Institutions

Publication Details

Journal
Software & Systems Modeling
Published
2026-11-25
DOI
https://doi.org/10.1007/s10270-026-01442-1
Primary Topic
Model-Driven Software Engineering Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

Semi-formal modeling as foundation for hybrid model-driven and LLM-based code generation

Thomas Buchmann, Felix Schwägerl
Software & Systems Modeling
Model-Driven Software Engineering Techniques
article

Semi-formal modeling as foundation for hybrid model-driven and LLM-based code generation

Thomas Buchmann, Felix Schwägerl
article en

Abstract

Model-driven software engineering (MDSE) generates executable code from models, but typically requires fully formal specifications that are costly to create and maintain, particularly for behavioral aspects. Large language models (LLMs) provide a flexible means to generate such behavior, yet their non-deterministic nature conflicts with the reproducibility and traceability expected in MDSE. This article presents a hybrid approach that combines object-oriented modeling with controlled LLM-based code generation. The approach is realized by MoProCo, a semi-formal modeling tool for UML-like class diagrams that contain natural-language behavioral specifications in addition to structural elements. The tool is primarily textual, rendering diagram visualization on demand. From these models, Java code skeletons are first generated deterministically, before behavioral fragments such as method bodies are synthesized by LLMs based on the natural-language behavioral specifications in a second step. In a human feedback phase, LLM-generated fragments can either be regenerated or be propagated back into the model, restoring determinism for subsequent regeneration cycles in order to reconcile LLM-based generation with model-driven principles. A quantitative evaluation based on three scenarios shows that the semi-formal hybrid generation approach produces syntactically and behaviorally correct results. It furthermore represents specifications more efficiently than both fully formal MDSE and manual coding, and reduces the complexity of specifications. While doing so, it requires less LLM runtime and generates fewer tokens. MoProCo considerably increases determinism when compared to black-box LLM-based development. In an additional application scenario, we demonstrate MoProCo’s practical feasibility by transferring the approach to REST backend applications and successfully reengineering a sample application of realistic extent.

Software & Systems Modeling
OTH Regensburg (DE), Hof University of Applied Sciences (DE)
Model-Driven Software Engineering Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon