Manuscript Offprint

arXiv:2608.12228

Towards Automated Domain Model Extraction from Source Code using Heuristics and Open-Source LLMs

Alessandra Mancas, Mounir Ammam, Hyacinth Ali, Kevin Delcourt, Houari Sahraoui

Conference: ACM/IEEE 29th International Conference on Model Driven Engineering Languages and Systems; October 04–09, 2026; Málaga, SpainACM/IEEE 29th International Conference on Model Driven Engineering Languages and Systems (MODELS 2026), October 04–09, 2026, Málaga, SpainDOI: 10.1145/3822455.3830329ISBN: 979-8-4007-2809-9/2026/10CCS: Software and its engineering Software reverse engineeringCCS: Software and its engineering Model-driven software engineeringCCS: Software and its engineering Unified Modeling Language (UML)

© cc

Abstract.

Large language models (LLMs) have recently shown strong capabilities for code understanding, making them promising for reverse engineering domain models from source code. However, state-of-the-art proprietary LLMs cannot be used in many industrial contexts due to privacy and confidentiality constraints, while compact open-source LLMs that can run locally are limited by their context window and cannot process large code bases directly.

In this paper, we propose an automated approach to extract domain models from source code using lightweight, locally deployable LLMs. Our method combines structural and semantic heuristics with iterative LLM-based reasoning to overcome context limitations. By progressively analyzing ranked subsets of code elements, the approach identifies domain concepts and refines domain boundaries without requiring full-system context.

Our approach achieves high F1-scores on a dataset of ten projects, each comprising a curated domain model and its corresponding implementation, while remaining fully executable on locally deployable LLMs. This makes it particularly suitable for reverse engineering tasks in privacy-sensitive industrial environments.

Keywords:

Domain Modeling, Large Language Models (LLMs), Reverse Engineering, Domain Models, Class Diagram, Model Generation

References (40)