LLMs生成数据库ER图在复杂需求下易出错,可靠性不足。
On the Limitations of Large Language Models for Conceptual Database Modeling

- 用提示工程结合三种LLM,从自然语言生成ER图
- 复杂需求下错误率上升,约束和语义不一致明显
- 适合简单场景快速原型,复杂项目需人工校验
本文分析大型语言模型(LLMs)在关系型数据库概念建模中的应用,通过自然语言需求自动生成功能一致的实体-关系(ER)图。实验对比了三种LLM在零样本、思维链及思维链+验证器三种提示策略下的表现,针对逐步增加复杂度的需求场景进行评估。生成的ER图通过与原文需求直接比对,考察其结构与语义一致性。结果表明,尽管在简单场景下表现合理,但随着需求复杂度提升,模型在实体、关系、属性识别上出现更多不一致、模糊与约束遗漏,可靠性显著下降。当前状态下,LLMs尚不足以在复杂场景中可靠使用,且人工验证成本可能抵消其看似提升的效率。
原文摘要 · Abstract (English)
This article analyzes the use of Large Language Models (LLMs) as support for the conceptual modeling of relational databases through the automatic generation of Entity-Relationship (ER) diagrams from natural language requirements. The approach combines different language models with prompt engineering techniques to evaluate their ability to identify entities, relationships, and attributes in a conceptually consistent manner. The experimental evaluation involved three LLMs, each subjected to three prompting techniques (Zero-Shot, Chain of Thought, and Chain of Thought + Verifier), applied to the same requirements scenario with progressively increasing complexity. The generated diagrams were qualitatively analyzed through direct comparison with the textual requirements, considering the structural and semantic adherence of the modeled elements. The results indicate that, although LLMs show reasonable performance in less complex scenarios, their reliability decreases as the complexity of the requirements increases, with a rise in inconsistencies, ambiguities, and failures in representing constraints. These findings reinforce that, in their current state, LLMs are not sufficiently mature for reliable use in complex scenarios, and the cost of validation may offset the apparent productivity gains.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。