Graph Embeddings for Software Architecture Recovery

Rakhshanda Jabeen, Morgan Ericsson, Jonas Nordqvist, Anna Wingkvist · Nordic Machine Intelligence · 2026

A software system's source code is organized into files, but the way those files group into architectural modules is often undocumented or has drifted from the original design. Software architecture recovery (SAR) reconstructs this module view to help developers understand and maintain large systems. We study SAR from file-level static dependency graphs by learning file embeddings in a self-supervised manner and clustering them into modules. Using node2vec as a baseline, we train graph autoencoders via link reconstruction and compare dependency-based representations (a graph attention encoder, with and without personalized PageRank diffusion) against heterogeneous ones that also incorporate the project's folder structure. We evaluate eleven open-source Java, C, and C++ systems against ground-truth architectures using complementary alignment and modularity metrics. Recovery from a dependency structure alone is useful but limited, bounded more by how much structural context is available to the model than by the choice of encoder. Folder organization helps where dependency cohesion is weak, but heterogeneous methods often gain alignment by drifting from pure dependency modularity, a trade-off between structural cohesion and the developer-intended decomposition. No single method wins on every system and metric — node2vec and the diffusion model are comparable on dependencies alone, while folder-aware methods are worth their added complexity mainly when cohesion is weak. All representations scale well and are practical to run and tune, so representation learning is not the bottleneck for adoption.

Read the paper · More papers on PaperTik