🤖 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.