[研究会] Structure-Aware Enhanced LLMs via Knowledge Graphs for Microservice Architecture Documentation

小林研M2のLinさんが,3月9日から2日間で本学大岡山キャンパスにて開催された情報処理学会ソフトウェア工学研究会3月研究集会にて研究発表を行いました。この研究はLinさんの修士論文の一部をまとめたものです.

著者:Qiao Lin, Profir-Petru Par?achi,Takashi Kobayashi(Science Tokyo)
題目:Structure-Aware Enhanced LLMs via Knowledge Graphs for Microservice Architecture Documentation
掲載誌: The SIG Technical Reports of IPSJ, Vol. 2026-SE-222, No. 20, pp.1-8. [Link], Mar. 9, 2026.

概要:
Microservice documentation is critical yet hard to maintain due to its complex and distributed architecture. Developers use Large Language Models (LLMs) with Retrieval Augmented Generation (RAG) to automate the creation and update of microservice documentations; however, this approach has limitations. Standard RAG is blind to the high level, global structural dependencies among services and relies solely on semantic similarity (Structural Blindness). As a result, LLMs suffer from missing key dependencies and information during generation and leading to inaccurate documentation. We introduce a Graph RAG framework that integrates structural awareness into the generation process. A Knowledge Graph (KG) and a GNN are used to help retrieve the most relevant dependencies for the LLM during generation. This ensures the generated documentation is both semantically coherent and architecturally complete, addressing some of the current limitation. As the result, we improve on three metrics over our baselines: Correctness (0.66-1.64), Completeness (0.86-2.24), and Faithfulness (0.64-1.62).

マイクロサービスアーキテクチャは複雑かつ分散的であるため,そのドキュメントを維持することは重要である一方で容易ではない.開発者は,マイクロサービスドキュメントの生成および更新を自動化するために,Retrieval Augmented Generation(RAG)を組み合わせた大規模言語モデル(LLM)を利用している.しかし,このアプローチには依然として限界が存在する.標準的なRAGは,サービス間の高次かつグローバルな構造的依存関係を考慮できず,意味的類似度のみに依拠するという「構造的盲目性」を有している.その結果,LLMは生成過程において重要な依存関係や情報を取りこぼし,不正確なドキュメント生成につながる.
本研究では,生成プロセスに構造的知識を組み込むGraph RAGフレームワークを提案する.本手法では,Knowledge Graph(KG)およびGNNを用いて,生成時にLLMが参照すべき最も関連性の高い依存関係を取得する.これにより,生成されるドキュメントが意味的整合性とアーキテクチャ的完全性の双方を満たすようになり,従来手法の限界の一部を克服する.その結果,提案手法はベースラインと比較して,Correctness(0.66–1.64),Completeness(0.86–2.24),Faithfulness(0.64–1.62)の3指標において改善を達成した.