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, 297 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.


翻译:在模型驱动工程中,元模型的演化导致需要适配相应的语法以保持一致性,这通常需要繁琐的人工操作。现有基于规则的方法可以实现部分自动化,但在处理复杂语法场景时存在局限性。本文提出一种基于大语言模型的方法,通过学习先前版本的语法适配,在演化后自动对新的语法应用适配。我们在六个真实的Xtext领域特定语言上评估了该方法,其中使用四个DSL作为训练集以制定提示策略,两个DSL作为测试集进行验证,并在QVTo上开展了纵向案例研究。评估使用了三种大语言模型(Claude Sonnet 4.5、ChatGPT 5.1、Gemini 3),并从三个维度衡量语法适配质量:语法规则级适配一致性、输出相似度以及元模型符合度。结果表明,在测试集上,所有三种大语言模型均实现了100%的适配一致性和输出相似度,而基于规则的方法在DOT上仅达到84.21%,在Xcore上达到62.50%。在QVTo纵向研究中,基于大语言模型的方法在所有三个演化步骤中成功复用了已学习的适配,无需手动编辑语法,而基于规则的方法在三个过渡中有两个需要手动调整。然而,在大规模语法(EAST-ADL,297条规则)上,大语言模型的适配一致性远低于90%。本研究展示了基于大语言模型的方法在处理复杂语法场景中的优势,同时揭示了其在大规模语法适配中的局限性。

0
下载
关闭预览

相关内容

大语言模型与小语言模型协同机制综述
专知会员服务
40+阅读 · 2025年5月15日
大语言模型在规划与调度问题上的应用
专知会员服务
54+阅读 · 2025年1月12日
大语言模型算法演进综述
专知会员服务
81+阅读 · 2024年5月30日
大模型如何迭代?北大等《大型语言模型自我进化》综述
大型语言模型:原理、实现与发展
专知会员服务
102+阅读 · 2023年11月28日
绝对干货!NLP预训练模型:从transformer到albert
新智元
14+阅读 · 2019年11月10日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
A Survey of Large Language Models
Arxiv
501+阅读 · 2023年3月31日
VIP会员
最新内容
非对称防御中的自组织临界性:俄乌战争
专知会员服务
1+阅读 · 今天14:36
《战争中的大语言模型监管》
专知会员服务
2+阅读 · 今天14:26
边缘计算的军事应用
专知会员服务
8+阅读 · 8月9日
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
9+阅读 · 8月8日
相关VIP内容
大语言模型与小语言模型协同机制综述
专知会员服务
40+阅读 · 2025年5月15日
大语言模型在规划与调度问题上的应用
专知会员服务
54+阅读 · 2025年1月12日
大语言模型算法演进综述
专知会员服务
81+阅读 · 2024年5月30日
大模型如何迭代?北大等《大型语言模型自我进化》综述
大型语言模型:原理、实现与发展
专知会员服务
102+阅读 · 2023年11月28日
相关基金
国家自然科学基金
43+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
7+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
国家自然科学基金
18+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员