arXiv:2603.21178cs.SEcs.AI2026-03被引 1

用大模型自动生成软件架构图,效果有限仍需人工把关。

LLM-based Automated Architecture View Generation: Where Are We Now?

  • 测试3个大模型+2种智能体,在340个开源项目上生成4137张图
  • 自定义智能体表现最佳,清晰度失败率22.6%,细节完整度达50%
  • 大模型常误判粒度,生成代码级描述而非架构抽象,适合辅助而非替代

架构视图对软件架构文档至关重要,但手动创建耗时且易过时。随着系统复杂度提升,从源码自动生架构视图的价值日益凸显。本文通过实证评估大模型与智能体方法在源码生成架构视图上的能力。我们分析了13种实验配置下的340个开源仓库,使用3个大模型、3种提示策略和2种智能体方法,共生成4137张视图。通过自动化指标结合人工评估,对比生成结果与真实标注。结果显示:提示策略改善有限,少样本提示相比零样本减少9.2%的清晰度失败;自定义智能体优于通用智能体,清晰度失败率最低为22.6%,细节成功率50%。结论表明,大模型与智能体可生成语法正确的架构视图,但普遍存在粒度不匹配问题,多停留在代码层面而非架构抽象,说明仍需人类专家参与,大模型与智能体应作为辅助工具而非自主架构师。

原文摘要 · Abstract (English)

Architecture views are essential for software architecture documentation, yet their manual creation is labor intensive and often leads to outdated artifacts. As systems grow in complexity, the automated generation of views from source code becomes increasingly valuable. Goal: We empirically evaluate the ability of LLMs and agentic approaches to generate architecture views from source code. Method: We analyze 340 open-source repositories across 13 experimental configurations using 3 LLMs with 3 prompting techniques and 2 agentic approaches, yielding 4,137 generated views. We evaluate the generated views by comparing them with the ground-truth using a combination of automated metrics complemented by human evaluations. Results: Prompting strategies offer marginal improvements. Few-shot prompting reduces clarity failures by 9.2% compared to zero-shot baselines. The custom agentic approach consistently outperforms the general-purpose agent, achieving the best clarity (22.6% failure rate) and level-of-detail success (50%). Conclusions: LLM and agentic approaches demonstrate capabilities in generating syntactically valid architecture views. However, they consistently exhibit granularity mismatches, operating at the code level rather than architectural abstractions. This suggests that there is still a need for human expertise, positioning LLMs and agents as assistive tools rather than autonomous architects.

大模型架构生成智能体代码分析

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