Query2Diagram: Answering Developer Queries with UML Diagrams
- URL: http://arxiv.org/abs/2604.23816v1
- Date: Sun, 26 Apr 2026 17:34:43 GMT
- Title: Query2Diagram: Answering Developer Queries with UML Diagrams
- Abstract summary: We introduce query-driven diagram generation.<n>We fine-tune Qwen2.5-Coder-14B on a curated dataset of code files.<n>Results demonstrate that fine-tuning on a modest amount of manually corrected data yields dramatic improvements.
- Score: 7.42369031190836
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Software documentation frequently becomes outdated or fails to exist entirely, yet developers need focused views of their codebase to understand complex systems. While automated reverse engineering tools can generate UML diagrams from code, they produce overwhelming detail without considering developer intent. We introduce query-driven UML diagram generation, where LLMs create diagrams that directly answer natural language questions about code. Unlike existing methods, our approach produces semantically focused diagrams containing only relevant elements with contextual descriptions. We fine-tune Qwen2.5-Coder-14B on a curated dataset of code files, developer queries, and corresponding diagram representations in a structured JSON format, evaluating with both automatic detection of structural defects and human assessment of semantic relevance. Results demonstrate that fine-tuning on a modest amount of manually corrected data yields dramatic improvements: our best model achieves the highest F1 scores while reducing defect rates below state-of-the-art LLMs, generating diagrams that are both structurally sound and semantically faithful to developer queries. Thus, we establish the feasibility of using LLMs for scalable contextual, on-demand documentation generation. We make our code and dataset publicly available at https://github.com/i-need-a-pencil/query2diagram.
Related papers
- GraphSkill: Documentation-Guided Hierarchical Retrieval-Augmented Coding for Complex Graph Reasoning [26.69769871719694]
We propose a textit agentic hierarchical retrieval-augmented coding framework for graph reasoning.<n>Our method achieves higher task accuracy and lower inference cost compared to baselines.
arXiv Detail & Related papers (2026-02-20T21:51:21Z) - UltRAG: a Universal Simple Scalable Recipe for Knowledge Graph RAG [4.612466149994232]
Retrieval augmented generation (RAG) tries to reduce factual errors by identifying information in a knowledge corpus and putting it in the context window of the model.<n>We introduce ULTRAG, a general framework for retrieving information from Knowledge Graphs that shifts away from classical RAG.<n>In our experiments, ULTRAG achieves better performance when compared to state-of-the-art KG-RAG solutions.
arXiv Detail & Related papers (2026-01-28T14:31:29Z) - AmbiGraph-Eval: Can LLMs Effectively Handle Ambiguous Graph Queries? [31.91169297907121]
AmbiGraph-Eval is a novel benchmark of real-world ambiguous queries paired with expert-verified graph query answers.<n>Our findings reveal a critical gap in ambiguity handling and motivate future work on specialized resolution techniques.
arXiv Detail & Related papers (2025-08-13T09:06:59Z) - Data Dependency-Aware Code Generation from Enhanced UML Sequence Diagrams [54.528185120850274]
We propose a novel step-by-step code generation framework named API2Dep.<n>First, we introduce an enhanced Unified Modeling Language (UML) API diagram tailored for service-oriented architectures.<n>Second, recognizing the critical role of data flow, we introduce a dedicated data dependency inference task.
arXiv Detail & Related papers (2025-08-05T12:28:23Z) - MCeT: Behavioral Model Correctness Evaluation using Large Language Models [4.34964016971127]
With the growing use of Large Language Models (LLM) as AI modeling assistants, more automation will be involved in generating diagrams.<n>We propose MCeT, the first fully automated tool to evaluate the correctness of a behavioral model, sequence diagrams in particular, against its corresponding requirements text.
arXiv Detail & Related papers (2025-08-01T13:41:58Z) - Beyond Isolated Dots: Benchmarking Structured Table Construction as Deep Knowledge Extraction [80.88654868264645]
Arranged and Organized Extraction Benchmark designed to evaluate ability of large language models to comprehend fragmented documents.<n>AOE includes 11 carefully crafted tasks across three diverse domains, requiring models to generate context-specific schema tailored to varied input queries.<n>Results show that even the most advanced models struggled significantly.
arXiv Detail & Related papers (2025-07-22T06:37:51Z) - Behavioral Augmentation of UML Class Diagrams: An Empirical Study of Large Language Models for Method Generation [0.0]
This study evaluates nine large language models (LLMs) in augmenting a methodless diagram (21 classes, 17 relationships) using 21 structured waste-management use cases.<n>A total of 90 diagrams (3,373 methods) were assessed across six iterations.
arXiv Detail & Related papers (2025-06-01T02:33:40Z) - Align-GRAG: Reasoning-Guided Dual Alignment for Graph Retrieval-Augmented Generation [79.75818239774952]
Large language models (LLMs) have demonstrated remarkable capabilities, but still struggle with issues like hallucinations and outdated information.<n>Retrieval-augmented generation (RAG) addresses these issues by grounding LLM outputs in external knowledge with an Information Retrieval (IR) system.<n>We propose Align-GRAG, a novel reasoning-guided dual alignment framework in post-retrieval phrase.
arXiv Detail & Related papers (2025-05-22T05:15:27Z) - Harnessing Large Language Models for Knowledge Graph Question Answering via Adaptive Multi-Aspect Retrieval-Augmentation [81.18701211912779]
We introduce an Adaptive Multi-Aspect Retrieval-augmented over KGs (Amar) framework.<n>This method retrieves knowledge including entities, relations, and subgraphs, and converts each piece of retrieved text into prompt embeddings.<n>Our method has achieved state-of-the-art performance on two common datasets.
arXiv Detail & Related papers (2024-12-24T16:38:04Z) - Distill Visual Chart Reasoning Ability from LLMs to MLLMs [64.32993770646165]
Solving complex chart Q&A tasks requires advanced visual reasoning abilities in multimodal large language models (MLLMs)<n>We propose Code-as-Intermediary Translation (CIT), a cost-effective, efficient and scalable data synthesis method for distilling visual reasoning abilities from LLMs to MLLMs.<n>ReachQA is a dataset containing 3k reasoning-intensive charts and 20k Q&A pairs to enhance both recognition and reasoning abilities of MLLMs.
arXiv Detail & Related papers (2024-10-24T14:50:42Z) - DiagrammerGPT: Generating Open-Domain, Open-Platform Diagrams via LLM Planning [62.51232333352754]
Text-to-image (T2I) generation has seen significant growth over the past few years.
Despite this, there has been little work on generating diagrams with T2I models.
We present DiagrammerGPT, a novel two-stage text-to-diagram generation framework.
We show that our framework produces more accurate diagrams, outperforming existing T2I models.
arXiv Detail & Related papers (2023-10-18T17:37:10Z) - Integrating Graphs with Large Language Models: Methods and Prospects [68.37584693537555]
Large language models (LLMs) have emerged as frontrunners, showcasing unparalleled prowess in diverse applications.
Merging the capabilities of LLMs with graph-structured data has been a topic of keen interest.
This paper bifurcates such integrations into two predominant categories.
arXiv Detail & Related papers (2023-10-09T07:59:34Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.