MCeT: Behavioral Model Correctness Evaluation using Large Language Models

Khaled Ahmed, Jialing Song, Boqi Chen, Ou Wei, Bingzhou Zheng

TL;DR

This paper introduces MCeT, a novel automated tool that uses Large Language Models (LLMs) to evaluate the correctness of behavioral models (specifically sequence diagrams) against natural language requirements. By breaking down the evaluation into fine-grained, multi-perspective checks and employing a self-consistency mechanism, MCeT significantly improves issue detection and precision compared to simpler LLM-based approaches.

What Problem Does This Paper Address?

In model-driven engineering, system behavior is often represented using diagrams like sequence diagrams, which are derived from textual requirements. Ensuring these diagrams accurately reflect the requirements is crucial for system quality. While LLMs are increasingly used as AI assistants in this process, automatically evaluating the correctness of LLM-generated or manually created diagrams against free-form natural language requirements remains a challenge. Existing methods often rely on formal semantics or reference models, which are not always available or practical. Furthermore, directly asking an LLM to compare a diagram and requirements often leads to missed issues or "hallucinations" (false positives).

Methods

The paper proposes MCeT, a two-stage automated evaluation tool.

MCeT-A (Atomic Checking): This stage breaks down the evaluation into three complementary checks:

  • Holistic Check: The LLM directly compares the entire diagram with the entire requirements text.
  • Diagram-atom Check: The diagram is decomposed into "diagram-atoms" (individual interactions/messages with participants), and each is checked against the requirements.
  • Requirement-atom Check: Requirements are split into "requirement-atoms" (single actions involving participants), and the diagram is checked for their complete and accurate implementation.

MCeT-X (Higher Authority Cross-check): This stage addresses hallucinations by performing a self-consistency check. It leverages the observation that requirement-atom checks are generally more reliable. Issues flagged by the holistic or diagram-atom checks are cross-referenced against requirement-atoms that were deemed correct. If a diagram-atom issue conflicts with a correct requirement-atom, it's discarded as a hallucination. This "higher authority" approach helps filter out false positives.

Datasets

The evaluation was performed on the FBENCH dataset, which consists of 76 sequence diagrams derived from real-world industrial requirements. These diagrams were generated by an LLM (ChatGPT's GPT3.5) based on variants of requirements that included introduced "requirement smells" (e.g., ambiguity, inconsistency). The dataset also includes issues identified by experienced engineers, serving as ground truth.

Key Insights and Ideas

  • Holistic LLM evaluation is insufficient: Directly asking an LLM to compare a whole diagram to requirements misses many issues and can be prone to hallucinations.
  • Decomposition is key: Breaking down both the diagram and requirements into smaller, atomic units (diagram-atoms and requirement-atoms) allows LLMs to focus and detect more nuanced issues.
  • Requirement-atom checks are more reliable: These checks are less context-dependent and tend to have higher precision, making them a good basis for cross-checking.
  • Self-consistency filtering is crucial: A "higher authority" cross-check, using reliable requirement-atom checks to validate or invalidate issues from less reliable checks, significantly reduces false positives.
  • LLMs can provide detailed, human-like feedback: MCeT not only detects issues but also provides explanations in natural language, similar to what experienced engineers would provide.

Key Results

  • MCeT achieves a precision of 0.81, a significant improvement over the baseline holistic approach's 0.58.
  • The tool detects 90% more issues than the direct holistic approach when compared to human-reported issues.
  • MCeT reports an average of 6 new issues per diagram that were not identified by human experts.
  • The combined MCeT-A (atomic checks) achieved a recall of 68.1%, nearly doubling the baseline holistic check's 34.1%.
  • MCeT identified 391 new issues not reported by human experts, a 14x increase compared to the baseline.
  • The approach is robust across different LLMs, with lighter-weight models like GPT-40-mini achieving comparable results to more powerful models at a fraction of the cost and time.

Limitations and Future Work

  • LLM Probabilistic Nature: LLMs are inherently probabilistic, meaning results might vary slightly across runs. The paper addresses this with a voting mechanism.
  • Generalization to Other Models: The current work focuses on sequence diagrams. Future work aims to generalize the approach to other types of behavioral models.
  • Preventing Over-filtering: The authors plan to investigate preventing the cross-checking approach from incorrectly eliminating real issues.
  • Subjectivity of Human Judgment: The evaluation relies on human judgment, which can be subjective. The authors mitigated this by using multiple evaluators and measuring inter-rater reliability.

Summary updated

BibTeX
@inproceedings{ahmed2025mcet,
  author = {Khaled Ahmed and Jialing Song and Boqi Chen and Ou Wei and Bingzhou Zheng},
  title = {{MCeT: Behavioral Model Correctness Evaluation using Large Language Models}},
  booktitle = {Models},
  year = {2025},
  doi = {10.1109/models67397.2025.00014},
}
Figure