arXiv:2508.00255cs.SEcs.AI2025-08中稿 · ACM / IEEE 28th In…被引 2

用大模型生成图模型时,如何避免错误和不一致?

Accurate and Consistent Graph Model Generation from Text with Large Language Models

  • 通过多输出聚合与精炼,提升生成图模型的一致性
  • 在多个数据集上显著降低语法错误与语义偏差
  • 适合需要高可靠性的软件建模与自动化开发场景

从自然语言生成图模型是软件工程中的重要任务。尽管大语言模型(LLMs)被广泛用于此任务,但生成结果常存在三类问题:(1)语法违规——模型不符合元模型定义的语法;(2)约束不一致——结构违背领域特定约束;(3)不准确——因模型固有的不确定性引入幻觉元素。现有方法多针对第一类问题,后两类仍缺乏有效解决。受自一致性方法启发,本文提出一种抽象-具体化框架,通过整合多个大模型输出构建概率部分模型,并在此基础上精炼出满足所有约束的最优具体模型。我们在多个开源与闭源大模型上,使用多种数据集进行评估,结果表明该方法显著提升了生成图模型的一致性与质量。

原文摘要 · Abstract (English)

Graph model generation from natural language description is an important task with many applications in software engineering. With the rise of large language models (LLMs), there is a growing interest in using LLMs for graph model generation. Nevertheless, LLM-based graph model generation typically produces partially correct models that suffer from three main issues: (1) syntax violations: the generated model may not adhere to the syntax defined by its metamodel, (2) constraint inconsistencies: the structure of the model might not conform to some domain-specific constraints, and (3) inaccuracy: due to the inherent uncertainty in LLMs, the models can include inaccurate, hallucinated elements. While the first issue is often addressed through techniques such as constraint decoding or filtering, the latter two remain largely unaddressed. Motivated by recent self-consistency approaches in LLMs, we propose a novel abstraction-concretization framework that enhances the consistency and quality of generated graph models by considering multiple outputs from an LLM. Our approach first constructs a probabilistic partial model that aggregates all candidate outputs and then refines this partial model into the most appropriate concrete model that satisfies all constraints. We evaluate our framework on several popular open-source and closed-source LLMs using diverse datasets for model generation tasks. The results demonstrate that our approach significantly improves both the consistency and quality of the generated graph models.

图模型生成大语言模型自一致性软件工程

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