---
title: 'InstruBPM: Automated BPMN Generation'
url: https://www.emergentmind.com/topics/instrubpm
type: topic
---

# InstruBPM: Automated BPMN Generation

InstruBPM is a methodology and artifact for automatic generation of BPMN (Business Process Model and Notation) process models from natural-language domain descriptions, leveraging open-weight large language models instruction-tuned for on-premises, resource-efficient, and robust BPMN diagram synthesis in DOT format. The system was introduced in the context of reducing modeling complexity and cost for practitioners while maintaining high structural fidelity, guideline conformance, and practical utility across diverse business domains [2512.12063].

## 1. Training Data Curation and Alignment

InstruBPM sources data from the MaD dataset, comprising approximately 30,000 pairs of textual process descriptions and their corresponding BPMN diagrams in DOT format, spanning 15 business domains. Preprocessing entails parsing each DOT graph with pydot, removing invalid, disconnected, or oversize samples. This results in 26,000 high-quality, aligned pairs, each with an average of 12.25 nodes, 13.44 edges, and 4.18 gateways per graph. The textual inputs average 132 words over 7.8 sentences. Samples are split 80% train, 10% validation, and 10% test; tokenization uses the standard Qwen tokenizer to convert instruction-template-augmented descriptions paired with DOT targets.

## 2. Model Architecture and Instruction Tuning Procedures

The core language model is Qwen3-4B-Instruct, a 4B-parameter Transformer with LRPE and gated linear units. InstruBPM applies parameter-efficient fine-tuning via LoRA adapters inserted into all linear projections within each attention and feed-forward layer. For each weight $W\in\mathbb{R}^{d\times k}$, adapters $A,B$ and scaling $\alpha$ modulate only the low-rank updates $\Delta W = (\alpha/r)\cdot AB^\top$. During training, only adapter parameters $(A,B)$ are optimized under cross-entropy loss:

$$L(\theta) = - \sum_{(x,y)} \log p_\theta(y|x)$$

Configuration: rank $r=16$, scale $\alpha=32$, dropout $=0.05$. The framework comprises PyTorch, HuggingFace, FlashAttention 2, and Liger kernels, using 21.5k training samples over one epoch on dual NVIDIA L40S GPUs, totaling approximately 670 optimization steps.

Merge-time $\alpha$ sweeps enable practitioners to control adapter strength without retraining, yielding checkpoints at $\alpha \in \{8,16,32,64\}$ which affect output domain generalization and quality.

## 3. Quantization for Efficient On-Prem Deployment

InstruBPM supports post-training quantization using the HQQ scheme implemented via bitsandbytes/gguf. Each merged checkpoint undergoes blockwise quantization, with weight blocks $w\in\mathbb{R}^k$ quantized per

$$s = \frac{\max(w) - \min(w)}{2^b - 1}\\
q_i = \mathrm{round}((w_i - \min(w))/s)\\
\hat{w}_i = s q_i + \min(w)$$

where $b$ is the bit-width (2–8). Model size and throughput decrease commensurately with bit-width ($\text{BF16} \sim 8.05$ GB, $Q8_0 \sim 4.28$ GB, $Q4K \sim 2.5$ GB), with BLEU performance dropping notably below 4 bits. The 8-bit and 6/5-bit quantized models preserve near-BF16 sequence and structure metrics.

## 4. Prompting and Generation Workflows

All training and inference use an explicit instruction template:

>You are an expert in BPMN modeling and DOT language. Your task is to convert detailed textual descriptions of business processes into accurate BPMN models in DOT. – Label each node with its activity name. – Do not label edges. – Include all decision points (gateways) and flows. Now generate the BPMN DOT code for the following process description: <natural-language description>

The tuned model is prompted zero-shot with the template; untuned baseline models receive additional syntax-grounding via example code snippets. Chain-of-thought and tree-of-thought extensions yield only marginal effects ($\Delta$BLEU~-0.7).

## 5. Evaluation Metrics and Benchmark Results

InstruBPM applies four complementary metrics:

**Textual similarity:** BLEU, ROUGE-L, and METEOR are computed on DOT outputs, with BLEU defined as

$$\mathrm{BLEU} = \mathrm{BP} \cdot \exp\left(\sum_{n=1}^4 w_n \log P_n \right),$$

where $\mathrm{BP}$ is brevity penalty, and $P_n$ $n$-gram precision.

**Structural fidelity:** Relative Graph Edit Distance (R-GED):

$$\mathrm{R-GED}(G_{\mathrm{ref}},G_{\mathrm{gen}}) = 1 - \mathrm{GED}(G_{\mathrm{ref}},G_{\mathrm{gen}})/\left[\mathrm{GED}(G_{\mathrm{ref}},\varnothing)+\mathrm{GED}(G_{\mathrm{gen}},\varnothing)\right]$$

**BPMN guideline conformance:** Output models are converted from DOT to BPMN XML and checked via BEBoP for 20+ understandability and correctness rules.

**Expert review:** Practitioners rate drafts for correctness, usability, and structural quality.

Macro-averaged scores over 180 test cases with Qwen3-4B-LoRA are: BLEU=83.1, ROUGE-L=94.4, METEOR=92.8, R-GED=99.4%. Guideline checking shows 100% pass on structure, hierarchy, and activity labeling, 96–99% for gateway-related rules, but low compliance for activity description and XOR labeling (44.1%). Experts confirmed logical correctness, minimal post-editing on simple/medium processes, and human-readable diagrams.

Quantization ablations reveal that Q8_0 (8-bit) reduces model size by ~50% with negligible BLEU loss; Q4K introduces minor losses (BLEU=80.4, –2.6). Merge $\alpha$ sweeps identified optimal tuning at $\alpha\approx32$.

## 6. Comparative Analysis and Robustness

InstruBPM-tuned Qwen3-4B-LoRA outperforms untuned open-weight models (BLEU 2.9–8.0, R-GED 38–44%) and proprietary baselines such as GPT-5.1, Gemini-2.5, and Claude-4.5 (BLEU 12.6–28.7, R-GED 30–44%). The improvement is statistically significant (Friedman test $p<0.001$, Kendall’s $W$ 0.65–0.81). The system retains consistency across 14/15 domains; customer support exhibits lower BLEU and METEOR (structure remains optimal). Prompting strategy and quantization provide levers for resource-conscious deployment and real-world robustness.

## 7. Artifact Release and Reproducibility

Full codebases (data processing, model training, merge/quantization, inference, evaluation), configuration, prompts, and checkpoints for all quantization settings are distributed via Zenodo (DOI 10.5281/zenodo.17776444) and HuggingFace, with all scripts and random seeds included. The reproducibility pipeline encompasses dataset filtering, LoRA adapter training/merging, PTQ application, inference via vLLM, and multi-metric evaluation using sacreBLEU, rouge, meteor, networkx GED, and BEBoP guideline checking.

---

In summary, InstruBPM combines curated data alignment, parameter-efficient instruction tuning, quantization, and structured prompting to yield open-weight language models that robustly generate high-fidelity BPMN process models from natural-language input [2512.12063]. The tuned system surpasses untuned and proprietary baselines in BLEU, METEOR, ROUGE-L, graph edit distance, and BPMN guideline conformance, offering domain transferability, on-prem deployment flexibility, and artifact-level reproducibility. Weaknesses center on activity description coverage and XOR gateway labeling, targets for future post-processing or prompt adaptation. The methodology provides a reference for instruction-tuning symbolic modeling tasks with open-weight LLMs under resource and privacy constraints.

Source: https://www.emergentmind.com/topics/instrubpm