arXiv:2602.11904cs.SEcs.AI2026-02被引 5

用大模型自动同步文本领域语言的语法与代码,兼顾准确性和人工信息保留。

Leveraging LLMs to support co-evolution between definitions and instances of textual DSLs: A Systematic Evaluation

  • 用大模型驱动语法与代码的协同演化,保留注释等人类相关细节。
  • 小规模修改(少于20行)时准确率超94%,大规模修改后性能下降。
  • 适合语法变更不大、需保留人工信息的场景,不适用于复杂删除或大规模重构。

软件语言因功能扩展而持续演进,语法变化可能导致原有文本实例过时。尽管模型驱动工程提供多种元模型与模型协同演化技术,但这些方法不适用于文本领域语言,且可能丢失布局、注释等人机交互信息。本研究系统评估了大语言模型(LLMs)在协同演化文本领域语言语法与实例方面的潜力。使用 Claude Sonnet 4.5 与 GPT-5.2,在十种案例语言上各运行十次,评估正确性与对人类相关特征的保留能力。结果表明,在小规模修改(少于20行更改)时,精确率与召回率均≥94%;规模增大后性能下降:Claude 在40行更改时仍保持85%召回率,而GPT在最大实例上失败。响应时间随实例规模显著增加,语法演化复杂度与删除粒度对性能影响大于变更类型。研究明确了大模型协同演化适用边界与现存局限。

原文摘要 · Abstract (English)

Software languages evolve over time for reasons such as feature additions. When grammars evolve, textual instances that originally conformed to them may become outdated. While model-driven engineering provides many techniques for co-evolving models with metamodel changes, these approaches are not designed for textual DSLs and may lose human-relevant information such as layout and comments. This study systematically evaluates the potential of large language models (LLMs) for co-evolving grammars and instances of textual DSLs. Using Claude Sonnet 4.5 and GPT-5.2 across ten case languages with ten runs each, we assess both correctness and preservation of human-oriented information. Results show strong performance on small-scale cases ($\geq$94% precision and recall for instances requiring fewer than 20 modified lines), but performance degraded with scale: Claude maintains 85% recall at 40 lines, while GPT fails on the largest instances. Response time increases substantially with instance size, and grammar evolution complexity and deletion granularity affect performance more than change type. These findings clarify when LLM-based co-evolution is effective and where current limitations remain.

大模型领域语言代码演化自动化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。