In model-driven engineering and beyond, software models are key development artifacts. In practice, they often grow to substantial size and complexity, undergoing thousands of modifications over time due to evolution, refactoring, and maintenance. The rise of AI has sparked interest in how software modeling activities can be automated. Recently, LLM-based approaches for software model completion have been proposed, however, the state of the art supports only single-location model completion by predicting changes at a specific location. Going beyond, we aim to bridge the gap toward handling coordinated changes that span multiple locations across large, complex models. Specifically, we propose a novel global embedding-based next focus predictor, NextFocus, which is capable of multi-location model completion for the first time. The predictor consists of a neural network with an attention mechanism that is trained on historical software model evolution data. Starting from an existing change, it predicts further model elements to change, potentially spanning multiple parts of the model. We evaluate our approach on multi-location model changes that have actually been performed by developers in real-world projects. NextFocus achieves promising results for multi-location model completion, even when changes are heavily spread across the model. It achieves an average Precision@k score of 0.98 for $k \leq 10$, significantly outperforming the three baseline approaches.
翻译:在模型驱动工程及其他领域中,软件模型是关键开发制品。实践中,它们常会增长至相当规模和复杂度,并随着演化、重构和维护而经历数千次修改。人工智能的兴起引发了人们对软件建模活动自动化可能性的关注。近期,已有基于LLM的软件模型补全方法被提出,然而现有技术仅支持通过预测特定位置的变更来实现单位置模型补全。更进一步地,我们致力于弥合处理跨大型复杂模型多个位置的协同变更这一空白。具体而言,我们提出了一种新颖的基于全局嵌入的下一焦点预测器NextFocus,首次实现了多位置模型补全能力。该预测器由具有注意力机制的神经网络构成,并基于历史软件模型演化数据进行训练。从现有变更出发,它能预测需进一步修改的模型元素,这些变更可能跨越模型的多个部分。我们在真实项目开发人员实际执行的多位置模型变更上评估了该方法。NextFocus在多位置模型补全中取得了令人鼓舞的结果,即使变更在模型中高度分散。当$k \leq 10$时,其平均Precision@k分数达到0.98,显著优于三种基线方法。