SlsReuse:基于LLM的无服务器函数重用
SlsReuse: LLM-Powered Serverless Function Reuse
AI总结:
SlsReuse是首个基于LLM的无服务器函数重用框架,通过语义增强表示和多级修剪策略提升函数推荐效果。
摘要:
无服务器计算迅速发展成为一种流行的云计算范式。它使开发人员能够实现函数级任务,即无服务器函数,而无需管理基础设施。尽管减少了操作开销,但这也给新手开发人员带来了挑战。从头开始开发函数需要适应异构、平台特定的编程风格,使过程变得耗时且容易出错。函数重用提供了一种有希望的解决方案来解决这些挑战。然而,关于无服务器计算的研究缺乏专门的功能推荐方法。传统上下文中的现有技术由于任务描述与异构函数实现之间的语义鸿沟而不够充分。大语言模型(LLM)的进步,这些模型在大规模语料库上预训练,创造了机会,通过将开发人员需求与函数语义对齐来弥合这一鸿沟。本文提出了SlsReuse,这是首个基于LLM的无服务器函数重用框架。具体而言,SlsReuse首先构建了一个可重用的函数仓库,作为基础知识库。然后,它通过有效的提示工程和少量提示学习,学习异构函数的统一语义增强表示,捕捉隐含的代码意图、目标平台、编程语言和云服务。最后,给定一个自然语言任务查询,SlsReuse执行意图感知的发现,结合多级修剪策略和相似性匹配。我们在精心整理的110个任务查询数据集上评估了SlsReuse。基于ChatGPT-4o,最具有代表性的LLM之一,SlsReuse实现了Recall@10为91.20%,超过最先进的基线24.53个百分点。
英文摘要:
Serverless computing has rapidly emerged as a popular cloud computing paradigm. It enables developers to implement function-level tasks, i.e., serverless functions, without managing infrastructure. While reducing operational overhead, it poses challenges, especially for novice developers. Developing functions from scratch requires adapting to heterogeneous, platform-specific programming styles, making the process time-consuming and error-prone. Function reuse offers a promising solution to address these challenges. However, research on serverless computing lacks a dedicated approach for function recommendation. Existing techniques from traditional contexts remain insufficient due to the semantic gap between task descriptions and heterogeneous function implementations. Advances in large language models (LLMs), pre-trained on large-scale corpora, create opportunities to bridge this gap by aligning developer requirements with function semantics. This paper presents SlsReuse, the first LLM-powered framework for serverless function reuse. Specifically, SlsReuse first constructs a reusable function repository serving as a foundational knowledge base. Then, it learns unified semantic-enhanced representations of heterogeneous functions through effective prompt engineering with few-shot prompting, capturing implicit code intent, target platforms, programming languages, and cloud services. Finally, given a natural language task query, SlsReuse performs intent-aware discovery combined with a multi-level pruning strategy and similarity matching. We evaluate SlsReuse on a curated dataset of 110 task queries. Built on ChatGPT-4o, one of the most representative LLMs, SlsReuse achieves Recall@10 of 91.20%, exceeding the state-of-the-art baseline by 24.53 percentage points.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。