arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.15865cs.SE
收藏

从文本到DSL:利用开源LLMs评估基于语法的模型生成

From Text to DSL: Evaluating Grammar-Based Model Generation Using Open LLMs

Univ. Grenoble Alpes, CNRS, Grenoble INP, LIG(格勒诺布尔阿尔卑斯大学、法国国家科学研究中心、格勒诺布尔理工学院、信息学实验室)

Junaid Baber, Nicolas Hili, Didier Schwab, Léo Challier, Cécilia Satrin

AI总结:

本文评估了不同规模的开源LLMs在无需微调的情况下,通过少量示例提示生成符合DSL的模型的能力,验证了小型开源LLMs在MDE中的可行性。

摘要:

大型语言模型(LLMs)在自动化模型驱动软件工程任务中展现出越来越大的潜力,特别是在从自然语言生成符合领域特定语言(DSL)的模型方面。尽管大多数现有方法依赖于大型专有模型,但其高昂的成本和有限的部署性阻碍了更广泛的应用。本文评估了不同规模(0.5B到32B参数)的开源LLMs是否能仅通过少量示例提示生成符合DSL的模型,而无需任何微调。评估重点在于关键的模型驱动工程(MDE)需求,包括语法有效性、语义完整性和跨模型引用一致性。我们通过扩展先前的工作,从生成用户界面模型(本文称为“UI模型”)和固定预定义数据模式(“数据模型”)转向完全从头生成UI和数据模型。这种转变有两方面的目的:首先,它突显了LLM推断领域特定关系并保持多个互联模型之间一致性的能力;其次,它使我们能够通过在不同性质和结构角色的模型上测试DSL生成来推广先前的发现。我们的结构化评估结合了自动解析和专家反馈,对39个LLM进行了评估,发现几个紧凑的模型(如gemma3:12b、mistral:7b-instruct)在质量上接近或达到了更大模型的水平。这些发现证明了在MDE工作流中使用小型开源LLMs生成符合语法的DSL的可行性,为闭源LLMs提供了一种更具成本效益和可部署性的替代方案。

英文摘要:

Large Language Models (LLMs) have shown increasing potential in automating model-driven software engineering tasks, particularly in generating models conforming to Domain Specific Languages (DSLs) from natural language. While most existing approaches rely on large proprietary models, their high cost and limited deployability hinder broader adoption. In this paper, we evaluate whether open-source LLMs of varying sizes (0.5B to 32B parameters) can generate DSL-conformant models using only few-shot prompting, without any fine-tuning. Our evaluation focuses on key model-driven engineering (MDE) requirements, including syntactic validity, semantic completeness, and inter-model reference consistency. We extend our prior work by moving from generating user interface models (referred to as "UI models" in this paper) over fixed, predefined data schemas ("data models") to generating both the UI and data models entirely from scratch. This shift serves two purposes: first, it highlights the LLM's ability to infer domain-specific relationships and maintain consistency across multiple interconnected models; second, it allows us to generalize earlier findings by testing DSL generation across models of different natures and structural roles. Our structured evaluation combines automatic parsing and expert feedback across 39 LLMs, revealing that several compact models (e.g., \texttt{gemma3:12b}, \texttt{mistral:7b-instruct}) approach or match the quality of much larger models. These findings demonstrate the feasibility of using smaller, open-source LLMs for grammar-conformant DSL generation in MDE workflows, offering a cost-effective and deployable alternative to closed LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑