Silva J., Ma Q., Cabot J., Kelsen P., Proper H.A.
Lecture Notes in Computer Science, vol. 17081 LNCS, pp. 92-108, 2027
The use of Large Language Models (LLMs) has shown significant potential for generating domain models from textual descriptions. However, these models often fall short in soundness, which is inevitably caused by the statistical nature of LLMs that only generate plausible output rather than output grounded in the provided input. Generated unsound model elements lack supporting evidence in the source textual descriptions, and are commonly referred to as hallucinations. In this paper, we propose an explainable approach that combines (1) attention-based model element confidence scoring and (2) confidence-driven model ensembling to reduce hallucinations in domain model generation from text. The proposed scoring mechanism leverages the attention weights within transformer architectures to estimate the strength of original textual evidence supporting each generated model element, distinguishing between intra-element and inter-element evidence. The confidence-driven model ensembling strategy then retains the most confident model elements from multiple executions of multiple LLMs and synthesizes them into a final domain model. We evaluate the effectiveness of our approach using open-weight Small Language Models (SLMs), as their higher propensity for hallucinations provides a rigorous environment for validation. Through an ablation study, we demonstrate how confidence filtering based on intra-element and inter-element scores, together with an ensemble strategy, balances textual grounding and model completeness, providing interpretable evidence for the resulting domain models.
