Introduction
In the early stages of software engineering, teams frequently use whiteboards or paper to brainstorm system architectures via Unified Modeling Language (UML) diagrams. While these sketches facilitate human collaboration, they represent "dead" data that is not machine-readable. To integrate these designs into automated "low-code" pipelines or formal documentation, a human must manually transcribe them into a modeling tool—a process that is both tedious and prone to error. This research investigates the potential of multimodal Large Language Models (LLMs) to automate this transcription, transforming photos of informal whiteboard sketches into functional, structured PlantUML code.
Methodology and Datasets
The researchers conducted a controlled experiment to evaluate the "image-to-UML" capabilities of four prominent models: GPT-4V, Gemini Pro, Gemini Ultra, and the open-source CogVLM. The workflow involved inputting hand-drawn UML class diagrams and using three levels of prompts, ranging from simple requests to highly descriptive instructions.
The study utilized a custom benchmark consisting of four diagrams of increasing complexity:
- Levels 1-3: Progressively complex realistic diagrams adding more classes, attributes, and relationship types like aggregations.
- Level 4: A "nonsensical" diagram (e.g., a "Human" inheriting from a "Spaceship") designed to test whether models prioritize visual evidence over internal semantic "common sense."
Each configuration was run three times to account for non-determinism, with researchers tracking "mistakes" (missing or hallucinated elements) and syntax errors.
Key Results and Insights
The evaluation revealed significant performance disparities between the models. GPT-4V emerged as the gold standard, being the only model to achieve a 0% syntax error rate across all 36 generations. In contrast, other models struggled significantly with generating valid code.
Key findings include:
- The "Opinionated AI" Problem: Google’s Gemini models frequently refused to process the "Level 4" nonsensical diagram, arguing that the entities were irrelevant to UML. This suggests that internal guardrails or semantic filters may hinder creative or unconventional modeling tasks.
- The Prompting Paradox: Counter-intuitively, the researchers found that the least descriptive prompts often yielded the best results. Overly verbose instructions appeared to confuse the models rather than assist them.
- Complexity Correlation: A clear linear correlation exists between diagram complexity and error rates; as the number of elements in a drawing increases, the accuracy of the generated code decreases.
Limitations and Future Work
While the results are promising, the study identified several limitations. The current scope is restricted to class diagrams, whereas software engineering utilizes many other types (e.g., sequence or use case diagrams). Additionally, the small sample size of four diagrams necessitates larger, more diverse datasets for comprehensive stress-testing.
Future research could explore a "multi-agent" approach, where one LLM generates the code and a second "LLM-as-judge" reviews it for errors, potentially creating a self-correcting modeling pipeline. For now, while AI provides an excellent "first draft," human oversight remains essential to refine and validate the output.
Summary updated