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

📅 2026-08-12
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of domain modeling in privacy-sensitive industrial settings where closed-source large language models are inaccessible and locally deployed open-source small models are constrained by limited context windows, hindering direct extraction of domain knowledge from extensive codebases. To overcome this, the authors propose an iterative reasoning approach that integrates structural and semantic heuristics to prioritize and select critical code subsets, thereby guiding lightweight, locally deployable large language models to incrementally identify domain concepts and refine their boundaries—without requiring access to the full system context. This method represents the first integration of heuristic strategies with on-premise large language models for domain modeling, achieving high F1 scores across a benchmark dataset of ten real-world projects while preserving both privacy and model fidelity.
📝 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-ofthe- 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.
Problem

Research questions and friction points this paper is trying to address.

domain model extraction
source code
open-source LLMs
context window limitation
privacy-sensitive environments
Innovation

Methods, ideas, or system contributions that make the work stand out.

domain model extraction
open-source LLMs
code understanding
heuristics
reverse engineering
🔎 Similar Papers
2023-12-04ACM Transactions on Software Engineering and MethodologyCitations: 11
💼 Related Jobs
No related jobs found.
A
Alessandra Mancas
Université de Montréal, DIRO, Montreal, Canada
M
Mounir Ammam
Université de Montréal, DIRO, Montreal, Canada
H
Hyacinth Ali
University of Alberta, Electrical and Computer Engineering, Alberta, Canada
K
Kevin Delcourt
Université de Montréal, DIRO, Montreal, Canada
Houari Sahraoui
Houari Sahraoui
Professor of Computer Science, Université de Montréal
Software EngineeringArtificial IntelligenceAutomated software engineeringMDESBSE