Detecting Semantic Correspondences in Ecore Models via Contrastive Learning and LLM-Based Approach
Detecting semantic correspondences between elements of independently developed Ecore models is a fundamental challenge in model-driven engineering, underpinning tasks such as model integration, consistency checking, and transformation reuse. Heterogeneity in naming, typing, and structure makes automated detection difficult, while manual inspection is impractical at scale. Because model elements encode semantics across multiple interdependent dimensions, approaches that rely solely on textual similarity are insufficient. We propose a hybrid approach that jointly models textual and structural semantics by combining contrastive learning with a large language model (LLM). Our pipeline employs Contrastive Learning (SimCLR)-based encoders to capture textual descriptions and the topology of inheritance and reference structures, integrated through a learned gating mechanism. The fused embeddings enable efficient candidate retrieval, and an LLM verifies the top-ranked candidates through pairwise semantic reasoning with contextual justification. We evaluate the approach on a cross-domain industrial scenario involving an Ecore-based brake system model and a CAD parameter model. Empirical results indicate that the hybrid method outperforms contrastive learning alone and LLM-only matching in precision, recall, and F1, highlighting the complementary strengths of representation learning and LLM-based reasoning.