TL;DR
MermaidSeqBench is a new human-verified and synthetically expanded benchmark designed to evaluate how well large language models (LLMs) generate Mermaid sequence diagrams from natural language descriptions. By testing models across six fine-grained criteria using an LLM-as-a-judge framework, the benchmark exposes significant capability gaps in current models, particularly when handling complex control flows, activation blocks, and error states.
What Problem Does This Paper Address?
Sequence diagrams are essential tools in software engineering for visualizing how components, processes, and objects interact over time. Text-based diagramming languages like Mermaid have made it easy to integrate diagram generation into automated workflows and LLM applications.
However, evaluating whether an LLM-generated diagram is actually correct has remained a major challenge. Previous evaluation methods typically relied on basic syntax validation or simple rendering checks. These approaches fail to assess whether the diagram accurately reflects the underlying logic, handles component activations properly, or correctly maps out error-handling paths described in the natural language prompt. Without a rigorous, multi-faceted benchmark, it is impossible to systematically compare models or diagnose their specific architectural weaknesses in structured generation tasks.
Methods
The authors developed a robust evaluation pipeline called MermaidSeqBench, which combines a hybrid dataset construction method with a multi-dimensional LLM-as-a-judge framework.
Instead of relying purely on human annotation or fully synthetic generation, the dataset was built using a three-stage hybrid pipeline:
- Seed Creation: A subject matter expert (SME) manually crafted 10 high-quality seed diagrams and natural language descriptions.
- Synthetic Expansion: Using an open-source Scalable Synthetic Data Generation (SDG) framework, the authors used Mistral-Large-Instruct to expand the core set to 40 verified samples, which were then manually checked using the Mermaid Live Editor.
- Rule-Based Augmentation: To scale the dataset deterministically, rule-based transformations were applied to programmatically reorder conditional blocks (like
alt/elsestructures) and normalize participant names, resulting in a 4x expansion while preserving underlying semantics.
For evaluation, the framework rejects simple binary pass/fail checks in favor of an LLM-as-a-Judge setup evaluating six distinct dimensions: Syntax, Mermaid Only (avoiding conversational fluff), Logic, Completeness, Activation Handling, and Error & Status Tracking. To mitigate individual model bias, the authors utilized two separate state-of-the-art judge models: DeepSeek-V3 (671B) and GPT-OSS (120B).
Datasets
The paper introduces MermaidSeqBench, a dataset consisting of 132 structured natural language to Mermaid sequence diagram pairs. The dataset features realistic multi-component interactions (averaging 5.0 participants per diagram), with robust coverage of complex logic: 89.4% of samples include conditional branching, and 33.3% feature nested control flows. The dataset and evaluation code have been open-sourced on GitHub and HuggingFace.
Key Insights and Ideas
- The 7B Parameter Threshold: When analyzing model scaling, the authors observed a massive performance leap when moving from 3B to 7B parameter models (specifically within the Qwen-2.5 family). This suggests a critical capability threshold required for models to successfully manage structured reasoning and multi-step control flows.
- Absolute vs. Relative Judge Calibration: A fascinating meta-insight from the cross-judge analysis showed that while DeepSeek-V3 was consistently more generous and GPT-OSS was significantly stricter (with absolute score gaps up to 24 percentage points), both judges yielded identical relative rankings and directional trends. This validates the use of LLM judges for comparative ranking, even if absolute scores vary.
- Syntax is Easy, Semantics are Hard: Across all models and scales, scores for basic Syntax and Mermaid Only formatting quickly saturated. However, Activation Handling and Error & Status Tracking proved to be the most stubborn capability gaps, showing that tracking state transitions over time remains a major hurdle for LLMs.
Key Results
The authors conducted cross-family evaluations on models of similar scales, including Llama-3.1-8B-Instruct, Qwen-2.5-7B-Instruct, and Granite-3.3-8B-Instruct.
- Top Performers: Llama-3.1-8B-Instruct and Qwen-2.5-7B-Instruct achieved the highest overall scores. Under the DeepSeek-V3 judge, Llama-3.1-8B hit 92.01% on Syntax and 87.35% on Logic, closely matched by Qwen-2.5-7B at 91.29% (Syntax) and 87.23% (Logic).
- Family Strengths: Granite-3.3-8B-Instruct demonstrated highly precise syntax adherence (94.13% on Mermaid Only under DeepSeek) but lagged behind on complex dimensions like Activation Handling (74.13%).
- Scaling Trends: In the Qwen-2.5 intra-family ablation (ranging from 0.5B to 72B parameters), performance improved monotonically under the GPT-OSS judge. While the 32B and 72B models neared perfection on syntax, they still showed incremental, non-saturating improvements on semantic error tracking, proving that larger models handle edge-case logic significantly better.
Limitations and Future Work
While MermaidSeqBench provides a critical foundation, the authors note several scope limitations:
- Missing Constructs: The current dataset omits parallel flows (
parblocks), loops (loopstructures), and optional blocks (opt), which are common in highly complex software architectures. - Diagram Types: The benchmark is strictly limited to sequence diagrams, leaving out other widely used Mermaid formats like flowcharts, class diagrams, or Gantt charts.
- Judge Validation: The evaluation relies entirely on LLM judges. The authors propose that future work should establish a human-annotated "gold standard" subset to formally anchor and calibrate these automated judges.
Summary updated