Zing Forum

Reading

Automated Syntax Adaptation Using Large Models: A New Approach for Metamodel Evolution Scenarios

The study proposes an automated syntax adaptation method based on large language models (LLMs), which learns adaptation patterns from historical versions. It achieves 100% adaptation consistency on multiple DSLs, significantly outperforming traditional rule-based methods, but still has limitations in large-scale syntax scenarios.

大语言模型语法适配元模型演进领域特定语言Xtext软件工程
Published 2026-05-21 01:51Recent activity 2026-05-21 11:49Estimated read 5 min
Automated Syntax Adaptation Using Large Models: A New Approach for Metamodel Evolution Scenarios
1

Section 01

[Introduction] Automated Syntax Adaptation Using Large Models: A New Approach for Metamodel Evolution

The study proposes an automated syntax adaptation method based on large language models (LLMs), which learns adaptation patterns from historical versions. It achieves 100% adaptation consistency on multiple DSLs, significantly outperforming traditional rule-based methods, but still has limitations in large-scale syntax scenarios. This method provides a new solution to the syntax synchronization problem in metamodel evolution.

2

Section 02

Background: Pain Points of Syntax Synchronization in Metamodel Evolution

In model-driven engineering, changes to the metamodel of a DSL require synchronous adjustments to its grammar. Traditional manual methods are tedious and error-prone, while existing rule-based methods can only handle simple scenarios and struggle with complex syntax changes. For example, refactoring a DSL with hundreds of rules takes days of manual modification and still cannot guarantee correctness.

3

Section 03

Core Method: Learning Adaptation Patterns from Historical Versions

Using large language models to learn adaptation patterns from syntax changes in historical versions, the process includes: 1. Historical version analysis (collecting paired data of metamodel changes and grammar modifications); 2. Adaptation pattern learning (using prompt strategies to enable LLMs to learn change logic); 3. Automated adaptation application (generating new grammar modification suggestions based on patterns). This method simulates human experience reuse and does not require predefined rules.

4

Section 04

Experimental Design and Results: Significantly Outperforming Traditional Rule-Based Methods

The experiments were conducted on 6 Xtext DSLs, with 4 DSLs in the training set and 2 (DOT, Xcore) in the test set. A longitudinal study was done on 3 versions of QVTo, using three models: Claude Sonnet 4.5, ChatGPT5.1, and Gemini3. Results: All three models achieved 100% adaptation consistency and output similarity on the test set, with consistent metamodels; compared to rule-based methods, the gaps were significant (DOT: 84.21%, Xcore: 62.50%). In the longitudinal study, LLMs required no manual editing, while rule-based methods needed two manual adjustments.

5

Section 05

Limitations and Improvements: Challenges of Large-Scale Syntax and Countermeasures

On large-scale DSLs (EAST-ADL with 297 rules), the adaptation consistency of LLMs was far below 90% due to context window limitations and insufficient ability to handle global dependencies. Improvement directions: chunked processing, iterative optimization, hybrid strategy (using rules for simple cases and LLMs for complex ones).

6

Section 06

Methodological Insights: Paradigm Shift in Software Engineering Automation

  1. Paradigm shift from rule-driven to case-based learning; 2. The key role of prompt engineering in LLM applications; 3. Multi-model validation enhances result reliability, and mainstream commercial models are competent.
7

Section 07

Future Outlook: Extended Applications and Optimization Directions

Future research directions include: extending to tasks such as code refactoring and API migration; combining formal methods to ensure correctness; incremental learning to improve adaptation capabilities; designing human-machine collaboration workflows.