Instruction-Tuning Open-Weight Language Models for BPMN Model Generation
Organizations: Boğaziçi University, İstanbul, Türkiye · Utrecht University, Utrecht, The Netherlands
Abstract
Domain models are central to software engineering, as they enable a shared understanding, guide implementation, and support automated analyses and model-driven development. Yet, despite these benefits, practitioners often skip modeling because it is time-consuming and demands scarce expertise. We address this barrier by investigating whether open-weight large language models, adapted via instruction tuning, can generate high-quality BPMN process models directly from natural language descriptions in a cost-effective and privacy-preserving way. We introduce InstruBPM, a reproducible approach that prepares paired text-diagram data and instruction tunes an open source large language model with parameter-efficient fine-tuning and quantization for on-prem deployment. We evaluate the tuned model through complementary perspectives: (i) text/code similarity using BLEU, ROUGE-L, and METEOR, (ii) structural fidelity using Relative Graph Edit Distance, (iii) guidelines conformance using external tool checks, and (iv) a small expert review. Using a curated subset of a multi-domain BPMN dataset, we compare the tuned model with untuned open-weight baselines and strong proprietary models under consistent prompting regimes. Our compact tuned model outperforms all baselines across sequence and structural metrics while requiring substantially fewer resources; guideline analysis and expert feedback further indicate that the generated diagrams largely follow BPMN best practices and are useful starting points that reduce modeling effort. Overall, instruction tuning improves structural accuracy and robustness compared to untuned baselines and reduces reliance on heavy prompt scaffolding. We publicly share the trained models and scripts to support reproducibility and further research.
Figures & tables
| Approach | Model | Adapt. | Target | Evaluation |
|---|---|---|---|---|
| Grohs et al. [ 21 ] | GPT-4 | Prompt | BPMN/RPA | Qualitative |
| Klievtsova et al. [ 27 ] | GPT-3.5/4 | Prompt | Dialogue/extraction | Empirical |
| Licardo et al. [ 39 ] | GPT-4+BERT | Prompt+FT | BPMN | R-GED |
| Nivon & Salaün [ 44 ] | GPT-3.5 | FT | Grammar/AST to BPMN | Text + structural |
| Bernardi et al. [ 4 ] | LLaMA | FT+RAG | BPMN Q&A | Retrieval metrics |
| Kourani et al. [ 29 ] | GPT-4 | Prompt | BPMN/Petri nets | Manual + structural |
| ID | Current Role | Years of BPM Experience |
|---|---|---|
| E1 | System Analyst | 2 |
| E2 | Business Analyst | 4 |
| E3 | Workflow Automation Engineer | 6 |
| E4 | Lead Business Analyst | 10 |
| DOT element | BPMN 2.0 element |
|---|---|
| START_NODE (circle) | bpmn2:startEvent |
| END_NODE (double circle) | bpmn2:endEvent |
| Box node (labeled) | bpmn2:task |
| Diamond [label="+"] | bpmn2:parallelGateway |
| Diamond [label="X"] | bpmn2:exclusiveGateway |
| Diamond [label="O"] | bpmn2:inclusiveGateway |
| Category | ID | Description |
| General | 2 | Smaller models improve understandability and reduce cognitive load. |
| Notation | 16 | The designer should split or join sequence flows always using gateways. |
| 18 | Match split/join pairs to preserve structuredness. | |
| 20 | Do not represent gateways with only one incoming and one outgoing sequence flow. | |
| 21 | Minimize the use of inclusive (OR) gateways, which are difficult to synchronize. | |
| 22 | Avoid dead ends at exclusive gateways; provide a default branch. |
| Models | BLEU | ROUGE-L | METEOR | R-GED |
|---|---|---|---|---|
| Open-Weight LLMs | ||||
| Qwen2.5-7B-Instruct | ||||
| Qwen2.5-14B-Instruct | ||||
| Qwen2.5-Coder-7B-Instruct | ||||
| Qwen2.5-Coder-14B-Instruct | ||||
| Qwen3-4B-Instruct-2507 | ||||
| Domain | BLEU | ROUGE-L | METEOR | R-GED |
|---|---|---|---|---|
| Account payable process | ||||
| Accounts receivable process | ||||
| Budget preparation process | ||||
| Churn-rate prevention process | ||||
| Client onboarding (marketing agency) | ||||
| Content promotion process |
| Technique | BLEU | ROUGE-L | METEOR |
|---|---|---|---|
| Zero-shot | 83.06 | 94.43 | 92.82 |
| Chain-of-thought | 81.92 | 93.79 | 91.25 |
| Tree-of-thoughts | 81.80 | 93.72 | 91.16 |
| Training Mode | BLEU | ROUGE-L | METEOR | Model Size (GB) | Throughput (tokens/sec) | Avg Time to 1st Token (s) |
|---|---|---|---|---|---|---|
| Full-Lora-Tuning (BF16) | 8.05 | |||||
| Q8_0-GGUF | 4.28 | |||||
| Q6_K-GGUF | 3.31 | |||||
| Q5_K_M-GGUF | 2.89 | |||||
| Q4_K_M-GGUF | 2.50 | |||||
| Q3_K_M-GGUF | 2.08 |
| Alpha ( ) | BLEU | ROUGE-L | METEOR | R-GED (%) |
|---|---|---|---|---|
| 8 | 41.24 | 51.13 | 58.50 | 55.07 |
| 16 | 74.47 | 87.77 | 85.60 | 98.23 |
| 32 | 83.06 | 94.43 | 92.82 | 99.44 |
| 64 | 14.09 | 33.78 | 30.98 | 31.09 |
| ID | Guideline | OK | KO | Pass (%) |
|---|---|---|---|---|
| 2 | Minimize model size | 179 | 0 | 100.00 |
| 16 | Use explicit gateways | 173 | 6 | 96.65 |
| 18 | Split and join flows consistently | 175 | 4 | 97.77 |
| 20 | Use meaningful gateways | 178 | 1 | 99.44 |
| 21 | Minimize inclusive OR gateways | 81 | 98 | 45.25 |
| 22 | Use default flows | 174 | 5 | 97.21 |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Models | BLEU | ROUGE-L | METEOR | R-GED |
|---|---|---|---|---|
| Open-weight LLMs | ||||
| Qwen2.5-7B-Instruct | 5.67 [ 4.85, 6.82] | 43.11 [41.44, 44.89] | 45.10 [42.17, 47.51] | 37.94 [32.70, 44.14] |
| Qwen2.5-14B-Instruct | 6.66 [ 5.63, 8.02] | 43.01 [41.12, 44.98] | 42.96 [39.47, 46.26] | 40.00 [34.92, 45.79] |
| Qwen2.5-Coder-7B-Instruct | 6.08 [ 5.30, 6.95] | 41.34 [40.01, 42.61] | 39.38 [36.41, 42.09] | 38.48 [32.99, 44.32] |
| Qwen2.5-Coder-14B-Instruct | 6.76 [ 5.76, 8.01] | 43.30 [41.80, 44.85] | 43.99 [41.40, 46.21] | 42.10 [37.92, 46.95] |
| Qwen3-4B-Instruct-2507 | 2.89 [ 2.16, 4.02] | 40.31 [38.70, 42.03] | 44.16 [41.52, 46.67] | 44.47 [39.38, 50.08] |
| Domain | BLEU | ROUGE-L | METEOR | R-GED |
|---|---|---|---|---|
| Account payable process | 84.0 [77.9, 89.2] | 94.7 [92.6, 96.4] | 93.6 [91.4, 95.4] | 100.0 [100.0, 100.0] |
| Accounts receivable process | 85.6 [80.6, 89.5] | 95.6 [93.7, 97.1] | 94.2 [91.6, 96.0] | 100.0 [100.0, 100.0] |
| Budget preparation process | 81.2 [77.4, 84.2] | 94.4 [93.1, 95.4] | 92.5 [90.8, 94.0] | 100.0 [100.0, 100.0] |
| Churn-rate prevention process | 87.3 [83.6, 90.2] | 96.1 [95.0, 97.0] | 94.9 [93.5, 96.1] | 100.0 [100.0, 100.0] |
| Client onboarding (marketing agency) | 83.6 [79.3, 87.2] | 95.5 [94.3, 96.5] | 93.3 [91.4, 94.8] | 100.0 [100.0, 100.0] |
| Content promotion process | 82.2 [77.3, 86.2] | 94.7 [93.3, 95.8] | 92.8 [90.8, 94.4] | 100.0 [100.0, 100.0] |
| Metric | (df = 13) | -value | models | instances | |
|---|---|---|---|---|---|
| BLEU | 1862.52 | 0.81 | 14 | 177 | |
| ROUGE-L | 1506.76 | 0.65 | 14 | 177 | |
| METEOR | 1727.50 | 0.75 | 14 | 177 | |
| R-GED | 1702.32 | 0.74 | 14 | 177 |
| ID | Guideline | OK | KO | Pass (%) [95% CI] |
|---|---|---|---|---|
| 2 | Minimize model size | 179 | 0 | 100.00 [97.90, 100.00] |
| 16 | Use explicit gateways | 173 | 6 | 96.65 [92.88, 98.45] |
| 18 | Split and join flows consistently | 175 | 4 | 97.77 [94.40, 99.13] |
| 20 | Use meaningful gateways | 178 | 1 | 99.44 [96.90, 99.90] |
| 21 | Minimize inclusive OR gateways | 81 | 98 | 45.25 [38.14, 52.57] |
| 22 | Use default flows | 174 | 5 | 97.21 [93.63, 98.80] |