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

arXiv: https://arxiv.org/abs/2508.00255 · HTML: https://mlsanity.com/paper/2508.00255/

## Key facts

- Cited by 3 papers in the map (data through 14 Oct 2026).
- Builds on 19 of its 65 references that are in the map.
- First posted on arXiv 1 Aug 2025.

## Builds on (most cited first, 19 of 19)

- [GPT-4 Technical Report](https://mlsanity.com/paper/2303.08774/) (2023)
- [The Llama 3 Herd of Models](https://mlsanity.com/paper/2407.21783/) (2024)
- [Chain-of-Thought Prompting Elicits Reasoning in Large Language Models](https://mlsanity.com/paper/2201.11903/) (2022)
- [Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks](https://mlsanity.com/paper/1908.10084/) (2019)
- [DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning](https://mlsanity.com/paper/2501.12948/) (2025)
- [Self-Consistency Improves Chain of Thought Reasoning in Language Models](https://mlsanity.com/paper/2203.11171/) (2022)
- [GPT-4o System Card](https://mlsanity.com/paper/2410.21276/) (2024)
- [Competition-Level Code Generation with AlphaCode](https://mlsanity.com/paper/2203.07814/) (2022)
- [CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning](https://mlsanity.com/paper/1612.06890/) (2016)
- [Natural Language to Code Translation with Execution](https://mlsanity.com/paper/2204.11454/) (2022)
- [A Survey on Deep Graph Generation: Methods and Applications](https://mlsanity.com/paper/2203.06714/) (2022)
- [Prompting or Fine-tuning? A Comparative Study of Large Language Models for Taxonomy Construction](https://mlsanity.com/paper/2309.01715/) (2023)
- [On the use of Large Language Models in Model-Driven Engineering](https://mlsanity.com/paper/2410.17370/) (2024)
- [Model Generation with LLMs: From Requirements to UML Sequence Diagrams](https://mlsanity.com/paper/2404.06371/) (2024)
- [Atomic Self-Consistency for Better Long Form Generations](https://mlsanity.com/paper/2405.13131/) (2024)
- [Using Grammar Masking to Ensure Syntactic Validity in LLM-based Modeling Tasks](https://mlsanity.com/paper/2407.06146/) (2024)
- [Practical Constraint Solving for Generating System Test Data](https://mlsanity.com/paper/1902.00397/) (2019)
- [PAGED: A Benchmark for Procedural Graphs Extraction from Documents](https://mlsanity.com/paper/2408.03630/) (2024)
- [MIDGARD: Self-Consistency Using Minimum Description Length for Structured Commonsense Reasoning](https://mlsanity.com/paper/2405.05189/) (2024)

## Built on by (most cited first, 3 of 3)

- [GraphLocator: Graph-guided Causal Reasoning for Issue Localization](https://mlsanity.com/paper/2512.22469/) (2025)
- [Metamodel-Guided Model Generation with Layered Constraints](https://mlsanity.com/paper/2510.25890/) (2025)
- [DTScribe: Generating Models for Digital Twin Reporting using Local Large Language Models](https://mlsanity.com/paper/2610.18635/) (2026)

## Abstract (arXiv)

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.
