MSR 2025
Mon 28 - Tue 29 April 2025 Ottawa, Ontario, Canada
co-located with ICSE 2025

Metamodel matching is a crucial step in defining transformation rules within model-driven engineering, as it identifies correspondences between different metamodels and lays the foundation for effective transformations. Current techniques face significant challenges due to syntactical and structural heterogeneity. To address this, matching techniques often employ semantic similarity to identify correspondences. Traditional semantic matchers, however, rely on ontology matching tools or lexical databases, which can struggle when metamodels use different terminologies or have different hierarchical structures. Inspired by the contextual understanding capabilities of Large Language Models (LLMs), we explore their applicability—specifically GPT-4—as semantic matchers and alternatives to baseline methods for metamodel matching. However, metamodels can be large, which can overwhelm LLMs if provided in a single prompt, leading to reduced accuracy. Therefore, we propose prompting LLMs with fragments of the source and target metamodels, identifying correspondences through an iterative process. The fragments to be provided in the prompt are identified based on an initial mapping derived from their elements’ definitions. Through experiments with 10 metamodel matching cases, our results show that our LLM-based approach remarkably improves the accuracy of metamodel matching, achieving an average F-measure of 91%, greatly outperforming both the baseline and hybrid approaches, which have a maximum average F-measure of 29% and 74%, respectively. Moreover, our approach surpasses single-prompt LLM-based matching, which has an average F-measure of 80%, by approximately 11%