arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.04604cs.SE
收藏

面向单体到微服务拆分的对比学习增强大语言模型

Contrastive Learning-Enhanced Large Language Models for Monolith-to-Microservice Decomposition

Laval University(拉瓦尔大学)

Khaled Sellami, Mohamed Aymen Saied

AI总结:

针对单体应用向微服务迁移时拆分难度大的问题,提出MonoEmbed方法,结合对比学习、LoRA微调大语言模型生成组件表示并聚类,可生成更高质量的均衡微服务拆分结果。

摘要:

随着单体应用不断迭代演进,其维护与升级难度持续提升,会引发扩展性瓶颈与团队协作问题。微服务架构凭借模块化、灵活性与可扩展性优势,可为大规模应用提供适配方案,支撑其响应持续增长的用户需求。尽管微服务优势显著,但从单体架构向微服务架构迁移通常成本高昂、流程复杂,其中拆分环节是核心挑战。本研究提出基于语言模型的自动化拆分方法MonoEmbed以解决该问题。MonoEmbed利用当前最优的大语言模型(LLMs)与表示学习技术生成单体组件的表示向量,再通过聚类形成微服务。研究评估了多种预训练模型,应用对比学习、低秩适配(LoRA)等微调技术优化面向微服务划分的表示向量。微调模型评估结果显示,相比预训练模型与传统表示方法,其生成的表示向量质量得到显著提升。所提方法与现有拆分方法开展基准对比,结果表明其在为不同规模单体应用生成高内聚、均衡的微服务方面性能更优。

英文摘要:

As Monolithic applications evolve, they become increasingly difficult to maintain and improve, leading to scaling and organizational issues. The Microservices architecture, known for its modularity, flexibility and scalability, offers a solution for large-scale applications allowing them to adapt and meet the demand on an ever increasing user base. Despite its advantages, migrating from a monolithic to a microservices architecture is often costly and complex, with the decomposition step being a significant challenge. This research addresses this issue by introducing MonoEmbed, a Language Model based approach for automating the decomposition process. MonoEmbed leverages state-of-the-art Large Language Models (LLMs) and representation learning techniques to generate representation vectors for monolithic components, which are then clustered to form microservices. By evaluating various pre-trained models and applying fine-tuning techniques such as Contrastive Learning and Low Rank Adaptation (LoRA), MonoEmbed aims to optimize these representations for microservice partitioning. The evaluation of the fine-tuned models showcases that they were able to significantly improve the quality of the representation vectors when compared with pre-trained models and traditional representations. The proposed approach was benchmarked against existing decomposition methods, demonstrating superior performance in generating cohesive and balanced microservices for monolithic applications with varying scales.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑