Model slicing is a useful technique for identifying a subset of a larger model that is relevant to fulfilling a given requirement. Notable applications of slicing include reducing inspection effort when checking design adequacy to meet requirements of interest and when conducting change impact analysis. In this paper, we present a method based on large language models (LLMs) for extracting model slices from graphical Simulink models. Our approach converts a Simulink model into a textual representation, uses an LLM to identify the necessary Simulink blocks for satisfying a specific requirement, and constructs a sound model slice that incorporates the blocks identified by the LLM. We explore how different levels of granularity (verbosity) in transforming Simulink models into textual representations, as well as the strategy used to prompt the LLM, impact the accuracy of the generated slices. Our preliminary findings suggest that prompts created by textual representations that retain the syntax and semantics of Simulink blocks while omitting visual rendering information of Simulink models yield the most accurate slices. Furthermore, the chain-of-thought and zero-shot prompting strategies result in the largest number of accurate model slices produced by our approach.
翻译:模型切片是一种用于识别大型模型中满足特定需求相关子集的有效技术。切片的重要应用包括:在检查设计是否满足需求时的审查工作量缩减,以及变更影响分析。本文提出了一种基于大语言模型的方法,用于从图形化Simulink模型中提取模型切片。该方法将Simulink模型转换为文本表示,利用LLM识别满足特定需求所需的Simulink模块,并构建包含LLM识别模块的正确模型切片。我们研究了将Simulink模型转换为文本表示时不同粒度(详细程度)以及LLM提示策略对生成切片准确性的影响。初步结果表明:保留Simulink模块语法语义但省略视觉渲染信息的文本表示所构建的提示,能生成最准确的切片;此外,链式思考和零样本提示策略能使本方法生成数量最多的准确模型切片。