Leveraging LLMs for Grammar Adaptation: A Study on Metamodel-Grammar Co-Evolution
Weixing Zhang, Bowen Jiang, Rahul Sharma, Regina Hebig, Daniel Str\"uber

TL;DR
This study explores using Large Language Models to automate grammar adaptation in model-driven engineering, showing high accuracy on small to medium grammars but limitations on large-scale ones.
Contribution
It introduces a novel LLM-based method for automatic grammar adaptation, outperforming rule-based approaches in complex scenarios and demonstrating practical effectiveness.
Findings
LLMs achieved 100% consistency on small test sets.
Rule-based methods scored 84.21% and 62.50%.
LLMs struggled with large-scale grammars, dropping below 90%.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
