Leveraging LLMs for Grammar Adaptation: A Study on Metamodel-Grammar Co-Evolution
In model-driven engineering, metamodel evolution leads to the need to adapt corresponding grammars to maintain consistency, which typically requires tedious manual work. Existing rule-based methods can achieve partial automation but have limitations when handling complex grammar scenarios. This paper proposes a Large Language Model-based approach that automatically applies adaptations to new grammars after evolution by learning grammar adaptations from previous versions. We evaluated this approach on six real-world Xtext domain-specific languages, using four DSLs as a training set to develop prompting strategies, two DSLs as a test set for validation, and conducting a longitudinal case study on QVTo. The evaluation used three Large Language Models (Claude Sonnet 4.5, ChatGPT 5.1, Gemini 3) and measured grammar adaptation quality from three dimensions: Grammar Rule-level adaptation consistency, output similarity, and metamodel conformance. Results show that on the test set, all three LLMs achieved 100% adaptation consistency and output similarity, while the rule-based approach achieved only 84.21% on DOT and 62.50% on Xcore. In the QVTo longitudinal study, the LLM-based approach successfully reused learned adaptations across all three evolution steps without manual grammar editing, while the rule-based approach required manual adjustments in two of three transitions. However, on large-scale grammars (EAST-ADL, 291 rules), LLMs’ adaptation consistency was far below 90%. This study demonstrates the advantages of LLM-based approaches in handling complex grammar scenarios, while revealing their limitations in large-scale grammar adaptation.
Wed 1 JulDisplayed time zone: Brussels, Copenhagen, Madrid, Paris change
11:00 - 12:30 | |||
11:00 30mTalk | Assessing the Scalability of Graph Predicate Evaluation with Large Language Models ECMFA 2026 Rebeka Farkas Budapest University of Technology and Economics, Kristóf Marussy Budapest University of Technology and Economics, Oszkár Semeráth Budapest University of Technology and Economics | ||
11:30 30mTalk | Leveraging LLMs for Grammar Adaptation: A Study on Metamodel-Grammar Co-Evolution ECMFA 2026 Weixing Zhang Karlsruhe Institute of Technology (KIT), Bowen Jiang Karlsruhe Institute of Technology, Rahul Sharma Karlsruhe Institute of Technology, Regina Hebig Universität Rostock, Rostock, Germany, Daniel Strüber Chalmers | University of Gothenburg / Radboud University | ||
12:00 30mTalk | Structural-Semantic Clustering for Architectural Models ECMFA 2026 Thi Dinh Tran Gran Sasso Science Institute, Maria Teresa Rossi University of Milano Bicocca, Italy, Davide Soldati University of Milano-Bicocca, Mauro Sonzogni University of Milano-Bicocca, Amleto Di Salle Gran Sasso Science Institute, L'Aquila, Italy, Ludovico Iovino Gran Sasso Science Institute, L'Aquila, Italy, Leonardo Mariani University of Milano-Bicocca | ||