Serverless computing is an emerging cloud computing paradigm that enables developers to build applications at the function level, known as serverless applications. Amazon Web Services (AWS), the leading provider in this domain, provides the Serverless Application Model (AWS SAM), the most widely adopted configuration schema for configuring and managing serverless applications through a specified file. However, misconfigurations pose a significant challenge in serverless development. Traditional data-driven techniques may struggle with serverless applications because the complexity of serverless configurations hinders pattern recognition, and it is challenging to gather complete datasets that cover all possible configurations. Leveraging vast amounts of publicly available data during pre-training, LLMs can have the potential to assist in identifying and explaining misconfigurations in serverless applications. In this paper, we introduce SlsDetector, the first framework leveraging LLMs to detect misconfigurations in serverless applications. SlsDetector utilizes effective prompt engineering with zero-shot learning to identify configuration issues. It designs multi-dimensional constraints specifically tailored to the configuration characteristics of serverless applications and leverages the Chain of Thought technique to enhance LLMs inferences. We evaluate SlsDetector on a curated dataset of 110 configuration files. Our results show that SlsDetector, based on ChatGPT-4o, achieves a precision of 72.88%, recall of 88.18%, and F1-score of 79.75%, outperforming state-of-the-art data-driven approaches by 53.82, 17.40, and 49.72 percentage points, respectively. Furthermore, we investigate the generalization capability of SlsDetector by applying recent LLMs, including Llama 3.1 (405B) Instruct Turbo and Gemini 1.5 Pro, with results showing consistently high effectiveness across these models.
翻译:无服务器计算是一种新兴的云计算范式,它使开发者能够在函数级别构建应用程序,即无服务器应用程序。该领域的领先提供商亚马逊网络服务(AWS)提供了无服务器应用程序模型(AWS SAM),这是通过指定文件配置和管理无服务器应用时最广泛采用的配置模式。然而,错误配置是无服务器开发中的一个重大挑战。传统的数据驱动技术可能难以应对无服务器应用,因为无服务器配置的复杂性阻碍了模式识别,并且收集覆盖所有可能配置的完整数据集具有挑战性。大型语言模型(LLMs)在预训练阶段利用了海量的公开数据,因此有潜力协助识别和解释无服务器应用中的错误配置。本文中,我们介绍了SlsDetector,这是首个利用LLMs检测无服务器应用错误配置的框架。SlsDetector采用有效的提示工程与零样本学习来识别配置问题。它专门针对无服务器应用的配置特性设计了多维约束,并利用思维链技术来增强LLMs的推理能力。我们在一个包含110个配置文件的精选数据集上评估了SlsDetector。结果表明,基于ChatGPT-4o的SlsDetector实现了72.88%的精确率、88.18%的召回率和79.75%的F1分数,分别比最先进的数据驱动方法高出53.82、17.40和49.72个百分点。此外,我们通过应用包括Llama 3.1 (405B) Instruct Turbo和Gemini 1.5 Pro在内的近期LLMs,研究了SlsDetector的泛化能力,结果显示这些模型均能保持持续的高效性。